Support epg - part 2

pull/362/head
FongMi 2 years ago
parent 158b258eee
commit 29ebc07f13
  1. 11
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/LiveActivity.java
  2. 2
      app/src/mobile/res/drawable/shape_live_list.xml
  3. 5
      app/src/mobile/res/layout/activity_live.xml
  4. 2
      app/src/mobile/res/layout/adapter_epg.xml

@ -202,8 +202,8 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
mBinding.control.action.text.setOnLongClickListener(view -> onTextLong());
mBinding.control.action.player.setOnLongClickListener(view -> onChoose());
mBinding.control.action.speed.setOnLongClickListener(view -> onSpeedLong());
mBinding.video.setOnTouchListener((view, event) -> mKeyDown.onTouchEvent(event));
mBinding.control.action.getRoot().setOnTouchListener(this::onActionTouch);
mBinding.video.setOnTouchListener((view, event) -> mKeyDown.onTouchEvent(event));
}
private void setRecyclerView() {
@ -303,9 +303,12 @@ public class LiveActivity extends BaseActivity implements CustomKeyDownLive.List
}
private void setWidth(Live live) {
int base = ResUtil.dp2px(44);
for (Group group : live.getGroups()) live.setWidth(Math.max(live.getWidth(), ResUtil.getTextWidth(group.getName(), 14)));
mBinding.group.getLayoutParams().width = live.getWidth() == 0 ? 0 : Math.min(live.getWidth() + base, ResUtil.dp2px(180));
int def = ResUtil.dp2px(160);
int logo = ResUtil.dp2px(56);
int group = ResUtil.dp2px(44);
for (Group item : live.getGroups()) live.setWidth(Math.max(live.getWidth(), ResUtil.getTextWidth(item.getName(), 14)));
mBinding.group.getLayoutParams().width = live.getWidth() == 0 ? 0 : Math.min(live.getWidth() + group, def);
mBinding.channel.getLayoutParams().width = live.getLogo().isEmpty() ? def : logo;
mBinding.divide1.setVisibility(live.getWidth() == 0 ? View.GONE : View.VISIBLE);
}

@ -5,7 +5,7 @@
<gradient
android:angle="0"
android:centerColor="@color/black_60"
android:endColor="@color/black_05"
android:endColor="@color/black_20"
android:startColor="@color/black_80"
android:type="linear" />

@ -80,7 +80,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/channel"
android:layout_width="220dp"
android:layout_width="180dp"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false"
@ -93,7 +93,8 @@
android:id="@+id/divide2"
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/epg"

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="8dp"

Loading…
Cancel
Save