use of android.support.design.testapp.custom.CustomSnackbarMainContent in project material-components-android by material-components.
the class CustomSnackbarTest method makeCustomSnackbar.
private CustomSnackbar makeCustomSnackbar() {
final LayoutInflater inflater = LayoutInflater.from(mCoordinatorLayout.getContext());
final CustomSnackbarMainContent content = (CustomSnackbarMainContent) inflater.inflate(R.layout.custom_snackbar_include, mCoordinatorLayout, false);
final BaseTransientBottomBar.ContentViewCallback contentViewCallback = new BaseTransientBottomBar.ContentViewCallback() {
@Override
public void animateContentIn(int delay, int duration) {
ViewCompat.setAlpha(content, 0f);
ViewCompat.animate(content).alpha(1f).setDuration(duration).setStartDelay(delay).start();
}
@Override
public void animateContentOut(int delay, int duration) {
ViewCompat.setAlpha(content, 1f);
ViewCompat.animate(content).alpha(0f).setDuration(duration).setStartDelay(delay).start();
}
};
return new CustomSnackbar(mCoordinatorLayout, content, contentViewCallback);
}
Aggregations