Skip to content

Commit

Permalink
optimize compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
GangJust committed Apr 30, 2024
1 parent 2cc8510 commit 16f3083
Show file tree
Hide file tree
Showing 49 changed files with 2,102 additions and 934 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "io.github.fplus"
minSdk 24
targetSdk 33
versionCode 122
versionName "1.2.8"
versionCode 123
versionName "1.2.9"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/assets/update.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
v1.2.9
增加底部选项自定义关键字隐藏
增加部分误触复确认弹窗提示
增加崩溃拦截容错处理选项
调整获取下载链接为随机下标
调整空闲退出在直播间时暂停计时
修复清爽模式长按偶弹官方菜单问题
移除双击视频暂停选项
调整部分逻辑(可能需要重新设置模块)

v1.2.8
修复定时、空闲后台重复退出问题
移除启动时底部提示
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/assets/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.8-122
1.2.9-123
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public abstract class Aweme {

public List<ImageUrlStruct> images;

public String shareUrl;

public Aweme() {
throw new RuntimeException("stub!!");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.ss.android.ugc.aweme.feed.model;

public class VideoItemParams {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.ss.android.ugc.aweme.live

import android.app.Activity

class LivePlayActivity : Activity() {

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,8 @@ public class User {

public String uid;


//1: 已关注, 0: 未关注
public int getFollowStatus() {
throw new RuntimeException("Stub!");
}
}
30 changes: 24 additions & 6 deletions core/src/main/java/io/github/fplus/core/base/BaseHook.kt
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,20 @@ abstract class BaseHook<T> : HookEntity<T>() {
}

@Synchronized
fun showDialog(view: View) {
fun showDialog(
view: View,
onDismiss: () -> Unit = {},
) {
kDialog = if (kDialog == null) KDialog() else kDialog
kDialog!!.setView(view)
kDialog!!.show()
kDialog!!.setOnDismissListener { onDismiss.invoke() }
}

@Synchronized
fun showComposeDialog(
context: Context,
onDismiss: () -> Unit = {},
content: @Composable (closeHandler: () -> Unit) -> Unit
) {
XplerDialogWrapper(context).apply {
Expand All @@ -145,6 +150,9 @@ abstract class BaseHook<T> : HookEntity<T>() {
content.invoke(this::dismiss)
}
}
setOnDismissListener {
onDismiss.invoke()
}
}.show()
}

Expand All @@ -157,6 +165,7 @@ abstract class BaseHook<T> : HookEntity<T>() {
singleButton: Boolean = false, // 只会响应 onConfirm 方法
onConfirm: () -> Unit = {},
onCancel: () -> Unit = {},
onDismiss: () -> Unit = {},
) {
val isDarkMode = context.isDarkMode
val dialogView = context.inflateModuleView<FrameLayout>(R.layout.dialog_message_layout)
Expand Down Expand Up @@ -202,14 +211,18 @@ abstract class BaseHook<T> : HookEntity<T>() {
onConfirm.invoke()
}

showDialog(binding.root)
showDialog(
view = binding.root,
onDismiss = onDismiss,
)
}

fun showProgressDialog(
context: Context,
title: CharSequence,
progress: Int = 0,
listener: (dialog: KDialog, progress: ProgressDialogNotification) -> Unit,
onDismiss: () -> Unit = {},
) {
val isDarkMode = context.isDarkMode
val dialogView = KtXposedHelpers.inflateView<FrameLayout>(context, R.layout.dialog_progress_layout)
Expand All @@ -232,7 +245,10 @@ abstract class BaseHook<T> : HookEntity<T>() {
)
)

showDialog(binding.root)
showDialog(
view = binding.root,
onDismiss = onDismiss
)
}

fun showInputChoiceDialog(
Expand All @@ -247,6 +263,7 @@ abstract class BaseHook<T> : HookEntity<T>() {
cancel: CharSequence = "取消",
onChoice: (view: View, input1: String, input2: String, item: CharSequence, position: Int) -> Unit,
onCancel: () -> Unit = {},
onDismiss: () -> Unit = {},
) {
val isDarkMode = context.isDarkMode
val dialogView = KtXposedHelpers.inflateView<FrameLayout>(context, R.layout.dialog_input_choice_layout)
Expand Down Expand Up @@ -315,7 +332,10 @@ abstract class BaseHook<T> : HookEntity<T>() {
)
}

showDialog(binding.root)
showDialog(
view = binding.root,
onDismiss = onDismiss
)
}

fun showChoiceDialog(
Expand Down Expand Up @@ -371,7 +391,6 @@ abstract class BaseHook<T> : HookEntity<T>() {
showDialog(binding.root)
}


private fun getHintTextColor(isDarkMode: Boolean): Int {
return if (isDarkMode) {
Color.parseColor("#FFAAAAAA")
Expand All @@ -396,7 +415,6 @@ abstract class BaseHook<T> : HookEntity<T>() {
}
}


fun showNotification(
context: Context,
notifyId: Int,
Expand Down
76 changes: 60 additions & 16 deletions core/src/main/java/io/github/fplus/core/config/ConfigV1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,35 @@ class ConfigV1 private constructor() {
}

/// 按视频创作者单独创建文件夹
var isOwnerDir: Boolean = false
var ownerDir: Boolean = false
get() {
field = mmkv.getBoolean("isOwnerDir", false)
field = mmkv.getBoolean("ownerDir", false)
return field
}
set(value) {
mmkv.putBoolean("isOwnerDir", value)
mmkv.putBoolean("ownerDir", value)
field = value
}

/// 通知栏下载
var isNotification: Boolean = false
var notificationDownload: Boolean = false
get() {
field = mmkv.getBoolean("isNotification", false)
field = mmkv.getBoolean("notificationDownload", false)
return field
}
set(value) {
mmkv.putBoolean("isNotification", value)
mmkv.putBoolean("notificationDownload", value)
field = value
}

/// 复制链接时弹出下载
var isCopyDownload: Boolean = false
var copyLinkDownload: Boolean = false
get() {
field = mmkv.getBoolean("isCopyDownload", false)
field = mmkv.getBoolean("copyLinkDownload", false)
return field
}
set(value) {
mmkv.putBoolean("isCopyDownload", value)
mmkv.putBoolean("copyLinkDownload", value)
field = value
}

Expand All @@ -103,24 +103,24 @@ class ConfigV1 private constructor() {
}

/// 表情包/评论区视频、图片保存
var isEmoji: Boolean = false
var isEmojiDownload: Boolean = false
get() {
field = mmkv.getBoolean("isEmoji", false)
field = mmkv.getBoolean("isEmojiDownload", false)
return field
}
set(value) {
mmkv.putBoolean("isEmoji", value)
mmkv.putBoolean("isEmojiDownload", value)
field = value
}

/// 震动反馈
var isVibrate: Boolean = false
var vibrate: Boolean = false
get() {
field = mmkv.getBoolean("isVibrate", false)
field = mmkv.getBoolean("vibrate", false)
return field
}
set(value) {
mmkv.putBoolean("isVibrate", value)
mmkv.putBoolean("vibrate", value)
field = value
}

Expand Down Expand Up @@ -164,7 +164,7 @@ class ConfigV1 private constructor() {
field = value
}

/// 双击响应类型: 0=暂停视频, 1=打开评论, 2=点赞视频
/// 双击响应类型: 1=打开评论, 2=点赞视频
var doubleClickType: Int = 2
get() {
field = mmkv.getInt("doubleClickType", 2)
Expand Down Expand Up @@ -208,6 +208,28 @@ class ConfigV1 private constructor() {
field = value
}

/// 隐藏底部tab
var isHideBottomTab: Boolean = false
get() {
field = mmkv.getBoolean("isHideBottomTab", false)
return field
}
set(value) {
mmkv.putBoolean("isHideBottomTab", value)
field = value
}

/// 隐藏底部tab包含的关键字, 逗号隔开
var hideBottomTabKeywords: String = "商城, 朋友, 消息"
get() {
field = mmkv.getString("hideBottomTabKeywords", "商城, 朋友, 消息")!!
return field
}
set(value) {
mmkv.putString("hideBottomTabKeywords", value)
field = value
}

/// 隐藏底部加号按钮
var isHidePhotoButton: Boolean = false
get() {
Expand All @@ -230,6 +252,17 @@ class ConfigV1 private constructor() {
field = value
}

/// 手势误触复确认
var isPreventAccidentalTouch: Boolean = false
get() {
field = mmkv.getBoolean("isPreventAccidentalTouch", false)
return field
}
set(value) {
mmkv.putBoolean("isPreventAccidentalTouch", value)
field = value
}

/// 视频右侧控件栏
var isVideoOptionBarFilter: Boolean = false
get() {
Expand Down Expand Up @@ -525,6 +558,17 @@ class ConfigV1 private constructor() {
field = value
}

/// 崩溃容错
var isCrashTolerance: Boolean = false
get() {
field = mmkv.getBoolean("isCrashTolerance", false)
return field
}
set(value) {
mmkv.putBoolean("isCrashTolerance", value)
field = value
}

/// 去插件化
var isDisablePlugin: Boolean = false
get() {
Expand Down
Loading

0 comments on commit 16f3083

Please sign in to comment.