|
|
|
|
@ -265,7 +265,7 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setWidth(Live live) { |
|
|
|
|
int padding = ResUtil.dp2px(48); |
|
|
|
|
int padding = ResUtil.dp2px(52); |
|
|
|
|
if (live.getWidth() == 0) for (Group item : live.getGroups()) live.setWidth(Math.max(live.getWidth(), ResUtil.getTextWidth(item.getName(), 16))); |
|
|
|
|
int width = live.getWidth() == 0 ? 0 : Math.min(live.getWidth() + padding, ResUtil.getScreenWidth() / 4); |
|
|
|
|
setWidth(mBinding.group, width); |
|
|
|
|
@ -273,7 +273,7 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick |
|
|
|
|
|
|
|
|
|
private Group setWidth(Group group) { |
|
|
|
|
int logo = ResUtil.dp2px(60); |
|
|
|
|
int padding = ResUtil.dp2px(60); |
|
|
|
|
int padding = ResUtil.dp2px(64); |
|
|
|
|
if (group.isKeep()) group.setWidth(0); |
|
|
|
|
if (group.getWidth() == 0) for (Channel item : group.getChannel()) group.setWidth(Math.max(group.getWidth(), (item.getLogo().isEmpty() ? 0 : logo) + ResUtil.getTextWidth(item.getNumber() + item.getName(), 16))); |
|
|
|
|
int width = group.getWidth() == 0 ? 0 : Math.min(group.getWidth() + padding, ResUtil.getScreenWidth() / 2); |
|
|
|
|
@ -282,9 +282,9 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setWidth(Epg epg) { |
|
|
|
|
int padding = ResUtil.dp2px(48); |
|
|
|
|
int padding = ResUtil.dp2px(52); |
|
|
|
|
if (epg.getList().isEmpty()) return; |
|
|
|
|
int minWidth = ResUtil.getTextWidth(epg.getList().get(0).getTime(), 16); |
|
|
|
|
int minWidth = ResUtil.getTextWidth(epg.getList().get(0).getTime(), 14); |
|
|
|
|
if (epg.getWidth() == 0) for (EpgData item : epg.getList()) epg.setWidth(Math.max(epg.getWidth(), ResUtil.getTextWidth(item.getTitle(), 16))); |
|
|
|
|
int width = epg.getWidth() == 0 ? 0 : Math.min(Math.max(epg.getWidth(), minWidth) + padding, ResUtil.getScreenWidth() / 2); |
|
|
|
|
setWidth(mBinding.epgData, width); |
|
|
|
|
|