493 questions
1
vote
1
answer
52
views
Remove the background of the bottom navigation
I am testing my React Native app on two devices. And for the past two days I've been trying to find a way to remove the background of the bottom navigation.
I've tried transparent mode, but it's not ...
1
vote
0
answers
439
views
Undo Snackbar with a SwipeToDismissBox
I'm starting to get into Jetpack Compose and am trying to implement a list where you can swipe to delete an item but you can also restore it via a Snackbar action. In the old XML-Layout-based world I ...
0
votes
0
answers
453
views
How can I ensure that the snackbar remains visible and not hidden behind the modal bottom sheet on Compose?
TL-DR -> How can I ensure that the snackbar remains visible and not hidden behind the modal bottom sheet? What is the reason of it?
I'm creating a Snackbar using snackbarHost and snackBarHostState ...
2
votes
1
answer
164
views
Android Snackbar.SnackbarLayout obsolete; replacement?
I'm maintaining an "enterprise" Android app that runs on wrist-mounted computers in an industrial environment. When we need to let the user know something of middling importance, we have the ...
0
votes
3
answers
2k
views
Don't use 'BuildContext's across async gaps in Flutter warning doesn't go away
Flutter gives me the warning "Don't use 'BuildContext's across async gaps. Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check". The warning is in ...
5
votes
0
answers
257
views
Should I use a banner in Android with Material 3?
We use the Google Maps SDK. We want to use an icon inside of a Snackbar to make it easier for a user to grasp that internet connection is missing, or that he needs to zoom in, for using a feature. ...
1
vote
1
answer
54
views
Prevent Snackbar Overlap with FloatingActionButton in ConstraintLayout of Activity's Child Fragment
This is my current Setup:
I have a BaseActivity that registers the snackbar on the root layout (CoordinatorLayout):
<?xml version="1.0" encoding="utf-8"?>
<androidx....
1
vote
0
answers
83
views
Snackbar disappear with recomposition
I have implemented method to manage single-time events in android compose, like displaying snackbar, according to this article by Marco Cattaneo on medium.com.
It uses channel of messages in viewmodel....
0
votes
1
answer
56
views
How to put snackbar button response in one suspend function in Kotlin jetpack
How to put snackbar button response in one suspend function in Kotlin jetpack.
I have one SnackbarResult.ActionPerformed for all my snackbars.
And I have suspend fun for my snackbar:
suspend fun ...
4
votes
2
answers
2k
views
Jetpack compose snackbar hidden behind bottomsheet
I show a SnackBar inside Scaffold like this:
val scaffoldState = rememberScaffoldState()
LaunchedEffect(offerViewModel.onAddToCartError) {
offerViewModel.onAddToCartError = {
...
1
vote
1
answer
358
views
Handling Snackbar display in Compose Globally
Hi I am using the below code to handle the snackbar display globally. I am new to compose and I went through various videos and blogs, and finally came up with below. Is this the right way of doing ...
1
vote
1
answer
90
views
how to set snackbar message in the center of Screen in Angular
I have a snackbar i am calling this snackbar on the button click.
Below is the button
.html
<button mat-icon-button (click)="UpdateCandidateData(row)" matTooltip="Save Changes"
...
0
votes
1
answer
177
views
How to design an icon in Snack bar?
Is there any way to put a button on Snack bar to do some actions like canceling , undo or closing the snack bar with clicking on a designed icon?
i'm usin Kotlin and Xml in android studio
tried using ...
0
votes
0
answers
57
views
Should a custom SnackbarHost use the Scaffold's default SnackbarHostState or a custom one?
There are apparently two ways to initialize a custom Snackbar.
You can do this by using a custom SnackbarHostState and ignoree the default one passed to the lambda. (I found it in this question while ...
4
votes
2
answers
2k
views
Android Jetpack Compose Snackbar: How to immediately close the previous Snackbar when a new one is triggered?
I'm facing an issue with Android Jetpack Compose Snackbar in my application. I have a LazyColumn where each row is a SwipeToDismiss composable. On each swipe, I remove the row and show a Snackbar. ...
0
votes
1
answer
359
views
Get user location in Compose with M3
I am trying to get the User Location in Compose.
I found this link and tried the Mitch solution. But it has an infinite loop and the snackbar is not shown. From other links I read that it needs to be ...
2
votes
0
answers
56
views
How to add modifier in rememberScaffoldState of snackbarHostState?
So, I've been following this article. The code below shows the snackbar state, how do I add modifier in the below code so that I can have the snackbar show in top or bottom area. My goal is to somehow ...
0
votes
1
answer
99
views
How to add snackbar when user already exists in jetpack compose android
I want to show the user snackbar when user already exists in firebase. How can I add a snackbar notification when .addOnFailureListener or user already exists? I have conceptual knowledge gap so ...
0
votes
1
answer
186
views
How to make SnackBar NOT match_parent - android kotlin
Initially, I wanted to make Toast with a custom layout, but then I saw that starting from Android 11, it was not desirable to do this, and the setView() method for Toast became deprecated. I decided ...
-1
votes
1
answer
137
views
How to have an alert similar to Twitter Toast/Snackbar alert in Android Studio?
How one can have Toast/Snackbar notification UI like Twitter Toast/Snackbar notification in android studio (java or kotlin)?
2
votes
1
answer
1k
views
Android display Snackbar on returning from another screen
In all android compose examples I seen they show a snackbar message with undo when u delete from a list... and stay in same screen.
Can someone link me to an example where they select a record and GO ...
0
votes
0
answers
425
views
How to do custom message box in android jetpack compose?
I want to show a message box at the bottom of the screen there will be an image on the left of the message box and a message on the right as fillmaxwidth size if a success response is returned from ...
2
votes
1
answer
3k
views
Jetpack Compose Snackbar above Dialog
How can a Snackbar be shown above a Dialog or AlertDialog in Jetpack Compose? Everything I have tried has resulted in the snack bar being below the scrim of the dialog not to mention the dialog itself....
3
votes
3
answers
6k
views
How can I fix exception "Floating SnackBar presented off screen" in flutter
I have an app that displays a snackbar when some action is done. I had tested this with my phone and some emulator and it works. Recently I installed an emulator with android 13 and maybe a bigger ...
1
vote
0
answers
61
views
Is it possible to hide android screenshot toolbar but detect the screenshot to show my custom screenshot toolbar from app?
Is it possible to hide android screenshot toolbar but detect the screenshot to show my custom screenshot toolbar from app?
I tried:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, ...
0
votes
1
answer
171
views
I'm trying to implement a snackbar in android studio but the app keeps crashing when i use it
I'm trying to implement a snackbar in android studio where when i click the button in the center of the screen, it will display the snackbar and say "moving to second screen". if the user ...
0
votes
2
answers
871
views
How to change TextStyle in Snackbar with Scaffold?
Don't understand how to assign text style to Snackbar
Scaffold(
scaffoldState = scaffoldState,
snackbarHost = { hostState ->
SnackbarHost(hostState = hostState) { data -...
0
votes
1
answer
396
views
Chain Snackbar calls
I'm trying to use the snackbar on Android Compose. However, as I'm trying to display 2 messages in a row on the snackbar, I can only see the first message, does anybody know what can cause this?
I'm ...
0
votes
2
answers
134
views
How to alight drawable left near to TextView Android (Or custom snackbar android)
I'm using a custom SnackBar for android, I have created SnackBar with an icon and a message. Icon drawable isn't working as expected. The margin text is further than expected. So, this is what I did:
...
0
votes
1
answer
179
views
The argument type 'BuildContext' can't be assigned to the parameter type 'OverlayState'. top_snackbar_flutter: ^3.0.0
showTopSnackBar(
context,
CustomSnackBar.success(
message:
"Good job, your release is successful. Have a nice day",
),
);
top_snackbar_flutter: ^3.0.0
4
votes
1
answer
2k
views
Queue of snackbars jetpack Compose
When i call Snackbar multiple times, they create a queue and occure one by one. I want a new Snachbar to immediately close previous one. Here is my code:
Scaffold(
snackbarHost = {
...
0
votes
1
answer
941
views
How to resolve the Show Snack Bar Error in Line Context
Recently i am trying to run the project but seem the snackbar is have some kind of error like this
the compiler show the error below the "context" message
how to solve it?
void ...
1
vote
2
answers
248
views
Is there way to bring snackbar to the front, like Toast?
I try bring the snackbar to the foremost ui.
My case is
Open internet_connectiviity popup(modal) with Settings.panel.ACTION_INTERNET_CONNECTIVITY
When user enable wifi, my app shows an alert to close ...
0
votes
1
answer
68
views
Snackbar message being replicated
I have created a bottom navigation bar in which i have three fragments, for now,let's say fragment 1, 2 and 3. I have enabled a live data observer and it shows a message whenever an api returns the ...
2
votes
2
answers
1k
views
How to override SnackbarData in Jetpack Compose?
I need a custom parameter in the snackbar, but showSnackbar only allows passing three parameters (message, actionLabel and duration). I need to pass an Enum to decide which status to show.
@Composable
...
0
votes
1
answer
488
views
How to format the text of a Snackbar in Android
I have a method that displays snackbars which is called from many different fragments. Here is the code of this method:
public static void showSnackBar(Activity activity, String message, View root) {
...
2
votes
2
answers
181
views
Snackbar replaces toast and unit tests crash when snackbar comes to foreground
I have replaced Toast with Snackbar in my code. I have added the following dependency in the corresponding build: implementation('com.google.android.material:material:1.8.0-alpha01')
private fun ...
2
votes
1
answer
304
views
Android java - Trying to show snackbar in new thread
Ive been trying to make my bluetooth connection thread be able to send messages to the user through snackbars, but they never appear on the screen.
In main method:
//listener for connect button
...
1
vote
2
answers
892
views
Jetpack compose snackbar action click is not working
I have displayed a snackbar with specific action in Jetpack compose but click listener on that action is not working.
Here is my code:
@Composable
fun MySnackBar() {
Snackbar(
...
8
votes
2
answers
2k
views
Scalable way to use the Snackbar in Android Compose
This is not a post to have a solution but to discuss the project structure on Compose.
I'm currently learning Compose and I have difficulties to understand how to use the Snackbar in a project. Most ...
3
votes
1
answer
3k
views
How to change background color of the jetpack compose snackbar?
I want to change solid or gradient color to jetpack compose snack bar. Please guide me how to
change color
Here is my snack bar using material3 compose, I am looking solution to change the background ...
2
votes
1
answer
2k
views
How to show a Snackbar in Android on the top when using ConstraintLayout in a nice way
I am using ConstraintLayout in Android and I would like to display a Snackbar message at the top of the screen. I found this question on Stackoverflow: How to show Snackbar at top of the screen
The ...
0
votes
1
answer
857
views
Android Snackbar: No suitable parent found from the given view. Please provide a valid view
I have a Fragment class and a normal HelpFunctionsclass. I want the Fragment class to show a Snackbar by calling a method in the HelpFunctionsclass.
In the Fragment class I call the following code ...
-2
votes
2
answers
1k
views
How to set margin in SnackBar
I'm trying to add margins at bottom, left and right to my SnackBar but I'm not able to get it.
That's what I tried:
var snackBar = Snackbar.make(binding.root,msg,Snackbar.LENGHT_LONG)
var ...
0
votes
1
answer
100
views
Action in SnackBar called instantly when show
I'm trying to show my SnackBar but my action is being called instantly when shown and not when the button is clicked. Why is this happening?
fun showSnackBar(msg:String,btnMsg:String,action:Unit){
...
1
vote
1
answer
301
views
Snackbar overlays Admob banner ad
I have a snackbar which overlays the banner ad. It has a LENGTH_INDEFINITE because I have some functionality I need to complete after the snackbar is displayed.
Would this be considered a violation of ...
1
vote
0
answers
462
views
Snackbar over multiple activity's
I have a snackbar but when switching activity's it stays on the original activity it had been activated. Is there a way to make it stay on screen when switching activity's?
val mainSnackBar = ...
0
votes
1
answer
278
views
SnackBar Direction in Compose
I implement user interface in Jetpack Compose, and want to show SnackBar inside Compose functions.
the issue is that i can't change SnackBar's Layout Direction to Rtl.
What I've implemented to change ...
0
votes
0
answers
111
views
Could not able to change the width of snackbar using material 1.5.0
Could not able to change the width of the snackbar when migrated material design from 1.3.0 to 1.5.0.
Using below code :
val contentLayoutParams = snackBar.view.layoutParams as FrameLayout....
4
votes
4
answers
2k
views
Compose Snackbar not appearing on repeated error
I am new to jetpack compose and is trying to show an error snackbar whenever the error message I am observing is not null.
Scaffold(scaffoldState = scaffoldState) {
LaunchedEffect(errorMessage)...