I have the following Activity
where users can post comments. If there is no internet connection I am showing message to user in a SnackBar
on top of the screen because at the bottom I have EditText
. Now the problem is that SnackBar
is fading out top-to-bottom
like in the 2nd image. I was wondering if it's possible to change this behavior so that it would fade out bottom-to-top
.
Asked
Active
Viewed 844 times
-1

Abdurakhmon
- 2,813
- 5
- 20
- 41
-
can you make a gif on how that snackbar is fading ? im not getting you quite right – Gastón Saillén May 25 '18 at 17:43
-
well it just like the first image and then it slides down like in the second image and then disappears – Abdurakhmon May 25 '18 at 17:54
-
oh, now i get it ! – Gastón Saillén May 25 '18 at 17:56
-
1https://github.com/AndreiD/TSnackBar check this out dude – Gastón Saillén May 25 '18 at 17:58
-
yeah that exactly what I was looking for. Thanks – Abdurakhmon May 25 '18 at 18:01
1 Answers
1
As I stated above you can use this library:
https://github.com/AndreiD/TSnackBar
To implement it just do this steps
In your gradle module app (do not use compile as it will discontinued soon)
implementation'com.androidadvance:topsnackbar:1.1.1'
As this is in Maven, you can check the latest version of the library just by clicking here
https://mvnrepository.com/artifact/com.androidadvance/topsnackbar
What OP is needing is the first example, to do it just simply add this to your onCreate (or whenever you want it)
TSnackbar.make(findViewById(android.R.id.content),"Hello from TSnackBar.",TSnackbar.LENGTH_LONG).show();

halfer
- 19,824
- 17
- 99
- 186

Gastón Saillén
- 12,319
- 5
- 67
- 77