|
|
|
|
@ -272,7 +272,7 @@ public class LiveActivity extends BaseActivity implements CustomKeyDown.Listener |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setWidth(Live live) { |
|
|
|
|
int padding = ResUtil.dp2px(48); |
|
|
|
|
int padding = ResUtil.dp2px(36); |
|
|
|
|
if (live.getWidth() == 0) for (Group item : live.getGroups()) live.setWidth(Math.max(live.getWidth(), ResUtil.getTextWidth(item.getName(), 14))); |
|
|
|
|
int width = live.getWidth() == 0 ? 0 : Math.min(live.getWidth() + padding, ResUtil.getScreenWidth() / 4); |
|
|
|
|
setWidth(mBinding.group, width); |
|
|
|
|
@ -281,7 +281,7 @@ public class LiveActivity extends BaseActivity implements CustomKeyDown.Listener |
|
|
|
|
@Override |
|
|
|
|
public void setWidth(Group group) { |
|
|
|
|
int logo = ResUtil.dp2px(56); |
|
|
|
|
int padding = ResUtil.dp2px(60); |
|
|
|
|
int padding = ResUtil.dp2px(48); |
|
|
|
|
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(), 14))); |
|
|
|
|
int width = group.getWidth() == 0 ? 0 : Math.min(group.getWidth() + padding, ResUtil.getScreenWidth() / 2); |
|
|
|
|
@ -289,9 +289,9 @@ public class LiveActivity extends BaseActivity implements CustomKeyDown.Listener |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void setWidth(Epg epg) { |
|
|
|
|
int padding = ResUtil.dp2px(40); |
|
|
|
|
int padding = ResUtil.dp2px(36); |
|
|
|
|
if (epg.getList().isEmpty()) return; |
|
|
|
|
int minWidth = ResUtil.getTextWidth(epg.getList().get(0).getTime(), 14); |
|
|
|
|
int minWidth = ResUtil.getTextWidth(epg.getList().get(0).getTime(), 12); |
|
|
|
|
if (epg.getWidth() == 0) for (EpgData item : epg.getList()) epg.setWidth(Math.max(epg.getWidth(), ResUtil.getTextWidth(item.getTitle(), 14))); |
|
|
|
|
int width = epg.getWidth() == 0 ? 0 : Math.min(Math.max(epg.getWidth(), minWidth) + padding, ResUtil.getScreenWidth() / 2); |
|
|
|
|
setWidth(mBinding.epgData, width); |
|
|
|
|
|