aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHongguang Chen <hgchen@google.com>2023-10-30 16:35:59 -0700
committerHongguang Chen <hgchen@google.com>2023-10-31 18:14:38 +0000
commit44a6a9a2f44bd77216e19bb30ee66dc401d02f85 (patch)
treead859b20453aa2251df2a02274941452887f2ef1
parentd5b20f92dc663a16c7aa39d47b137843276223b3 (diff)
downloadTV-44a6a9a2f44bd77216e19bb30ee66dc401d02f85.tar.gz
Update V2 input banner and no signal screen
Update per UX review feedback and fix previous no signal screen visible when switching input https://screenshot.googleplex.com/55nSi99Nj4erGb5.png Bug: 302992748 Test: manual Change-Id: I02acb31422e731c34b7b1b6a4b7a58d49756ce6d
-rw-r--r--res/drawable/empty_input_background.pngbin0 -> 1304602 bytes
-rw-r--r--res/drawable/ic_input_banner_compound.xml30
-rw-r--r--res/drawable/ic_input_hdmi.xml10
-rw-r--r--res/drawable/input_banner_v2_background.xml2
-rw-r--r--res/layout/empty_input_status_block.xml7
-rw-r--r--res/layout/input_banner_v2.xml77
-rw-r--r--res/values/colors.xml1
-rw-r--r--res/values/strings.xml6
-rw-r--r--src/com/android/tv/ui/InputBannerViewV2.java60
-rw-r--r--src/com/android/tv/ui/TunableTvView.java3
10 files changed, 39 insertions, 157 deletions
diff --git a/res/drawable/empty_input_background.png b/res/drawable/empty_input_background.png
new file mode 100644
index 00000000..2dc3970a
--- /dev/null
+++ b/res/drawable/empty_input_background.png
Binary files differ
diff --git a/res/drawable/ic_input_banner_compound.xml b/res/drawable/ic_input_banner_compound.xml
deleted file mode 100644
index d3498708..00000000
--- a/res/drawable/ic_input_banner_compound.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2023 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.
- -->
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item>
- <shape android:shape="oval">
- <size android:width="44dp" android:height="44dp"/>
- <solid android:color="#0FE8EAED" />
- </shape>
- </item>
- <item
- android:height="24dp"
- android:width="24dp"
- android:gravity="center"
- android:drawable="@drawable/ic_input_hdmi" >
- </item>
-</layer-list>
diff --git a/res/drawable/ic_input_hdmi.xml b/res/drawable/ic_input_hdmi.xml
deleted file mode 100644
index 3243148b..00000000
--- a/res/drawable/ic_input_hdmi.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="24dp"
- android:height="24dp"
- android:viewportWidth="960"
- android:viewportHeight="960"
- android:tint="?attr/colorControlNormal">
- <path
- android:fillColor="@android:color/white"
- android:pathData="M320,880L320,760L200,520L200,280L240,280L240,160Q240,127 263.5,103.5Q287,80 320,80L640,80Q673,80 696.5,103.5Q720,127 720,160L720,280L760,280L760,520L640,760L640,880L320,880ZM320,280L400,280L400,200L440,200L440,280L520,280L520,200L560,200L560,280L640,280L640,160Q640,160 640,160Q640,160 640,160L320,160Q320,160 320,160Q320,160 320,160L320,280ZM400,740L400,740L560,740L560,740L560,740L400,740L400,740ZM400,740L560,740L680,500L680,360L280,360L280,500L400,740Z"/>
-</vector>
diff --git a/res/drawable/input_banner_v2_background.xml b/res/drawable/input_banner_v2_background.xml
index a4015766..ac93e32c 100644
--- a/res/drawable/input_banner_v2_background.xml
+++ b/res/drawable/input_banner_v2_background.xml
@@ -17,5 +17,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="16dp" />
- <solid android:color="#A6252A34"/>
+ <solid android:color="#E6252A34"/>
</shape> \ No newline at end of file
diff --git a/res/layout/empty_input_status_block.xml b/res/layout/empty_input_status_block.xml
index 2f5d8d26..d44a2f01 100644
--- a/res/layout/empty_input_status_block.xml
+++ b/res/layout/empty_input_status_block.xml
@@ -20,7 +20,7 @@
android:id="@+id/block_screen_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/empty_input_status_background_color">
+ android:background="@drawable/empty_input_background">
<ImageView
android:id="@+id/empty_input_status_icon"
@@ -37,7 +37,7 @@
android:id="@+id/empty_input_status_title_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:fontFamily="google-sans-regular"
+ android:fontFamily="google-sans-text-regular"
android:textColor="@color/empty_input_status_title_text_color"
android:textSize="@dimen/empty_input_status_block_title_text_size"
android:text="@string/empty_input_status_title_format"
@@ -50,6 +50,7 @@
android:id="@+id/empty_input_status_info_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:fontFamily="google-sans-text-regular"
android:textColor="@color/empty_input_status_info_text_color"
android:textSize="@dimen/empty_input_status_block_info_text_size"
android:text="@string/empty_input_status_info"
@@ -57,4 +58,4 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/empty_input_status_title_text" />
-</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/res/layout/input_banner_v2.xml b/res/layout/input_banner_v2.xml
index d3369219..8f897827 100644
--- a/res/layout/input_banner_v2.xml
+++ b/res/layout/input_banner_v2.xml
@@ -24,60 +24,41 @@
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:background="@drawable/input_banner_v2_background"
+ android:maxWidth="@dimen/input_banner_item_label_max_width"
+ android:minWidth="76dp"
+ android:minHeight="39dp"
+ android:orientation="vertical"
android:elevation="8dp"
android:focusable="false"
- android:orientation="horizontal">
+ android:paddingStart="20dp"
+ android:paddingTop="16dp"
+ android:paddingEnd="20dp"
+ android:paddingBottom="16dp">
- <LinearLayout
- android:id="@+id/input_label_text_container"
+ <TextView
+ android:id="@+id/input_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="20dp"
- android:layout_marginTop="18dp"
- android:layout_marginEnd="8dp"
- android:layout_marginBottom="18dp"
- android:minWidth="100dp"
- android:minHeight="39dp"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/input_label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:ellipsize="end"
- android:fontFamily="google-sans-medium"
- android:gravity="start"
- android:singleLine="true"
- android:textColor="#E8F0FE"
- android:textSize="16sp" />
-
- <TextView
- android:id="@+id/input_info"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_marginTop="4dp"
- android:alpha="0.6"
- android:ellipsize="end"
- android:fontFamily="google-sans-medium"
- android:gravity="start"
- android:singleLine="true"
- android:textColor="#D2E3FC"
- android:textSize="11sp" />
- </LinearLayout>
+ android:layout_gravity="center_vertical"
+ android:ellipsize="end"
+ android:fontFamily="google-sans-text-medium"
+ android:gravity="start"
+ android:singleLine="true"
+ android:text="@string/input_banner_v2_active_input"
+ android:textColor="#CCD2E3FC"
+ android:textSize="12sp" />
- <ImageView
- android:id="@+id/input_label_icon"
- android:layout_width="44dp"
- android:layout_height="44dp"
+ <TextView
+ android:id="@+id/input_label"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:layout_marginStart="16dp"
- android:layout_marginTop="16dp"
- android:layout_marginEnd="20dp"
- android:layout_marginBottom="16dp"
- android:contentDescription="@null"
- android:src="@drawable/ic_input_banner_compound"
- android:tint="#E8EAED" />
+ android:layout_marginTop="2dp"
+ android:ellipsize="end"
+ android:fontFamily="google-sans-text-medium"
+ android:gravity="start"
+ android:singleLine="true"
+ android:textColor="#E8F0FE"
+ android:textSize="18sp" />
</com.android.tv.ui.InputBannerViewV2>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index e8c75bca..e372c150 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -112,7 +112,6 @@
<color name="tvview_block_image_color_filter">#99000000</color>
<!-- Empty input status -->
- <color name="empty_input_status_background_color">#FF0E0E0F</color>
<color name="empty_input_status_icon_tint_color">#FF445664</color>
<color name="empty_input_status_title_text_color">#FFE8F0FE</color>
<color name="empty_input_status_info_text_color">#99D2E3FC</color>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c1eefbbd..a5b59a9b 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -425,14 +425,14 @@
<!-- The text used when external input source is weak signal or not connected [CHAR LIMIT=NONE] -->
<string name="empty_input_status_title_format"><xliff:g id="input_label" example="HDMI 1">%1$s</xliff:g> - No signal</string>
<!-- The text used to indicate the action when external input source is weak signal or not connected [CHAR LIMIT=NONE] -->
- <string name="empty_input_status_info">Check the external input or select another input.</string>
+ <string name="empty_input_status_info">Check the external input or select another input</string>
<!-- Input Banner -->
<eat-comment />
+ <!-- The text used to how in the input banner [CHAR LIMIT=NONE] -->
+ <string name="input_banner_v2_active_input">Current active input</string>
<!-- The text used when switching to a new input source. [CHAR LIMIT=NONE] -->
<string name="input_banner_v2_input_label_format"><xliff:g example="HDMI 1" id="label">%1$s</xliff:g> ยท <xliff:g example="Play Station" id="custom_label">%2$s</xliff:g></string>
- <!-- The text used when switching to a new input source and provide additional video information. [CHAR LIMIT=NONE] -->
- <string name="input_banner_v2_input_info_format"><xliff:g example="3840" id="video_width">%1$d</xliff:g> x <xliff:g example="2160" id="video_height">%2$d</xliff:g>/<xliff:g example="60" id="frame_rate">%3$.0f</xliff:g>P</string>
<!-- Channel Banner -->
<eat-comment />
diff --git a/src/com/android/tv/ui/InputBannerViewV2.java b/src/com/android/tv/ui/InputBannerViewV2.java
index b6f83148..e340819b 100644
--- a/src/com/android/tv/ui/InputBannerViewV2.java
+++ b/src/com/android/tv/ui/InputBannerViewV2.java
@@ -32,12 +32,6 @@ public class InputBannerViewV2 extends InputBannerViewBase
private static final String TAG = "InputBannerViewV2";
private TextView mInputLabelTextView;
- private TextView mInputInfoTextView;
-
- private int mVideoWidth = 0;
- private int mVideoHeight = 0;
- private float mFrameRate = 0f;
-
public InputBannerViewV2(Context context) {
super(context);
}
@@ -54,7 +48,6 @@ public class InputBannerViewV2 extends InputBannerViewBase
protected void onFinishInflate() {
super.onFinishInflate();
mInputLabelTextView = findViewById(R.id.input_label);
- mInputInfoTextView = findViewById(R.id.input_info);
}
@Override
@@ -88,57 +81,4 @@ public class InputBannerViewV2 extends InputBannerViewBase
}
}
-
- private boolean updateInputInfoIfNeeded(StreamInfo streamInfo) {
- if (!streamInfo.isVideoAvailable()) return false;
-
- boolean updated = false;
- int videoWidth = streamInfo.getVideoWidth();
- int videoHeight = streamInfo.getVideoHeight();
- float frameRate = streamInfo.getVideoFrameRate();
-
- if (videoWidth != mVideoWidth) {
- mVideoWidth = videoWidth;
- updated = true;
- }
-
- if (videoHeight != mVideoHeight) {
- mVideoHeight = videoHeight;
- updated = true;
- }
-
- if (frameRate != mFrameRate) {
- mFrameRate = frameRate;
- updated = true;
- }
-
- if (updated && isInputInfoValid(videoWidth, videoHeight, frameRate)) {
- String info = getResources().getString(
- R.string.input_banner_v2_input_info_format, videoWidth, videoHeight, frameRate);
- mInputInfoTextView.setText(info);
- return true;
- }
- return false;
- }
-
- private boolean isInputInfoValid(int videoWidth, int videoHeight, float frameRate) {
- return videoWidth > 0 && videoHeight > 0 && frameRate > 0;
- }
-
- /**
- * Loading input source video takes time and metadata could change. Provide input banner with
- * the latest stream info for possible update.
- */
- @Override
- public void onStreamInfoUpdated(StreamInfo info) {
- super.onStreamInfoUpdated(info);
- boolean updated = updateInputInfoIfNeeded(info);
-
- if (updated) {
- // users might not have time to read the updated info before it disappears,
- // so extend the showing time if the input banner is updated
- removeCallbacks(mHideRunnable);
- postDelayed(mHideRunnable, mShowDurationMillis);
- }
- }
}
diff --git a/src/com/android/tv/ui/TunableTvView.java b/src/com/android/tv/ui/TunableTvView.java
index 75f0f8c6..76fb0a12 100644
--- a/src/com/android/tv/ui/TunableTvView.java
+++ b/src/com/android/tv/ui/TunableTvView.java
@@ -1018,9 +1018,10 @@ public class TunableTvView extends FrameLayout implements StreamInfo, TunableTvV
}
mBlockScreenView.setVisibility(VISIBLE);
if (shouldShowEmptyInputStatusBlock()){
- // It will fade out along with mBlockScreenView when contents available
mBlockScreenView.setEmptyInputStatusInputInfo(mInputInfo);
mBlockScreenView.setEmptyInputStatusBlockVisibility(true);
+ } else {
+ mBlockScreenView.setEmptyInputStatusBlockVisibility(false);
}
if (mTvIAppView != null) {
mTvIAppView.setVisibility(INVISIBLE);