pull/172/head
FongMi 2 years ago
parent 65ce30c7c5
commit 28d52c0ab0
  1. 4
      app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  2. 4
      app/src/leanback/res/layout/activity_live.xml
  3. 4
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  4. 4
      app/src/mobile/res/layout/activity_live.xml

@ -253,8 +253,10 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick
}
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) {

@ -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"

@ -272,8 +272,10 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
}
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) {

@ -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