Search in sources :

Example 96 with ColorDrawable

use of android.graphics.drawable.ColorDrawable in project SimpleNews by liuling07.

the class SwipeBackActivityHelper method onActivityCreate.

@SuppressWarnings("deprecation")
public void onActivityCreate() {
    mActivity.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mActivity.getWindow().getDecorView().setBackgroundDrawable(null);
    mSwipeBackLayout = (SwipeBackLayout) LayoutInflater.from(mActivity).inflate(me.imid.swipebacklayout.lib.R.layout.swipeback_layout, null);
    mSwipeBackLayout.addSwipeListener(new SwipeBackLayout.SwipeListener() {

        @Override
        public void onScrollStateChange(int state, float scrollPercent) {
        }

        @Override
        public void onEdgeTouch(int edgeFlag) {
            Utils.convertActivityToTranslucent(mActivity);
        }

        @Override
        public void onScrollOverThreshold() {
        }
    });
}
Also used : SwipeBackLayout(me.imid.swipebacklayout.lib.SwipeBackLayout) ColorDrawable(android.graphics.drawable.ColorDrawable)

Example 97 with ColorDrawable

use of android.graphics.drawable.ColorDrawable in project NotificationPeekPort by lzanita09.

the class AppearanceSettingsFragment method initPreviewBackgroundDrawable.

/**
     * Create a new {@link android.graphics.drawable.TransitionDrawable} object with correct order
     * of Drawables based on user selection.
     *
     * @return TransitionDrawable object created.
     */
private TransitionDrawable initPreviewBackgroundDrawable() {
    boolean isWallpaperSelected = WallpaperFactory.isWallpaperThemeSelected(getActivity());
    Drawable black = new ColorDrawable(Color.BLACK);
    Drawable wallpaper = mUseLiveWallpaper ? new ColorDrawable(Color.TRANSPARENT) : new BitmapDrawable(getResources(), mWallpaperFactory.getPrefSystemWallpaper());
    mChangeDrawables = !isWallpaperSelected ? new Drawable[] { black, wallpaper } : new Drawable[] { wallpaper, black };
    mBlackDrawableIndex = !isWallpaperSelected ? 0 : 1;
    return new TransitionDrawable(mChangeDrawables);
}
Also used : TransitionDrawable(android.graphics.drawable.TransitionDrawable) ColorDrawable(android.graphics.drawable.ColorDrawable) ColorDrawable(android.graphics.drawable.ColorDrawable) BitmapDrawable(android.graphics.drawable.BitmapDrawable) Drawable(android.graphics.drawable.Drawable) TransitionDrawable(android.graphics.drawable.TransitionDrawable) BitmapDrawable(android.graphics.drawable.BitmapDrawable)

Example 98 with ColorDrawable

use of android.graphics.drawable.ColorDrawable in project AdvancedMaterialDrawer by madcyph3r.

the class MaterialNavigationDrawer method initKitKatDependencies.

private void initKitKatDependencies(Resources.Theme theme) {
    if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
        TypedArray windowTraslucentAttribute = theme.obtainStyledAttributes(new int[] { android.R.attr.windowTranslucentStatus });
        kitkatTraslucentStatusbar = windowTraslucentAttribute.getBoolean(0, false);
        if (kitkatTraslucentStatusbar) {
            Window window = this.getWindow();
            window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
            RelativeLayout.LayoutParams statusParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, resources.getDimensionPixelSize(R.dimen.traslucentStatusMargin));
            statusBar.setLayoutParams(statusParams);
            statusBar.setImageDrawable(new ColorDrawable(darkenColor(primaryColor)));
        }
    }
}
Also used : Window(android.view.Window) ColorDrawable(android.graphics.drawable.ColorDrawable) TypedArray(android.content.res.TypedArray) RelativeLayout(android.widget.RelativeLayout)

Example 99 with ColorDrawable

use of android.graphics.drawable.ColorDrawable in project AdvancedMaterialDrawer by madcyph3r.

the class MaterialRippleLayout method setRippleBackground.

public void setRippleBackground(int color) {
    rippleBackground = new ColorDrawable(color);
    rippleBackground.setBounds(bounds);
    invalidate();
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable)

Example 100 with ColorDrawable

use of android.graphics.drawable.ColorDrawable in project AdvancedMaterialDrawer by madcyph3r.

the class MaterialRippleLayoutNineOld method setRippleBackground.

public void setRippleBackground(int color) {
    rippleBackground = new ColorDrawable(color);
    rippleBackground.setBounds(bounds);
    invalidate();
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable)

Aggregations

ColorDrawable (android.graphics.drawable.ColorDrawable)519 View (android.view.View)112 Drawable (android.graphics.drawable.Drawable)102 BitmapDrawable (android.graphics.drawable.BitmapDrawable)67 ImageView (android.widget.ImageView)62 TextView (android.widget.TextView)55 Bitmap (android.graphics.Bitmap)51 AdapterView (android.widget.AdapterView)32 LinearLayout (android.widget.LinearLayout)32 Test (org.junit.Test)31 Canvas (android.graphics.Canvas)29 ListView (android.widget.ListView)27 FrameLayout (android.widget.FrameLayout)23 ViewGroup (android.view.ViewGroup)22 Handler (android.os.Handler)20 TransitionDrawable (android.graphics.drawable.TransitionDrawable)19 Paint (android.graphics.Paint)18 StateListDrawable (android.graphics.drawable.StateListDrawable)17 WindowManager (android.view.WindowManager)17 Point (android.graphics.Point)16