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() {
}
});
}
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);
}
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)));
}
}
}
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();
}
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();
}
Aggregations