This is kind of a Menu includes Animations .
- 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
Install my-project with https://jitpack.io/
dependencies {
implementation 'com.github.Mori-hub:Advanced_Menu:1.0.0'
}
// 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)
- 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
setItems(
backToolbar: Int,
icons: ArrayList<Int>,
fromColors: ArrayList<Int>,
toColors: ArrayList<Int>,
text: ArrayList<String>,
runningFunctions: ArrayList<(() -> Unit)?>
)
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() }
)
)
If you want a logo on your toolbar call this method
logoToolbar(
logo: Int,
backColor: Int? = null,
click: (() -> Unit)?
)
upper.logoToolbar(android.R.drawable.sym_contact_card,null) {
Toast.makeText(applicationContext, "Hi", Toast.LENGTH_SHORT).show()
}
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
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)
As you can see in the images, there are two more menus and you can call them.
fun setItems(
backToolbar: Int? = null,
icons: ArrayList<Int>,
textIcons: ArrayList<String>,
backColors: ArrayList<Int>,
runningFunctions: ArrayList<(() -> Unit)?>
)
fun setItems(
backToolbar: Int,
icons: ArrayList<Int>,
fromOneColor: Int,
toOneColor: Int,
runningFunctions: ArrayList<(() -> Unit)?>
)
Please add parameters due to number of icons, otherwise the app will crash and close.
I'm a full stack developer...
Java, Kotlin, CSS....
Important: For Gradle 7.2 & jitpack.io Please use this way : https://stackoverflow.com/a/71603699/12272687
Update: March 2022
If you have any feedback, please reach out to us at SR-App@outlook.com