Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.1 KB

ReadME_Extensions_Snackbar.md

File metadata and controls

31 lines (25 loc) · 1.1 KB

🍟 Snackbar Extensions

You can show Snackbars with snackL() or snackS()or snackI() in MeowActivity/MeowFragment. See this example :

class MyActivity : MeowActivity<*> {  
    override fun onCreate(savedInstanceState: Bundle?) {
        //...
        // Shows Snackbar with LENGTH_SHORT duration.
        snackS(R.string.snackbars_message)
        
        // Shows Snackbar with LENGTH_LONG duration.
        snackL(R.string.snackbars_message)
        
        // Shows Snackbar with LENGTH_INDEFINITE duration.
        snackI(R.string.snackbars_message)

        // Shows Snackbar with LENGTH_LONG with action button.
        snackL(  
            message = R.string.snackbars_message,  
            resActionText = R.string.snackbars_action,
      
            // Optional - if you want to set custom textApperance to message and action, set this attributes.
            messageTextAppearanceId = R.style.textAppearance_Snack_Message, 
            actionTextAppearanceId = R.style.textAppearance_Snack_Action  
        ) {
             // Callback for action button click.
          }
    }
}