Skip to content

Commit

Permalink
feat: home - Optimized app launch delay
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Dec 8, 2024
1 parent e7e5f70 commit 693d825
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -293,6 +294,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -293,6 +294,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -292,6 +293,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -284,6 +285,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -287,6 +288,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
import com.sevtinge.hyperceiler.module.hook.home.other.OptAppLaunchDelay;
import com.sevtinge.hyperceiler.module.hook.home.other.OverlapMode;
import com.sevtinge.hyperceiler.module.hook.home.other.ShortcutItemCount;
import com.sevtinge.hyperceiler.module.hook.home.other.ShowAllHideApp;
Expand Down Expand Up @@ -286,6 +287,7 @@ public void handleLoadPackage() {
// initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));
initHook(new HideReportText(), mPrefsMap.getBoolean("home_title_hide_report_text"));
initHook(new DisablePrestart(), mPrefsMap.getBoolean("home_other_disable_prestart"));
initHook(new OptAppLaunchDelay(), mPrefsMap.getBoolean("home_other_opt_app_launch_delay"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* This file is part of HyperCeiler.
*
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/

package com.sevtinge.hyperceiler.module.hook.home.other;

import com.sevtinge.hyperceiler.module.base.BaseHook;

// from nakixii
public class OptAppLaunchDelay extends BaseHook {
@Override
public void init() throws NoSuchMethodException {
findAndHookMethod("com.android.systemui.shared.recents.utilities.WindowTransitionCallbackHelper", "executeFinishCallback", boolean.class, boolean.class, int.class, "android.window.WindowContainerTransaction", "com.android.systemui.shared.recents.utilities.ShellTransitionCallback", boolean.class, boolean.class, new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
param.args[5] = false;
}
});
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@
<string name="home_other_mi_pad_enable_more_setting_title">解锁桌面设置更多选项</string>
<string name="home_other_mi_pad_enable_more_setting_desc">解锁后的功能不一定可用,部分功能需要系统底层支持</string>
<string name="home_other_disable_prestart">禁用应用预加载</string>
<string name="home_other_opt_app_launch_delay">优化应用启动延迟</string>

<string name="home_recent_blur_level">模糊等级</string>
<string name="home_recent_complete_blur_plus">完整模糊补充 (实验性)</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,7 @@
<string name="home_other_mi_pad_enable_more_setting_title">Unlock more options for Home screen settings</string>
<string name="home_other_mi_pad_enable_more_setting_desc">The unlocked features may not be available, and some features require support from the underlying system.</string>
<string name="home_other_disable_prestart">Disable app preload</string>
<string name="home_other_opt_app_launch_delay">Optimized app launch delay</string>
<!--Gallery Editor-->
<string name="mediaeditor">Gallery Editor</string>
<string name="mediaeditor_foundation">Foundation</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/home_other.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
android:key="prefs_key_home_other_disable_prestart"
android:title="@string/home_other_disable_prestart" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_home_other_opt_app_launch_delay"
android:title="@string/home_other_opt_app_launch_delay" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_home_other_user_present_animation"
Expand Down

0 comments on commit 693d825

Please sign in to comment.