Questions tagged [android-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

477 questions
15
votes
4 answers

SnackBar from top. Is this possible?

I wanted to provide the SnackBar animation from top, instead of the regular behavior that displays the SnackBar from bottom. Is this easily hackable?
14
votes
1 answer

Flaky Android Espresso Test - Snackbar

1) All devices/emulators being tested have animations disabled. 2) I have an @BeforeClass which builds my Credentials object. 3) I have an IntenServiceIdlingResource and an EventBusIdlingResource, registered in @Before. 4) When the sign in button is…
14
votes
4 answers

Showing a Snackbar from inside a Service

When showing a SnackBar from inside an Activity, I have the rootView available. But I need to show a SnackBar from inside a Service, where I do not have a View available. How might I accomplish this? As backstory: an activity starts a service to do…
Nouvel Travay
  • 6,292
  • 13
  • 40
  • 65
14
votes
1 answer

CoordinatorLayout with two floating action buttons

I have two Fabs located inside a CoordinateLayout view. When I show a Snackbar, I expect the two Fabs go up all together, but the result is that only one of the Fab (lower one) responds and go up (see picture). what do I miss here? berfore after…
14
votes
10 answers

Custom theme interferes with snackbar background color

Trying out the new Design Support Library, I added a snackbar; but unlike its main background, the text area is not colored with the default value of #323232. Instead, it looks like this. It seems to take its color from the android:background value…
14
votes
5 answers

How do I change an Android Snackbar's initial alignment from bottom to top?

The recent android library came out just a few days ago, but I would like to have the SnackBar appear on top of the screen, preferably within a RelativeLayout as it's parent view. How does one change the SnackBar's initial alignment which I presume…
13
votes
4 answers

Android KitKat: Snackbar is not in the bottom of the screen

I add a Snackbar to my app. The problem is that in API 19 it's not at the bottom of the screen. In API 21 it's ok. Here is my layout
Vitalii
  • 10,091
  • 18
  • 83
  • 151
13
votes
2 answers

FAB not animated when one-line Snackbar is swiped away

I have a CoordinatorLayout with support FloatingActionButton in which I want to display a Snackbar..
12
votes
3 answers

Show snack bar above FAB in androidx

trying create app using androidx. my layout
12
votes
2 answers

AdView and FloatingActionButton overlap while using CoordinatorLayout

After incorporating the new CoordinatorLayout in one of my layouts, I have an issue with Adviews overlapping with FloatingActionButton.
11
votes
7 answers

How to fix the Snackbar height and position?

On Android Support Library 24.1.1, the Snackbar was working fine: Then starting on Android Support Library 24.2.0 onwards, the Snackbar started to behave like this: On the library revision history, there is the following statement: Behavior…
11
votes
1 answer

How to Display Emoticons/Emoji in Snackbar or Toast / Textview

I am trying to add emoticons/emoji in Snackbar/Toast notification. Do this emoticons need to be image resource or Unicode character. I am getting string output when i use unicode character from following website Unicode Character Website.…
Savan Akbari
  • 460
  • 1
  • 6
  • 13
11
votes
2 answers

Snack bar not displayed

I'm inheriting from BaseActivity for all the other activities. public class BaseActivity extends AppCompatActivity { public static CoordinatorLayout coordinatorLayout; @Override protected void onCreate(Bundle savedInstanceState) { …
user1382802
  • 618
  • 2
  • 12
  • 24
11
votes
2 answers

How Can I show SnackBar under FragmentDialog?

I have an activity with FragmentDialog. In onResume of this dialog I set height and weight of it to 80% and 90% by code: WindowManager.LayoutParams layoutParams = new…
KWA
  • 312
  • 3
  • 15
10
votes
3 answers

Flutter: How to display a snackbar from an appbar action

I'm trying to display a SnackBar after performing an action from the AppBar. The AppBar cannot be built from a builder so it can't access is Scaffold ancestor. I know we can use a GlobalKey object to access the context whenever we want, but I would…
Quentin
  • 586
  • 8
  • 10