-1

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.

enter image description here

enter image description here

Abdurakhmon
  • 2,813
  • 5
  • 20
  • 41

1 Answers1

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

enter image description here

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