use snack bar library
from
https://github.com/Kennyc1012/SnackBar/tree/master/library/src/main/java/com/kenny/snackbar
public static void maketoast(Activity c) {
new SnackBarItem.Builder(c)
.setMessageResource("No internet connection")
.setSnackBarMessageColorResource(R.color.white)
.setSnackBarBackgroundColorResource(R.color.blue)
.setInterpolatorResource(android.R.interpolator.accelerate_decelerate)
.setMessageTypeface(UtilsTyeFace.getHelveticaNeueLTArabicRoman(c))
.setDuration(5000)
.setSnackBarListener(new snackbarlistner())
.show();
}
}
snack bar listner
public class snackbarlistner implements SnackBarListener{
@Override
public void onSnackBarStarted(Object object) {
// TODO Auto-generated method stub
SharedObjects.getInstance().setCustomtoast(true);
}
@Override
public void onSnackBarFinished(Object object, boolean actionPressed) {
// TODO Auto-generated method stub
SharedObjects.getInstance().setCustomtoast(false);
Log.e("calledend","calledend");
}
}
No comments:
Post a Comment