diff options
| -rw-r--r-- | packages/SystemUI/res/drawable/ic_landscape_from_auto_rotate_animation.xml | 32 | ||||
| -rw-r--r-- | packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate.xml | 65 | ||||
| -rw-r--r-- | packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate_animation.xml | 29 | ||||
| -rw-r--r-- | packages/SystemUI/res/drawable/ic_portrait_from_auto_rotate_animation.xml | 35 | ||||
| -rw-r--r-- | packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate.xml | 68 | ||||
| -rw-r--r-- | packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate_animation.xml | 35 | ||||
| -rw-r--r-- | packages/SystemUI/res/drawable/ic_qs_auto_rotate.xml (renamed from packages/SystemUI/res/drawable/ic_portrait_from_auto_rotate.xml) | 7 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java | 40 |
8 files changed, 6 insertions, 305 deletions
diff --git a/packages/SystemUI/res/drawable/ic_landscape_from_auto_rotate_animation.xml b/packages/SystemUI/res/drawable/ic_landscape_from_auto_rotate_animation.xml deleted file mode 100644 index 00bcaf6e2359..000000000000 --- a/packages/SystemUI/res/drawable/ic_landscape_from_auto_rotate_animation.xml +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2017 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. ---> -<animated-vector - xmlns:android="http://schemas.android.com/apk/res/android" - android:drawable="@drawable/ic_landscape_from_auto_rotate" > - <target - android:name="landscape" - android:animation="@anim/ic_rotate_to_landscape_landscape_animation" /> - <target - android:name="arrows" - android:animation="@anim/ic_rotate_to_landscape_arrows_animation" /> - <target - android:name="arrows_0" - android:animation="@anim/ic_rotate_to_landscape_arrows_0_animation" /> - <target - android:name="bottom_merged" - android:animation="@anim/ic_rotate_to_landscape_bottom_merged_animation" /> -</animated-vector> diff --git a/packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate.xml b/packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate.xml deleted file mode 100644 index cde67976337e..000000000000 --- a/packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate.xml +++ /dev/null @@ -1,65 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2017 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. ---> -<vector - xmlns:android="http://schemas.android.com/apk/res/android" - android:name="ic_landscape_to_rotate" - android:height="48dp" - android:width="48dp" - android:viewportHeight="48" - android:viewportWidth="48" - android:tint="?android:attr/colorControlNormal" > - <group - android:name="device" - android:translateX="24" - android:translateY="24" > - <group - android:name="device_pivot" - android:translateX="-24.15" - android:translateY="-24.25" > - <group - android:name="landscape" - android:translateX="24" - android:translateY="24" > - <path - android:name="device_merged" - android:pathData="M -21.9799957275,-10.0 c 0.0,0.0 -0.0200042724609,20.0 -0.0200042724609,20.0 c 0.0,2.19999694824 1.80000305176,4.0 4.0,4.0 c 0.0,0.0 36.0,0.0 36.0,0.0 c 2.19999694824,0.0 4.0,-1.80000305176 4.0,-4.0 c 0.0,0.0 0.0,-20.0 0.0,-20.0 c 0.0,-2.19999694824 -1.80000305176,-4.0 -4.0,-4.0 c 0.0,0.0 -36.0,0.0 -36.0,0.0 c -2.19999694824,0.0 -3.97999572754,1.80000305176 -3.97999572754,4.0 Z M 14.0,10.0 c 0.0,0.0 -28.0,0.0 -28.0,0.0 c 0.0,0.0 0.0,-20.0 0.0,-20.0 c 0.0,0.0 28.0,0.0 28.0,0.0 c 0.0,0.0 0.0,20.0 0.0,20.0 Z" - android:fillColor="#FFFFFFFF" /> - </group> - </group> - </group> - <group - android:name="arrows" - android:translateX="24" - android:translateY="24" - android:rotation="-90" > - <group - android:name="arrows_pivot" - android:translateX="-24.0798" - android:translateY="-24.23" > - <group - android:name="arrows_0" - android:translateX="12.2505" - android:translateY="37.2145" > - <path - android:name="bottom_merged" - android:pathData="M 20.7395019531,-31.9844970703 c 6.23999023438,2.83999633789 10.6999969482,8.7200012207 11.8399963379,15.7799987793 c 0.119995117188,0.699996948242 0.740005493164,1.2200012207 1.46099853516,1.2200012207 c 0.919998168945,0.0 1.6190032959,-0.84001159668 1.47900390625,-1.74000549316 c -1.75900268555,-10.3800048828 -9.75900268555,-19.1199951172 -22.5800018311,-20.1600036621 c -0.919998168945,-0.0800018310547 -1.43899536133,1.04000854492 -0.800003051758,1.70001220703 c 0.0,0.0 5.12100219727,5.11999511719 5.12100219727,5.11999511719 c 0.378997802734,0.380004882812 0.97900390625,0.380004882812 1.37899780273,0.020004272461 c 0.0,0.0 2.10000610352,-1.94000244141 2.10000610352,-1.94000244141 Z M 2.73950195312,6.01550292969 c -6.26000976562,-2.83999633789 -10.7200012207,-8.76000976562 -11.8399963379,-15.8600006104 c -0.118011474609,-0.667007446289 -0.702011108398,-1.15100097656 -1.38000488281,-1.13999938965 c -0.860000610352,0.0 -1.52000427246,0.759994506836 -1.38000488281,1.61999511719 c 1.54000854492,10.4000091553 9.5,19.2200012207 22.4199981689,20.2799987793 c 0.920013427734,0.0800018310547 1.44100952148,-1.03999328613 0.800003051758,-1.69999694824 c 0.0,0.0 -5.11999511719,-5.11999511719 -5.11999511719,-5.11999511719 c -0.380004882812,-0.376007080078 -0.988998413086,-0.385009765625 -1.38000488281,-0.0200042724609 c 0.0,0.0 -2.11999511719,1.94000244141 -2.11999511719,1.94000244141 Z" - android:fillColor="#FFFFFFFF" - android:fillAlpha="0" /> - </group> - </group> - </group> -</vector> diff --git a/packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate_animation.xml b/packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate_animation.xml deleted file mode 100644 index 86dc6ce978bf..000000000000 --- a/packages/SystemUI/res/drawable/ic_landscape_to_auto_rotate_animation.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2017 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. ---> -<animated-vector - xmlns:android="http://schemas.android.com/apk/res/android" - android:drawable="@drawable/ic_landscape_to_auto_rotate" > - <target - android:name="landscape" - android:animation="@anim/ic_landscape_to_rotate_landscape_animation" /> - <target - android:name="arrows" - android:animation="@anim/ic_landscape_to_rotate_arrows_animation" /> - <target - android:name="bottom_merged" - android:animation="@anim/ic_landscape_to_rotate_bottom_merged_animation" /> -</animated-vector> diff --git a/packages/SystemUI/res/drawable/ic_portrait_from_auto_rotate_animation.xml b/packages/SystemUI/res/drawable/ic_portrait_from_auto_rotate_animation.xml deleted file mode 100644 index b8465f4ba6b6..000000000000 --- a/packages/SystemUI/res/drawable/ic_portrait_from_auto_rotate_animation.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2017 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. ---> -<animated-vector - xmlns:android="http://schemas.android.com/apk/res/android" - android:drawable="@drawable/ic_portrait_to_auto_rotate" > - <target - android:name="device_0" - android:animation="@anim/ic_portrait_to_rotate_device_0_animation" /> - <target - android:name="device_merged" - android:animation="@anim/ic_portrait_to_rotate_device_merged_animation" /> - <target - android:name="arrows" - android:animation="@anim/ic_portrait_to_rotate_arrows_animation" /> - <target - android:name="arrows_0" - android:animation="@anim/ic_portrait_to_rotate_arrows_0_animation" /> - <target - android:name="bottom_merged" - android:animation="@anim/ic_portrait_to_rotate_bottom_merged_animation" /> -</animated-vector> diff --git a/packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate.xml b/packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate.xml deleted file mode 100644 index 0ef15f0582f7..000000000000 --- a/packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2017 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. ---> -<vector - xmlns:android="http://schemas.android.com/apk/res/android" - android:name="ic_rotate_to_portrait" - android:height="48dp" - android:width="48dp" - android:viewportHeight="48" - android:viewportWidth="48" - android:tint="?android:attr/colorControlNormal" > - <group - android:name="device" - android:translateX="24" - android:translateY="24" > - <group - android:name="device_pivot" - android:translateX="-24.15" - android:translateY="-24.25" > - <group - android:name="device_0" - android:translateX="24.14999" - android:translateY="24.25" - android:rotation="-135" > - <path - android:name="device_merged" - android:pathData="M -3.34053039551,-22.9980926514 c -1.3207244873,-1.3207244873 -3.46876525879,-1.26383972168 -4.74829101563,0.125762939453 c 0.0,0.0 -14.8512420654,14.7411804199 -14.8512420654,14.7411804199 c -1.39259338379,1.392578125 -1.44947814941,3.54061889648 -0.125762939453,4.74827575684 c 0.0,0.0 26.4143981934,26.4144134521 26.4143981934,26.4144134521 c 1.3207244873,1.3207244873 3.46876525879,1.26382446289 4.74829101562,-0.125762939453 c 0.0,0.0 14.7381896973,-14.7381896973 14.7381896973,-14.7381896973 c 1.392578125,-1.39259338379 1.44947814941,-3.54061889648 0.125762939453,-4.74829101562 c 0.0,0.0 -26.3013458252,-26.417388916 -26.3013458252,-26.417388916 Z M 2.87156677246,16.9857940674 c 0.0,0.0 -19.7573547363,-19.7573699951 -19.7573547363,-19.7573699951 c 0.0,0.0 14.0142059326,-14.2142181396 14.0142059326,-14.2142181396 c 0.0,0.0 19.7573699951,19.7573699951 19.7573699951,19.7573699951 c 0.0,0.0 -14.0142211914,14.2142181396 -14.0142211914,14.2142181396 Z" - android:fillColor="#FFFFFFFF" /> - </group> - </group> - </group> - <group - android:name="arrows" - android:translateX="24" - android:translateY="24" - android:rotation="-221" > - <group - android:name="arrows_pivot" - android:translateX="-24.0798" - android:translateY="-24.23" > - <group - android:name="arrows_0" - android:translateX="12.2505" - android:translateY="37.2145" - android:scaleX="0.9" - android:scaleY="0.9" > - <path - android:name="bottom_merged" - android:pathData="M 20.7395019531,-31.9844970703 c 6.23999023438,2.83999633789 10.6999969482,8.7200012207 11.8399963379,15.7799987793 c 0.119995117188,0.699996948242 0.740005493164,1.2200012207 1.46099853516,1.2200012207 c 0.919998168945,0.0 1.6190032959,-0.84001159668 1.47900390625,-1.74000549316 c -1.75900268555,-10.3800048828 -9.75900268555,-19.1199951172 -22.5800018311,-20.1600036621 c -0.919998168945,-0.0800018310547 -1.43899536133,1.04000854492 -0.800003051758,1.70001220703 c 0.0,0.0 5.12100219727,5.11999511719 5.12100219727,5.11999511719 c 0.378997802734,0.380004882812 0.97900390625,0.380004882812 1.37899780273,0.020004272461 c 0.0,0.0 2.10000610352,-1.94000244141 2.10000610352,-1.94000244141 Z M 2.73950195312,6.01550292969 c -6.26000976562,-2.83999633789 -10.7200012207,-8.76000976562 -11.8399963379,-15.8600006104 c -0.118011474609,-0.667007446289 -0.702011108398,-1.15100097656 -1.38000488281,-1.13999938965 c -0.860000610352,0.0 -1.52000427246,0.759994506836 -1.38000488281,1.61999511719 c 1.54000854492,10.4000091553 9.5,19.2200012207 22.4199981689,20.2799987793 c 0.920013427734,0.0800018310547 1.44100952148,-1.03999328613 0.800003051758,-1.69999694824 c 0.0,0.0 -5.11999511719,-5.11999511719 -5.11999511719,-5.11999511719 c -0.380004882812,-0.376007080078 -0.988998413086,-0.385009765625 -1.38000488281,-0.0200042724609 c 0.0,0.0 -2.11999511719,1.94000244141 -2.11999511719,1.94000244141 Z" - android:fillColor="#FFFFFFFF" - android:fillAlpha="0" /> - </group> - </group> - </group> -</vector> diff --git a/packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate_animation.xml b/packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate_animation.xml deleted file mode 100644 index 6d3fd372b222..000000000000 --- a/packages/SystemUI/res/drawable/ic_portrait_to_auto_rotate_animation.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2017 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. ---> -<animated-vector - xmlns:android="http://schemas.android.com/apk/res/android" - android:drawable="@drawable/ic_portrait_from_auto_rotate" > - <target - android:name="device_0" - android:animation="@anim/ic_rotate_to_portrait_device_0_animation" /> - <target - android:name="device_merged" - android:animation="@anim/ic_rotate_to_portrait_device_merged_animation" /> - <target - android:name="arrows" - android:animation="@anim/ic_rotate_to_portrait_arrows_animation" /> - <target - android:name="arrows_0" - android:animation="@anim/ic_rotate_to_portrait_arrows_0_animation" /> - <target - android:name="bottom_merged" - android:animation="@anim/ic_rotate_to_portrait_bottom_merged_animation" /> -</animated-vector> diff --git a/packages/SystemUI/res/drawable/ic_portrait_from_auto_rotate.xml b/packages/SystemUI/res/drawable/ic_qs_auto_rotate.xml index bce494c975ed..fba45d17cc5b 100644 --- a/packages/SystemUI/res/drawable/ic_portrait_from_auto_rotate.xml +++ b/packages/SystemUI/res/drawable/ic_qs_auto_rotate.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- - Copyright (C) 2017 The Android Open Source Project + Copyright (C) 2018 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. @@ -16,12 +16,10 @@ --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - android:name="ic_portrait_to_rotate" android:height="48dp" android:width="48dp" android:viewportHeight="48" - android:viewportWidth="48" - android:tint="?android:attr/colorControlNormal" > + android:viewportWidth="48"> <group android:name="device" android:translateX="24" @@ -61,4 +59,3 @@ </group> </group> </vector> - diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java index 1e00894483ac..60422ee61aa5 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java @@ -36,20 +36,8 @@ import com.android.systemui.statusbar.policy.RotationLockController.RotationLock /** Quick settings tile: Rotation **/ public class RotationLockTile extends QSTileImpl<BooleanState> { - private final AnimationIcon mPortraitToAuto - = new AnimationIcon(R.drawable.ic_portrait_to_auto_rotate_animation, - R.drawable.ic_portrait_from_auto_rotate); - private final AnimationIcon mAutoToPortrait - = new AnimationIcon(R.drawable.ic_portrait_from_auto_rotate_animation, - R.drawable.ic_portrait_to_auto_rotate); - - private final AnimationIcon mLandscapeToAuto - = new AnimationIcon(R.drawable.ic_landscape_to_auto_rotate_animation, - R.drawable.ic_landscape_from_auto_rotate); - private final AnimationIcon mAutoToLandscape - = new AnimationIcon(R.drawable.ic_landscape_from_auto_rotate_animation, - R.drawable.ic_landscape_to_auto_rotate); + private final Icon mIcon = ResourceIcon.get(R.drawable.ic_qs_auto_rotate); private final RotationLockController mController; public RotationLockTile(QSHost host) { @@ -93,19 +81,10 @@ public class RotationLockTile extends QSTileImpl<BooleanState> { protected void handleUpdateState(BooleanState state, Object arg) { if (mController == null) return; final boolean rotationLocked = mController.isRotationLocked(); - // TODO: Handle accessibility rotation lock and whatnot. state.value = !rotationLocked; - final boolean portrait = isCurrentOrientationLockPortrait(mController, mContext); - if (rotationLocked) { - final int label = portrait ? R.string.quick_settings_rotation_locked_portrait_label - : R.string.quick_settings_rotation_locked_landscape_label; - state.label = mContext.getString(label); - state.icon = portrait ? mAutoToPortrait : mAutoToLandscape; - } else { - state.label = mContext.getString(R.string.quick_settings_rotation_unlocked_label); - state.icon = portrait ? mPortraitToAuto : mLandscapeToAuto; - } + state.label = mContext.getString(R.string.quick_settings_rotation_unlocked_label); + state.icon = mIcon; state.contentDescription = getAccessibilityString(rotationLocked); state.expandedAccessibilityClassName = Switch.class.getName(); state.state = state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE; @@ -134,18 +113,7 @@ public class RotationLockTile extends QSTileImpl<BooleanState> { * @param locked Whether or not rotation is locked. */ private String getAccessibilityString(boolean locked) { - if (locked) { - return mContext.getString(R.string.accessibility_quick_settings_rotation_value, - isCurrentOrientationLockPortrait(mController, mContext) - ? mContext.getString( - R.string.quick_settings_rotation_locked_portrait_label) - : mContext.getString( - R.string.quick_settings_rotation_locked_landscape_label)) - + "," + mContext.getString(R.string.accessibility_quick_settings_rotation); - - } else { - return mContext.getString(R.string.accessibility_quick_settings_rotation); - } + return mContext.getString(R.string.accessibility_quick_settings_rotation); } @Override |