From 87eb9b4fe5b3e60a9558f41ec4e513ca99314375 Mon Sep 17 00:00:00 2001 From: FongMi Date: Thu, 10 Nov 2022 22:47:26 +0800 Subject: [PATCH] Clean code --- .../com/fongmi/android/tv/ui/activity/DetailActivity.java | 6 +++--- .../drawable/{shape_live_info.xml => shape_info_live.xml} | 4 ++-- .../res/drawable/shape_info_vod.xml} | 6 +++--- app/src/leanback/res/drawable/shape_live_list.xml | 6 +++--- app/src/leanback/res/layout/view_widget_live.xml | 2 +- app/src/leanback/res/layout/view_widget_vod.xml | 4 ++-- app/src/main/res/values/colors.xml | 1 + 7 files changed, 15 insertions(+), 14 deletions(-) rename app/src/leanback/res/drawable/{shape_live_info.xml => shape_info_live.xml} (68%) rename app/src/{main/res/drawable/shape_title.xml => leanback/res/drawable/shape_info_vod.xml} (60%) diff --git a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java index 52720847e..48f6d991c 100644 --- a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java +++ b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/DetailActivity.java @@ -349,7 +349,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis } private void exitFullscreen() { - mBinding.widget.top.setVisibility(View.GONE); + mBinding.widget.info.setVisibility(View.GONE); mBinding.widget.center.setVisibility(View.GONE); mBinding.video.setForeground(ResUtil.getDrawable(R.drawable.selector_video)); mBinding.video.setLayoutParams(mFrameParams); @@ -520,7 +520,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis public void run() { mBinding.widget.action.setImageResource(R.drawable.ic_play); mBinding.widget.center.setVisibility(View.GONE); - mBinding.widget.top.setVisibility(View.GONE); + mBinding.widget.info.setVisibility(View.GONE); } }; @@ -584,7 +584,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis private void onPause(boolean visible) { mBinding.widget.exoPosition.setText(mPlayers.getTime(0)); mBinding.widget.exoDuration.setText(mControl.exoDuration.getText()); - mBinding.widget.top.setVisibility(visible ? View.VISIBLE : View.GONE); + mBinding.widget.info.setVisibility(visible ? View.VISIBLE : View.GONE); mBinding.widget.center.setVisibility(visible ? View.VISIBLE : View.GONE); mPlayers.pause(); } diff --git a/app/src/leanback/res/drawable/shape_live_info.xml b/app/src/leanback/res/drawable/shape_info_live.xml similarity index 68% rename from app/src/leanback/res/drawable/shape_live_info.xml rename to app/src/leanback/res/drawable/shape_info_live.xml index f5e9e43d4..dc4b2e126 100644 --- a/app/src/leanback/res/drawable/shape_live_info.xml +++ b/app/src/leanback/res/drawable/shape_info_live.xml @@ -4,8 +4,8 @@ \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_title.xml b/app/src/leanback/res/drawable/shape_info_vod.xml similarity index 60% rename from app/src/main/res/drawable/shape_title.xml rename to app/src/leanback/res/drawable/shape_info_vod.xml index 54bd9fd1b..af23d1284 100644 --- a/app/src/main/res/drawable/shape_title.xml +++ b/app/src/leanback/res/drawable/shape_info_vod.xml @@ -4,9 +4,9 @@ \ No newline at end of file diff --git a/app/src/leanback/res/drawable/shape_live_list.xml b/app/src/leanback/res/drawable/shape_live_list.xml index 10ffe56fd..a2664c9fd 100644 --- a/app/src/leanback/res/drawable/shape_live_list.xml +++ b/app/src/leanback/res/drawable/shape_live_list.xml @@ -4,9 +4,9 @@ \ No newline at end of file diff --git a/app/src/leanback/res/layout/view_widget_live.xml b/app/src/leanback/res/layout/view_widget_live.xml index fffc8212b..b6177249a 100644 --- a/app/src/leanback/res/layout/view_widget_live.xml +++ b/app/src/leanback/res/layout/view_widget_live.xml @@ -33,7 +33,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" - android:background="@drawable/shape_live_info" + android:background="@drawable/shape_info_live" android:gravity="center" android:orientation="horizontal" android:padding="16dp" diff --git a/app/src/leanback/res/layout/view_widget_vod.xml b/app/src/leanback/res/layout/view_widget_vod.xml index 1e07678df..f022f378a 100644 --- a/app/src/leanback/res/layout/view_widget_vod.xml +++ b/app/src/leanback/res/layout/view_widget_vod.xml @@ -5,10 +5,10 @@ android:layout_height="match_parent"> @color/black #00000000 #000000 + #0D000000 #1A000000 #33000000 #4D000000