Add expand icon for user switcher.
Adds the arrow to the left of the user name. Animates the arrow in a sweet 180 degree rotation. Bug: 65423882 Change-Id: I13a40dbd65c1335fdb579223d7c7cbd8623b3d6b (cherry picked from commit f4d69c2b575940eca4620db5aec6d42b98b53071)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<!-- 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.
|
||||
-->
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<objectAnimator
|
||||
android:duration="167"
|
||||
android:propertyName="rotation"
|
||||
android:valueType="floatType"
|
||||
android:valueFrom="180"
|
||||
android:valueTo="0"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
</set>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!-- 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.
|
||||
-->
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<objectAnimator
|
||||
android:duration="167"
|
||||
android:propertyName="rotation"
|
||||
android:valueType="floatType"
|
||||
android:valueFrom="0"
|
||||
android:valueTo="180"
|
||||
android:interpolator="@android:interpolator/fast_out_slow_in" />
|
||||
</set>
|
||||
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
~ Copyright (C) 2015 The Android Open Source Project
|
||||
~ 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.
|
||||
|
||||
24
packages/SystemUI/res/drawable/car_ic_arrow_drop_up.xml
Normal file
24
packages/SystemUI/res/drawable/car_ic_arrow_drop_up.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<!--
|
||||
~ 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
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="48.0dp"
|
||||
android:height="48.0dp"
|
||||
android:viewportWidth="48.0"
|
||||
android:viewportHeight="48.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M14 28l10-10 10 10z"/>
|
||||
</vector>
|
||||
@@ -35,7 +35,6 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_width="@dimen/car_qs_footer_icon_width"
|
||||
android:layout_height="@dimen/car_qs_footer_icon_height"
|
||||
android:layout_marginRight="@dimen/car_qs_footer_user_switch_margin_right"
|
||||
android:background="@drawable/ripple_drawable"
|
||||
android:focusable="true">
|
||||
|
||||
@@ -47,6 +46,18 @@
|
||||
android:scaleType="fitCenter"/>
|
||||
</com.android.systemui.statusbar.phone.MultiUserSwitch>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_switch_expand_icon"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="@dimen/car_qs_footer_user_switch_icon_width"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@+id/multi_user_switch"
|
||||
android:layout_marginLeft="@dimen/car_qs_footer_user_switch_icon_margin"
|
||||
android:layout_marginRight="@dimen/car_qs_footer_user_switch_icon_margin"
|
||||
android:src="@drawable/car_ic_arrow_drop_up"
|
||||
android:scaleType="fitCenter">
|
||||
</ImageView>
|
||||
|
||||
<TextView android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -54,7 +65,7 @@
|
||||
android:textColor="@color/car_qs_footer_user_name_color"
|
||||
android:gravity="start|center_vertical"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toEndOf="@id/multi_user_switch" />
|
||||
android:layout_toEndOf="@id/user_switch_expand_icon" />
|
||||
|
||||
<com.android.systemui.statusbar.phone.SettingsButton
|
||||
android:id="@+id/settings_button"
|
||||
|
||||
@@ -50,7 +50,8 @@
|
||||
<dimen name="car_qs_footer_padding_start">46dp</dimen>
|
||||
<dimen name="car_qs_footer_icon_width">56dp</dimen>
|
||||
<dimen name="car_qs_footer_icon_height">56dp</dimen>
|
||||
<dimen name="car_qs_footer_user_switch_margin_right">46dp</dimen>
|
||||
<dimen name="car_qs_footer_user_switch_icon_margin">5dp</dimen>
|
||||
<dimen name="car_qs_footer_user_switch_icon_width">36dp</dimen>
|
||||
<dimen name="car_qs_footer_user_name_text_size">@dimen/car_body2_size</dimen>
|
||||
|
||||
<dimen name="car_user_switcher_container_height">420dp</dimen>
|
||||
|
||||
@@ -50,6 +50,7 @@ public class CarQSFragment extends Fragment implements QS {
|
||||
private View mUserSwitcherContainer;
|
||||
private CarQSFooter mFooter;
|
||||
private View mFooterUserName;
|
||||
private View mFooterExpandIcon;
|
||||
private UserGridView mUserGridView;
|
||||
private PageIndicator mPageIndicator;
|
||||
private AnimatorSet mAnimatorSet;
|
||||
@@ -67,6 +68,7 @@ public class CarQSFragment extends Fragment implements QS {
|
||||
mHeader = view.findViewById(R.id.header);
|
||||
mFooter = view.findViewById(R.id.qs_footer);
|
||||
mFooterUserName = mFooter.findViewById(R.id.user_name);
|
||||
mFooterExpandIcon = mFooter.findViewById(R.id.user_switch_expand_icon);
|
||||
|
||||
mUserSwitcherContainer = view.findViewById(R.id.user_switcher_container);
|
||||
|
||||
@@ -261,6 +263,12 @@ public class CarQSFragment extends Fragment implements QS {
|
||||
nameAnimator.setTarget(mFooterUserName);
|
||||
allAnimators.add(nameAnimator);
|
||||
|
||||
Animator iconAnimator = AnimatorInflater.loadAnimator(getContext(),
|
||||
opening ? R.anim.car_user_switcher_open_icon_animation
|
||||
: R.anim.car_user_switcher_close_icon_animation);
|
||||
iconAnimator.setTarget(mFooterExpandIcon);
|
||||
allAnimators.add(iconAnimator);
|
||||
|
||||
Animator pageAnimator = AnimatorInflater.loadAnimator(getContext(),
|
||||
opening ? R.anim.car_user_switcher_open_pages_animation
|
||||
: R.anim.car_user_switcher_close_pages_animation);
|
||||
|
||||
Reference in New Issue
Block a user