Search in sources :

Example 1 with ColorDrawable

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);
    }
}
Also used : Explode(android.transition.Explode) ColorDrawable(android.graphics.drawable.ColorDrawable) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with ColorDrawable

use of android.graphics.drawable.ColorDrawable in project SimplifyReader by chentao0707.

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(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 : ColorDrawable(android.graphics.drawable.ColorDrawable)

Example 3 with ColorDrawable

use of android.graphics.drawable.ColorDrawable in project MyDiary by erttyy8821.

the class SettingActivity method setThemeColor.

private void setThemeColor() {
    IV_setting_theme_main_color.setImageDrawable(new ColorDrawable(themeManager.getThemeMainColor(this)));
    IV_setting_theme_dark_color.setImageDrawable(new ColorDrawable(themeManager.getThemeDarkColor(this)));
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable)

Example 4 with ColorDrawable

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;
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) StateListDrawable(android.graphics.drawable.StateListDrawable) GradientDrawable(android.graphics.drawable.GradientDrawable) File(java.io.File)

Example 5 with ColorDrawable

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;
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) StateListDrawable(android.graphics.drawable.StateListDrawable) GradientDrawable(android.graphics.drawable.GradientDrawable) File(java.io.File)

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