<!-- Interruption level: Alarms only. Optimized for narrow two-line display. [CHAR LIMIT=40] -->
<string name="interruption_level_alarms_twoline">Alarms\nonly</string>
+ <!-- Interruption level: All interruptions. [CHAR LIMIT=40] -->
+ <string name="interruption_level_all">All</string>
+
+ <!-- Interruption level: All interruptions. Optimized for narrow two-line display. [CHAR LIMIT=40] -->
+ <string name="interruption_level_all_twoline">All\n</string>
+
<!-- Indication on the keyguard that is shown when the device is charging. [CHAR LIMIT=40]-->
<string name="keyguard_indication_charging_time">Charging (<xliff:g id="charging_time_left" example="4 hours and 2 minutes">%s</xliff:g> until full)</string>
<!-- User visible title for the the keyboard shortcut that triggers the back action. -->
<string name="keyboard_shortcut_group_system_back">Back</string>
+ <!-- SysUI Tuner: Option to show full do not disturb panel in volume [CHAR LIMIT=60] -->
+ <string name="tuner_full_zen_title">Show do not disturb in volume</string>
+ <!-- SysUI Tuner: Summary of option to show full do not disturb panel in volume [CHAR LIMIT=NONE] -->
+ <string name="tuner_full_zen_summary">Allow full control of do not disturb in the volume dialog.</string>
+
</resources>
import android.accessibilityservice.AccessibilityServiceInfo;
import android.animation.LayoutTransition;
-import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener;
-import android.view.animation.DecelerateInterpolator;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.ZenModeController;
+import com.android.systemui.tuner.TunerService;
import com.android.systemui.volume.VolumeDialogController.State;
import com.android.systemui.volume.VolumeDialogController.StreamState;
*
* Methods ending in "H" must be called on the (ui) handler.
*/
-public class VolumeDialog {
+public class VolumeDialog implements TunerService.Tunable {
private static final String TAG = Util.logTag(VolumeDialog.class);
+ public static final String SHOW_FULL_ZEN = "sysui_show_full_zen";
+
private static final long USER_ATTEMPT_GRACE_PERIOD = 1000;
private static final int WAIT_FOR_RIPPLE = 200;
private boolean mHovering = false;
private int mLastActiveStream;
+ private boolean mShowFullZen;
+ private final ZenModePanel mZenPanel;
+
public VolumeDialog(Context context, int windowType, VolumeDialogController controller,
ZenModeController zenModeController, Callback callback) {
mContext = context;
mExpandButtonAnimationDuration = res.getInteger(R.integer.volume_expand_animation_duration);
mZenFooter = (ZenFooter) mDialog.findViewById(R.id.volume_zen_footer);
mZenFooter.init(zenModeController);
+ mZenPanel = (ZenModePanel) mDialog.findViewById(R.id.zen_mode_panel);
+ mZenPanel.addNoneButton();
+ mZenPanel.init(zenModeController);
+ mZenPanel.setCallback(mZenPanelCallback);
mAccessibility.init();
controller.addCallback(mControllerCallbackH, mHandler);
controller.getState();
+ TunerService.get(mContext).addTunable(this, SHOW_FULL_ZEN);
+ }
+
+ @Override
+ public void onTuningChanged(String key, String newValue) {
+ if (SHOW_FULL_ZEN.equals(key)) {
+ mShowFullZen = newValue != null && Integer.parseInt(newValue) != 0;
+ }
}
private ColorStateList loadColorStateList(int colorResId) {
.getDimensionPixelSize(R.dimen.volume_slider_interspacing);
final LinearLayout.LayoutParams lp =
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, h);
- mDialogContentView.addView(v, mDialogContentView.getChildCount() - 1, lp);
+ mDialogContentView.addView(v, mDialogContentView.getChildCount() - 2, lp);
row.space = v;
}
row.settingsButton.addOnLayoutChangeListener(new OnLayoutChangeListener() {
}
});
// add new row just before the footer
- mDialogContentView.addView(row.view, mDialogContentView.getChildCount() - 1);
+ mDialogContentView.addView(row.view, mDialogContentView.getChildCount() - 2);
mRows.add(row);
}
if (D.BUG) Log.d(TAG, "updateFooterH");
final boolean wasVisible = mZenFooter.getVisibility() == View.VISIBLE;
final boolean visible = mState.zenMode != Global.ZEN_MODE_OFF
- && (mAudioManager.isStreamAffectedByRingerMode(mActiveStream) || mExpanded);
+ && (mAudioManager.isStreamAffectedByRingerMode(mActiveStream) || mExpanded)
+ && !mShowFullZen;
if (wasVisible != visible && !visible) {
prepareForCollapse();
}
Util.setVisOrGone(mZenFooter, visible);
mZenFooter.update();
+
+ final boolean fullWasVisible = mZenPanel.getVisibility() == View.VISIBLE;
+ final boolean fullVisible = mShowFullZen && (mState.zenMode != Global.ZEN_MODE_OFF
+ || mExpanded);
+ if (fullWasVisible != fullVisible && !fullVisible) {
+ prepareForCollapse();
+ }
+ Util.setVisOrGone(mZenPanel, fullVisible);
}
private void updateVolumeRowH(VolumeRow row) {
}
};
+ private final ZenModePanel.Callback mZenPanelCallback = new ZenModePanel.Callback() {
+ @Override
+ public void onPrioritySettings() {
+ mCallback.onZenPrioritySettingsClicked();
+ }
+
+ @Override
+ public void onInteraction() {
+ mHandler.sendEmptyMessage(H.RESCHEDULE_TIMEOUT);
+ }
+
+ @Override
+ public void onExpanded(boolean expanded) {
+ // noop.
+ }
+ };
+
private final OnClickListener mClickExpand = new OnClickListener() {
@Override
public void onClick(View v) {