File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed
assists-web/src/main/java/com/ven/assists/web
assists/src/main/java/com/ven/assists Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ class ASJavascriptInterface(val webView: WebView) {
318318 val minWidth = request.arguments?.get(" minWidth" )?.asInt ? : (ScreenUtils .getScreenWidth() * 0.5 ).toInt()
319319 val minHeight = request.arguments?.get(" minHeight" )?.asInt ? : (ScreenUtils .getScreenHeight() * 0.5 ).toInt()
320320 val initialCenter = request.arguments?.get(" initialCenter" )?.asBoolean ? : true
321- val keepScreenOn = request.arguments?.get(" keepScreenOn" )?.asBoolean ? : true
321+ val keepScreenOn = request.arguments?.get(" keepScreenOn" )?.asBoolean ? : false
322322 val webWindowBinding = WebFloatingWindowBinding .inflate(LayoutInflater .from(AssistsService .instance)).apply {
323323 webView.loadUrl(url)
324324 webView.setBackgroundColor(0 )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.ven.assists.web
33import android.app.Activity
44import android.app.Application
55import android.content.Intent
6+ import android.os.Build
67import android.os.Bundle
78import androidx.activity.ComponentActivity
89import androidx.activity.result.ActivityResult
@@ -39,9 +40,12 @@ class CustomFileProvider : FileProvider() {
3940 }
4041 }
4142
42- clearIds.forEach { NodeCacheManager .cache.remove(it) }
43-
44- // LogUtils.dTag("NodeCacheManager", "cache size",NodeCacheManager.cache.size)
43+ clearIds.forEach {
44+ if (Build .VERSION .SDK_INT < Build .VERSION_CODES .UPSIDE_DOWN_CAKE ) { // Android 14 以下
45+ runCatching { NodeCacheManager .cache[it]?.get()?.recycle() }
46+ }
47+ NodeCacheManager .cache.remove(it)
48+ }
4549 }
4650
4751 delay(1000 )
@@ -108,6 +112,7 @@ class CustomFileProvider : FileProvider() {
108112 return result.getOrNull()
109113
110114 }
115+
111116 suspend fun requestLaunchersScan (scanOptions : ScanOptions ): ScanIntentResult ? {
112117 val result = runCatching {
113118 currentCompletableDeferredScan?.completeExceptionally(RuntimeException (" reset" ))
Original file line number Diff line number Diff line change @@ -169,11 +169,11 @@ object AssistsCore {
169169 /* *
170170 * 屏幕保持常亮
171171 */
172- fun keepScreenOn (tip : String = "") {
172+ fun keepScreenOn (tip : String = "屏幕保持常亮 ") {
173173 if (AssistsWindowManager .contains(" keepScreenOn" )) return
174174 AssistsService .instance?.let {
175175 AssistsWindowManager .add(FrameLayout (it).apply {
176- // setBackgroundColor("#80000000".toColorInt())
176+ setBackgroundColor(" #80000000" .toColorInt())
177177 addView(TextView (it).apply {
178178 text = tip
179179 setTextColor(" #80FF0000" .toColorInt())
You can’t perform that action at this time.
0 commit comments