diff options
3 files changed, 49 insertions, 0 deletions
diff --git a/packages/SystemUI/res/anim/control_state_list_animator.xml b/packages/SystemUI/res/anim/control_state_list_animator.xml new file mode 100644 index 000000000000..7940b8874ece --- /dev/null +++ b/packages/SystemUI/res/anim/control_state_list_animator.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2020 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. + --> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_pressed="true"> + <set> + <objectAnimator + android:duration="50" + android:propertyName="scaleX" + android:valueTo="0.97" + android:valueType="floatType" /> + <objectAnimator + android:duration="50" + android:propertyName="scaleY" + android:valueTo="0.97" + android:valueType="floatType" /> + + </set> + </item> + <item> + <set> + <objectAnimator + android:duration="250" + android:propertyName="scaleX" + android:valueTo="1" + android:valueType="floatType" /> + <objectAnimator + android:duration="250" + android:propertyName="scaleY" + android:valueTo="1" + android:valueType="floatType" /> + </set> + </item> +</selector>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout/controls_base_item.xml b/packages/SystemUI/res/layout/controls_base_item.xml index 55c9083e4147..6a8621398191 100644 --- a/packages/SystemUI/res/layout/controls_base_item.xml +++ b/packages/SystemUI/res/layout/controls_base_item.xml @@ -24,6 +24,7 @@ android:clickable="false" android:focusable="true" android:screenReaderFocusable="true" + android:stateListAnimator="@anim/control_state_list_animator" android:layout_marginLeft="@dimen/control_base_item_margin" android:layout_marginRight="@dimen/control_base_item_margin" android:background="@drawable/control_background"> diff --git a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml index 72cc2ddba282..477ec6a1c72c 100644 --- a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml +++ b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml @@ -28,6 +28,7 @@ android:paddingRight="@dimen/global_actions_grid_item_side_margin" android:layout_marginRight="@dimen/control_base_item_margin" android:layout_marginLeft="@dimen/control_base_item_margin" + android:stateListAnimator="@anim/control_state_list_animator" android:background="@drawable/control_background"> <LinearLayout android:layout_width="@dimen/global_actions_grid_item_width" |