图片圆角问题修复;优化直播菜单加载逻辑;EPG信息修正;

pull/142/head
21561 1 year ago
parent 29f14b45ff
commit 6a90b05769
  1. 63
      app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java
  2. 56
      app/src/main/java/com/github/tvbox/osc/picasso/RoundTransformation.java
  3. 2
      app/src/main/java/com/github/tvbox/osc/player/controller/VodController.java
  4. 83
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java
  5. 2
      app/src/main/java/com/github/tvbox/osc/ui/adapter/CollectAdapter.java
  6. 2
      app/src/main/java/com/github/tvbox/osc/ui/adapter/FastSearchAdapter.java
  7. 4
      app/src/main/java/com/github/tvbox/osc/ui/adapter/GridAdapter.java
  8. 2
      app/src/main/java/com/github/tvbox/osc/ui/adapter/HistoryAdapter.java
  9. 2
      app/src/main/java/com/github/tvbox/osc/ui/adapter/HomeHotVodAdapter.java
  10. 2
      app/src/main/java/com/github/tvbox/osc/ui/adapter/SearchAdapter.java
  11. 16
      app/src/main/java/com/github/tvbox/osc/ui/fragment/ModelSettingFragment.java
  12. 1
      app/src/main/java/com/github/tvbox/osc/util/HawkConfig.java
  13. 2
      app/src/main/java/com/github/tvbox/osc/util/HistoryHelper.java
  14. 2
      app/src/main/java/com/github/tvbox/osc/viewmodel/SourceViewModel.java
  15. 65
      app/src/main/res/layout/fragment_model.xml
  16. 4
      gradle.properties

