diff options
author | John Spurlock <jspurlock@google.com> | 2015-03-25 18:09:51 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-04-02 14:03:57 -0400 |
commit | f88d8082a86bee00c604cbbcfb5261f5573936fe (patch) | |
tree | c6d3448fd8cd1e43d00b2896efd482f55d27068e /packages/SystemUI/res/layout | |
parent | 356c628e1b3ff6a3f327fdc512deb5288710ab47 (diff) | |
download | frameworks_base-f88d8082a86bee00c604cbbcfb5261f5573936fe.zip frameworks_base-f88d8082a86bee00c604cbbcfb5261f5573936fe.tar.gz frameworks_base-f88d8082a86bee00c604cbbcfb5261f5573936fe.tar.bz2 |
Introduce new volume dialog.
- New VolumeDialog (presentation) + VolumeDialogController (state)
to implement a volume dialog that keeps track of multiple audio
streams, including all remote streams.
- The dialog starts out with a single stream, with more detail available
behind an expand chevron.
- Existing zen options reorganized under a master switch bar
named "Block interruptions", with "None" renamed to "No interruptions"
and "Priority" renamed to "Priority only".
- Combined "Block interruptions" icon replaces the now-obsolete star/no-smoking
icons in the status bar.
- New icons for all sliders.
- All sliders present a continuous facade, mapped to discrete integer units
under the hood.
- All interesting volume events and state changes piped through one central
helper for future routing.
- VolumePanel is obsolete, still accessible via a sysprop if needed.
Complete removal / garbage collection deferred until all needed
functionality is ported over.
Bug: 19260237
Change-Id: I6689de3e4d14ae666d3e8da302cc9da2d4d77b9b
Diffstat (limited to 'packages/SystemUI/res/layout')
-rw-r--r-- | packages/SystemUI/res/layout/segmented_button.xml | 8 | ||||
-rw-r--r-- | packages/SystemUI/res/layout/volume_dialog.xml | 50 | ||||
-rw-r--r-- | packages/SystemUI/res/layout/volume_dialog_row.xml | 64 | ||||
-rw-r--r-- | packages/SystemUI/res/layout/volume_panel_dialog.xml | 27 | ||||
-rw-r--r-- | packages/SystemUI/res/layout/volume_text_footer.xml | 54 | ||||
-rw-r--r-- | packages/SystemUI/res/layout/volume_zen_footer.xml | 108 | ||||
-rw-r--r-- | packages/SystemUI/res/layout/zen_mode_panel.xml | 4 |
7 files changed, 300 insertions, 15 deletions
diff --git a/packages/SystemUI/res/layout/segmented_button.xml b/packages/SystemUI/res/layout/segmented_button.xml index e92f310..2f84bab 100644 --- a/packages/SystemUI/res/layout/segmented_button.xml +++ b/packages/SystemUI/res/layout/segmented_button.xml @@ -19,10 +19,8 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/segmented_button_spacing" android:layout_weight="1" - android:gravity="center_horizontal|top" + android:gravity="center" android:textColor="@color/segmented_button_text_selector" android:background="@drawable/btn_borderless_rect" - android:textAppearance="@style/TextAppearance.QS.SegmentedButton" - android:minHeight="64dp" - android:paddingTop="11dp" - android:drawablePadding="6dp" /> + android:textAppearance="@style/TextAppearance.Volume.ZenSwitchSummary" + android:minHeight="48dp" /> diff --git a/packages/SystemUI/res/layout/volume_dialog.xml b/packages/SystemUI/res/layout/volume_dialog.xml index 3765fe8..7586227 100644 --- a/packages/SystemUI/res/layout/volume_dialog.xml +++ b/packages/SystemUI/res/layout/volume_dialog.xml @@ -1,6 +1,5 @@ -<?xml version="1.0" encoding="utf-8"?> <!-- - Copyright (C) 2014 The Android Open Source Project + Copyright (C) 2015 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,15 +13,50 @@ See the License for the specific language governing permissions and limitations under the License. --> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/volume_dialog" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginBottom="4dp" android:layout_marginLeft="@dimen/notification_side_padding" android:layout_marginRight="@dimen/notification_side_padding" - android:background="@drawable/qs_background_primary" - android:translationZ="@dimen/volume_panel_z" - android:layout_marginBottom="@dimen/volume_panel_z"> + android:layout_marginTop="4dp" + android:background="@drawable/volume_dialog_background" + android:translationZ="4dp" > - <include layout="@layout/volume_panel" /> + <com.android.keyguard.AlphaOptimizedImageButton + android:id="@+id/volume_expand_button" + style="@style/VolumeButtons" + android:layout_alignParentLeft="true" + android:layout_width="@dimen/volume_button_size" + android:layout_height="@dimen/volume_button_size" + android:clickable="true" + android:soundEffectsEnabled="false" + android:src="@drawable/ic_volume_collapse_animation" /> -</FrameLayout>
\ No newline at end of file + <LinearLayout + android:id="@+id/volume_dialog_content" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingBottom="4dp" + android:paddingEnd="4dp" + android:paddingStart="4dp" + android:paddingTop="6dp" > + + <!-- volume rows added and removed here! :-) --> + + <FrameLayout + android:id="@+id/volume_footer" + android:layout_width="match_parent" + android:layout_height="wrap_content" + tools:ignore="UselessParent" > + + <include layout="@layout/volume_text_footer" /> + + <include layout="@layout/volume_zen_footer" /> + </FrameLayout> + </LinearLayout> + +</RelativeLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/volume_dialog_row.xml b/packages/SystemUI/res/layout/volume_dialog_row.xml new file mode 100644 index 0000000..af27cc4 --- /dev/null +++ b/packages/SystemUI/res/layout/volume_dialog_row.xml @@ -0,0 +1,64 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:clipChildren="false" > + + <TextView + android:id="@+id/volume_row_header" + style="?android:attr/textAppearanceButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:alpha="@dimen/volume_secondary_alpha" + android:ellipsize="end" + android:maxLines="1" + android:paddingBottom="0dp" + android:paddingEnd="12dp" + android:paddingStart="13dp" + android:paddingTop="8dp" /> + + <com.android.keyguard.AlphaOptimizedImageButton + android:id="@+id/volume_row_icon" + style="@style/VolumeButtons" + android:layout_width="@dimen/volume_button_size" + android:layout_height="@dimen/volume_button_size" + android:layout_below="@id/volume_row_header" + android:soundEffectsEnabled="false" /> + + <SeekBar + android:id="@+id/volume_row_slider" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBottom="@+id/volume_row_icon" + android:layout_alignWithParentIfMissing="true" + android:layout_below="@id/volume_row_header" + android:layout_toEndOf="@id/volume_row_icon" + android:layout_toStartOf="@+id/volume_settings_button" + android:paddingEnd="4dp" + android:paddingStart="4dp" + android:progressTint="@android:color/white" + android:thumbTint="@android:color/white" /> + + <com.android.keyguard.AlphaOptimizedImageButton + android:id="@+id/volume_settings_button" + style="@style/VolumeButtons" + android:layout_width="@dimen/volume_button_size" + android:layout_height="@dimen/volume_button_size" + android:layout_alignParentEnd="true" + android:layout_below="@id/volume_row_header" /> + +</RelativeLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/volume_panel_dialog.xml b/packages/SystemUI/res/layout/volume_panel_dialog.xml new file mode 100644 index 0000000..700102f --- /dev/null +++ b/packages/SystemUI/res/layout/volume_panel_dialog.xml @@ -0,0 +1,27 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/volume_panel_z" + android:layout_marginLeft="@dimen/notification_side_padding" + android:layout_marginRight="@dimen/notification_side_padding" + android:background="@drawable/qs_background_primary" + android:translationZ="@dimen/volume_panel_z" > + + <include layout="@layout/volume_panel" /> + +</FrameLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/volume_text_footer.xml b/packages/SystemUI/res/layout/volume_text_footer.xml new file mode 100644 index 0000000..7436488 --- /dev/null +++ b/packages/SystemUI/res/layout/volume_text_footer.xml @@ -0,0 +1,54 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/volume_text_footer" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:visibility="gone" + tools:ignore="UselessParent" > + + <TextView + android:id="@+id/volume_footline_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignBaseline="@+id/volume_footline_action_button" + android:alpha="@dimen/volume_secondary_alpha" + android:fontFamily="sans-serif" + android:paddingEnd="8dp" + android:paddingStart="13dp" + android:textColor="?android:attr/textColorPrimary" /> + + <Button + android:id="@+id/volume_footline_action_button" + style="@android:style/Widget.Material.Button.Borderless" + android:layout_width="wrap_content" + android:layout_height="@dimen/volume_button_size" + android:layout_toEndOf="@id/volume_footline_text" + android:layout_toStartOf="@+id/volume_settings_button" + android:alpha="@dimen/volume_secondary_alpha" + android:paddingEnd="0dp" + android:paddingStart="0dp" /> + + <com.android.keyguard.AlphaOptimizedImageButton + android:id="@+id/volume_settings_button" + style="@style/VolumeButtons" + android:layout_width="@dimen/volume_button_size" + android:layout_height="@dimen/volume_button_size" + android:layout_alignParentEnd="true" + android:src="@drawable/ic_volume_settings" /> + +</RelativeLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/volume_zen_footer.xml b/packages/SystemUI/res/layout/volume_zen_footer.xml new file mode 100644 index 0000000..f4a8b89 --- /dev/null +++ b/packages/SystemUI/res/layout/volume_zen_footer.xml @@ -0,0 +1,108 @@ +<!-- + Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<com.android.systemui.volume.ZenFooter xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/volume_zen_footer" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" > <!-- extends LinearLayout --> + + <LinearLayout + android:id="@+id/volume_zen_switch_bar" + android:layout_width="match_parent" + android:layout_height="@dimen/volume_button_size" + android:clickable="true" + android:orientation="horizontal" > + + <ImageView + android:id="@+id/volume_zen_switch_bar_icon" + android:layout_width="@dimen/volume_button_size" + android:layout_height="@dimen/volume_button_size" + android:scaleType="center" + android:src="@drawable/ic_dnd" /> + + <TextView + android:layout_width="0dp" + android:layout_height="fill_parent" + android:layout_weight="1" + android:gravity="center_vertical" + android:textDirection="locale" + android:padding="3dp" + android:text="@string/volume_zen_switch_text" + android:textAppearance="@style/TextAppearance.Volume.ZenSwitch" /> + + <Switch + android:id="@+id/volume_zen_switch" + android:layout_width="wrap_content" + android:layout_height="fill_parent" + android:layout_marginEnd="11dp" /> + </LinearLayout> + + <RelativeLayout + android:id="@+id/volume_zen_panel_summary" + android:layout_width="match_parent" + android:layout_height="@dimen/volume_button_size" + android:layout_marginStart="@dimen/volume_button_size" + android:paddingEnd="3dp" + android:paddingStart="3dp" > + + <TextView + android:id="@+id/volume_zen_panel_summary_line_1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="@style/TextAppearance.Volume.ZenSwitchSummary" /> + + <TextView + android:id="@+id/volume_zen_panel_summary_line_2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/volume_zen_panel_summary_line_1" + android:textAppearance="@style/TextAppearance.Volume.ZenSwitchDetail" /> + </RelativeLayout> + + <include layout="@layout/zen_mode_panel" /> + + <LinearLayout + android:id="@+id/volume_zen_mode_panel_buttons" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="end" > + + <TextView + android:id="@+id/volume_zen_mode_panel_more" + style="@style/QSBorderlessButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:clickable="true" + android:focusable="true" + android:minWidth="132dp" + android:text="@string/quick_settings_more_settings" + android:textAppearance="@style/TextAppearance.QS.DetailButton" /> + + <TextView + android:id="@+id/volume_zen_mode_panel_done" + style="@style/QSBorderlessButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:clickable="true" + android:focusable="true" + android:minWidth="84dp" + android:text="@string/quick_settings_done" + android:textAppearance="@style/TextAppearance.QS.DetailButton" /> + </LinearLayout> + +</com.android.systemui.volume.ZenFooter>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/zen_mode_panel.xml b/packages/SystemUI/res/layout/zen_mode_panel.xml index 33c1899..ef403e4 100644 --- a/packages/SystemUI/res/layout/zen_mode_panel.xml +++ b/packages/SystemUI/res/layout/zen_mode_panel.xml @@ -34,8 +34,8 @@ android:id="@+id/zen_buttons" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" + android:layout_marginLeft="40dp" + android:layout_marginRight="40dp" android:layout_marginBottom="8dp" android:clipChildren="false" /> </FrameLayout> |