Methods Summary |
---|
protected java.lang.String | composeChangeAnnouncement()
if (mState.value) {
return mContext.getString(
R.string.accessibility_quick_settings_color_inversion_changed_on);
} else {
return mContext.getString(
R.string.accessibility_quick_settings_color_inversion_changed_off);
}
|
protected void | handleClick()
mSetting.setValue(mState.value ? 0 : 1);
mEnable.setAllowAnimation(true);
mDisable.setAllowAnimation(true);
|
protected void | handleDestroy()
super.handleDestroy();
mUsageTracker.setListening(false);
mSetting.setListening(false);
|
protected void | handleLongClick()
if (mState.value) return; // don't allow usage reset if inversion is active
final String title = mContext.getString(R.string.quick_settings_reset_confirmation_title,
mState.label);
mUsageTracker.showResetConfirmation(title, new Runnable() {
@Override
public void run() {
refreshState();
}
});
|
protected void | handleUpdateState(BooleanState state, java.lang.Object arg)
final int value = arg instanceof Integer ? (Integer) arg : mSetting.getValue();
final boolean enabled = value != 0;
state.visible = enabled || mUsageTracker.isRecentlyUsed();
state.value = enabled;
state.label = mContext.getString(R.string.quick_settings_inversion_label);
state.icon = enabled ? mEnable : mDisable;
|
protected void | handleUserSwitch(int newUserId)
mSetting.setUserId(newUserId);
handleRefreshState(mSetting.getValue());
|
protected BooleanState | newTileState()
return new BooleanState();
|
public void | setListening(boolean listening)
mListening = listening;
|