I have a custom textview in a cardview at the bottom of the screen and using snackbar to display error messages on logging in. Now when the snackbar shows, the sign up textv
This is what I did in-case someone is looking out.
activity_login.xml
CoordinatorBehavior.java
public class CoordinatorBehavior extends CoordinatorLayout.Behavior {
public CoordinatorBehavior(Context context, AttributeSet attrs) {
}
public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
return dependency instanceof Snackbar.SnackbarLayout;
}
public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
float translationY = Math.min(0, dependency.getTranslationY() - dependency.getHeight());
child.setTranslationY(translationY);
return true;
}
}