Skip to content

Commit 9f9111b

Browse files
committed
Update
1 parent bf32013 commit 9f9111b

4 files changed

Lines changed: 155 additions & 130 deletions

File tree

app/src/main/assets/home/etc/start-early.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if checkonline; then
1010
echo -e "Download the log and the latest version..."
1111
timeout 20 taive 'https://raw.githubusercontent.com/Zenlua/Tool-Tree/refs/heads/main/Version.md' $TEMP/Version.md
1212
if [ -f $TEMP/Version.md ]; then
13-
sed -e 's|\*\*||g' -e 's|+|•|g' $TEMP/Version.md | awk 'BEGIN{RS="Version:"} NR>=2 && NR<=5 {printf "Version:%s", $0}' | trans -b "$LANGUAGE-$COUNTRY" > $TEMP/version.txt
13+
sed -e 's|\*\*||g' -e 's|+|•|g' $TEMP/Version.md | awk 'BEGIN{RS="Version:"} NR>=2 && NR<=6 {printf "Version:%s", $0}' | trans -b "$LANGUAGE-$COUNTRY" > $TEMP/version.txt
1414
fi
1515

1616
# Thông báo cập nhật

app/src/main/assets/home/etc/tool-tree.rc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ fi
479479
</action>
480480
<text>
481481
<desc>'"$(cat $TEMP/version.txt 2>/dev/null)"'</desc>
482+
<slices>
483+
<slice photo="'$ETC'/icon/tool-tree.jpg" />
484+
</slices>
482485
</text>
483486
</group>'
484487
}

app/src/main/java/com/omarea/common/ui/DialogHelper.kt

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -405,48 +405,37 @@ class DialogHelper {
405405
// Trong setWindowBlurBg
406406
fun setWindowBlurBg(window: Window, activity: Activity) {
407407
val wallpaperMode = activity.window.attributes.flags and WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER != 0
408-
409-
if (disableBlurBg) {
410-
window.applyDefaultBackground(activity, wallpaperMode)
411-
return
412-
}
413-
414-
FastBlurUtility.getBlurBackgroundAsync(activity) { blurBitmap ->
415-
// An toàn: Không làm việc với activity đã đóng
416-
if (activity.isFinishing || activity.isDestroyed) {
417-
blurBitmap?.recycle()
418-
return@getBlurBackgroundAsync
408+
window.run {
409+
val blurBitmap = if (disableBlurBg) {
410+
null
411+
} else {
412+
FastBlurUtility.getBlurBackgroundDrawer(activity)
419413
}
420-
421414
if (blurBitmap != null) {
422-
window.setBackgroundDrawable(BitmapDrawable(activity.resources, blurBitmap))
415+
setBackgroundDrawable(blurBitmap.toDrawable(activity.resources))
423416
} else {
424-
window.applyDefaultBackground(activity, wallpaperMode)
425-
}
426-
}
427-
}
428-
429-
// Tách logic nền mặc định ra để tái sử dụng
430-
private fun Window.applyDefaultBackground(activity: Activity, wallpaperMode: Boolean) {
431-
try {
432-
val bg = getWindowBackground(activity)
433-
if (bg == Color.TRANSPARENT) {
434-
if (isFloating) {
435-
setBackgroundDrawable(bg.toDrawable())
436-
setDimAmount(0.5f)
437-
} else {
438-
val d = if (wallpaperMode || isNightMode(context)) {
439-
Color.argb(255, 18, 18, 18).toDrawable()
417+
try {
418+
val bg = getWindowBackground(activity)
419+
if (bg == Color.TRANSPARENT) {
420+
if (isFloating) {
421+
setBackgroundDrawable(bg.toDrawable())
422+
setDimAmount(0.5f)
423+
return
424+
} else {
425+
val d = if (wallpaperMode || isNightMode(context)) {
426+
Color.argb(255, 18, 18, 18).toDrawable()
427+
} else {
428+
Color.argb(255, 245, 245, 245).toDrawable()
429+
}
430+
setBackgroundDrawable(d)
431+
}
440432
} else {
441-
Color.argb(255, 245, 245, 245).toDrawable()
433+
setBackgroundDrawable(bg.toDrawable())
442434
}
443-
setBackgroundDrawable(d)
435+
} catch (_: Exception) {
436+
setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
444437
}
445-
} else {
446-
setBackgroundDrawable(bg.toDrawable())
447438
}
448-
} catch (_: Exception) {
449-
setBackgroundDrawable(Color.TRANSPARENT.toDrawable())
450439
}
451440
}
452441
}

0 commit comments

Comments
 (0)