Refresh mic disclosure indicator

Remove the pulsating animation.
Move the indicator to 12dp from top/right edge.
Scale down the indicator.

Bug: 162513710
Test: adb shell appops start com.google.android.katniss 27
Change-Id: Ia4be3c2ff49952d53ac3d98007f00e44bbd16c84
This commit is contained in:
Sergey Nikolaienkov
2020-08-06 07:15:01 +00:00
parent 7921255fb1
commit 6a9d0f7744
6 changed files with 16 additions and 101 deletions

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="@color/tv_audio_recording_indicator_pulse" />
</shape>

View File

@@ -16,9 +16,10 @@
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
android:shape="rectangle">
<solid
android:color="@color/tv_audio_recording_indicator_background" />
<corners android:radius="20dp"/>
<solid android:color="@color/tv_audio_recording_indicator_icon_background"/>
<stroke android:width="1dp" android:color="@color/tv_audio_recording_indicator_stroke"/>
</shape>

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2019 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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="1dp"
android:color="@android:color/white" />
</shape>

View File

@@ -19,7 +19,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="32dp">
android:padding="12dp">
<FrameLayout
android:layout_width="wrap_content"
@@ -32,45 +32,25 @@
android:orientation="horizontal">
<FrameLayout
android:layout_width="45dp"
android:layout_height="47dp">
android:layout_width="wrap_content"
android:layout_height="match_parent">
<View
android:id="@+id/icon_container_bg"
android:layout_width="match_parent"
android:layout_width="50dp"
android:layout_height="match_parent"
android:background="@drawable/tv_rect_dark_left_rounded"/>
<FrameLayout
android:id="@+id/icon_mic"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginStart="6dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp">
<View
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_gravity="center"
android:background="@drawable/tv_circle_dark"/>
android:layout_width="34dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:background="@drawable/tv_rect_shadow_rounded">
<ImageView
android:id="@+id/pulsating_circle"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_gravity="center"
android:background="@drawable/tv_circle_white_translucent"/>
<ImageView
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_gravity="center"
android:src="@drawable/tv_ring_white"/>
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_gravity="center"
android:background="@drawable/tv_ic_mic_white"/>
</FrameLayout>

View File

@@ -24,7 +24,8 @@
<!-- Background color for audio recording indicator (G800) -->
<color name="tv_audio_recording_indicator_background">#FF3C4043</color>
<color name="tv_audio_recording_indicator_pulse">#4DFFFFFF</color>
<color name="tv_audio_recording_indicator_icon_background">#CC000000</color>
<color name="tv_audio_recording_indicator_stroke">#33FFFFFF</color>
<color name="red">#FFCC0000</color>
</resources>

View File

@@ -22,7 +22,6 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.annotation.IntDef;
import android.annotation.UiThread;
import android.content.Context;
@@ -94,8 +93,6 @@ public class AudioRecordingDisclosureBar implements
private static final int ANIMATION_DURATION = 600;
private static final int MAXIMIZED_DURATION = 3000;
private static final int PULSE_BIT_DURATION = 1000;
private static final float PULSE_SCALE = 1.25f;
private final Context mContext;
private boolean mIsEnabledInSettings;
@@ -366,7 +363,6 @@ public class AudioRecordingDisclosureBar implements
@Override
public void onAnimationEnd(Animator animation) {
startPulsatingAnimation();
if (mRevealRecordingPackages) {
onExpanded();
} else {
@@ -529,20 +525,6 @@ public class AudioRecordingDisclosureBar implements
mBgEnd = null;
}
@UiThread
private void startPulsatingAnimation() {
final View pulsatingView = mIconTextsContainer.findViewById(R.id.pulsating_circle);
final ObjectAnimator animator =
ObjectAnimator.ofPropertyValuesHolder(
pulsatingView,
PropertyValuesHolder.ofFloat(View.SCALE_X, PULSE_SCALE),
PropertyValuesHolder.ofFloat(View.SCALE_Y, PULSE_SCALE));
animator.setDuration(PULSE_BIT_DURATION);
animator.setRepeatCount(ObjectAnimator.INFINITE);
animator.setRepeatMode(ObjectAnimator.REVERSE);
animator.start();
}
private String[] getGlobalStringArray(String setting) {
String result = Settings.Global.getString(mContext.getContentResolver(), setting);
return TextUtils.isEmpty(result) ? new String[0] : result.split(",");