Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8579905949 | |||
| 6d6239e602 | |||
| 81832a055e | |||
| 4ec3c434b2 |
@@ -26,11 +26,6 @@
|
|||||||
- 支持 TV 和手机双平台
|
- 支持 TV 和手机双平台
|
||||||
- Material Design 界面设计
|
- Material Design 界面设计
|
||||||
|
|
||||||
## 应用截图
|
|
||||||
- 视频列表
|
|
||||||
- 播放界面
|
|
||||||
- 设置中心
|
|
||||||
|
|
||||||
## 开发说明
|
## 开发说明
|
||||||
本项目仅用于学习 Android 开发,代码改自 [FongMi/TV](https://github.com/FongMi/TV)。
|
本项目仅用于学习 Android 开发,代码改自 [FongMi/TV](https://github.com/FongMi/TV)。
|
||||||
|
|
||||||
|
|||||||
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
|
minSdk 21
|
||||||
//noinspection ExpiredTargetSdkVersion
|
//noinspection ExpiredTargetSdkVersion
|
||||||
targetSdk 28
|
targetSdk 28
|
||||||
versionCode 300
|
versionCode 302
|
||||||
versionName "3.0.0"
|
versionName "3.0.2"
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
annotationProcessorOptions {
|
annotationProcessorOptions {
|
||||||
arguments = ["room.schemaLocation": "$projectDir/schemas".toString(), "eventBusIndex": "com.fongmi.android.tv.event.EventIndex"]
|
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.app.Notification;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Gravity;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@@ -25,6 +28,7 @@ public class Notify {
|
|||||||
public static final int ID = 9527;
|
public static final int ID = 9527;
|
||||||
private AlertDialog mDialog;
|
private AlertDialog mDialog;
|
||||||
private Toast mToast;
|
private Toast mToast;
|
||||||
|
private Handler mHandler;
|
||||||
|
|
||||||
private static class Loader {
|
private static class Loader {
|
||||||
static volatile Notify INSTANCE = new Notify();
|
static volatile Notify INSTANCE = new Notify();
|
||||||
@@ -57,6 +61,14 @@ public class Notify {
|
|||||||
get().makeText(text);
|
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) {
|
public static void progress(Context context) {
|
||||||
dismiss();
|
dismiss();
|
||||||
get().create(context);
|
get().create(context);
|
||||||
@@ -86,4 +98,23 @@ public class Notify {
|
|||||||
mToast.setDuration(Toast.LENGTH_LONG);
|
mToast.setDuration(Toast.LENGTH_LONG);
|
||||||
mToast.show();
|
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秒
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
package com.fongmi.android.tv.ui.dialog;
|
package com.fongmi.android.tv.ui.dialog;
|
||||||
|
|
||||||
|
import android.content.ClipData;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
|
import com.fongmi.android.tv.App;
|
||||||
import com.fongmi.android.tv.bean.Config;
|
import com.fongmi.android.tv.bean.Config;
|
||||||
import com.fongmi.android.tv.databinding.DialogHistoryBinding;
|
import com.fongmi.android.tv.databinding.DialogHistoryBinding;
|
||||||
import com.fongmi.android.tv.impl.ConfigCallback;
|
import com.fongmi.android.tv.impl.ConfigCallback;
|
||||||
import com.fongmi.android.tv.ui.adapter.ConfigAdapter;
|
import com.fongmi.android.tv.ui.adapter.ConfigAdapter;
|
||||||
import com.fongmi.android.tv.ui.custom.SpaceItemDecoration;
|
import com.fongmi.android.tv.ui.custom.SpaceItemDecoration;
|
||||||
|
import com.fongmi.android.tv.utils.Notify;
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
|
|
||||||
public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
||||||
@@ -45,7 +50,6 @@ public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
|||||||
binding.recycler.setHasFixedSize(true);
|
binding.recycler.setHasFixedSize(true);
|
||||||
binding.recycler.setAdapter(adapter.addAll(type));
|
binding.recycler.setAdapter(adapter.addAll(type));
|
||||||
binding.recycler.addItemDecoration(new SpaceItemDecoration(1, 8));
|
binding.recycler.addItemDecoration(new SpaceItemDecoration(1, 8));
|
||||||
binding.recycler.post(() -> binding.recycler.scrollToPosition(0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDialog() {
|
private void setDialog() {
|
||||||
@@ -60,6 +64,13 @@ public class HistoryDialog implements ConfigAdapter.OnClickListener {
|
|||||||
dialog.dismiss();
|
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
|
@Override
|
||||||
public void onDeleteClick(Config item) {
|
public void onDeleteClick(Config item) {
|
||||||
if (adapter.remove(item) == 0) dialog.dismiss();
|
if (adapter.remove(item) == 0) dialog.dismiss();
|
||||||
|
|||||||
Reference in New Issue
Block a user