Search in sources :

Example 1 with SystemBarTintManager

use of com.yzy.supercleanmaster.utils.SystemBarTintManager in project superCleanMaster by joyoyao.

the class AutoStartManageActivity method applyKitKatTranslucency.

/**
     * Apply KitKat specific translucency.
     */
private void applyKitKatTranslucency() {
    // KitKat translucent navigation/status bar.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
        SystemBarTintManager mTintManager = new SystemBarTintManager(this);
        mTintManager.setStatusBarTintEnabled(true);
        mTintManager.setNavigationBarTintEnabled(true);
        // mTintManager.setTintColor(0xF00099CC);
        mTintManager.setTintDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
        getActionBar().setBackgroundDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
    }
}
Also used : SystemBarTintManager(com.yzy.supercleanmaster.utils.SystemBarTintManager)

Example 2 with SystemBarTintManager

use of com.yzy.supercleanmaster.utils.SystemBarTintManager in project superCleanMaster by joyoyao.

the class MemoryCleanActivity method applyKitKatTranslucency.

/**
     * Apply KitKat specific translucency.
     */
private void applyKitKatTranslucency() {
    // KitKat translucent navigation/status bar.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
        SystemBarTintManager mTintManager = new SystemBarTintManager(this);
        mTintManager.setStatusBarTintEnabled(true);
        mTintManager.setNavigationBarTintEnabled(true);
        // mTintManager.setTintColor(0xF00099CC);
        mTintManager.setTintDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
        getActionBar().setBackgroundDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
    }
}
Also used : SystemBarTintManager(com.yzy.supercleanmaster.utils.SystemBarTintManager)

Example 3 with SystemBarTintManager

use of com.yzy.supercleanmaster.utils.SystemBarTintManager in project superCleanMaster by joyoyao.

the class RubbishCleanActivity method applyKitKatTranslucency.

/**
     * Apply KitKat specific translucency.
     */
private void applyKitKatTranslucency() {
    // KitKat translucent navigation/status bar.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
        SystemBarTintManager mTintManager = new SystemBarTintManager(this);
        mTintManager.setStatusBarTintEnabled(true);
        mTintManager.setNavigationBarTintEnabled(true);
        // mTintManager.setTintColor(0xF00099CC);
        mTintManager.setTintDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
        getActionBar().setBackgroundDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
    }
}
Also used : SystemBarTintManager(com.yzy.supercleanmaster.utils.SystemBarTintManager)

Example 4 with SystemBarTintManager

use of com.yzy.supercleanmaster.utils.SystemBarTintManager in project superCleanMaster by joyoyao.

the class ShortCutActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_short_cut);
    rect = getIntent().getSourceBounds();
    if (rect == null) {
        finish();
        return;
    }
    if (rect != null) {
        Class<?> c = null;
        Object obj = null;
        Field field = null;
        int x = 0, statusBarHeight = 0;
        try {
            c = Class.forName("com.android.internal.R$dimen");
            obj = c.newInstance();
            field = c.getField("status_bar_height");
            x = Integer.parseInt(field.get(obj).toString());
            statusBarHeight = getResources().getDimensionPixelSize(x);
        } catch (Exception e1) {
            e1.printStackTrace();
        }
        layoutAnim.measure(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        int height = layoutAnim.getMeasuredHeight();
        int width = layoutAnim.getMeasuredWidth();
        RelativeLayout.LayoutParams layoutparams = (RelativeLayout.LayoutParams) layoutAnim.getLayoutParams();
        layoutparams.leftMargin = rect.left + rect.width() / 2 - width / 2;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            setTranslucentStatus(true);
            SystemBarTintManager tintManager = new SystemBarTintManager(this);
            tintManager.setStatusBarTintEnabled(true);
            tintManager.setStatusBarTintResource(R.color.transparent);
            layoutparams.topMargin = rect.top + rect.height() / 2 - height / 2;
        } else {
            layoutparams.topMargin = rect.top + rect.height() / 2 - height / 2 - statusBarHeight;
        }
        mRelativeLayout.updateViewLayout(layoutAnim, layoutparams);
    }
    cleanLightImg.startAnimation(AnimationUtils.loadAnimation(this, R.anim.rotate_anim));
    bindService(new Intent(mContext, CoreService.class), mServiceConnection, Context.BIND_AUTO_CREATE);
}
Also used : Field(java.lang.reflect.Field) LayoutParams(android.view.WindowManager.LayoutParams) RelativeLayout(android.widget.RelativeLayout) CoreService(com.yzy.supercleanmaster.service.CoreService) Intent(android.content.Intent) SystemBarTintManager(com.yzy.supercleanmaster.utils.SystemBarTintManager)

Example 5 with SystemBarTintManager

use of com.yzy.supercleanmaster.utils.SystemBarTintManager in project superCleanMaster by joyoyao.

the class SoftwareManageActivity method applyKitKatTranslucency.

/**
     * Apply KitKat specific translucency.
     */
private void applyKitKatTranslucency() {
    // KitKat translucent navigation/status bar.
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
        SystemBarTintManager mTintManager = new SystemBarTintManager(this);
        mTintManager.setStatusBarTintEnabled(true);
        mTintManager.setNavigationBarTintEnabled(true);
        // mTintManager.setTintColor(0xF00099CC);
        mTintManager.setTintDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
        getActionBar().setBackgroundDrawable(UIElementsHelper.getGeneralActionBarBackground(this));
    }
}
Also used : SystemBarTintManager(com.yzy.supercleanmaster.utils.SystemBarTintManager)

Aggregations

SystemBarTintManager (com.yzy.supercleanmaster.utils.SystemBarTintManager)6 Intent (android.content.Intent)1 LayoutParams (android.view.WindowManager.LayoutParams)1 RelativeLayout (android.widget.RelativeLayout)1 CoreService (com.yzy.supercleanmaster.service.CoreService)1 Field (java.lang.reflect.Field)1