diff --git a/app/build.gradle b/app/build.gradle index dcd4f005f..1b6e1c1a4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.fongmi.android.tv" minSdk 21 targetSdk 28 - versionCode 207 - versionName "20231118" + versionCode 208 + versionName "2.0.8" javaCompileOptions { annotationProcessorOptions { arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] diff --git a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java index 436f67b2e..89bba6be7 100644 --- a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java +++ b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java @@ -213,10 +213,10 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick mBinding.control.invert.setActivated(Setting.isInvert()); mBinding.control.across.setActivated(Setting.isAcross()); mBinding.control.change.setActivated(Setting.isChange()); - mBinding.control.home.setVisibility(LiveConfig.isOnly() ? View.GONE : View.VISIBLE); findViewById(R.id.timeBar).setNextFocusUpId(R.id.player); getExo().getSubtitleView().setStyle(ExoUtil.getCaptionStyle()); getIjk().getSubtitleView().setStyle(ExoUtil.getCaptionStyle()); + mBinding.control.home.setVisibility(LiveConfig.isOnly() ? View.GONE : View.VISIBLE); } private void setScale(int scale) { @@ -236,6 +236,7 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick } private void getLive() { + mBinding.control.home.setText(getHome().getName()); mPlayers.setPlayer(getPlayerType(-1)); mViewModel.getLive(getHome()); setPlayerView(); @@ -249,12 +250,13 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick for (Group group : live.getGroups()) (group.isHidden() ? mHides : items).add(group); mGroupAdapter.setItems(items, null); setPosition(LiveConfig.get().find(items)); - mBinding.control.home.setText(live.getName()); } private void setWidth(Live live) { + int base = ResUtil.dp2px(live.hasLogo() ? 98 : 50); for (Group group : live.getGroups()) live.setWidth(Math.max(live.getWidth(), ResUtil.getTextWidth(group.getName(), 16))); - mBinding.group.getLayoutParams().width = Math.min(live.getWidth() + ResUtil.dp2px(live.hasLogo() ? 98 : 50), ResUtil.dp2px(260)); + mBinding.group.getLayoutParams().width = live.getWidth() == 0 ? 0 : Math.min(live.getWidth() + base, ResUtil.dp2px(200)); + mBinding.divide.setVisibility(live.getWidth() == 0 ? View.GONE : View.VISIBLE); } private void setPosition(int[] position) { @@ -740,12 +742,14 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick } private void prevLine() { + if (mChannel == null) return; mChannel.prevLine(); showInfo(); fetch(); } private void nextLine(boolean show) { + if (mChannel == null) return; mChannel.nextLine(); if (show) showInfo(); else setInfo(); diff --git a/app/src/leanback/res/layout/activity_live.xml b/app/src/leanback/res/layout/activity_live.xml index 58271b9dc..1ba03996b 100644 --- a/app/src/leanback/res/layout/activity_live.xml +++ b/app/src/leanback/res/layout/activity_live.xml @@ -70,9 +70,11 @@ tools:listitem="@layout/adapter_group" /> + android:background="@color/grey_700" + android:visibility="gone" /> + android:background="@color/grey_700" + android:visibility="gone" />