From 0c6d98f040fb3877b609f38a6ba3f94459bb0e9a Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Tue, 1 Jul 2025 22:06:49 +0545 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(launcher):=20fix=20settings?= =?UTF-8?q?=20on=20empty=20area=20click?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sankalp/lunox/LauncherActivity.java | 14 +++--- .../lunox/dialogs/DoubleTapLockDialog.java | 20 +++----- .../lunox/dialogs/GlobalSettingsDialog.java | 9 +--- .../LockScreenAccessibilityService.java | 44 +++++++--------- .../lunox/utils/AccessibilityUtils.java | 20 +++----- .../lunox/utils/NotificationPanelManager.java | 50 ++++++++----------- .../metadata/android/en-US/changelogs/20.txt | 15 ++++++ 7 files changed, 76 insertions(+), 96 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/20.txt diff --git a/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java b/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java index 77c9816..69af876 100644 --- a/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java +++ b/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java @@ -1197,18 +1197,20 @@ public class LauncherActivity extends Activity implements View.OnClickListener, loadApps(); } - @Override + @Override public void onSwipe(Gestures.Direction direction) { - if (direction == Gestures.Direction.SWIPE_UP) { - // Open search bar on swipe up (down to up gesture) + if (direction == Gestures.Direction.SWIPE_RIGHT) { searching = true; mSearchBox.setText(""); mSearchBox.setVisibility(View.VISIBLE); mSearchBox.requestFocus(); imm.showSoftInput(mSearchBox, InputMethodManager.SHOW_IMPLICIT); - } else if (direction == Gestures.Direction.SWIPE_DOWN) { - // Open notification panel on swipe down (up to down gesture) - NotificationPanelManager.expandNotificationPanel(this); + } else if (direction == Gestures.Direction.SWIPE_LEFT) { + if (searching) { + mSearchBox.setVisibility(View.GONE); + imm.hideSoftInputFromWindow(mSearchBox.getWindowToken(), 0); + onResume(); + } } } diff --git a/app/src/main/java/io/github/sankalp/lunox/dialogs/DoubleTapLockDialog.java b/app/src/main/java/io/github/sankalp/lunox/dialogs/DoubleTapLockDialog.java index a4e9443..4969785 100644 --- a/app/src/main/java/io/github/sankalp/lunox/dialogs/DoubleTapLockDialog.java +++ b/app/src/main/java/io/github/sankalp/lunox/dialogs/DoubleTapLockDialog.java @@ -1,20 +1,12 @@ /* - * Lunox Launcher - * Copyright (C) 2024 Sankalp + * Lunox + * Copyright (C) 2025 Sankalp Tharu * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This file is part of Last Launcher (forked). + * Licensed under the GNU General Public License v3 or later. + * See . * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +*/ package io.github.sankalp.lunox.dialogs; diff --git a/app/src/main/java/io/github/sankalp/lunox/dialogs/GlobalSettingsDialog.java b/app/src/main/java/io/github/sankalp/lunox/dialogs/GlobalSettingsDialog.java index 9128356..75ea680 100644 --- a/app/src/main/java/io/github/sankalp/lunox/dialogs/GlobalSettingsDialog.java +++ b/app/src/main/java/io/github/sankalp/lunox/dialogs/GlobalSettingsDialog.java @@ -282,13 +282,8 @@ public class GlobalSettingsDialog extends Dialog implements View.OnClickListener } private void defaultSettings() { - if (!BuildConfig.DEBUG) { - DbUtils.clearDB(); - launcherActivity.recreate(); - } else { - //DO SOME ESTER EGG.. FOR DEBUG BUILD.. - } - + DbUtils.clearDB(); + launcherActivity.recreate(); } private void toggleDoubleTapToLock() { diff --git a/app/src/main/java/io/github/sankalp/lunox/services/LockScreenAccessibilityService.java b/app/src/main/java/io/github/sankalp/lunox/services/LockScreenAccessibilityService.java index 5008ff6..ae255dd 100644 --- a/app/src/main/java/io/github/sankalp/lunox/services/LockScreenAccessibilityService.java +++ b/app/src/main/java/io/github/sankalp/lunox/services/LockScreenAccessibilityService.java @@ -1,20 +1,12 @@ /* - * Lunox Launcher - * Copyright (C) 2024 Sankalp + * Lunox + * Copyright (C) 2025 Sankalp Tharu * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This file is part of Last Launcher (forked). + * Licensed under the GNU General Public License v3 or later. + * See . * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +*/ package io.github.sankalp.lunox.services; @@ -32,41 +24,41 @@ import android.view.accessibility.AccessibilityEvent; * This service can perform global actions like simulating power key press */ public class LockScreenAccessibilityService extends AccessibilityService { - + private static final String TAG = "LockScreenAccessibilityService"; private static LockScreenAccessibilityService instance; - + public static final String ACTION_LOCK_SCREEN = "io.github.sankalp.lunox.ACTION_LOCK_SCREEN"; - + @Override public void onCreate() { super.onCreate(); instance = this; Log.d(TAG, "Accessibility service created"); } - + @Override public void onDestroy() { super.onDestroy(); instance = null; Log.d(TAG, "Accessibility service destroyed"); } - + @Override public void onAccessibilityEvent(AccessibilityEvent event) { // We don't need to handle accessibility events for this use case } - + @Override public void onInterrupt() { Log.d(TAG, "Accessibility service interrupted"); } - + @Override protected boolean onKeyEvent(KeyEvent event) { return super.onKeyEvent(event); } - + @Override public int onStartCommand(Intent intent, int flags, int startId) { if (intent != null && ACTION_LOCK_SCREEN.equals(intent.getAction())) { @@ -74,7 +66,7 @@ public class LockScreenAccessibilityService extends AccessibilityService { } return START_NOT_STICKY; } - + /** * Lock the screen using accessibility service global action */ @@ -96,7 +88,7 @@ public class LockScreenAccessibilityService extends AccessibilityService { Log.e(TAG, "Failed to lock screen", e); } } - + /** * Simulate power button press using accessibility service */ @@ -113,14 +105,14 @@ public class LockScreenAccessibilityService extends AccessibilityService { Log.e(TAG, "Failed to simulate power button", e); } } - + /** * Get the current instance of the accessibility service */ public static LockScreenAccessibilityService getInstance() { return instance; } - + /** * Check if the accessibility service is running */ diff --git a/app/src/main/java/io/github/sankalp/lunox/utils/AccessibilityUtils.java b/app/src/main/java/io/github/sankalp/lunox/utils/AccessibilityUtils.java index fcaa98f..a5c6c25 100644 --- a/app/src/main/java/io/github/sankalp/lunox/utils/AccessibilityUtils.java +++ b/app/src/main/java/io/github/sankalp/lunox/utils/AccessibilityUtils.java @@ -1,20 +1,12 @@ /* - * Lunox Launcher - * Copyright (C) 2024 Sankalp + * Lunox + * Copyright (C) 2025 Sankalp Tharu * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This file is part of Last Launcher (forked). + * Licensed under the GNU General Public License v3 or later. + * See . * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +*/ package io.github.sankalp.lunox.utils; diff --git a/app/src/main/java/io/github/sankalp/lunox/utils/NotificationPanelManager.java b/app/src/main/java/io/github/sankalp/lunox/utils/NotificationPanelManager.java index b5de678..73b0df1 100644 --- a/app/src/main/java/io/github/sankalp/lunox/utils/NotificationPanelManager.java +++ b/app/src/main/java/io/github/sankalp/lunox/utils/NotificationPanelManager.java @@ -1,20 +1,12 @@ /* - * Last Launcher - * Copyright (C) 2019,2020 Shubham Tyagi + * Lunox + * Copyright (C) 2025 Sankalp Tharu * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This file is part of Last Launcher (forked). + * Licensed under the GNU General Public License v3 or later. + * See . * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ +*/ package io.github.sankalp.lunox.utils; @@ -28,9 +20,9 @@ import java.lang.reflect.Method; * Utility class to manage notification panel expansion */ public class NotificationPanelManager { - + private static final String TAG = "NotificationPanelManager"; - + /** * Attempts to expand the notification panel using reflection * @param context The application context @@ -40,15 +32,15 @@ public class NotificationPanelManager { try { // Get the StatusBarManager service Object statusBarService = context.getSystemService("statusbar"); - + if (statusBarService == null) { Log.w(TAG, "StatusBar service not available"); return false; } - + Class statusBarManager = Class.forName("android.app.StatusBarManager"); Method expandMethod; - + // Different method names for different Android versions if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { // Android 4.2+ uses expandNotificationsPanel @@ -57,20 +49,20 @@ public class NotificationPanelManager { // Older versions use expand expandMethod = statusBarManager.getMethod("expand"); } - + expandMethod.setAccessible(true); expandMethod.invoke(statusBarService); - + Log.d(TAG, "Notification panel expanded successfully"); return true; - + } catch (Exception e) { Log.e(TAG, "Failed to expand notification panel: " + e.getMessage()); e.printStackTrace(); return false; } } - + /** * Attempts to collapse the notification panel using reflection * @param context The application context @@ -80,15 +72,15 @@ public class NotificationPanelManager { try { // Get the StatusBarManager service Object statusBarService = context.getSystemService("statusbar"); - + if (statusBarService == null) { Log.w(TAG, "StatusBar service not available"); return false; } - + Class statusBarManager = Class.forName("android.app.StatusBarManager"); Method collapseMethod; - + // Different method names for different Android versions if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { // Android 4.2+ uses collapsePanels @@ -97,13 +89,13 @@ public class NotificationPanelManager { // Older versions use collapse collapseMethod = statusBarManager.getMethod("collapse"); } - + collapseMethod.setAccessible(true); collapseMethod.invoke(statusBarService); - + Log.d(TAG, "Notification panel collapsed successfully"); return true; - + } catch (Exception e) { Log.e(TAG, "Failed to collapse notification panel: " + e.getMessage()); e.printStackTrace(); diff --git a/fastlane/metadata/android/en-US/changelogs/20.txt b/fastlane/metadata/android/en-US/changelogs/20.txt new file mode 100644 index 0000000..ac45e4e --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/20.txt @@ -0,0 +1,15 @@ +*Beta release 9* + +* What's New in this release + +- FOrked from the original Last Launcher +- Rename App Name +- New App Icon +- Added Swipe Up to Open Notifications Panel +- Fixed Launcher Settings now work on all empty area +- Added Double Tap to Lock Screen Feature + + +* Project Shource codes Changes. + +- SDK targets 28-> 34 (android 13/14)