-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(launcher): Add recent tasks settings
- Added an option to force display memory usage in recent tasks. - Added a new page for recent tasks settings. - Adjusted icon and text size multiplier settings. Signed-off-by: suqi8 <[email protected]>
- Loading branch information
Showing
9 changed files
with
99 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/suqi8/oshin/hook/launcher/recent_task.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.suqi8.oshin.hook.launcher | ||
|
||
import android.annotation.SuppressLint | ||
import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker | ||
import com.highcapable.yukihookapi.hook.factory.method | ||
|
||
class recent_task: YukiBaseHooker() { | ||
@SuppressLint("UseCompatLoadingForDrawables", "SetTextI18n") | ||
override fun onHook() { | ||
loadApp("com.android.launcher"){ | ||
if (prefs("launcher\\recent_task").getBoolean("com_android_launcher_icon_text", false)) { | ||
"com.oplus.quickstep.memory.MemoryInfoManager".toClass().apply { | ||
method { | ||
name = "isAllowMemoryInfoDisplay" | ||
}.hook { | ||
after { | ||
args[0] = true | ||
} | ||
} | ||
} | ||
"com.oplus.quickstep.memory.MemoryInfoManager".toClass().apply { | ||
method { | ||
name = "needMemoryDetail" | ||
}.hook{ | ||
after { | ||
args[0] = true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/suqi8/oshin/ui/activity/com/android/launcher/recent_task.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.suqi8.oshin.ui.activity.com.android.launcher | ||
|
||
import android.annotation.SuppressLint | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import androidx.navigation.NavController | ||
import com.suqi8.oshin.R | ||
import com.suqi8.oshin.ui.activity.funlistui.FunPage | ||
import com.suqi8.oshin.ui.activity.funlistui.FunSwich | ||
import top.yukonga.miuix.kmp.basic.Card | ||
|
||
@SuppressLint("SuspiciousIndentation") | ||
@Composable | ||
fun recent_task(navController: NavController) { | ||
FunPage( | ||
title = stringResource(R.string.recent_tasks), | ||
appList = listOf("com.android.launcher"), | ||
navController = navController | ||
) { | ||
Card( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(horizontal = 12.dp) | ||
.padding(bottom = 6.dp, top = 15.dp) | ||
) { | ||
FunSwich( | ||
title = stringResource(R.string.force_display_memory), | ||
category = "launcher\\recent_task", | ||
key = "force_display_memory", | ||
defValue = false | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters