bugs fixes & proxy mode optimize

pull/1/head
haha459862 4 years ago
parent 8ec2c2fb18
commit 448531dd70
  1. 9
      .idea/misc.xml
  2. 4
      app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java
  3. 22
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java
  4. 4
      app/src/main/res/layout/activity_live_play.xml
  5. 1
      app/src/main/res/layout/item_channel_group_layout.xml
  6. 9
      app/src/main/res/layout/item_live_channel_layout.xml

@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/android/repository/TVBoxOSC/app/src/main/res/layout/activity_live_play.xml" value="0.1" />
<entry key="..\:/android/repository/TVBoxOSC/app/src/main/res/layout/item_channel_group_layout.xml" value="0.22826086956521738" />
<entry key="..\:/android/repository/TVBoxOSC/app/src/main/res/layout/item_live_channel_layout.xml" value="0.22826086956521738" />
</map>
</option>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />

@ -439,6 +439,10 @@ public class ApiConfig {
public List<ChannelGroup> getChannelGroupList() {
return channelGroupList;
}
public void setChannelGroupList(List<ChannelGroup> list) {
channelGroupList.clear();
channelGroupList.addAll(list);
}
public List<IJKCode> getIjkCodes() {
return ijkCodes;

@ -82,7 +82,7 @@ public class LivePlayActivity extends BaseActivity {
// layoutParams.width = 100;
// layoutParams.height = 50;
// mVideoView.setLayoutParams(layoutParams);
tvLeftLinearLayout = findViewById(R.id.tvLeftlinearLayout);
tvLeftLinearLayout = findViewById(R.id.tvLeftLinearLayout);
mGroupGridView = findViewById(R.id.mGroupGridView);
mChannelGridView = findViewById(R.id.mChannelGridView);
tvChannel = findViewById(R.id.tvChannel);
@ -306,6 +306,7 @@ public class LivePlayActivity extends BaseActivity {
}
channelGroupList.add(channelGroup);
}
ApiConfig.get().setChannelGroupList(channelGroupList);
}
private void initLiveState() {
@ -388,7 +389,7 @@ public class LivePlayActivity extends BaseActivity {
private Runnable showListAfterScrollOk = new Runnable() {
@Override
public void run() {
if (mGroupGridView.isScrolling()) {
if (mGroupGridView.isScrolling() || mChannelGridView.isScrolling()) {
mHandler.postDelayed(this, 100);
} else {
ViewObj viewObj = new ViewObj(tvLeftLinearLayout, (ViewGroup.MarginLayoutParams) tvLeftLinearLayout.getLayoutParams());
@ -409,11 +410,18 @@ public class LivePlayActivity extends BaseActivity {
private void showChannelList() {
if (tvLeftLinearLayout.getVisibility() == View.INVISIBLE) {
tvHint.setVisibility(View.VISIBLE);
tvLeftLinearLayout.setVisibility(View.VISIBLE);
if (selectedGroupIndex != currentGroupIndex) {
channelGroupList.get(selectedGroupIndex).setDefault(false);
groupAdapter.notifyItemChanged(selectedGroupIndex);
selectedGroupIndex = currentGroupIndex;
channelGroupList.get(selectedGroupIndex).setDefault(true);
groupAdapter.notifyItemChanged(selectedGroupIndex);
}
channelAdapter.setNewData(channelGroupList.get(currentGroupIndex).getLiveChannels());
mGroupGridView.setSelection(currentGroupIndex);
mChannelGridView.setSelection(currentChannelIndex);
tvHint.setVisibility(View.VISIBLE);
tvLeftLinearLayout.setVisibility(View.VISIBLE);
mHandler.postDelayed(showListAfterScrollOk, 100);
}
}
@ -442,9 +450,9 @@ public class LivePlayActivity extends BaseActivity {
|| channelIndex < 0 || channelIndex >= channelGroupList.get(groupIndex).getLiveChannels().size())
return false;
if (groupIndex != currentGroupIndex) {
channelGroupList.get(currentGroupIndex).setDefault(false);
groupAdapter.notifyItemChanged(currentGroupIndex);
if (groupIndex != selectedGroupIndex) {
channelGroupList.get(selectedGroupIndex).setDefault(false);
groupAdapter.notifyItemChanged(selectedGroupIndex);
}
if (channelIndex != currentChannelIndex) {
channelGroupList.get(currentGroupIndex).getLiveChannels().get(currentChannelIndex).setDefault(false);

@ -10,10 +10,10 @@
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/tvLeftlinearLayout"
android:id="@+id/tvLeftLinearLayout"
android:layout_width="421mm"
android:layout_height="match_parent"
android:layout_marginLeft="0mm"
android:layout_marginLeft="-421mm"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="visible" >

@ -4,7 +4,6 @@
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:layout_marginBottom="10mm"
android:background="@drawable/live_focus"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal">

@ -4,15 +4,16 @@
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:layout_marginBottom="10mm"
android:background="@drawable/live_focus"
android:layout_marginLeft="10mm"
android:layout_marginRight="10mm"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal">
<TextView
android:id="@+id/tvChannelNum"
android:layout_width="40mm"
android:layout_height="60mm"
android:layout_width="60mm"
android:layout_height="50mm"
android:ellipsize="marquee"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
@ -26,7 +27,7 @@
android:layout_height="60mm"
android:layout_weight="1"
android:ellipsize="marquee"
android:gravity="center"
android:gravity="left"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textColor="@android:color/white"

Loading…
Cancel
Save