改进UI: 更新设置页面图标,添加关于弹窗,优化镜像更新功能
This commit is contained in:
@@ -16,7 +16,9 @@ import com.github.catvod.net.OkHttp;
|
||||
import com.github.catvod.utils.Github;
|
||||
import com.github.catvod.utils.Path;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
@@ -25,20 +27,25 @@ import java.util.Locale;
|
||||
public class Updater implements Download.Callback {
|
||||
|
||||
private DialogUpdateBinding binding;
|
||||
private final Download download;
|
||||
private Download download;
|
||||
private AlertDialog dialog;
|
||||
private boolean dev;
|
||||
private String downloadUrl;
|
||||
|
||||
private File getFile() {
|
||||
return Path.cache("update.apk");
|
||||
}
|
||||
|
||||
private String getJson() {
|
||||
return Github.getJson(dev, BuildConfig.FLAVOR_mode);
|
||||
private String getApkName() {
|
||||
return "mobile-" + BuildConfig.FLAVOR_abi + ".apk";
|
||||
}
|
||||
|
||||
private String getApk() {
|
||||
return Github.getApk(dev, BuildConfig.FLAVOR_mode + "-" + BuildConfig.FLAVOR_abi);
|
||||
private String getJson() {
|
||||
String url = Github.getReleaseApi();
|
||||
boolean usingCnMirror = Github.useCnMirror();
|
||||
Logger.d("Using CN Mirror: " + usingCnMirror);
|
||||
Logger.d("Update check URL: " + url);
|
||||
return url;
|
||||
}
|
||||
|
||||
public static Updater create() {
|
||||
@@ -46,7 +53,7 @@ public class Updater implements Download.Callback {
|
||||
}
|
||||
|
||||
public Updater() {
|
||||
this.download = Download.create(getApk(), getFile(), this);
|
||||
this.download = Download.create("", getFile(), this);
|
||||
}
|
||||
|
||||
public Updater force() {
|
||||
@@ -74,18 +81,43 @@ public class Updater implements Download.Callback {
|
||||
App.execute(() -> doInBackground(activity));
|
||||
}
|
||||
|
||||
private boolean need(int code, String name) {
|
||||
return Setting.getUpdate() && (dev ? !name.equals(BuildConfig.VERSION_NAME) && code >= BuildConfig.VERSION_CODE : code > BuildConfig.VERSION_CODE);
|
||||
private boolean need(String tagName) {
|
||||
Logger.d("Current version: " + BuildConfig.VERSION_NAME);
|
||||
Logger.d("Latest version: " + tagName);
|
||||
if (tagName.startsWith("v")) tagName = tagName.substring(1);
|
||||
return Setting.getUpdate() && !tagName.equals(BuildConfig.VERSION_NAME);
|
||||
}
|
||||
|
||||
private void doInBackground(Activity activity) {
|
||||
try {
|
||||
JSONObject object = new JSONObject(OkHttp.string(getJson()));
|
||||
String name = object.optString("name");
|
||||
String desc = object.optString("desc");
|
||||
int code = object.optInt("code");
|
||||
if (need(code, name)) App.post(() -> show(activity, name, desc));
|
||||
String jsonUrl = getJson();
|
||||
Logger.d("Fetching update info from: " + jsonUrl);
|
||||
String response = OkHttp.string(jsonUrl);
|
||||
Logger.d("Update check response: " + response);
|
||||
|
||||
JSONObject release = new JSONObject(response);
|
||||
String tagName = release.getString("tag_name");
|
||||
String body = release.getString("body");
|
||||
JSONArray assets = release.getJSONArray("assets");
|
||||
|
||||
// Find the correct APK asset
|
||||
String apkName = getApkName();
|
||||
for (int i = 0; i < assets.length(); i++) {
|
||||
JSONObject asset = assets.getJSONObject(i);
|
||||
if (asset.getString("name").equals(apkName)) {
|
||||
downloadUrl = asset.getString("browser_download_url");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (downloadUrl != null && need(tagName)) {
|
||||
download = Download.create(downloadUrl, getFile(), this);
|
||||
App.post(() -> show(activity, tagName, body));
|
||||
} else {
|
||||
Logger.d("No update needed or APK not found");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logger.e("Update check failed", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@@ -127,6 +159,7 @@ public class Updater implements Download.Callback {
|
||||
|
||||
@Override
|
||||
public void error(String msg) {
|
||||
Logger.e("Download error: " + msg);
|
||||
Notify.show(msg);
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@@ -179,7 +179,13 @@ public class HomeActivity extends BaseActivity implements NavigationBarView.OnIt
|
||||
if (mBinding.navigation.getSelectedItemId() == item.getItemId()) return false;
|
||||
if (item.getItemId() == R.id.setting) return mManager.change(1);
|
||||
if (item.getItemId() == R.id.vod) return mManager.change(0);
|
||||
if (item.getItemId() == R.id.live) return openLive();
|
||||
if (item.getItemId() == R.id.live) {
|
||||
if (LiveConfig.isEmpty()) {
|
||||
Notify.showCenter(R.string.error_no_live);
|
||||
return false;
|
||||
}
|
||||
return openLive();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,17 +4,24 @@ import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.BatteryManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.provider.Settings;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.format.DateFormat;
|
||||
import android.text.style.ClickableSpan;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -22,6 +29,7 @@ import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -63,6 +71,7 @@ import com.fongmi.android.tv.event.RefreshEvent;
|
||||
import com.fongmi.android.tv.model.SiteViewModel;
|
||||
import com.fongmi.android.tv.player.Players;
|
||||
import com.fongmi.android.tv.player.exo.ExoUtil;
|
||||
import com.fongmi.android.tv.player.Source;
|
||||
import com.fongmi.android.tv.service.PlaybackService;
|
||||
import com.fongmi.android.tv.ui.adapter.EpisodeAdapter;
|
||||
import com.fongmi.android.tv.ui.adapter.FlagAdapter;
|
||||
@@ -98,6 +107,7 @@ import com.github.catvod.utils.Trans;
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
@@ -148,6 +158,10 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
|
||||
private Clock mClock;
|
||||
private String tag;
|
||||
private PiP mPiP;
|
||||
private Handler mHandler;
|
||||
private Runnable mTimeUpdateRunnable;
|
||||
private BroadcastReceiver mBatteryReceiver;
|
||||
private int mBatteryLevel = -1;
|
||||
|
||||
public static void push(FragmentActivity activity, String text) {
|
||||
if (FileChooser.isValid(activity, Uri.parse(text))) file(activity, FileChooser.getPathFromUri(activity, Uri.parse(text)));
|
||||
@@ -302,6 +316,64 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
|
||||
showProgress();
|
||||
showDanmaku();
|
||||
checkId();
|
||||
mHandler = new Handler(Looper.getMainLooper());
|
||||
initTimeBatteryUpdate();
|
||||
}
|
||||
|
||||
private void initTimeBatteryUpdate() {
|
||||
mBatteryReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction())) {
|
||||
int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
||||
int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||
if (level != -1 && scale != -1) {
|
||||
mBatteryLevel = (int) ((level / (float) scale) * 100);
|
||||
updateTimeBattery();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
mTimeUpdateRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateTimeBattery();
|
||||
mHandler.postDelayed(this, 30000);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void updateTimeBattery() {
|
||||
TextView timeBattery = mBinding.getRoot().findViewById(R.id.time_battery);
|
||||
if (timeBattery == null) return;
|
||||
|
||||
// 只在横屏模式下显示
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
String time = DateFormat.getTimeFormat(this).format(System.currentTimeMillis());
|
||||
String battery = mBatteryLevel >= 0 ? mBatteryLevel + "%" : "";
|
||||
String text = time + (battery.isEmpty() ? "" : " | " + battery);
|
||||
timeBattery.setText(text);
|
||||
timeBattery.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
timeBattery.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void startTimeBatteryUpdates() {
|
||||
registerReceiver(mBatteryReceiver, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
|
||||
updateTimeBattery();
|
||||
mHandler.post(mTimeUpdateRunnable);
|
||||
}
|
||||
|
||||
private void stopTimeBatteryUpdates() {
|
||||
try {
|
||||
if (mBatteryReceiver != null) {
|
||||
unregisterReceiver(mBatteryReceiver);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
mHandler.removeCallbacks(mTimeUpdateRunnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -960,6 +1032,7 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
|
||||
mBinding.control.bottom.setVisibility(isLock() ? View.GONE : View.VISIBLE);
|
||||
mBinding.control.top.setVisibility(isLock() ? View.GONE : View.VISIBLE);
|
||||
mBinding.control.getRoot().setVisibility(View.VISIBLE);
|
||||
updateTimeBattery();
|
||||
setR1Callback();
|
||||
checkPlayImg();
|
||||
}
|
||||
@@ -1555,6 +1628,7 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
|
||||
if (isAutoRotate() && isPort() && newConfig.orientation == Configuration.ORIENTATION_PORTRAIT && !isRotate()) exitFullscreen();
|
||||
if (isAutoRotate() && isPort() && newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) enterFullscreen();
|
||||
if (isFullscreen()) Util.hideSystemUI(this);
|
||||
updateTimeBattery();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1574,6 +1648,7 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
startTimeBatteryUpdates();
|
||||
if (isRedirect()) onPlay();
|
||||
setRedirect(false);
|
||||
}
|
||||
@@ -1581,6 +1656,7 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
stopTimeBatteryUpdates();
|
||||
if (isRedirect()) onPaused();
|
||||
}
|
||||
|
||||
@@ -1608,14 +1684,17 @@ public class VideoActivity extends BaseActivity implements Clock.Callback, Custo
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
stopSearch();
|
||||
mClock.release();
|
||||
mPlayers.release();
|
||||
mClock.release();
|
||||
Timer.get().reset();
|
||||
RefreshEvent.history();
|
||||
PlaybackService.stop();
|
||||
mHandler.removeCallbacksAndMessages(null);
|
||||
App.removeCallbacks(mR1, mR2, mR3, mR4);
|
||||
EventBus.getDefault().unregister(this);
|
||||
mViewModel.result.removeObserver(mObserveDetail);
|
||||
mViewModel.player.removeObserver(mObservePlayer);
|
||||
mViewModel.search.removeObserver(mObserveSearch);
|
||||
stopTimeBatteryUpdates();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.fongmi.android.tv.api.config.VodConfig;
|
||||
import com.fongmi.android.tv.bean.Config;
|
||||
import com.fongmi.android.tv.databinding.AdapterConfigBinding;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigAdapter extends RecyclerView.Adapter<ConfigAdapter.ViewHolder> {
|
||||
@@ -26,19 +27,36 @@ public class ConfigAdapter extends RecyclerView.Adapter<ConfigAdapter.ViewHolder
|
||||
|
||||
void onTextClick(Config item);
|
||||
|
||||
void onCopyClick(Config item);
|
||||
|
||||
void onDeleteClick(Config item);
|
||||
}
|
||||
|
||||
public ConfigAdapter addAll(int type) {
|
||||
mItems = Config.getAll(type);
|
||||
mItems.remove(type == 0 ? VodConfig.get().getConfig() : LiveConfig.get().getConfig());
|
||||
mItems = new ArrayList<>();
|
||||
List<Config> configs = Config.getAll(type);
|
||||
Config currentConfig = type == 0 ? VodConfig.get().getConfig() : LiveConfig.get().getConfig();
|
||||
|
||||
for (Config config : configs) {
|
||||
if (config.equals(currentConfig) || config.isEmpty()) continue;
|
||||
mItems.add(config);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public void addItem(Config item) {
|
||||
if (item.isEmpty()) return;
|
||||
|
||||
mItems.add(0, item);
|
||||
notifyItemInserted(0);
|
||||
}
|
||||
|
||||
public int remove(Config item) {
|
||||
int position = mItems.indexOf(item);
|
||||
item.delete();
|
||||
mItems.remove(item);
|
||||
notifyDataSetChanged();
|
||||
notifyItemRemoved(position);
|
||||
return getItemCount();
|
||||
}
|
||||
|
||||
@@ -58,6 +76,7 @@ public class ConfigAdapter extends RecyclerView.Adapter<ConfigAdapter.ViewHolder
|
||||
Config item = mItems.get(position);
|
||||
holder.binding.text.setText(item.getDesc());
|
||||
holder.binding.text.setOnClickListener(v -> mListener.onTextClick(item));
|
||||
holder.binding.copy.setOnClickListener(v -> mListener.onCopyClick(item));
|
||||
holder.binding.delete.setOnClickListener(v -> mListener.onDeleteClick(item));
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ public class TypeAdapter extends RecyclerView.Adapter<TypeAdapter.ViewHolder> {
|
||||
|
||||
public void addAll(Result result) {
|
||||
mItems.addAll(result.getTypes());
|
||||
if (!result.getList().isEmpty()) mItems.add(0, home());
|
||||
if (!mItems.isEmpty()) mItems.get(0).setActivated(true);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@@ -144,8 +144,18 @@ public class ConfigDialog {
|
||||
private void onPositive(DialogInterface dialog, int which) {
|
||||
String url = binding.url.getText().toString().trim();
|
||||
String name = binding.name.getText().toString().trim();
|
||||
|
||||
// 如果是编辑模式,更新现有配置
|
||||
if (edit) Config.find(ori, type).url(url).name(name).update();
|
||||
if (url.isEmpty()) Config.delete(ori, type);
|
||||
|
||||
// 如果URL为空,删除配置
|
||||
if (url.isEmpty()) {
|
||||
Config.delete(ori, type);
|
||||
dialog.dismiss();
|
||||
return;
|
||||
}
|
||||
|
||||
// 只有URL不为空时,才设置配置
|
||||
callback.setConfig(Config.find(url, type));
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@@ -73,6 +73,13 @@ public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
||||
|
||||
@Override
|
||||
public void onDeleteClick(Config item) {
|
||||
if (adapter.remove(item) == 0) dialog.dismiss();
|
||||
int count = adapter.remove(item);
|
||||
if (count == 0) {
|
||||
dialog.dismiss();
|
||||
} else {
|
||||
// 强制重新测量布局高度
|
||||
binding.recycler.requestLayout();
|
||||
dialog.getWindow().setLayout(dialog.getWindow().getAttributes().width, android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,15 @@ package com.fongmi.android.tv.ui.fragment;
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.RelativeSizeSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -32,6 +38,7 @@ import com.fongmi.android.tv.impl.SiteCallback;
|
||||
import com.fongmi.android.tv.player.Source;
|
||||
import com.fongmi.android.tv.ui.activity.HomeActivity;
|
||||
import com.fongmi.android.tv.ui.base.BaseFragment;
|
||||
import com.fongmi.android.tv.ui.dialog.AboutDialog;
|
||||
import com.fongmi.android.tv.ui.dialog.ConfigDialog;
|
||||
import com.fongmi.android.tv.ui.dialog.HistoryDialog;
|
||||
import com.fongmi.android.tv.ui.dialog.LiveDialog;
|
||||
@@ -91,9 +98,9 @@ public class SettingFragment extends BaseFragment implements ConfigCallback, Sit
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
mBinding.vodUrl.setText(VodConfig.getDesc());
|
||||
mBinding.liveUrl.setText(LiveConfig.getDesc());
|
||||
mBinding.wallUrl.setText(WallConfig.getDesc());
|
||||
setSourceHintText(mBinding.vodUrl, VodConfig.getDesc());
|
||||
setSourceHintText(mBinding.liveUrl, LiveConfig.getDesc());
|
||||
setSourceHintText(mBinding.wallUrl, WallConfig.getDesc());
|
||||
mBinding.versionText.setText(BuildConfig.VERSION_NAME);
|
||||
|
||||
// 设置开关的颜色为黄色
|
||||
@@ -145,6 +152,7 @@ public class SettingFragment extends BaseFragment implements ConfigCallback, Sit
|
||||
mBinding.player.setOnClickListener(this::onPlayer);
|
||||
mBinding.restore.setOnClickListener(this::onRestore);
|
||||
mBinding.version.setOnClickListener(this::onVersion);
|
||||
mBinding.about.setOnClickListener(this::onAbout);
|
||||
mBinding.vod.setOnLongClickListener(this::onVodEdit);
|
||||
mBinding.vodHome.setOnClickListener(this::onVodHome);
|
||||
mBinding.live.setOnLongClickListener(this::onLiveEdit);
|
||||
@@ -162,6 +170,9 @@ public class SettingFragment extends BaseFragment implements ConfigCallback, Sit
|
||||
|
||||
@Override
|
||||
public void setConfig(Config config) {
|
||||
// 如果URL为空,不进行任何操作
|
||||
if (config.isEmpty()) return;
|
||||
|
||||
if (config.getUrl().startsWith("file") && !PermissionX.isGranted(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE)) {
|
||||
PermissionX.init(this).permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE).request((allGranted, grantedList, deniedList) -> load(config));
|
||||
} else {
|
||||
@@ -204,7 +215,18 @@ public class SettingFragment extends BaseFragment implements ConfigCallback, Sit
|
||||
@Override
|
||||
public void error(String msg) {
|
||||
Notify.show(msg);
|
||||
setConfig(type);
|
||||
Notify.dismiss();
|
||||
switch (type) {
|
||||
case 0:
|
||||
setSourceHintText(mBinding.vodUrl, VodConfig.getDesc());
|
||||
break;
|
||||
case 1:
|
||||
setSourceHintText(mBinding.liveUrl, LiveConfig.getDesc());
|
||||
break;
|
||||
case 2:
|
||||
setSourceHintText(mBinding.wallUrl, WallConfig.getDesc());
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -216,24 +238,37 @@ public class SettingFragment extends BaseFragment implements ConfigCallback, Sit
|
||||
Notify.dismiss();
|
||||
RefreshEvent.video();
|
||||
RefreshEvent.config();
|
||||
mBinding.vodUrl.setText(VodConfig.getDesc());
|
||||
mBinding.liveUrl.setText(LiveConfig.getDesc());
|
||||
mBinding.wallUrl.setText(WallConfig.getDesc());
|
||||
setSourceHintText(mBinding.vodUrl, VodConfig.getDesc());
|
||||
setSourceHintText(mBinding.liveUrl, LiveConfig.getDesc());
|
||||
setSourceHintText(mBinding.wallUrl, WallConfig.getDesc());
|
||||
break;
|
||||
case 1:
|
||||
setCacheText();
|
||||
Notify.dismiss();
|
||||
RefreshEvent.config();
|
||||
mBinding.liveUrl.setText(LiveConfig.getDesc());
|
||||
setSourceHintText(mBinding.liveUrl, LiveConfig.getDesc());
|
||||
break;
|
||||
case 2:
|
||||
setCacheText();
|
||||
Notify.dismiss();
|
||||
mBinding.wallUrl.setText(WallConfig.getDesc());
|
||||
setSourceHintText(mBinding.wallUrl, WallConfig.getDesc());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void setSourceHintText(TextView textView, String desc) {
|
||||
if (TextUtils.isEmpty(desc)) {
|
||||
SpannableString spannable = new SpannableString(getString(R.string.source_hint));
|
||||
spannable.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.white)), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
spannable.setSpan(new RelativeSizeSpan(0.8f), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
int alpha = (int)(255 * 0.5f);
|
||||
spannable.setSpan(new ForegroundColorSpan(android.graphics.Color.argb(alpha, 255, 255, 255)), 0, spannable.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
textView.setText(spannable);
|
||||
} else {
|
||||
textView.setText(desc);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSite(Site item) {
|
||||
VodConfig.get().setHome(item);
|
||||
@@ -299,6 +334,10 @@ public class SettingFragment extends BaseFragment implements ConfigCallback, Sit
|
||||
private void onVersion(View view) {
|
||||
Updater.create().force().release().start(getActivity());
|
||||
}
|
||||
|
||||
private void onAbout(View view) {
|
||||
AboutDialog.show(this);
|
||||
}
|
||||
|
||||
private boolean onVersionDev(View view) {
|
||||
Updater.create().force().dev().start(getActivity());
|
||||
@@ -415,9 +454,9 @@ public class SettingFragment extends BaseFragment implements ConfigCallback, Sit
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
if (hidden) return;
|
||||
mBinding.vodUrl.setText(VodConfig.getDesc());
|
||||
mBinding.liveUrl.setText(LiveConfig.getDesc());
|
||||
mBinding.wallUrl.setText(WallConfig.getDesc());
|
||||
setSourceHintText(mBinding.vodUrl, VodConfig.getDesc());
|
||||
setSourceHintText(mBinding.liveUrl, LiveConfig.getDesc());
|
||||
setSourceHintText(mBinding.wallUrl, WallConfig.getDesc());
|
||||
setCacheText();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/white" android:state_checked="true" />
|
||||
<item android:color="@color/black" android:state_checked="true" />
|
||||
<item android:color="@color/white" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:color="@color/white" android:state_checked="true" />
|
||||
<item android:color="@color/black" android:state_checked="true" />
|
||||
<item android:color="@color/white" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#1AFFFFFF" />
|
||||
<corners android:radius="8dp" />
|
||||
<size android:height="48dp" />
|
||||
</shape>
|
||||
@@ -1,10 +1,18 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960">
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M438,617L613,503Q627,494 627,478Q627,462 613,453L438,339Q423,329 407.5,337.37Q392,345.74 392,364L392,592Q392,610.26 407.5,618.63Q423,627 438,617ZM140,800Q116,800 98,782Q80,764 80,740L80,220Q80,196 98,178Q116,160 140,160L820,160Q844.75,160 862.38,178Q880,196 880,220L880,740Q880,764 862.38,782Q844.75,800 820,800L140,800ZM140,740L140,740Q140,740 140,740Q140,740 140,740L140,220Q140,220 140,220Q140,220 140,220L140,220Q140,220 140,220Q140,220 140,220L140,740Q140,740 140,740Q140,740 140,740ZM140,740L820,740Q820,740 820,740Q820,740 820,740L820,220Q820,220 820,220Q820,220 820,220L140,220Q140,220 140,220Q140,220 140,220L140,740Q140,740 140,740Q140,740 140,740Z" />
|
||||
android:fillColor="#FF000000"
|
||||
android:fillAlpha="0"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FF000000"
|
||||
android:pathData="M3,6C3,4.89543 3.89543,4 5,4H19C20.1046,4 21,4.89543 21,6V18C21,19.1046 20.1046,20 19,20H5C3.89543,20 3,19.1046 3,18V6Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:fillAlpha="0"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FF000000"
|
||||
android:pathData="M10,9l5,3l-5,3l0,-6z"/>
|
||||
</vector>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FF000000"
|
||||
android:pathData="M3,6C3,4.89543 3.89543,4 5,4H19C20.1046,4 21,4.89543 21,6V18C21,19.1046 20.1046,20 19,20H5C3.89543,20 3,19.1046 3,18V6Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="#FF000000"
|
||||
android:pathData="M10,9l5,3l-5,3l0,-6z"/>
|
||||
</vector>
|
||||
@@ -1,7 +1,6 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960">
|
||||
<path
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#000000"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M140,160L214,312L344,312L270,160L359,160L433,312L563,312L489,160L578,160L652,312L782,312L708,160L820,160Q844,160 862,178Q880,196 880,220L880,740Q880,764 862,782Q844,800 820,800L140,800Q116,800 98,782Q80,764 80,740L80,220Q80,196 98,178Q116,160 140,160L140,160ZM140,372L140,740Q140,740 140,740Q140,740 140,740L820,740Q820,740 820,740Q820,740 820,740L820,372L140,372ZM140,372L140,372L140,740Q140,740 140,740Q140,740 140,740L140,740Q140,740 140,740Q140,740 140,740L140,372Z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M16,1L4,1c-1.1,0 -2,0.9 -2,2v14h2L4,3h12L16,1zM19,5L8,5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h11c1.1,0 2,-0.9 2,-2L21,7c0,-1.1 -0.9,-2 -2,-2zM19,21L8,21L8,7h11v14z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M20,3H4C2.9,3 2,3.9 2,5v14c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V5C22,3.9 21.1,3 20,3zM9,17H7v-5h2V17zM13,17h-2V7h2V17zM17,17h-2v-9h2V17z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12,1L3,5v6c0,5.55 3.84,10.74 9,12 5.16,-1.26 9,-6.45 9,-12V5l-9,-4zM12,11.99h7c-0.53,4.12 -3.28,7.79 -7,8.94V12H5V6.3l7,-3.11v8.8z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M21,19V5c0,-1.1 -0.9,-2 -2,-2H5c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2zM8.5,13.5l2.5,3.01L14.5,12l4.5,6H5l3.5,-4.5z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_nav_live_selected" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/ic_nav_live" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_nav_setting_selected" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/ic_nav_setting" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_nav_vod_selected" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/ic_nav_vod" android:state_checked="false" />
|
||||
</selector>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/yellow_500" />
|
||||
<corners android:radius="8dp" />
|
||||
<padding
|
||||
android:bottom="14dp"
|
||||
android:left="12dp"
|
||||
android:right="12dp"
|
||||
android:top="14dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="14dp" />
|
||||
<solid android:color="#212121" />
|
||||
</shape>
|
||||
@@ -4,9 +4,6 @@
|
||||
<item android:id="@android:id/background">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/black_20" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#BDBDBD" />
|
||||
<corners android:radius="8dp" />
|
||||
<padding
|
||||
android:bottom="14dp"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="14dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/white_10" />
|
||||
</shape>
|
||||
@@ -0,0 +1,235 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black_20">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="marquee"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
tools:text="慶餘年第一季:第一集" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/size"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
tools:text="1920 x 1080" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_battery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="21:30 | 85%" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cast"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_control_cast" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/info"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_control_info" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/keep"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_control_keep_off" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/setting"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_control_setting" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/prevRoot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_control"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/prev"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/exo_icon_previous" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:background="@drawable/shape_control">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/play"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/exo_icon_play" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/nextRoot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_control"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/next"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/exo_icon_next" />
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/danmaku"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_control_danmaku_on" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/right"
|
||||
layout="@layout/view_control_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="8dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/parse"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tools:itemCount="5"
|
||||
tools:listitem="@layout/adapter_parse_dark" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<com.fongmi.android.tv.ui.custom.CustomSeekView
|
||||
android:id="@+id/seek"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/full"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_control_full" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
android:id="@+id/action"
|
||||
layout="@layout/view_control_vod_action"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -14,14 +14,14 @@
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:id="@+id/navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="68dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@color/transparent"
|
||||
app:elevation="0dp"
|
||||
app:itemIconSize="24dp"
|
||||
app:itemIconTint="@color/nav"
|
||||
app:itemTextColor="@color/nav"
|
||||
app:labelVisibilityMode="labeled"
|
||||
app:labelVisibilityMode="unlabeled"
|
||||
app:itemActiveIndicatorStyle="@style/Indicator"
|
||||
app:menu="@menu/menu_nav" />
|
||||
|
||||
|
||||
@@ -6,17 +6,37 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/text"
|
||||
style="@style/Widget.App.Button.OutlinedButton.SiteDialog"
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="14sp"
|
||||
tools:text="https://fongmi.github.io/cat.json" />
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_site_dialog"
|
||||
android:gravity="center"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="14dp"
|
||||
android:paddingBottom="14dp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="14sp"
|
||||
tools:text="https://fongmi.github.io/cat.json" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/copy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_setting_copy" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delete"
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="24dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="关于"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="开发说明"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="本项目仅用于学习Android开发,代码改自FongMi/TV (https://github.com/FongMi/TV)。"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="免责声明"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1.本项目仅供学习交流使用,不得用于商业用途\n2.项目中的内容均来自网络,如有侵权请联系删除\n3.使用本项目产生的一切后果由使用者自行承担"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:layout_marginTop="8dp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/github"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/shape_about_button"
|
||||
android:text="我的GitHub"
|
||||
android:textColor="#212121"
|
||||
android:textSize="14sp"
|
||||
android:padding="12dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -58,15 +58,31 @@
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<!-- 源管理分组 -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/setting_source"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:alpha="0.7" />
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/setting_source"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:alpha="0.7" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="(长按输入框可改源名)"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"
|
||||
android:alpha="0.5" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -259,6 +275,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_control_setting"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -269,24 +292,31 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/incognito"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:id="@+id/incognito"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/setting_incognito"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_setting_incognito"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/setting_incognito"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/incognitoSwitch"
|
||||
@@ -303,6 +333,13 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_setting_size"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -342,6 +379,13 @@
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_setting_doh"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -368,6 +412,13 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_fab_link"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -395,6 +446,13 @@
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_folder"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -434,62 +492,121 @@
|
||||
android:orientation="horizontal"
|
||||
android:padding="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/backup"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/setting_backup"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_file"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/backup"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/setting_backup"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/restore"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="end"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/setting_restore"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/restore"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:gravity="end"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:text="@string/setting_restore"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/version"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/version"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@string/setting_version"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_setting_github"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/versionText"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@string/setting_version"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/versionText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="1.2.1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/about"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
tools:text="1.2.1" />
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/shape_item"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:src="@drawable/ic_control_info"
|
||||
android:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="关于"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -55,7 +55,10 @@
|
||||
android:layout_height="match_parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:paddingStart="24dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/render"
|
||||
|
||||
@@ -47,6 +47,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time_battery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
tools:text="21:30 | 85%" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cast"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:src="@drawable/ic_empty" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/error_no_live" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -60,7 +60,8 @@
|
||||
</style>
|
||||
|
||||
<style name="Indicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
|
||||
<item name="android:color">#1F1F1F</item>
|
||||
<item name="android:color">@color/primary</item>
|
||||
<item name="android:height">42dp</item>
|
||||
</style>
|
||||
|
||||
<style name="BottomNavigationView.TextAppearance" parent="TextAppearance.AppCompat">
|
||||
@@ -69,10 +70,12 @@
|
||||
</style>
|
||||
|
||||
<style name="BottomNavigation" parent="Widget.Material3.BottomNavigationView">
|
||||
<item name="itemPaddingTop">8dp</item>
|
||||
<item name="itemPaddingBottom">8dp</item>
|
||||
<item name="itemPaddingTop">4dp</item>
|
||||
<item name="itemPaddingBottom">4dp</item>
|
||||
<item name="itemTextAppearanceActive">@style/BottomNavigationView.TextAppearance</item>
|
||||
<item name="itemTextAppearanceInactive">@style/BottomNavigationView.TextAppearance</item>
|
||||
<item name="itemRippleColor">@android:color/transparent</item>
|
||||
<item name="android:background">@null</item>
|
||||
</style>
|
||||
|
||||
<!-- M3 Switch Style -->
|
||||
|
||||
Reference in New Issue
Block a user