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