Search in sources :

Example 6 with SuperToast

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();
}
Also used : SuperToast(com.github.johnpersano.supertoasts.SuperToast)

Example 7 with SuperToast

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();
}
Also used : SuperToast(com.github.johnpersano.supertoasts.SuperToast)

Example 8 with SuperToast

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();
}
Also used : SuperToast(com.github.johnpersano.supertoasts.SuperToast)

Example 9 with SuperToast

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();
}
Also used : SuperToast(com.github.johnpersano.supertoasts.SuperToast)

Example 10 with SuperToast

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;
}
Also used : SuperToast(com.github.johnpersano.supertoasts.SuperToast) RelativeLayout(android.widget.RelativeLayout) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuperToast (com.github.johnpersano.supertoasts.SuperToast)15 ViewPager (android.support.v4.view.ViewPager)5 View (android.view.View)5 ViewTreeObserver (android.view.ViewTreeObserver)5 AdapterView (android.widget.AdapterView)5 TextView (android.widget.TextView)5 MyGridView (com.nightonke.saver.ui.MyGridView)5 Window (android.view.Window)4 PasswordChangeButtonGridViewAdapter (com.nightonke.saver.adapter.PasswordChangeButtonGridViewAdapter)3 PasswordChangeFragmentAdapter (com.nightonke.saver.adapter.PasswordChangeFragmentAdapter)3 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 Interpolator (android.view.animation.Interpolator)2 RelativeLayout (android.widget.RelativeLayout)2 ButtonGridViewAdapter (com.nightonke.saver.adapter.ButtonGridViewAdapter)2 EditMoneyRemarkFragmentAdapter (com.nightonke.saver.adapter.EditMoneyRemarkFragmentAdapter)2 TagChooseFragmentAdapter (com.nightonke.saver.adapter.TagChooseFragmentAdapter)2 CoCoinScrollableViewPager (com.nightonke.saver.ui.CoCoinScrollableViewPager)2 FixedSpeedScroller (com.nightonke.saver.ui.FixedSpeedScroller)2 Field (java.lang.reflect.Field)2 MaterialIconView (net.steamcrafted.materialiconlib.MaterialIconView)2