diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/ContentExtension.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/ContentExtension.java index cf09e53bdc..9d20fd36f8 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/ContentExtension.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/ContentExtension.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.app; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import com.sevtinge.hyperceiler.module.base.BaseModule; import com.sevtinge.hyperceiler.module.base.HookExpand; @@ -41,6 +41,6 @@ public void handleLoadPackage() { initHook(new Taplus(), mPrefsMap.getBoolean("security_center_taplus")); initHook(new LinkOpenMode(), true); initHook(HorizontalContentExtension.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus_horizontal")); - initHook(UnlockTaplus.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus") && isPad()); + initHook(UnlockTaplus.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus") && getIS_TABLET()); } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home/Phone/HomeT.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home/Phone/HomeT.java index cccd79cf51..513597b980 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home/Phone/HomeT.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/Home/Phone/HomeT.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.app.Home.Phone; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import com.sevtinge.hyperceiler.module.base.BaseModule; import com.sevtinge.hyperceiler.module.base.HookExpand; @@ -220,14 +220,14 @@ public void handleLoadPackage() { initHook(RecentResource.INSTANCE, mPrefsMap.getInt("task_view_corners", 20) != 20 || mPrefsMap.getInt("task_view_header_height", 40) != 40); initHook(RealMemory.INSTANCE, mPrefsMap.getBoolean("home_recent_show_real_memory")); - initHook(MemInfoShow.INSTANCE, mPrefsMap.getBoolean("home_recent_show_memory_info") && isPad()); + initHook(MemInfoShow.INSTANCE, mPrefsMap.getBoolean("home_recent_show_memory_info") && getIS_TABLET()); initHook(AlwaysShowCleanUp.INSTANCE, mPrefsMap.getBoolean("always_show_clean_up")); initHook(new BackgroundBlur(), mPrefsMap.getBoolean("home_recent_blur")); // 图标 initHook(BigIconCorner.INSTANCE, mPrefsMap.getBoolean("home_title_big_icon_corner")); initHook(new DownloadAnimation(), mPrefsMap.getBoolean("home_title_download_animation")); - initHook(DisableHideTheme.INSTANCE, mPrefsMap.getBoolean("home_title_disable_hide_theme") && isPad()); + initHook(DisableHideTheme.INSTANCE, mPrefsMap.getBoolean("home_title_disable_hide_theme") && getIS_TABLET()); initHook(DisableHideFile.INSTANCE, mPrefsMap.getBoolean("home_title_disable_hide_file")); initHook(DisableHideGoogle.INSTANCE, mPrefsMap.getBoolean("home_title_disable_hide_google")); initHook(new FakeNonDefaultIcon(), mPrefsMap.getBoolean("fake_non_default_icon")); @@ -267,7 +267,7 @@ public void handleLoadPackage() { initHook(new HomeMode(), mPrefsMap.getStringAsInt("home_other_home_mode", 0) > 0); initHook(AlwaysShowStatusClock.INSTANCE, mPrefsMap.getBoolean("home_other_show_clock")); initHook(new InfiniteScroll(), mPrefsMap.getBoolean("home_other_infinite_scroll")); - if (isPad()) { + if (getIS_TABLET()) { initHook(new FreeformShortcutMenu(), mPrefsMap.getBoolean("home_other_freeform_shortcut_menu")); initHook(new TasksShortcutMenu(), mPrefsMap.getBoolean("home_other_tasks_shortcut_menu")); } else { @@ -305,7 +305,7 @@ public void handleLoadPackage() { initHook(SetDeviceLevel.INSTANCE, mPrefsMap.getBoolean("home_other_high_models")); // 小米/红米平板相关 - if (isPad()) { + if (getIS_TABLET()) { boolean mMoreSetting = mPrefsMap.getBoolean("home_other_mi_pad_enable_more_setting"); initHook(SetGestureNeedFingerNum.INSTANCE, mPrefsMap.getBoolean("mipad_input_need_finger_num")); initHook(EnableMoreSetting.INSTANCE, mMoreSetting); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework/Phone/SystemFrameworkT.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework/Phone/SystemFrameworkT.java index 8e7601485e..95f1791ce4 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework/Phone/SystemFrameworkT.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemFramework/Phone/SystemFrameworkT.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.app.SystemFramework.Phone; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import com.sevtinge.hyperceiler.module.base.BaseModule; @@ -138,7 +138,7 @@ public void handleLoadPackage() { // initHook(new LocationSimulation(), false); // 小米/红米平板设置相关 - if (isPad()) { + if (getIS_TABLET()) { initHook(IgnoreStylusKeyGesture.INSTANCE, mPrefsMap.getBoolean("mipad_input_ingore_gesture")); initHook(NoMagicPointer.INSTANCE, mPrefsMap.getBoolean("mipad_input_close_magic")); initHook(RemoveStylusBluetoothRestriction.INSTANCE, mPrefsMap.getBoolean("mipad_input_disable_bluetooth")); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java b/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java index bf2371c038..0509efd540 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/base/BaseXposedInit.java @@ -191,9 +191,9 @@ private boolean invokeHookInit(LoadPackageParam lpparam) { if (mPkgName.equals(mPkg)) { // 需要限制安卓版本和设备取消这些注释,并删除下面的invoke方法。 // if (!isAndroidVersion(android)) continue; - // if (isPad() && isPad) { + // if (getIS_TABLET() && isPad) { // return invoke(lpparam, clzz); - // } else if (isPad() && !isPad) { + // } else if (getIS_TABLET() && !isPad) { // continue; // } else { // return invoke(lpparam, clzz); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/LockApp.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/LockApp.java index 819db5e3fb..2b349f4aff 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/LockApp.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/LockApp.java @@ -18,8 +18,6 @@ */ package com.sevtinge.hyperceiler.module.hook.home; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; - import android.content.Context; import android.database.ContentObserver; import android.os.Handler; @@ -32,6 +30,8 @@ import de.robv.android.xposed.XposedHelpers; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; + /** * @author 焕晨HChen */ @@ -42,7 +42,7 @@ public class LockApp extends BaseHook { @Override public void init() throws NoSuchMethodException { - if (isPad()) { + if (getIS_TABLET()) { // 平板 findAndHookConstructor("com.miui.home.recents.GestureStubView", Context.class, diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/UserPresentAnimation.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/UserPresentAnimation.java index 6b09eb888f..1b1e1d52e5 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/UserPresentAnimation.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/UserPresentAnimation.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.home; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.view.View; @@ -30,7 +30,7 @@ public class UserPresentAnimation extends BaseHook { @Override public void init() { - mUserPresentAnimationCompatV12Phone = !isPad() ? + mUserPresentAnimationCompatV12Phone = !getIS_TABLET() ? findClassIfExists("com.miui.home.launcher.compat.UserPresentAnimationCompatV12Phone") : findClassIfExists("com.miui.home.launcher.compat.UserPresentAnimationCompatV12Spring"); findAndHookMethod(mUserPresentAnimationCompatV12Phone, "getSpringAnimator", View.class, int.class, float.class, float.class, float.class, float.class, new MethodHook() { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur.java index bd1e37f94e..b4566e019a 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.home.folder; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.content.Context; import android.os.Build; @@ -57,7 +57,7 @@ public void init() { mDragView = findClassIfExists("com.miui.home.launcher.DragView"); mFolderIcon2x2 = findClassIfExists("com.miui.home.launcher.folder.FolderIcon2x2"); - if (isPad()) { + if (getIS_TABLET()) { mFolderIcon2x2_4 = findClassIfExists("com.miui.home.launcher.folder.FolderIcon4x4_16"); mFolderIcon2x2_9 = findClassIfExists("com.miui.home.launcher.folder.FolderIcon3x3_9"); } else { @@ -97,7 +97,7 @@ protected void after(MethodHookParam param) { FrameLayout.LayoutParams lp1 = (FrameLayout.LayoutParams) mDockBlur.getLayoutParams(); lp1.gravity = Gravity.CENTER; - if(isPad()){ + if(getIS_TABLET()){ lp1.width = mFolderWidth * 2; lp1.height = mFolderHeight *2; }else { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur1x2.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur1x2.java index 704a87d211..d423655a83 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur1x2.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur1x2.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.home.folder; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.view.Gravity; import android.view.View; @@ -44,7 +44,7 @@ public class BigFolderIconBlur1x2 extends BaseHook { @Override public void init() { - if (isPad()) { + if (getIS_TABLET()) { mFolderIcon1x2 = findClassIfExists("com.miui.home.launcher.folder.FolderIcon2x2_4"); } else { mFolderIcon1x2 = findClassIfExists("com.miui.home.launcher.folder.FolderIcon1x2"); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur2x1.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur2x1.java index 1defae7dd8..f5964619c1 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur2x1.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/folder/BigFolderIconBlur2x1.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.home.folder; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.os.Build; import android.view.Gravity; @@ -45,7 +45,7 @@ public class BigFolderIconBlur2x1 extends BaseHook { @Override public void init() { - if (isPad()) { + if (getIS_TABLET()) { mFolderIcon2x1 = findClassIfExists("com.miui.home.launcher.folder.FolderIcon4x2_8"); } else { mFolderIcon2x1 = findClassIfExists("com.miui.home.launcher.folder.FolderIcon2x1"); @@ -77,7 +77,7 @@ protected void after(MethodHookParam param) { mIconContainer.addView(mDockBlur, 0); FrameLayout.LayoutParams lp1 = (FrameLayout.LayoutParams) mDockBlur.getLayoutParams(); lp1.gravity = Gravity.CENTER; - if (isPad()) { + if (getIS_TABLET()) { lp1.width = mFolderWidth * 2; lp1.height = mFolderHeight * 2; }else { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/other/FreeformShortcutMenu.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/other/FreeformShortcutMenu.java index 6e3252383c..928e4f23ec 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/other/FreeformShortcutMenu.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/other/FreeformShortcutMenu.java @@ -19,7 +19,7 @@ package com.sevtinge.hyperceiler.module.hook.home.other; import static com.sevtinge.hyperceiler.module.base.tool.OtherTool.getModuleRes; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static de.robv.android.xposed.XposedHelpers.callMethod; import android.annotation.SuppressLint; @@ -61,7 +61,7 @@ public class FreeformShortcutMenu extends BaseHook { @Override public void init() { - if (isPad()) { + if (getIS_TABLET()) { hookAllMethods("com.miui.home.launcher.shortcuts.SystemShortcutMenuItem$SmallWindowShortcutMenuItem", "isValid", MethodHook.returnConstant(true)); return; diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt index 5e5157edb9..f57e55cb47 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/AlwaysShowCleanUp.kt @@ -27,7 +27,7 @@ import com.sevtinge.hyperceiler.utils.devicesdk.* object AlwaysShowCleanUp: BaseHook() { override fun init() { loadClass( - when (isPad()) { + when (IS_TABLET) { false -> "com.miui.home.recents.views.RecentsContainer" true -> "com.miui.home.recents.views.RecentsDecorations" } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/BlurLevel.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/BlurLevel.kt index dfc44906e7..eff37ffaa2 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/BlurLevel.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/BlurLevel.kt @@ -82,7 +82,7 @@ object BlurLevel : BaseHook() { it.result = false } - if (isPad()) { + if (IS_TABLET) { navStubViewClass.hookAfterAllMethods("onTouchEvent") { val mLauncher = applicationClass.callStaticMethod("getLauncher") as Activity blurClass.callStaticMethod("fastBlur", 1.0f, mLauncher.window, true, 500L) diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt index 1bf3f50f89..d678fcbdbf 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/home/recent/RealMemory.kt @@ -41,7 +41,7 @@ object RealMemory : BaseHook() { fun Any.formatSize(): String = Formatter.formatFileSize(context, this as Long) val recentContainerClass = loadClass( - when (isPad()) { + when (IS_TABLET) { false -> "com.miui.home.recents.views.RecentsContainer" true -> "com.miui.home.recents.views.RecentsDecorations" } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/SystemLockApp.java b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/SystemLockApp.java index 9fb7e97c0b..9c1bd49e56 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/SystemLockApp.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemframework/SystemLockApp.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.module.hook.systemframework; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.content.Context; import android.database.ContentObserver; @@ -112,7 +112,7 @@ protected void before(MethodHookParam param) { } ); - if (isPad()) { + if (getIS_TABLET()) { findAndHookMethod("com.android.server.wm.MiuiCvwGestureController$GesturePointerEventListener", "onPointerEvent", MotionEvent.class, new MethodHook() { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java index 4d1072c79f..99ac0b461b 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/MainFragment.java @@ -20,7 +20,7 @@ import static com.sevtinge.hyperceiler.utils.devicesdk.DisplayUtils.dp2px; import static com.sevtinge.hyperceiler.utils.devicesdk.DisplayUtils.sp2px; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getBaseOs; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getRomAuthor; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; @@ -154,7 +154,7 @@ public void initPrefs() { mAod.setTitle(R.string.aod); mMiLink.setTitle(R.string.milink); mGuardProvider.setTitle(R.string.guard_provider); - if (isPad()) { + if (getIS_TABLET()) { mSecurityCenter.setTitle(R.string.security_center_pad); } else { mSecurityCenter.setTitle(R.string.security_center); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterFragment.java index 392078108f..79f0a36008 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterFragment.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.Manifest; @@ -50,7 +50,7 @@ public int getContentResId() { @Override public View.OnClickListener addRestartListener() { - mSecurity = getResources().getString(!isMoreHyperOSVersion(1f) ? (!isPad() ? R.string.security_center : R.string.security_center_pad) : R.string.security_center_hyperos); + mSecurity = getResources().getString(!isMoreHyperOSVersion(1f) ? (!getIS_TABLET() ? R.string.security_center : R.string.security_center_pad) : R.string.security_center_hyperos); return view -> ((BaseSettingsActivity)getActivity()).showRestartDialog( mSecurity, "com.miui.securitycenter" diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterSidebarFunctionFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterSidebarFunctionFragment.java index 2afda0b191..91f1f8365c 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterSidebarFunctionFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SecurityCenterSidebarFunctionFragment.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.view.View; @@ -37,7 +37,7 @@ public int getContentResId() { @Override public View.OnClickListener addRestartListener() { - mSecurity = getResources().getString(!isMoreHyperOSVersion(1f) ? (!isPad() ? R.string.security_center : R.string.security_center_pad) : R.string.security_center_hyperos); + mSecurity = getResources().getString(!isMoreHyperOSVersion(1f) ? (!getIS_TABLET() ? R.string.security_center : R.string.security_center_pad) : R.string.security_center_hyperos); return view -> ((BaseSettingsActivity)getActivity()).showRestartDialog( mSecurity, "com.miui.securitycenter" diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java index a84662ab6e..2ea0e46e03 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/SystemSettingsFragment.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; @@ -71,12 +71,12 @@ public void initPrefs() { mNotice = findPreference("prefs_key_system_settings_more_notification_settings"); mUiMode = findPreference("prefs_key_system_settings_unlock_ui_mode"); - mUiMode.setVisible(isPad()); + mUiMode.setVisible(getIS_TABLET()); mHighMode.setVisible(!isAndroidVersion(30)); mAreaScreenshot.setVisible(isAndroidVersion(30)); mNewNfc.setVisible((isMoreMiuiVersion(14f) || isMoreHyperOSVersion(1f)) && isMoreAndroidVersion(33)); mNoveltyHaptic.setVisible((isMoreMiuiVersion(14f) || isMoreHyperOSVersion(1f)) && isMoreAndroidVersion(31)); - mPad.setVisible(isPad()); + mPad.setVisible(getIS_TABLET()); if (isMoreHyperOSVersion(1f)) { mNotice.setSummary(R.string.system_settings_more_notification_settings_summary); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/VariousFragment.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/VariousFragment.java index 5abf195c8e..27e0fcfb40 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/VariousFragment.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/VariousFragment.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.os.Handler; @@ -57,7 +57,7 @@ public void initPrefs() { mDefault = findPreference("prefs_key_various_super_clipboard_key"); mMipad = findPreference("prefs_key_various_mipad"); mClipboard = findPreference("prefs_key_sogou_xiaomi_clipboard"); - mMipad.setVisible(isPad()); + mMipad.setVisible(getIS_TABLET()); handler = new Handler(); mClipboard.setOnPreferenceChangeListener((preference, o) -> { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeDockSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeDockSettings.java index e1869586c5..208d7dfce5 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeDockSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeDockSettings.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment.home; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.view.View; @@ -55,7 +55,7 @@ public View.OnClickListener addRestartListener() { @Override public void initPrefs() { mDisableRecentIcon = findPreference("prefs_key_home_dock_disable_recents_icon"); - mDisableRecentIcon.setVisible(isPad()); + mDisableRecentIcon.setVisible(getIS_TABLET()); mDockBackgroundBlur = findPreference("prefs_key_home_dock_bg_custom"); mDockBackgroundColor = findPreference("prefs_key_home_dock_bg_color"); int mBlurMode = Integer.parseInt(PrefsUtils.getSharedStringPrefs(getContext(), "prefs_key_home_dock_add_blur", "0")); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeFolderSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeFolderSettings.java index 61cc6542f3..6adee1371a 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeFolderSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeFolderSettings.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment.home; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.view.View; @@ -68,7 +68,7 @@ public void initPrefs() { mFolderWidth = findPreference("prefs_key_home_folder_width"); mFolderSpace = findPreference("prefs_key_home_folder_space"); - if (isPad()) { + if (getIS_TABLET()) { mSmallFolderIconBackgroundCustom1 = findPreference("prefs_key_home_big_folder_icon_bg_2x1"); mSmallFolderIconBackgroundCustom2 = findPreference("prefs_key_home_big_folder_icon_bg_1x2"); mSmallFolderIconBackgroundCustom3 = findPreference("prefs_key_home_big_folder_icon_bg"); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeOtherSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeOtherSettings.java index 8c838b7695..1955de2b82 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeOtherSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeOtherSettings.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment.home; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import android.view.View; @@ -49,7 +49,7 @@ public View.OnClickListener addRestartListener() { @Override public void initPrefs() { mEnableMoreSettings = findPreference("prefs_key_home_other_mi_pad_enable_more_setting"); - mEnableMoreSettings.setVisible(isPad()); + mEnableMoreSettings.setVisible(getIS_TABLET()); } } diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeRecentSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeRecentSettings.java index 4c41843b4d..44c9f16617 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeRecentSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeRecentSettings.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment.home; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.view.View; @@ -57,7 +57,7 @@ public void initPrefs() { mDimming = findPreference("prefs_key_home_recent_disable_wallpaper_dimming"); mDimming.setVisible(!isMoreHyperOSVersion(1f)); - mShowMenInfo.setVisible(isPad()); + mShowMenInfo.setVisible(getIS_TABLET()); mHideCleanIcon.setOnPreferenceChangeListener((preference, o) -> { if (!(boolean) o) { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeTitleSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeTitleSettings.java index 21dd62ca3d..15c0a68f68 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeTitleSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/home/HomeTitleSettings.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment.home; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import android.content.Intent; @@ -66,7 +66,7 @@ public void initPrefs() { mDisableMonetColor.setVisible(isMoreAndroidVersion(33)); mDisableMonetColor.setOnPreferenceChangeListener((preference, o) -> true); mDisableHideTheme = findPreference("prefs_key_home_title_disable_hide_theme"); - mDisableHideTheme.setVisible(isPad()); + mDisableHideTheme.setVisible(getIS_TABLET()); mIconTitleCustomization.setOnPreferenceClickListener(preference -> { Intent intent = new Intent(getActivity(), SubPickerActivity.class); intent.putExtra("mode", AppPicker.INPUT_MODE); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/SystemUIOtherSettings.java b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/SystemUIOtherSettings.java index 2dc8f374ee..cae4ff3ecb 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/SystemUIOtherSettings.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/ui/fragment/systemui/SystemUIOtherSettings.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.ui.fragment.systemui; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMiuiVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; @@ -73,7 +73,7 @@ public void initPrefs() { mChargeAnimationTitle.setVisible(!isMoreHyperOSVersion(1f)); mDisableBluetoothRestrict.setVisible(isMiuiVersion(14f) && isMoreAndroidVersion(31)); mMiuiMultiWinSwitch.setVisible(isMoreHyperOSVersion(1f) && isMoreAndroidVersion(34)); - mMiuiMultiWinSwitchRemove.setVisible(isMoreHyperOSVersion(1f) && isMoreAndroidVersion(34) && isPad()); + mMiuiMultiWinSwitchRemove.setVisible(isMoreHyperOSVersion(1f) && isMoreAndroidVersion(34) && getIS_TABLET()); mBottomBar.setVisible(isMoreHyperOSVersion(1f) && isMoreAndroidVersion(34)); mPctUseBlur.setVisible(isMoreHyperOSVersion(1f)); diff --git a/app/src/main/java/com/sevtinge/hyperceiler/utils/search/SearchHelper.java b/app/src/main/java/com/sevtinge/hyperceiler/utils/search/SearchHelper.java index e91448e530..94c246015a 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/utils/search/SearchHelper.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/utils/search/SearchHelper.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.utils.search; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.content.Context; @@ -366,7 +366,7 @@ public static void getAllMods(Context context, boolean force) { "com.sevtinge.hyperceiler.ui.fragment.various.AOSPSettings", R.string.various); - if (isPad()) { + if (getIS_TABLET()) { parsePrefXml(context, R.xml.various_mipad, "com.sevtinge.hyperceiler.ui.fragment.VariousFragment", R.string.various); @@ -390,7 +390,7 @@ private static void parsePrefXml(Context context, int xmlResId, String catPrefsF int locationId = 0; int locationHyperId = 0; int locationPadId = 0; - boolean isPad = isPad(); + boolean isPad = getIS_TABLET(); StringBuilder internalName = null; int eventType = xml.getEventType(); if (internalId.length != 0) { diff --git a/app/src/main/java/com/sevtinge/hyperceiler/view/RestartAlertDialog.java b/app/src/main/java/com/sevtinge/hyperceiler/view/RestartAlertDialog.java index 392ebf0584..30730b6dbf 100644 --- a/app/src/main/java/com/sevtinge/hyperceiler/view/RestartAlertDialog.java +++ b/app/src/main/java/com/sevtinge/hyperceiler/view/RestartAlertDialog.java @@ -18,7 +18,7 @@ */ package com.sevtinge.hyperceiler.view; -import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.isPad; +import static com.sevtinge.hyperceiler.utils.devicesdk.MiDeviceAppUtilsKt.getIS_TABLET; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.content.Context; @@ -48,7 +48,7 @@ public RestartAlertDialog(Context context) { private MultipleChoiceView createMultipleChoiceView(Context context) { Resources mRes = context.getResources(); MultipleChoiceView view = new MultipleChoiceView(context); - mAppNameList = Arrays.asList(mRes.getStringArray(!isMoreHyperOSVersion(1f) ? (!isPad() ? R.array.restart_apps_name : R.array.restart_apps_name_pad) : R.array.restart_apps_name_hyperos)); + mAppNameList = Arrays.asList(mRes.getStringArray(!isMoreHyperOSVersion(1f) ? (!getIS_TABLET() ? R.array.restart_apps_name : R.array.restart_apps_name_pad) : R.array.restart_apps_name_hyperos)); mAppPackageNameList = Arrays.asList(mRes.getStringArray(R.array.restart_apps_packagename)); view.setData(mAppNameList, null); view.deselectAll();