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
1 answer

Passing view inside arrayadapter for snackbar

I am trying to pass a View object in an arrayadapter, to open a snackbar. I need to pass a view into it, but taking a final view before the ClickListeners does not work. How can I get the view variable past the PopupMenu.OnMenuItemClickListener and…
0
votes
2 answers

How to make gradient in snackbar for Android?

I know I can set the snackbar's background by using sbView.setBackgroundColor(Color.XX);, however, if we need to add gradient to the color instead of a single color background. What should I do? Seems no API for that.
litaoshen
  • 1,762
  • 1
  • 20
  • 36
0
votes
1 answer

can't show a snackbar

I have a RecyclerView with some tasks. Task has some TextViews and Buttons. I have a delete button and when I press it I show a dialog to confirm deleting. If user press "Delete" i delete task and show a Snackbar with UNDO button. But when i try to…
0
votes
3 answers

The second Snackbar below a toolbar

I'm conscious that in more cases there should be only 1 snack bar, but in my app, the best UX will be when I will display undo bar on the bottom and in the same time all alerts will be displayed on the top. Snackbar from support library doesn't work…
jakub
  • 3,576
  • 3
  • 29
  • 55
0
votes
1 answer

Multi html formatting in Snackbar

Im trying to add multiple html foreground formattings of a snackbar text programmatically. In my strings.xml: The html entries %1$s and %2$s are looking different. How i try to format them: public static Spanned…
beeb
  • 1,615
  • 1
  • 12
  • 24
0
votes
3 answers

cannot resolve floatinbuttonAction and snackbar

I'm very new to the android development. I imported my friend's project in my android studio and I'm having this trouble right now that I'm unable to sort out on my own. Please help me fix it.
AQ Hassaan
  • 43
  • 4
0
votes
0 answers

Xamarin.Android Snackbar and FAB error

I get a error message if I try to call a snackbar by tapping on a floating action button. This is the error message I get: Android.Views.InflateException: Binary XML file line #18: can be used only with a valid ViewGroup root and…
WeSt
  • 889
  • 5
  • 14
  • 32
0
votes
0 answers

This is a snackbar message appearing in printouts

I've purchased and installed the highcharts editor http://www.highcharts.com/products/highcharts-editor by including the relevant JS and CSS files in my HTML templates. However, whenever a browser page is printed, a box with the text 'This is a…
Oliver Kohll
  • 772
  • 2
  • 7
  • 19
0
votes
0 answers

Snackbar's action Gravity

I'd like to display a Snackbar in my Activity. It works fine on my phone (Oneplus One CM13), however for some reason on the tablet (Nexus 7 2013 LineageOS 14.1 android 7.1.1) the action Button is displayed right after the Snackbar's text TextView…
0
votes
1 answer

XML items doesn't match correctly

I'm having problems with my Android Application. I'm trying to fix my snackbar's layout because it doesn't fit well with my BottomBar. If you see the picture I posted, you can see there's a small space between the two items which shouldn't…
Cesarsk
  • 153
  • 1
  • 2
  • 14
0
votes
1 answer

Unable to use Snackbar after updating Android Studio

I have recently updated my Android Studio version to 2.3 I am working on a project now and I've noticed that I am unable to import Snackbar class. I never had that problem before. I can use it by adding compile 'com.nispok:snackbar:2.6.1' and I can…
0
votes
2 answers

How can I know the real time the video starts in android VideoView with the video view from URL?

I am trying to popup a snack bar during a random time when the video plays I already got the video duration plus able to run the video. I have also able to set up the handler to show the snack bar at random time during the video duration. Uri uri2 =…
Chit Khine
  • 830
  • 1
  • 13
  • 34
0
votes
1 answer

Snackbar Not working on API 17

I am trying to use Snackbar from the support library but when I lunch the app on an emulator with an API below 21 , the app crush. I think the support library will make the snackbar work on an older version , is that correct ? Gradle : apply…
ArolaAb
  • 297
  • 3
  • 12
0
votes
1 answer

How to display and get selection gridView use adapter on LayoutInflater

Sorry for my poor English. My purpose now is, displaying one editText, and gridView text in the Snackbar. This Snackbar display when user click FAB, than he can write something in editText. After that, user should click some text generated by…
fajarra
  • 11
  • 3
0
votes
0 answers

How to Disable snackbar swipe to dismis behaviour

I want to disable swipe to dismiss behavior of snackbar i have tried lot of things not worked any for me , any one suggest how can i achieve this, Here is what i have tried final Snackbar snackbar = Snackbar .make(main_content,…
Rajesh Koshti
  • 572
  • 1
  • 7
  • 25