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

Android snackbar swipe bug

In my Android app I have a snackbar. When it is on the screen, I try to swipe it out, but after swiping another layout on the screen isn't changing. So, it looks like it presents on the screen with visibility setted to View.INVISIBLE. Is there a bug…
Kiryl Tkach
  • 3,118
  • 5
  • 20
  • 36
0
votes
1 answer

Snackbar doesn't appear again after Re-Opening the App

My Application looks for the Connectivity-State using a Broadcastlistener. If the Phone is offline, a Snackbar should appear. The Snackbar has an Action, to Open the Networksettings. If I click on this, my Networksettings were opened. If I don't…
the_dani
  • 2,466
  • 2
  • 20
  • 46
0
votes
1 answer

com.rey.material.widget.SnackBar - The text into it appears on the top

When I show the snackbar the text appears on the top. I'm talking about the text, not the snackbar. The next picture shows this behaviour: I'm using the library of com.rey.material.widget (https://github.com/rey5137/Material/wiki/SnackBar), and…
Rafa0809
  • 1,733
  • 21
  • 24
0
votes
5 answers

Android : snackbar not working in fragment class

I want to use snackbar in my app so I set below code for that public class FragmentAddProperty extends Fragment { RelativeLayout mRelative public View onCreateView(LayoutInflater inflater, ViewGroup container, …
user3547706
  • 101
  • 1
  • 2
0
votes
1 answer

Using MrEngineer13's SnackBar library implementation

I am using @MrEngineer13's SnackBar implementation and was wondering how to capture 2 separate "ActionClick" events - depending on when the actionclick event occurs, I need to do different things. The builder looks like this - new…
0
votes
2 answers

How to make the start Snackbar message when you click on the menu?

How to make the start Snackbar message when you click on the menu? public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case (R.id.reset): number1.setText(null); …
bonny
  • 13
  • 1
  • 3
0
votes
3 answers

Snackbar in Preferences Activity

I'm trying to use snackbar with custom xml in my preferences activity. And i'm doing something wrong, because i get a nullpointer exception. I think it has something to do with the view, or maybe it`s because i don't use coordinator layout. Here is…
Gidi Sprintzin
  • 365
  • 1
  • 2
  • 15
0
votes
2 answers

Snackbar inside layout

Is it possible to show a Snackbar message inside a layout, like show it inside a RelativeLayout instead of show it at the bottom of the screen? I've tried to use a referenced view to a RelativeLayout but it doesn't…
Gnzlt
  • 4,383
  • 2
  • 22
  • 24
-1
votes
1 answer

The method "showSnackBar" isn't defined for the type 'ScaffoldState'

I am revisiting an old code and it is giving me this error and I am not sure how to fix it.. void _showSuccessSnack() { final snackbar = SnackBar( content: Text( 'User $_username successfully created!', style: new…
acnow
  • 1
-1
votes
3 answers

error: This expression has a type of 'void' so its value can't be used

import 'package:flutter/material.dart'; class Utils{ static final messengerKey = GlobalKey(); static showSnackBar(String? text){ if (text == null) return; final snackBar = SnackBar(content: Text(text),…
-1
votes
1 answer

Snackbar action gets null pointer after moving to another fragment

Fragment A invokes a snackbar with an action button. When user clicks action, it starts new activity with intent. It's working fine. However, if the user moves to Fragment B while snackbar keeps appearing, then press action button, now it doesn't…
Tieria
  • 333
  • 3
  • 11
-1
votes
1 answer

Showing Snackbar using GetX Library

import 'package:flutter/material.dart'; import 'package:get/get.dart'; void main(List args) { runApp(GetMaterialApp( title: 'My App', home: MyApp(), )); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key:…
-1
votes
2 answers

What is the best place to implement shared method between different components in angular?

I'm trying to implement snackbar angular material component on my project. https://stackblitz.com/angular/ygomllvemnl?file=src%2Fapp%2Fsnack-bar-component-example.ts This element(component) is used by 3 other components. So I need to implement the…
-1
votes
2 answers

how to show snackbar message in flutter

I am trying to show snackbar when user click the button but I can't do that. I am not getting warning or error, I don't know what I am missing here is my code: RaisedButton( onPressed: () { if (formKey.currentState.validate()) { …
Tolga KÜÇÜK
  • 123
  • 2
  • 10
-1
votes
1 answer

How to show Snackbar at the bottom of container and not screen flutter

I have below screen to implement, The Problem I am having is that I don't know how to show the snackbar at the bottom of the container. It's showing snackbar at the bottom of the screen, but i want it like below: Note : The Snackbar in the image is…
Jay Dangar
  • 3,271
  • 1
  • 16
  • 35
1 2 3
32
33