use of com.github.johnpersano.supertoasts.SuperToast in project CoCoin by Nightonke.
the class CoCoinToast method showToast.
public void showToast(String text, int color) {
SuperToast.cancelAllSuperToasts();
SuperToast superToast = new SuperToast(CoCoinApplication.getAppContext());
superToast.setAnimations(CoCoinUtil.TOAST_ANIMATION);
superToast.setDuration(SuperToast.Duration.SHORT);
superToast.setTextColor(Color.parseColor("#ffffff"));
superToast.setTextSize(SuperToast.TextSize.SMALL);
superToast.setText(text);
superToast.setBackground(color);
superToast.getTextView().setTypeface(CoCoinUtil.typefaceLatoLight);
superToast.show();
}
use of com.github.johnpersano.supertoasts.SuperToast in project CoCoin by Nightonke.
the class CoCoinUtil method showToast.
public static void showToast(Context context, int textId) {
String text = context.getResources().getString(textId);
if (context == null)
return;
if (lastToast.equals(text)) {
SuperToast.cancelAllSuperToasts();
} else {
lastToast = text;
}
SuperToast superToast = new SuperToast(context);
superToast.setAnimations(SuperToast.Animations.FLYIN);
superToast.setDuration(SuperToast.Duration.VERY_SHORT);
superToast.setTextColor(Color.parseColor("#ffffff"));
superToast.setTextSize(SuperToast.TextSize.SMALL);
superToast.setText(text);
superToast.setBackground(SuperToast.Background.BLUE);
superToast.show();
}
use of com.github.johnpersano.supertoasts.SuperToast in project CoCoin by Nightonke.
the class CoCoinUtil method showToast.
public static void showToast(Context context, String text, int color) {
SuperToast.cancelAllSuperToasts();
SuperToast superToast = new SuperToast(context);
superToast.setAnimations(SuperToast.Animations.FLYIN);
superToast.setDuration(SuperToast.Duration.SHORT);
superToast.setTextColor(Color.parseColor("#ffffff"));
superToast.setTextSize(SuperToast.TextSize.SMALL);
superToast.setText(text);
superToast.setBackground(color);
superToast.show();
}
use of com.github.johnpersano.supertoasts.SuperToast in project CoCoin by Nightonke.
the class CoCoinUtil method showToast.
public static void showToast(Context context, String text) {
if (context == null)
return;
if (lastToast.equals(text)) {
SuperToast.cancelAllSuperToasts();
} else {
lastToast = text;
}
SuperToast superToast = new SuperToast(context);
superToast.setAnimations(SuperToast.Animations.FLYIN);
superToast.setDuration(SuperToast.Duration.VERY_SHORT);
superToast.setTextColor(Color.parseColor("#ffffff"));
superToast.setTextSize(SuperToast.TextSize.SMALL);
superToast.setText(text);
superToast.setBackground(SuperToast.Background.BLUE);
superToast.show();
}
use of com.github.johnpersano.supertoasts.SuperToast in project AnimeTaste by daimajia.
the class PlayActivity method setMaxSize.
@SuppressLint("InlinedApi")
private void setMaxSize() {
if (Build.VERSION.SDK_INT >= 9) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (Build.MODEL.equals("M040")) {
if (!mSharedPreferences.getBoolean("Meizu", false)) {
SuperToast superToast = new SuperToast(this);
superToast.setDuration(12000);
superToast.setText("魅族某些版本固件可能存在兼容性问题,建议您升级到最新固件");
superToast.setIcon(SuperToast.Icon.Dark.INFO, SuperToast.IconPosition.LEFT);
superToast.show();
mSharedPreferences.edit().putBoolean("Meizu", true).apply();
}
}
getSupportActionBar().hide();
RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(Screen.getScreenWidth(getWindowManager()), Screen.getScreenHeight(getWindowManager()));
mHeaderWrapper.setLayoutParams(param);
mVV.setLayoutParams(param);
mZoomButton.setBackgroundResource(R.drawable.screensize_zoomin_button);
mCurrentScape = OrientationHelper.LANDSCAPE;
}
Aggregations