From 7eace292e2ee7c2864106dfda7b2b81d7d729bf5 Mon Sep 17 00:00:00 2001 From: Sergey Nikolaienkov Date: Mon, 7 Sep 2020 15:31:44 +0000 Subject: [PATCH] Clean up unused Views in AudioRecordingDisclosureBar Bug: 166459250 Test: make, flash Test: atest CtsSystemUiTestCases:MicIndicatorTest Change-Id: I249cc29597d3c2891c23ccb2ed979bd46d5e4a78 --- .../drawable/tv_rect_dark_left_rounded.xml | 26 ------ .../drawable/tv_rect_dark_right_rounded.xml | 26 ------ .../layout/tv_audio_recording_indicator.xml | 81 +++---------------- packages/SystemUI/res/values/colors_tv.xml | 2 - .../AudioRecordingDisclosureBar.java | 33 +------- 5 files changed, 11 insertions(+), 157 deletions(-) delete mode 100644 packages/SystemUI/res/drawable/tv_rect_dark_left_rounded.xml delete mode 100644 packages/SystemUI/res/drawable/tv_rect_dark_right_rounded.xml diff --git a/packages/SystemUI/res/drawable/tv_rect_dark_left_rounded.xml b/packages/SystemUI/res/drawable/tv_rect_dark_left_rounded.xml deleted file mode 100644 index 9b48a70d9439b..0000000000000 --- a/packages/SystemUI/res/drawable/tv_rect_dark_left_rounded.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/drawable/tv_rect_dark_right_rounded.xml b/packages/SystemUI/res/drawable/tv_rect_dark_right_rounded.xml deleted file mode 100644 index 03348756231b4..0000000000000 --- a/packages/SystemUI/res/drawable/tv_rect_dark_right_rounded.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/packages/SystemUI/res/layout/tv_audio_recording_indicator.xml b/packages/SystemUI/res/layout/tv_audio_recording_indicator.xml index f9336a5403763..b62018d7cb9e8 100644 --- a/packages/SystemUI/res/layout/tv_audio_recording_indicator.xml +++ b/packages/SystemUI/res/layout/tv_audio_recording_indicator.xml @@ -22,80 +22,17 @@ android:padding="12dp"> + android:layout_width="34dp" + android:layout_height="24dp" + android:layout_gravity="center" + android:background="@drawable/tv_rect_shadow_rounded"> - - - - - - - - - - - - - - - - - - - - - - + - - diff --git a/packages/SystemUI/res/values/colors_tv.xml b/packages/SystemUI/res/values/colors_tv.xml index cb49918e4e3ff..1177bb5757c2b 100644 --- a/packages/SystemUI/res/values/colors_tv.xml +++ b/packages/SystemUI/res/values/colors_tv.xml @@ -22,8 +22,6 @@ #7FEEEEEE #7F000000 - - #FF3C4043 #CC000000 #33FFFFFF diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/micdisclosure/AudioRecordingDisclosureBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/micdisclosure/AudioRecordingDisclosureBar.java index a29db4d98329e..c1fad89179917 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/micdisclosure/AudioRecordingDisclosureBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/micdisclosure/AudioRecordingDisclosureBar.java @@ -36,7 +36,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewTreeObserver; import android.view.WindowManager; -import android.widget.TextView; import com.android.systemui.R; import com.android.systemui.statusbar.tv.TvStatusBar; @@ -89,12 +88,6 @@ public class AudioRecordingDisclosureBar implements private boolean mIsEnabled; private View mIndicatorView; - private View mIconTextsContainer; - private View mIconContainerBg; - private View mIcon; - private View mBgEnd; - private View mTextsContainers; - private TextView mTextView; private boolean mIsLtr; @State private int mState = STATE_STOPPED; @@ -221,21 +214,6 @@ public class AudioRecordingDisclosureBar implements mIndicatorView = LayoutInflater.from(mContext).inflate( R.layout.tv_audio_recording_indicator, null); - mIconTextsContainer = mIndicatorView.findViewById(R.id.icon_texts_container); - mIconContainerBg = mIconTextsContainer.findViewById(R.id.icon_container_bg); - mIcon = mIconTextsContainer.findViewById(R.id.icon_mic); - mTextsContainers = mIconTextsContainer.findViewById(R.id.texts_container); - mTextView = mTextsContainers.findViewById(R.id.text); - mBgEnd = mIndicatorView.findViewById(R.id.bg_end); - - mTextsContainers.setVisibility(View.GONE); - mIconContainerBg.setVisibility(View.GONE); - mTextView.setVisibility(View.GONE); - mBgEnd.setVisibility(View.GONE); - mTextsContainers = null; - mIconContainerBg = null; - mTextView = null; - mBgEnd = null; // Initially change the visibility to INVISIBLE, wait until and receives the size and // then animate it moving from "off" the screen correctly @@ -305,12 +283,11 @@ public class AudioRecordingDisclosureBar implements private void hide() { if (DEBUG) Log.d(TAG, "Hide indicator"); - final int targetOffset = (mIsLtr ? 1 : -1) * (mIndicatorView.getWidth() - - (int) mIconTextsContainer.getTranslationX()); + final int targetOffset = (mIsLtr ? 1 : -1) * mIndicatorView.getWidth(); final AnimatorSet set = new AnimatorSet(); set.playTogether( ObjectAnimator.ofFloat(mIndicatorView, View.TRANSLATION_X, targetOffset), - ObjectAnimator.ofFloat(mIcon, View.ALPHA, 0f)); + ObjectAnimator.ofFloat(mIndicatorView, View.ALPHA, 0f)); set.setDuration(ANIMATION_DURATION); set.addListener( new AnimatorListenerAdapter() { @@ -363,12 +340,6 @@ public class AudioRecordingDisclosureBar implements windowManager.removeView(mIndicatorView); mIndicatorView = null; - mIconTextsContainer = null; - mIconContainerBg = null; - mIcon = null; - mTextsContainers = null; - mTextView = null; - mBgEnd = null; } private static List splitByComma(String string) {