use of android.graphics.drawable.ColorDrawable in project MyDiary by erttyy8821.
the class ThemeManager method getContactsBgDrawable.
public Drawable getContactsBgDrawable(Context context, long topicId) {
Drawable bgDrawable;
File memoBg = new File(new FileManager(context, FileManager.CONTACTS_ROOT_DIR).getDirAbsolutePath() + "/" + topicId + "/" + CUSTOM_TOPIC_BG_FILENAME);
if (memoBg.exists()) {
bgDrawable = Drawable.createFromPath(memoBg.getAbsolutePath());
} else {
switch(currentTheme) {
case TAKI:
bgDrawable = ViewTools.getDrawable(context, R.drawable.contacts_bg_taki);
break;
case MITSUHA:
bgDrawable = ViewTools.getDrawable(context, R.drawable.contacts_bg_mitsuha);
break;
default:
bgDrawable = new ColorDrawable(SPFManager.getMainColor(context));
break;
}
}
return bgDrawable;
}
use of android.graphics.drawable.ColorDrawable in project MyDiary by erttyy8821.
the class ThemeManager method getMemoBgDrawable.
public Drawable getMemoBgDrawable(Context context, long topicId) {
Drawable bgDrawable;
File memoBg = new File(new FileManager(context, FileManager.MEMO_ROOT_DIR).getDirAbsolutePath() + "/" + topicId + "/" + CUSTOM_TOPIC_BG_FILENAME);
if (memoBg.exists()) {
bgDrawable = Drawable.createFromPath(memoBg.getAbsolutePath());
} else {
switch(currentTheme) {
case TAKI:
bgDrawable = new ColorDrawable(Color.WHITE);
break;
case MITSUHA:
bgDrawable = new ColorDrawable(Color.WHITE);
break;
default:
bgDrawable = new ColorDrawable(Color.WHITE);
break;
}
}
return bgDrawable;
}
use of android.graphics.drawable.ColorDrawable in project MyDiary by erttyy8821.
the class ThemeManager method createTopicItemSelectBg.
private Drawable createTopicItemSelectBg(Context context) {
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(getThemeMainColor(context)));
stateListDrawable.addState(new int[] {}, new ColorDrawable(Color.WHITE));
return stateListDrawable;
}
use of android.graphics.drawable.ColorDrawable in project photo-picker-plus-android by chute.
the class BaseActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setEnterTransition(new Explode());
getWindow().setExitTransition(new Explode());
}
setContentView(getLayoutResource());
Toolbar toolBar = (Toolbar) findViewById(R.id.toolbar);
if (toolBar != null) {
toolBar.bringToFront();
setSupportActionBar(toolBar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setIcon(new ColorDrawable(android.R.color.transparent));
getSupportActionBar().setTitle(R.string.choose_service);
setToolBar(toolBar);
}
}
use of android.graphics.drawable.ColorDrawable in project FastAdapter by mikepenz.
the class FastAdapterUIUtils method getSelectablePressedBackground.
/**
* helper to get the system default selectable background inclusive an active and pressed state
*
* @param ctx the context
* @param selected_color the selected color
* @param pressed_alpha 0-255
* @param animate true if you want to fade over the states (only animates if API newer than Build.VERSION_CODES.HONEYCOMB)
* @return the StateListDrawable
*/
public static StateListDrawable getSelectablePressedBackground(Context ctx, @ColorInt int selected_color, int pressed_alpha, boolean animate) {
StateListDrawable states = getSelectableBackground(ctx, selected_color, animate);
ColorDrawable clrPressed = new ColorDrawable(adjustAlpha(selected_color, pressed_alpha));
states.addState(new int[] { android.R.attr.state_pressed }, clrPressed);
return states;
}
Aggregations