Category : android-snackbar

I’m calling launch inside a coroutinescope but it does not execute. Snackbar action listener is executing but the launch block is not executing for some reason. CoroutineScope(Dispatchers.Main).launch { val scope = this val mn = snackbarManager(R.id.root); Snackbar.make(mn.container, R.string.recpt_deleted, Snackbar.LENGTH_LONG) .setAction(R.string.undo) { scope.launch {**//not executing** Toast.makeText(requireContext(),"Committing",Toast.LENGTH_LONG).show() Log.d("COMMIT", "calling commit") } } .show() } Source: Android..

Read more

I’m updating my current app to use snackbars, in the Google spec they show various ways of using them http://www.google.com/design/spec/components/snackbars-toasts.html#snackbars-toasts-specs Example A: Example B: Here’s my code atm: Snackbar snackbar = Snackbar.make(mParentLayout, displayMessage, Snackbar.LENGTH_LONG); snackbar.setAction(actionMessage, mClickListener); snackbar.show(); I get the result in Example B, How can i add margins? Source: Android Layout..

Read more