Skip to content

Latest commit

 

History

History
158 lines (125 loc) · 5.01 KB

README.md

File metadata and controls

158 lines (125 loc) · 5.01 KB

Advanced FAB s

This is kind of a FloatingActionButton includes Animations .

Features

  • FAB: Curve fab, Rectangle feb
  • 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_FAB:1.0.0'
	}

🧰Usage

    // Call Lib Rectangle feb
   val rectangle = Rectangle(this, R.id.mainParent)
    // Call Lib Curve fab
	 val curve = Curve(this, R.id.mainParent,findViewById(R.id.floatingActionButton))
		
        

Explain

  • Parent Layout : This must be a Layout and put anywhere
  • null : For Running Function and Finish Function
  • Show : When you call main method, the layout will attach to the window
  • SetItems : For set as you need

Structure

fun setItems(
        icons: ArrayList<Int>,
        colors: ArrayList<Int>,
        textIn: ArrayList<String>,
        textColor: Int,
        runningFunctions: ArrayList<(() -> Unit)?>
    )

Examples

rectangle.setItems(
            //Icons from Res
            arrayListOf(
                android.R.drawable.ic_media_play, 
                android.R.drawable.ic_input_add,
                android.R.drawable.btn_star_big_on, 
                android.R.drawable.ic_delete
            ),
            // Colors of row
            arrayListOf(
                Color.parseColor("black"),
                Color.parseColor("#8A351A"),
                Color.parseColor("#FF5722"),
                Color.parseColor("#9C27B0")
            ),
            // Text of each row
            arrayListOf("One", " two", "see it", "fun"),
            // Text Color
            Color.WHITE,
            // OnClick must be in {}
            arrayListOf(
                null,
                {Toast.makeText(applicationContext, "Hi", Toast.LENGTH_SHORT).show()
                    println("Hi there!")
                },
                null,
                null
            )
        )

Next One

This menu attachs to a floatingActionButton, so must be as a parameter

Structure

Curve(activity: Activity, parentLayout: Int, targetButton: View)

setItems(
        icons: ArrayList<Int>,
        colors: ArrayList<Int>,
        runningFunctions: ArrayList<(() -> Unit)?>
    ) 

Examples

   val curve = Curve(this, R.id.mainParent,findViewById(R.id.floatingActionButton))

        curve.setItems(
            //Icons from Res
            arrayListOf(
                android.R.drawable.ic_media_play, android.R.drawable.ic_input_add
                , android.R.drawable.btn_star_big_on, android.R.drawable.ic_delete
            ),
            // Colors of background icons
            arrayListOf(Color.parseColor("black"),
                Color.parseColor("#8A351A"),
                Color.parseColor("#FF5722"),
                Color.parseColor("#9C27B0")),
            // OnClick must be in {}
            arrayListOf(null,
                { Toast.makeText(applicationContext, "Hi", Toast.LENGTH_SHORT).show()
                    println("Hi there!")
                },
                null,
                null))

Screenshots && Gifs

🖐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 [email protected]

License

MIT