@ -12,6 +12,8 @@ import com.github.tvbox.osc.base.App;
import com.github.tvbox.osc.bean.LiveChannelGroup;
import com.github.tvbox.osc.bean.IJKCode;
import com.github.tvbox.osc.bean.LiveChannelItem;
import com.github.tvbox.osc.bean.LiveSettingGroup;
import com.github.tvbox.osc.bean.LiveSettingItem;
import com.github.tvbox.osc.bean.ParseBean;
import com.github.tvbox.osc.bean.SourceBean;
import com.github.tvbox.osc.server.ControlManager;
@ -41,6 +43,7 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
@ -377,13 +380,32 @@ public class ApiConfig {
if (mDefaultParse == null)
setDefaultParse(parseBeanList.get(0));
}
// 直播源
initLiveSettings();
if(infoJson.has("lives")){
JsonArray lives_groups=infoJson.get("lives").getAsJsonArray();
int live_group_index=Hawk.get(HawkConfig.LIVE_GROUP_INDEX,0);
if(live_group_index>lives_groups.size()-1)Hawk.put(HawkConfig.LIVE_GROUP_INDEX,0);
JsonObject livesOBJ = lives_groups.get(live_group_index).getAsJsonObject();
Hawk.put(HawkConfig.LIVE_GROUP_LIST,lives_groups);
//加载多源配置
try {
ArrayList<LiveSettingItem> liveSettingItemList = new ArrayList<>();
for (int i=0; i< lives_groups.size();i++) {
JsonObject jsonObject = lives_groups.get(i).getAsJsonObject();
String name = jsonObject.has("name")?jsonObject.get("name").getAsString():"线路"+(i+1);
LiveSettingItem liveSettingItem = new LiveSettingItem();
liveSettingItem.setItemIndex(i);
liveSettingItem.setItemName(name);
liveSettingItemList.add(liveSettingItem);
}
liveSettingGroupList.get(5).setLiveSettingItems(liveSettingItemList);
} catch (Exception e) {
// 捕获任何可能发生的异常
e.printStackTrace();
}
JsonObject livesOBJ = lives_groups.get(live_group_index).getAsJsonObject();
loadLiveApi(livesOBJ);
}
@ -506,6 +528,45 @@ public class ApiConfig {
}
}
private final List<LiveSettingGroup> liveSettingGroupList = new ArrayList<>();
private void initLiveSettings() {
ArrayList<String> groupNames = new ArrayList<>(Arrays.asList("线路选择", "画面比例", "播放解码", "超时换源", "偏好设置", "多源切换"));
ArrayList<ArrayList<String>> itemsArrayList = new ArrayList<>();
ArrayList<String> sourceItems = new ArrayList<>();
ArrayList<String> scaleItems = new ArrayList<>(Arrays.asList("默认", "16:9", "4:3", "填充", "原始", "裁剪"));
ArrayList<String> playerDecoderItems = new ArrayList<>(Arrays.asList("系统", "ijk硬解", "ijk软解", "exo"));
ArrayList<String> timeoutItems = new ArrayList<>(Arrays.asList("5s", "10s", "15s", "20s", "25s", "30s"));
ArrayList<String> personalSettingItems = new ArrayList<>(Arrays.asList("显示时间", "显示网速", "换台反转", "跨选分类"));
ArrayList<String> yumItems = new ArrayList<>();
itemsArrayList.add(sourceItems);
itemsArrayList.add(scaleItems);
itemsArrayList.add(playerDecoderItems);
itemsArrayList.add(timeoutItems);
itemsArrayList.add(personalSettingItems);
itemsArrayList.add(yumItems);
liveSettingGroupList.clear();
for (int i = 0; i < groupNames.size(); i++) {
LiveSettingGroup liveSettingGroup = new LiveSettingGroup();
ArrayList<LiveSettingItem> liveSettingItemList = new ArrayList<>();
liveSettingGroup.setGroupIndex(i);
liveSettingGroup.setGroupName(groupNames.get(i));
for (int j = 0; j < itemsArrayList.get(i).size(); j++) {
LiveSettingItem liveSettingItem = new LiveSettingItem();
liveSettingItem.setItemIndex(j);
liveSettingItem.setItemName(itemsArrayList.get(i).get(j));
liveSettingItemList.add(liveSettingItem);
}
liveSettingGroup.setLiveSettingItems(liveSettingItemList);
liveSettingGroupList.add(liveSettingGroup);
}
}
public List<LiveSettingGroup> getLiveSettingGroupList() {
return liveSettingGroupList;
}
public void loadLives(JsonArray livesArray) {
liveChannelGroupList.clear();
int groupIndex = 0;

@ -5,7 +5,6 @@ import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PaintFlagsDrawFilter;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Shader;
@ -63,37 +62,44 @@ public class RoundTransformation implements Transformation {
@Override
public Bitmap transform(Bitmap source) {
int width = source.getWidth();
int height = source.getHeight();
final int sourceWidth = source.getWidth();
final int sourceHeight = source.getHeight();
if (viewWidth == 0 || viewHeight == 0) {
viewWidth = width;
viewHeight = height;
viewWidth = sourceWidth;
viewHeight = sourceHeight;
}
Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
BitmapShader mBitmapShader = new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
if (viewWidth != width || viewHeight != height) {
//是否以宽计算
float scale;
if (width * 1f / viewWidth > height * 1f / viewHeight) {
scale = viewHeight * 1f / height;
width = (int) (width * scale);
height = viewHeight;
final float scale;
final int targetWidth;
final int targetHeight;
if (sourceWidth != viewWidth || sourceHeight != viewHeight) {
if (sourceWidth * 1f / viewWidth > sourceHeight * 1f / viewHeight) {
scale = (float) viewHeight / sourceHeight;
targetWidth = (int) (sourceWidth * scale);
targetHeight = viewHeight;
} else {
scale = viewWidth * 1f / width;
height = (int) (height * scale);
width = viewWidth;
scale = (float) viewWidth / sourceWidth;
targetWidth = viewWidth;
targetHeight = (int) (sourceHeight * scale);
}
} else {
scale = 1f;
targetWidth = sourceWidth;
targetHeight = sourceHeight;
}
BitmapShader shader = new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
if (scale != 1f) {
Matrix matrix = new Matrix();
matrix.postScale(scale, scale);
mBitmapShader.setLocalMatrix(matrix);
matrix.setScale(scale, scale);
shader.setLocalMatrix(matrix);
}
Bitmap bitmap = Bitmap.createBitmap(viewWidth, viewHeight, Bitmap.Config.RGB_565);
Bitmap bitmap = Bitmap.createBitmap(targetWidth, targetHeight, Bitmap.Config.ARGB_8888);
bitmap.setHasAlpha(true);
Canvas mCanvas = new Canvas(bitmap);
mPaint.setShader(mBitmapShader);
// mPaint.setAntiAlias(true);
mCanvas.setDrawFilter(new PaintFlagsDrawFilter(0, Paint.ANTI_ALIAS_FLAG | Paint.FILTER_BITMAP_FLAG));
drawRoundRect(mCanvas, mPaint, width, height);
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
paint.setShader(shader);
Canvas canvas = new Canvas(bitmap);
RectF rect = new RectF(0, 0, targetWidth, targetHeight);
canvas.drawRoundRect(rect, radius, radius, paint);
source.recycle();
return bitmap;
}

@ -659,7 +659,7 @@ public class VodController extends BaseController {
int width = mControlWrapper.getVideoSize()[0];
int height = mControlWrapper.getVideoSize()[1];
double screenSqrt = ScreenUtils.getSqrt(mActivity);
if (screenSqrt < 10.0 && width < height) {
if (screenSqrt < 10.0 && width <= height) {
mLandscapePortraitBtn.setVisibility(View.VISIBLE);
mLandscapePortraitBtn.setText("竖屏");
}

@ -4,6 +4,7 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.IntEvaluator;
import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.net.Uri;
import android.os.CountDownTimer;
@ -427,7 +428,7 @@ public class LivePlayActivity extends BaseActivity {
UrlHttpUtil.get(url, new CallBackUtil.CallBackString() {
public void onFailure(int i, String str) {
showEpg(date, new ArrayList());
// showBottomEpg();
showBottomEpg();
}
public void onResponse(String paramString) {
@ -452,36 +453,43 @@ public class LivePlayActivity extends BaseActivity {
String savedEpgKey = channelName + "_" + liveEpgDateAdapter.getItem(liveEpgDateAdapter.getSelectedIndex()).getDatePresented();
if (!hsEpg.contains(savedEpgKey))
hsEpg.put(savedEpgKey, arrayList);
// showBottomEpg();
showBottomEpg();
}
});
}
//显示底部EPG
@SuppressLint("SetTextI18n")
private void showBottomEpg() {
if (isSHIYI)
return;
if (channel_Name.getChannelName() != null) {
((TextView) findViewById(R.id.tv_channel_bar_name)).setText(channel_Name.getChannelName());
((TextView) findViewById(R.id.tv_channel_bottom_number)).setText("" + channel_Name.getChannelNum());
tip_chname.setText(channel_Name.getChannelName());
tv_channelnum.setText("" + channel_Name.getChannelNum());
TextView tv_current_program_name = findViewById(R.id.tv_current_program_name);
TextView tv_next_program_name = findViewById(R.id.tv_next_program_name);
tip_epg1.setText("暂无信息");
((TextView) findViewById(R.id.tv_current_program_name)).setText("");
tip_epg2.setText("开源测试软件,请勿商用以及播放违法内容");
((TextView) findViewById(R.id.tv_next_program_name)).setText("");
tv_current_program_name.setText("");
tip_epg2.setText("开源测试软件");
tv_next_program_name.setText("");
String savedEpgKey = channel_Name.getChannelName() + "_" + liveEpgDateAdapter.getItem(liveEpgDateAdapter.getSelectedIndex()).getDatePresented();
if (hsEpg.containsKey(savedEpgKey)) {
String[] epgInfo = EpgUtil.getEpgInfo(channel_Name.getChannelName());
updateChannelIcon(channel_Name.getChannelName(), epgInfo == null ? null : epgInfo[0]);
ArrayList arrayList = (ArrayList) hsEpg.get(savedEpgKey);
if (arrayList != null && arrayList.size() > 0) {
Date date = new Date();
int size = arrayList.size() - 1;
while (size >= 0) {
if (new Date().compareTo(((Epginfo) arrayList.get(size)).startdateTime) >= 0) {
tip_epg1.setText(((Epginfo) arrayList.get(size)).start + "--" + ((Epginfo) arrayList.get(size)).end);
((TextView) findViewById(R.id.tv_current_program_name)).setText(((Epginfo) arrayList.get(size)).title);
if (date.after(((Epginfo) arrayList.get(size)).startdateTime) & date.before(((Epginfo) arrayList.get(size)).enddateTime)) {
tip_epg1.setText(((Epginfo) arrayList.get(size)).start + " - " + ((Epginfo) arrayList.get(size)).end);
tv_current_program_name.setText(((Epginfo) arrayList.get(size)).title);
if (size != arrayList.size() - 1) {
tip_epg2.setText(((Epginfo) arrayList.get(size + 1)).start + "--" + ((Epginfo) arrayList.get(size)).end);
((TextView) findViewById(R.id.tv_next_program_name)).setText(((Epginfo) arrayList.get(size + 1)).title);
tip_epg2.setText(((Epginfo) arrayList.get(size + 1)).start + " - " + ((Epginfo) arrayList.get(size + 1)).end);
tv_next_program_name.setText(((Epginfo) arrayList.get(size + 1)).title);
} else {
tip_epg2.setText("00:00 - 23:59");
tv_next_program_name.setText("No Information");
}
break;
} else {
@ -1512,19 +1520,18 @@ public class LivePlayActivity extends BaseActivity {
case 5://多源切换
//TODO
if(position==Hawk.get(HawkConfig.LIVE_GROUP_INDEX, 0))break;
liveSettingItemAdapter.selectItem(position, true, true);
JsonArray live_groups=Hawk.get(HawkConfig.LIVE_GROUP_LIST,new JsonArray());
JsonObject livesOBJ = live_groups.get(position).getAsJsonObject();
String type= livesOBJ.get("type").getAsString();
if(!type.equals("0")){
Toast.makeText(App.getInstance(), "暂不支持该直播类型", Toast.LENGTH_SHORT).show();
return;
break;
}
liveSettingItemAdapter.selectItem(position, true, true);
Hawk.put(HawkConfig.LIVE_GROUP_INDEX, position);
ApiConfig.get().loadLiveApi(livesOBJ);
if (mVideoView != null) {
mVideoView.release();
mVideoView.resume();
mVideoView=null;
}
recreate();
@ -1650,51 +1657,7 @@ public class LivePlayActivity extends BaseActivity {
}
private void initLiveSettingGroupList() {
ArrayList<String> groupNames = new ArrayList<>(Arrays.asList("线路选择", "画面比例", "播放解码", "超时换源", "偏好设置", "多源切换"));
ArrayList<ArrayList<String>> itemsArrayList = new ArrayList<>();
ArrayList<String> sourceItems = new ArrayList<>();
ArrayList<String> scaleItems = new ArrayList<>(Arrays.asList("默认", "16:9", "4:3", "填充", "原始", "裁剪"));
ArrayList<String> playerDecoderItems = new ArrayList<>(Arrays.asList("系统", "ijk硬解", "ijk软解", "exo"));
ArrayList<String> timeoutItems = new ArrayList<>(Arrays.asList("5s", "10s", "15s", "20s", "25s", "30s"));
ArrayList<String> personalSettingItems = new ArrayList<>(Arrays.asList("显示时间", "显示网速", "换台反转", "跨选分类"));
// ArrayList<String> yumItems = new ArrayList<>(Arrays.asList("线路1", "线路2", "线路3"));
ArrayList<String> yumItems = new ArrayList<>();
try {
JsonArray jsonArray = Hawk.get(HawkConfig.LIVE_GROUP_LIST,new JsonArray());
for (int i=0; i< jsonArray.size();i++) {
JsonObject jsonObject = jsonArray.get(i).getAsJsonObject();
String name = jsonObject.has("name")?jsonObject.get("name").getAsString():"线路"+(i+1);
yumItems.add(name);
}
} catch (Exception e) {
// 捕获任何可能发生的异常
e.printStackTrace();
}
itemsArrayList.add(sourceItems);
itemsArrayList.add(scaleItems);
itemsArrayList.add(playerDecoderItems);
itemsArrayList.add(timeoutItems);
itemsArrayList.add(personalSettingItems);
itemsArrayList.add(yumItems);
liveSettingGroupList.clear();
for (int i = 0; i < groupNames.size(); i++) {
LiveSettingGroup liveSettingGroup = new LiveSettingGroup();
ArrayList<LiveSettingItem> liveSettingItemList = new ArrayList<>();
liveSettingGroup.setGroupIndex(i);
liveSettingGroup.setGroupName(groupNames.get(i));
for (int j = 0; j < itemsArrayList.get(i).size(); j++) {
LiveSettingItem liveSettingItem = new LiveSettingItem();
liveSettingItem.setItemIndex(j);
liveSettingItem.setItemName(itemsArrayList.get(i).get(j));
liveSettingItemList.add(liveSettingItem);
}
liveSettingGroup.setLiveSettingItems(liveSettingItemList);
liveSettingGroupList.add(liveSettingGroup);
}
liveSettingGroupList=ApiConfig.get().getLiveSettingGroupList();
liveSettingGroupList.get(3).getLiveSettingItems().get(Hawk.get(HawkConfig.LIVE_CONNECT_TIMEOUT, 1)).setItemSelected(true);
liveSettingGroupList.get(4).getLiveSettingItems().get(0).setItemSelected(Hawk.get(HawkConfig.LIVE_SHOW_TIME, false));
liveSettingGroupList.get(4).getLiveSettingItems().get(1).setItemSelected(Hawk.get(HawkConfig.LIVE_SHOW_NET_SPEED, false));

@ -52,7 +52,7 @@ public class CollectAdapter extends BaseQuickAdapter<VodCollect, BaseViewHolder>
.load(DefaultConfig.checkReplaceProxy(item.pic))
.transform(new RoundTransformation(MD5.string2MD5(item.pic + item.name))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 336))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()

@ -39,7 +39,7 @@ public class FastSearchAdapter extends BaseQuickAdapter<Movie.Video, BaseViewHol
.load(item.pic)
.transform(new RoundTransformation(MD5.string2MD5(item.pic))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 320))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 336))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()

@ -50,7 +50,7 @@ public class GridAdapter extends BaseQuickAdapter<Movie.Video, BaseViewHolder> {
.load(DefaultConfig.checkReplaceProxy(item.pic))
.transform(new RoundTransformation(MD5.string2MD5(item.pic))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 320))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 336))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()
@ -106,7 +106,7 @@ public class GridAdapter extends BaseQuickAdapter<Movie.Video, BaseViewHolder> {
.load(DefaultConfig.checkReplaceProxy(item.pic))
.transform(new RoundTransformation(MD5.string2MD5(item.pic))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 320))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 336))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()

@ -87,7 +87,7 @@ public class HistoryAdapter extends BaseQuickAdapter<VodInfo, BaseViewHolder> {
.load(DefaultConfig.checkReplaceProxy(item.pic))
.transform(new RoundTransformation(MD5.string2MD5(item.pic + item.name))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 336))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()

@ -68,7 +68,7 @@ public class HomeHotVodAdapter extends BaseQuickAdapter<Movie.Video, BaseViewHol
.load(DefaultConfig.checkReplaceProxy(item.pic))
.transform(new RoundTransformation(MD5.string2MD5(item.pic))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 336))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()

@ -41,7 +41,7 @@ public class SearchAdapter extends BaseQuickAdapter<Movie.Video, BaseViewHolder>
.load(item.pic)
.transform(new RoundTransformation(MD5.string2MD5(item.pic))
.centerCorp(true)
.override(AutoSizeUtils.mm2px(mContext, 300), AutoSizeUtils.mm2px(mContext, 400))
.override(AutoSizeUtils.mm2px(mContext, 240), AutoSizeUtils.mm2px(mContext, 336))
.roundRadius(AutoSizeUtils.mm2px(mContext, 10), RoundTransformation.RoundType.ALL))
.placeholder(R.drawable.img_loading_placeholder)
.noFade()

@ -72,6 +72,7 @@ public class ModelSettingFragment extends BaseLazyFragment {
private TextView tvSearchView;
private TextView tvShowPreviewText;
private TextView tvFastSearchText;
private TextView tvm3u8AdText;
private TextView tvRecStyleText;
private TextView tvIjkCachePlay;
@ -91,7 +92,9 @@ public class ModelSettingFragment extends BaseLazyFragment {
@Override
protected void init() {
tvFastSearchText = findViewById(R.id.showFastSearchText);
tvFastSearchText.setText(Hawk.get(HawkConfig.FAST_SEARCH_MODE, false) ? "已开启" : "已关闭");
tvFastSearchText.setText(Hawk.get(HawkConfig.FAST_SEARCH_MODE, false) ? "开启" : "关闭");
tvm3u8AdText = findViewById(R.id.m3u8AdText);
tvm3u8AdText.setText(Hawk.get(HawkConfig.M3U8_PURIFY, false) ? "开启" : "关闭");
tvRecStyleText = findViewById(R.id.showRecStyleText);
tvRecStyleText.setText(Hawk.get(HawkConfig.HOME_REC_STYLE, false) ? "是" : "否");
tvShowPreviewText = findViewById(R.id.showPreviewText);
@ -620,7 +623,16 @@ public class ModelSettingFragment extends BaseLazyFragment {
public void onClick(View v) {
FastClickCheckUtil.check(v);
Hawk.put(HawkConfig.FAST_SEARCH_MODE, !Hawk.get(HawkConfig.FAST_SEARCH_MODE, false));
tvFastSearchText.setText(Hawk.get(HawkConfig.FAST_SEARCH_MODE, false) ? "已开启" : "已关闭");
tvFastSearchText.setText(Hawk.get(HawkConfig.FAST_SEARCH_MODE, false) ? "开启" : "关闭");
}
});
findViewById(R.id.m3u8Ad).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
FastClickCheckUtil.check(v);
boolean is_purify=Hawk.get(HawkConfig.M3U8_PURIFY, false);
Hawk.put(HawkConfig.M3U8_PURIFY, !is_purify);
tvm3u8AdText.setText(!is_purify ? "开启" : "关闭");
}
});
findViewById(R.id.llHomeRecStyle).setOnClickListener(new View.OnClickListener() {

@ -44,5 +44,6 @@ public class HawkConfig {
public static final String LIVE_GROUP_INDEX = "live_group_index";
public static final String LIVE_GROUP_LIST = "live_group_list";
public static final String LIVE_API_URL = "live_api_url";
public static final String M3U8_PURIFY = "m3u8_purify";
public static boolean hotVodDelete;
}

@ -1,7 +1,7 @@
package com.github.tvbox.osc.util;
public class HistoryHelper {
private static Integer[] hisNumArray = {30,50,70};
private static Integer[] hisNumArray = {30,50,100};
public static final String getHistoryNumName(int index){
Integer value = getHisNum(index);

@ -402,7 +402,7 @@ public class SourceViewModel extends ViewModel {
});
String sortJson = null;
try {
sortJson = future.get(15, TimeUnit.SECONDS);
sortJson = future.get(10, TimeUnit.SECONDS);
} catch (TimeoutException e) {
e.printStackTrace();
future.cancel(true);

@ -455,11 +455,20 @@
</LinearLayout>
<LinearLayout
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/vs_5"
android:layout_marginLeft="@dimen/vs_5"
android:layout_weight="1"
android:focusable="false"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/llMediaCodec"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/vs_5"
android:layout_marginLeft="@dimen/vs_5"
android:layout_marginEnd="@dimen/vs_5"
android:layout_marginRight="@dimen/vs_5"
android:layout_weight="1"
android:background="@drawable/shape_setting_model_focus"
android:focusable="true"
@ -468,26 +477,69 @@
android:paddingLeft="@dimen/vs_20"
android:paddingRight="@dimen/vs_20">
<TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="IJK解码方式"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<Space
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
<TextView
android:id="@+id/tvMediaCodec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<TextView
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vs_10"
android:layout_marginLeft="@dimen/vs_10"
android:text=">"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_30" />
</LinearLayout>
<LinearLayout
android:id="@+id/m3u8Ad"
android:layout_width="@dimen/vs_0"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/vs_5"
android:layout_marginLeft="@dimen/vs_5"
android:layout_weight="1"
android:background="@drawable/shape_setting_model_focus"
android:focusable="true"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/vs_20"
android:paddingRight="@dimen/vs_20">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="去广告"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/m3u8AdText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_24" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/vs_10"
@ -495,6 +547,7 @@
android:text=">"
android:textColor="@android:color/white"
android:textSize="@dimen/ts_30" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
#org.gradle.jvmargs=-Xmx2048m
org.gradle.jvmargs=-Xmx2048m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@ -18,4 +18,4 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
IsDebug=true
org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED
#org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED

Loading…
Cancel
Save