Questions tagged [snackbar]

Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.

Introduction

Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.

They automatically disappear after a timeout or after user interaction elsewhere on the screen, particularly after interactions that summon a new surface or activity. Snackbars can be swiped off screen.

Snackbars can contain an action which is set via setAction(CharSequence, android.view.View.OnClickListener).

Documentation

Usage of SnackBar

493 questions
0
votes
4 answers

Hide Snackbar when another one is clicked

here is my code for three Snackbars using the Material Design Lite component library : (function() { 'use strict'; window['counter'] = 0; var snackbarContainer = document.querySelector('#sb-message-box'); var showToastButton =…
Robin Alexander
  • 984
  • 2
  • 13
  • 29
0
votes
2 answers

Change snackbar text in another Thread

After displaying a Snackbar, I run a Thread to execute actions. I want to change text according current progress in this Thread. I create the Snackbar: private View snackbarview; protected void onCreate(Bundle savedInstanceState) { …
Anduriel
  • 93
  • 2
  • 10
0
votes
1 answer

Angular2 Material SnackBar integration problems

I am trying to integrate Material Snackbar in my angular2 app. I have already succesfully integrated ProgressBar from the same library successfully but running into errors with SnackBar. Here's how I am integrating SnackBar (relevant)…
Jazib
  • 1,200
  • 1
  • 16
  • 39
0
votes
1 answer

Xamarin Android Snackbar NullReferenceException

I am trying to show a snackbar: Snackbar s = Snackbar .Make(Window.DecorView.RootView, text, Snackbar.LengthLong) .SetAction("Retry", view => { /* TODO */ …
hans meyer
  • 101
  • 2
  • 9
0
votes
0 answers

Make Snackbar appear on another View / Layout

I have a SnackBar that I would like to display on another view after I am done with the current view. It's a send form so when I click the send button, I want the SnackBar to appear on the other activity since the send form one will be closed.…
Montassir Ld
  • 531
  • 4
  • 12
0
votes
2 answers

Can't get CoordinatorLayout inside RecylerAdapter via findViewById

What am i trying to do? I have a RecyclerView which keeps rows and looks like a ListView. Rows of these list are defined at feed_listview_row.xml. I have a RecyclerAdapter for this RecyclerView and it is called Feed_Recycler_Adapter.java which you…
0
votes
1 answer

Snackbar for Circular Android Wear Designs

The classic Snackbar provided from Android design library works in wear project. In square display they looks fine, but in round they don't. The corner of the snackbar are cropped by the circular display. Does anyone know a workaround? I don't want…
alex_au
  • 240
  • 1
  • 2
  • 11
0
votes
0 answers

Show snackbar by AlarmManager in any activity

Please navigate me with the following problem. I have an AlarmManager that send a notification at specific time only if my app isnt on foreground. My goal is the show a snackbar in any current activity if user uses my app right now and insert to…
P. Savrov
  • 1,064
  • 4
  • 17
  • 29
0
votes
2 answers

How to anchor a UIView to a specific place on Screen and keep it there even while scrolling

I created a Snackbar style messages in Swift for iOS. I need to understand to which view I add the Snackbar as a subview. Example for one of the problems: I have a scrollview with a lot of content. When you press a button somewhere inside the…
MarkosDarkin
  • 315
  • 3
  • 20
0
votes
1 answer

How to make snackbar show up at the bottom of a RecycleView?

I have a RecycleView in my fragment, and I need to show a snackbar at the bottom of it. Whenever I pass the RecycleView to the snackbar's view parameter, it just shows the snackbar at the bottom of the fragment (I have stuff below the RecycleView…
CaptainForge
  • 1,365
  • 7
  • 21
  • 46
0
votes
1 answer

Align Snackbar's Action on the right

Good afternoon, I am working with Snackbars and I try to put an aciton (like UNDO), but the text is not aligned to the right of the screen. The result I need : The result I have : As you can see, the "UNDO" action is not aligned right, as I…
D. Math
  • 329
  • 6
  • 17
0
votes
2 answers

Is there an accepted practice between Toasts and Snackbars? Displaying them?

In Android I can display short messages to the user either using Toasts or Snackbars. Is there a particular standard as to which ones I should be using? All Toasts? All Snackbars? Toasts during DialogFragments and Snackbars otherwise? Is there a way…
AJJ
  • 2,004
  • 4
  • 28
  • 42
0
votes
2 answers

Display a Snackbar in a fragment after deleting an item from the database?

I am looking for a way to have a Snackbox pop up at the bottom of the display when the user deletes an item from the database using the caseR.id.delete:. Below I have attached code from the fragment. If you need more of my code from different areas,…
0
votes
1 answer

simple android Snackbar not working

I was trying to show a very simple Snackbar in the MainActivity in my app, after clicking on a button. This button also leads to the start of a new activity. But after I clicked it, no Snackbar show and the new Activity started. My MainActivity is a…
Emile
  • 187
  • 5
  • 17
0
votes
3 answers

Custom Snackbar doesn't work properly

I'm trying to show a custom Snackbar as in this example: how to customize snackBar's layout? This is my custom code to create a Snackbar: protected void showSnackBar(View view) { Snackbar snackbar = Snackbar.make(view, "",…
dpulgarin
  • 556
  • 5
  • 17