Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8579905949 | |||
| 6d6239e602 | |||
| 81832a055e | |||
| 4ec3c434b2 | |||
| d47f8d5cd4 | |||
| 5f7df956c3 | |||
| beaf3b30f6 | |||
| 730c6cc7a7 | |||
| 7c1744b366 | |||
| 1b61870cd4 | |||
| 0dcc0e6da1 | |||
| 592bcff438 | |||
| 6af8908670 | |||
| 993ef78d4d | |||
| 53ef17c01d |
@@ -1,5 +1,17 @@
|
||||
# XMBOX
|
||||
|
||||
各模块说明:
|
||||
|
||||
- app - 主要的应用程序代码
|
||||
- catvod - 视频点播相关功能
|
||||
- forcetech - 强制技术相关功能
|
||||
- hook - 钩子功能
|
||||
- jianpian - 剪片相关功能
|
||||
- quickjs - JavaScript 引擎
|
||||
- thunder - 迅雷下载相关功能
|
||||
- tvbus - TV 总线功能
|
||||
- zlive - 直播相关功能
|
||||
|
||||
一个简单的视频播放器应用,支持以下功能:
|
||||
|
||||
## 主要功能
|
||||
@@ -14,11 +26,6 @@
|
||||
- 支持 TV 和手机双平台
|
||||
- Material Design 界面设计
|
||||
|
||||
## 应用截图
|
||||
- 视频列表
|
||||
- 播放界面
|
||||
- 设置中心
|
||||
|
||||
## 开发说明
|
||||
本项目仅用于学习 Android 开发,代码改自 [FongMi/TV](https://github.com/FongMi/TV)。
|
||||
|
||||
@@ -267,15 +274,3 @@ getProxy(boolean local)
|
||||
[直播-線上](other/sample/live/online.json)
|
||||
[直播-本地](other/sample/live/offline.json)
|
||||
|
||||
### 飛機群
|
||||
|
||||
[討論群組](https://t.me/+qTlg0qAVzP9kMmM1)
|
||||
[發布頻道](https://t.me/fongmi_release)
|
||||
|
||||
### 贊助
|
||||
|
||||

|
||||
|
||||
### Star
|
||||
|
||||
[](https://www.star-history.com/#FongMi/TV&Date)
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "v3.0.1",
|
||||
"code": 301,
|
||||
"desc": "1. 优化项目结构,重新组织各功能模块\n2. 更新移动端界面,优化用户体验\n3. 强制使用深色模式,提供更好的观看体验"
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "v3.0.1",
|
||||
"code": 301,
|
||||
"desc": "1. 优化项目结构,重新组织各功能模块\n2. 更新移动端界面,优化用户体验\n3. 强制使用深色模式,提供更好的观看体验"
|
||||
}
|
||||
+2
-2
@@ -22,8 +22,8 @@ android {
|
||||
minSdk 21
|
||||
//noinspection ExpiredTargetSdkVersion
|
||||
targetSdk 28
|
||||
versionCode 300
|
||||
versionName "3.0.0"
|
||||
versionCode 302
|
||||
versionName "3.0.2"
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = ["room.schemaLocation": "$projectDir/schemas".toString(), "eventBusIndex": "com.fongmi.android.tv.event.EventIndex"]
|
||||
|
||||
@@ -4,8 +4,11 @@ import android.Manifest;
|
||||
import android.app.Notification;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Gravity;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -25,6 +28,7 @@ public class Notify {
|
||||
public static final int ID = 9527;
|
||||
private AlertDialog mDialog;
|
||||
private Toast mToast;
|
||||
private Handler mHandler;
|
||||
|
||||
private static class Loader {
|
||||
static volatile Notify INSTANCE = new Notify();
|
||||
@@ -57,6 +61,14 @@ public class Notify {
|
||||
get().makeText(text);
|
||||
}
|
||||
|
||||
public static void showCenter(int resId) {
|
||||
if (resId != 0) showCenter(ResUtil.getString(resId));
|
||||
}
|
||||
|
||||
public static void showCenter(String text) {
|
||||
get().makeTextCenter(text);
|
||||
}
|
||||
|
||||
public static void progress(Context context) {
|
||||
dismiss();
|
||||
get().create(context);
|
||||
@@ -86,4 +98,23 @@ public class Notify {
|
||||
mToast.setDuration(Toast.LENGTH_LONG);
|
||||
mToast.show();
|
||||
}
|
||||
|
||||
private void makeTextCenter(String message) {
|
||||
if (mToast != null) mToast.cancel();
|
||||
if (mHandler == null) mHandler = new Handler(Looper.getMainLooper());
|
||||
if (TextUtils.isEmpty(message)) return;
|
||||
mToast = new Toast(App.get());
|
||||
TextView view = (TextView) LayoutInflater.from(App.get()).inflate(R.layout.view_toast, null);
|
||||
view.setText(message);
|
||||
mToast.setView(view);
|
||||
mToast.setDuration(Toast.LENGTH_SHORT);
|
||||
mToast.setGravity(Gravity.CENTER, 0, 0);
|
||||
mToast.show();
|
||||
|
||||
// 1秒后取消Toast
|
||||
mHandler.removeCallbacksAndMessages(null);
|
||||
mHandler.postDelayed(() -> {
|
||||
if (mToast != null) mToast.cancel();
|
||||
}, 1000); // 1000毫秒 = 1秒
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.view.WindowManager;
|
||||
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.viewbinding.ViewBinding;
|
||||
|
||||
import com.fongmi.android.tv.R;
|
||||
@@ -32,6 +33,7 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
super.onCreate(savedInstanceState);
|
||||
if (transparent()) setTransparent(this);
|
||||
setContentView(getBinding().getRoot());
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package com.fongmi.android.tv.ui.dialog;
|
||||
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.fongmi.android.tv.App;
|
||||
import com.fongmi.android.tv.bean.Config;
|
||||
import com.fongmi.android.tv.databinding.DialogHistoryBinding;
|
||||
import com.fongmi.android.tv.impl.ConfigCallback;
|
||||
import com.fongmi.android.tv.ui.adapter.ConfigAdapter;
|
||||
import com.fongmi.android.tv.ui.custom.SpaceItemDecoration;
|
||||
import com.fongmi.android.tv.utils.Notify;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
||||
@@ -45,7 +50,6 @@ public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
||||
binding.recycler.setHasFixedSize(true);
|
||||
binding.recycler.setAdapter(adapter.addAll(type));
|
||||
binding.recycler.addItemDecoration(new SpaceItemDecoration(1, 8));
|
||||
binding.recycler.post(() -> binding.recycler.scrollToPosition(0));
|
||||
}
|
||||
|
||||
private void setDialog() {
|
||||
@@ -60,6 +64,13 @@ public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCopyClick(Config item) {
|
||||
ClipboardManager manager = (ClipboardManager) App.get().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
manager.setPrimaryClip(ClipData.newPlainText("url", item.getUrl()));
|
||||
Notify.showCenter("复制成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeleteClick(Config item) {
|
||||
if (adapter.remove(item) == 0) dialog.dismiss();
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
<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"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<item name="android:windowTranslucentStatus">false</item>
|
||||
</style>
|
||||
|
||||
<style name="BaseTheme" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<style name="BaseTheme" parent="Theme.Material3.Dark.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primaryDark</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
@@ -40,7 +40,7 @@
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
|
||||
<style name="BottomSheetDialog" parent="Theme.Material3.DayNight.BottomSheetDialog">
|
||||
<style name="BottomSheetDialog" parent="Theme.Material3.Dark.BottomSheetDialog">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primaryDark</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
@@ -60,7 +60,7 @@
|
||||
</style>
|
||||
|
||||
<style name="Indicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
|
||||
<item name="android:color">@color/indicator</item>
|
||||
<item name="android:color">#1F1F1F</item>
|
||||
</style>
|
||||
|
||||
<style name="BottomNavigationView.TextAppearance" parent="TextAppearance.AppCompat">
|
||||
|
||||
Reference in New Issue
Block a user