Search in sources :

Example 16 with SmartButtonView

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

the class SmartBarView method onKeyguardShowing.

@Override
protected void onKeyguardShowing(boolean showing) {
    if (mEditor != null) {
        mEditor.setKeyguardShowing(showing);
    }
    // do so without slowing faster boot time.
    if (!showing) {
        ViewGroup hidden = (ViewGroup) getHiddenView().findViewWithTag(Res.Common.NAV_BUTTONS);
        for (String buttonTag : mCurrentSequence) {
            SmartButtonView v = findCurrentButton(buttonTag);
            if (v != null) {
                ButtonConfig config = v.getButtonConfig();
                if (config != null && v.getDrawable() == null) {
                    v.setImageDrawable(config.getCurrentIcon(getContext()));
                }
            }
            v = (SmartButtonView) hidden.findViewWithTag(buttonTag);
            if (v != null) {
                ButtonConfig config = v.getButtonConfig();
                if (config != null && v.getDrawable() == null) {
                    v.setImageDrawable(config.getCurrentIcon(getContext()));
                }
            }
        }
    }
}
Also used : ButtonConfig(com.android.internal.utils.du.Config.ButtonConfig) ViewGroup(android.view.ViewGroup) SmartButtonView(com.android.systemui.navigation.smartbar.SmartButtonView)

Example 17 with SmartButtonView

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

the class SmartBarEditor method setButtonsEditMode.

private void setButtonsEditMode(boolean isInEditMode) {
    for (String buttonTag : mHost.getCurrentSequence()) {
        SmartButtonView v = mHost.findCurrentButton(buttonTag);
        if (v != null) {
            v.setEditMode(isInEditMode);
            OpaLayout opa = (OpaLayout) v.getParent();
            opa.setOnTouchListener(isInEditMode ? this : null);
        }
    }
}
Also used : OpaLayout(com.android.systemui.navigation.OpaLayout) SmartButtonView(com.android.systemui.navigation.smartbar.SmartButtonView)

Example 18 with SmartButtonView

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

the class SmartBarEditor method onActionPicked.

@Override
protected void onActionPicked(String action, ActionConfig actionConfig) {
    final String buttonFocus = getEditButtonTag();
    final int tapFocus = mTapHasFocusTag;
    SmartButtonView currentButton = mHost.findCurrentButton(buttonFocus);
    SmartButtonView otherButton = (SmartButtonView) getHiddenNavButtons().findViewWithTag(buttonFocus);
    ActionConfig currentAction = new ActionConfig(mContext, action);
    ActionConfig otherAction = new ActionConfig(mContext, action);
    ButtonConfig currentConfig = currentButton.getButtonConfig();
    ButtonConfig otherConfig = otherButton.getButtonConfig();
    OpaLayout currentOpa = (OpaLayout) currentButton.getParent();
    OpaLayout otherOpa = (OpaLayout) otherButton.getParent();
    currentConfig.setActionConfig(currentAction, tapFocus);
    otherConfig.setActionConfig(otherAction, tapFocus);
    currentButton.setButtonConfig(currentConfig);
    otherButton.setButtonConfig(otherConfig);
    if (tapFocus == ActionConfig.PRIMARY) {
        // update icon for single tap only
        mHost.setButtonDrawable(currentButton);
        SmartBarHelper.updateButtonScalingAndPadding(currentOpa, isLandscape());
        mHost.setButtonDrawable(otherButton);
        SmartBarHelper.updateButtonScalingAndPadding(otherOpa, !isLandscape());
    }
    onCommitChanges();
}
Also used : ActionConfig(com.android.internal.utils.du.Config.ActionConfig) ButtonConfig(com.android.internal.utils.du.Config.ButtonConfig) OpaLayout(com.android.systemui.navigation.OpaLayout) SmartButtonView(com.android.systemui.navigation.smartbar.SmartButtonView) Point(android.graphics.Point)

Example 19 with SmartButtonView

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

the class SmartBarView method setOpaLandscape.

private void setOpaLandscape(boolean landscape) {
    for (String buttonTag : mCurrentSequence) {
        SmartButtonView v = findCurrentButton(buttonTag);
        OpaLayout opa = (OpaLayout) v.getParent();
        opa.setLandscape(landscape);
    }
}
Also used : OpaLayout(com.android.systemui.navigation.OpaLayout) SmartButtonView(com.android.systemui.navigation.smartbar.SmartButtonView)

Aggregations

SmartButtonView (com.android.systemui.navigation.smartbar.SmartButtonView)19 OpaLayout (com.android.systemui.navigation.OpaLayout)11 ButtonConfig (com.android.internal.utils.du.Config.ButtonConfig)8 ViewGroup (android.view.ViewGroup)5 FrameLayout (android.widget.FrameLayout)5 Point (android.graphics.Point)3 LinearLayout (android.widget.LinearLayout)3 ActionConfig (com.android.internal.utils.du.Config.ActionConfig)2 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 ObjectAnimator (android.animation.ObjectAnimator)1 View (android.view.View)1 OvershootInterpolator (android.view.animation.OvershootInterpolator)1 ImageView (android.widget.ImageView)1 LayoutParams (android.widget.LinearLayout.LayoutParams)1 SmartBarView (com.android.systemui.navigation.smartbar.SmartBarView)1 ArrayList (java.util.ArrayList)1