/Advanced_Menu

Advanced Menus

Primary LanguageKotlin

Advanced Menus

This is kind of a Menu includes Animations .

Features

  • Menus: UpperMenu, CubeMenu, FalldownMenu
  • Easy Set up
  • Items setup : Icons, colors, text
  • Free Position : Put anywhere in Parent Layout
  • Get Running Function :Repeatdly to do
  • Animations: Enter and Exit
  • Colors : Changing colors from / to

📚Installation

Install my-project with https://jitpack.io/

  dependencies {
	        implementation 'com.github.Mori-hub:Advanced_Menu:1.0.0'
	}

🧰Usage

    // Call Lib UpperMenu
    val upper = UpperMenu(this, null, 0, Parent layout)
    // Call Lib CubeMenu
	 val cubeMenu = CubeMenu(this, null, 0,Parent layout)
	// Call Lib FalldownMenu
	 val fallDownMenu = FallDownMenu(this, null, 0, Parent layout)	
        

Explain

  • Parent Layout : This must be a ConstraintLayout and put anywhere
  • null : For Running Function and Finish Function
  • Show : When you call UpperMenu method, the layout will attach to the window
  • Show : For Cube and Falldown use .show()
  • SetItems : For set as you need

Structure

setItems(
        backToolbar: Int,
        icons: ArrayList<Int>,
        fromColors: ArrayList<Int>,
        toColors: ArrayList<Int>,
        text: ArrayList<String>,
        runningFunctions: ArrayList<(() -> Unit)?>
    )

Examples

val upper = UpperMenu(this, null, 0, R.id.mainParent)
     upper.setItems(
            Color.parseColor("#FCF69C"),
            arrayListOf(
                android.R.drawable.ic_btn_speak_now,
                android.R.drawable.ic_delete, android.R.drawable.ic_input_add,
                android.R.drawable.ic_media_play
            ),
            arrayListOf(
                Color.parseColor("white"),
                Color.parseColor("#55D8C1"),
                Color.parseColor("#FF6FB5"),
                Color.parseColor("#97D0AE")
            ),
            arrayListOf(
                Color.parseColor("gray"),
                Color.parseColor("#F55353"),
                Color.parseColor("#FEB139"),
                Color.parseColor("#F56D91")
            ),
            arrayListOf("Recording", "Delete", "Add", "Play"), arrayListOf(
                null,
                {
                    Toast.makeText(applicationContext, "Hi", Toast.LENGTH_SHORT).show()
                    println("Hi there!")
                },
                { fallDownMenu.show() },
                { cubeMenu.show() }
            )
        ) 

Optinal logoToolbar

If you want a logo on your toolbar call this method

Structure

logoToolbar(
	logo: Int, 
	backColor: Int? = null, 
	click: (() -> Unit)?
)

Examples

    upper.logoToolbar(android.R.drawable.sym_contact_card,null) {
            Toast.makeText(applicationContext, "Hi", Toast.LENGTH_SHORT).show()
        }

Optinal toolbar

If you are going to use it as a toolbar , do like this:

  • setTheme as a NoActionBar
  • put it before setContentView
  • add True for last parameter of UpperMenu

Examples

     this.setTheme(androidx.appcompat.R.style.Theme_AppCompat_DayNight_NoActionBar)
        setContentView(R.layout.activity_main)
	 val upper = UpperMenu(this, null, 0, R.id.mainParent, true)

Screenshots

Gifs

More Methods

As you can see in the images, there are two more menus and you can call them.

Structure FallDownMenu

     fun setItems(
        backToolbar: Int? = null,
        icons: ArrayList<Int>,
        textIcons: ArrayList<String>,
        backColors: ArrayList<Int>,
        runningFunctions: ArrayList<(() -> Unit)?>
    ) 

Structure CubeMenu

      fun setItems(
        backToolbar: Int,
        icons: ArrayList<Int>,
        fromOneColor: Int,
        toOneColor: Int,
        runningFunctions: ArrayList<(() -> Unit)?>
    ) 

🖐Important Notic

Please add parameters due to number of icons, otherwise the app will crash and close.

🚀 About Me

I'm a full stack developer...

🛠 Skills

Java, Kotlin, CSS....

Tech Stack

Important: For Gradle 7.2 & jitpack.io Please use this way : https://stackoverflow.com/a/71603699/12272687

Update: March 2022

🔗 Links

portfolio linkedin twitter Google

Feedback

If you have any feedback, please reach out to us at SR-App@outlook.com

License

MIT