Skip to content

Commit

Permalink
全局高刷新率 #101
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Jun 19, 2024
1 parent b5557de commit 2e588b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/org/b3log/siyuan/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import org.b3log.siyuan.common.ForegroundPushManager
import org.b3log.siyuan.services.BootService
import sc.windom.sofill.S
import sc.windom.sofill.U
import sc.windom.sofill.Us.U_Phone.setPreferredDisplayMode
import java.net.InetAddress
import java.net.UnknownHostException

Expand Down Expand Up @@ -154,6 +155,7 @@ class App : Application() {
TAG,
"onActivityPreCreated() invoked -> Activity : ${activity.javaClass.simpleName}"
)
activity.setPreferredDisplayMode() // 全局高刷新率
super.onActivityPreCreated(activity, savedInstanceState)
}

Expand Down
3 changes: 0 additions & 3 deletions app/src/main/java/org/b3log/siyuan/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,6 @@ protected void onCreate(final Bundle savedInstanceState) { // 只执行一次。
mmkv = MMKV.defaultMMKV();
// 注册 EventBus
EventBus.getDefault().register(this);
// 适配高刷新率
U_Phone.setPreferredDisplayMode(this);

// 获取OnBackPressedDispatcher
OnBackPressedDispatcher onBackPressedDispatcher = getOnBackPressedDispatcher();

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/sc/windom/sofill/Us/U_Phone.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object U_Phone {
}
}

Log.d(TAG, "preferredMode mode: $preferredMode")
Log.d(TAG, "apply preferredMode mode: $preferredMode to ${this.javaClass.simpleName}")
val params = window.attributes
params.preferredDisplayModeId = preferredMode.modeId
window.attributes = params
Expand Down

0 comments on commit 2e588b6

Please sign in to comment.