Merge branch 'dev' into release

pull/172/head
FongMi 2 years ago
commit 616e4e415c
  1. 4
      app/build.gradle
  2. 10
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  3. 4
      app/src/leanback/res/layout/activity_live.xml
  4. 8
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  5. 4
      app/src/mobile/res/layout/activity_live.xml

@ -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()]

@ -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();

@ -70,9 +70,11 @@
tools:listitem="@layout/adapter_group" />
<View
android:id="@+id/divide"
android:layout_width="0.3dp"
android:layout_height="match_parent"
android:background="@color/grey_700" />
android:background="@color/grey_700"
android:visibility="gone" />
<com.fongmi.android.tv.ui.custom.CustomLiveListView
android:id="@+id/channel"

@ -255,6 +255,7 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
}
private void getLive() {
mBinding.control.action.home.setText(getHome().getName());
mPlayers.setPlayer(getPlayerType(-1));
mViewModel.getLive(getHome());
setPlayerView();
@ -268,12 +269,13 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
for (Group group : live.getGroups()) (group.isHidden() ? mHides : items).add(group);
mGroupAdapter.addAll(items);
setPosition(LiveConfig.get().find(items));
mBinding.control.action.home.setText(live.getName());
}
private void setWidth(Live live) {
int base = ResUtil.dp2px(live.hasLogo() ? 90 : 45);
for (Group group : live.getGroups()) live.setWidth(Math.max(live.getWidth(), ResUtil.getTextWidth(group.getName(), 14)));
mBinding.group.getLayoutParams().width = Math.min(live.getWidth() + ResUtil.dp2px(live.hasLogo() ? 90 : 45), 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) {
@ -834,12 +836,14 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
}
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();

@ -72,9 +72,11 @@
tools:listitem="@layout/adapter_group" />
<View
android:id="@+id/divide"
android:layout_width="0.3dp"
android:layout_height="match_parent"
android:background="@color/grey_700" />
android:background="@color/grey_700"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/channel"

Loading…
Cancel
Save