Search in sources :

Example 1 with SmartBackButtonDrawable

use of com.android.systemui.navigation.smartbar.SmartBackButtonDrawable in project android_packages_apps_DUI by DirtyUnicorns.

the class SmartBarView method setButtonDrawable.

public void setButtonDrawable(SmartButtonView button) {
    ButtonConfig config = button.getButtonConfig();
    Drawable d = null;
    if (config != null) {
        // a system navigation action icon is showing, get it locally
        if (!config.hasCustomIcon() && config.isSystemAction()) {
            d = mResourceMap.getActionDrawable(config.getActionConfig(ActionConfig.PRIMARY).getAction());
        } else {
            // custom icon or intent icon, get from library
            d = config.getCurrentIcon(getContext());
        }
        if (TextUtils.equals(config.getTag(), Res.Softkey.BUTTON_BACK)) {
            SmartBackButtonDrawable backDrawable = new SmartBackButtonDrawable(d);
            button.setImageDrawable(null);
            button.setImageDrawable(backDrawable);
            final boolean backAlt = (mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) != 0;
            backDrawable.setImeVisible(backAlt);
        } else {
            button.setImageDrawable(null);
            button.setImageDrawable(d);
        }
    }
}
Also used : ButtonConfig(com.android.internal.utils.du.Config.ButtonConfig) Drawable(android.graphics.drawable.Drawable) SmartBackButtonDrawable(com.android.systemui.navigation.smartbar.SmartBackButtonDrawable) SmartBackButtonDrawable(com.android.systemui.navigation.smartbar.SmartBackButtonDrawable)

Aggregations

Drawable (android.graphics.drawable.Drawable)1 ButtonConfig (com.android.internal.utils.du.Config.ButtonConfig)1 SmartBackButtonDrawable (com.android.systemui.navigation.smartbar.SmartBackButtonDrawable)1