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 bcb0ef3..e7db18b 100644
--- a/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java
+++ b/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java
@@ -1157,16 +1157,26 @@ public class LauncherActivity extends Activity implements View.OnClickListener,
@Override
public void onSwipe(Gestures.Direction direction) {
if (direction == Gestures.Direction.SWIPE_RIGHT) {
- searching = true;
- mSearchBox.setText("");
- mSearchBox.setVisibility(View.VISIBLE);
- mSearchBox.requestFocus();
- imm.showSoftInput(mSearchBox, InputMethodManager.SHOW_IMPLICIT);
+ if (DbUtils.isSearchBarGestureEnabled() && !searching) {
+ searching = true;
+ mSearchBox.setText("");
+ mSearchBox.setVisibility(View.VISIBLE);
+ mSearchBox.requestFocus();
+ mSearchBox.animate().alpha(1.0f).setDuration(150).start();
+ imm.showSoftInput(mSearchBox, InputMethodManager.SHOW_IMPLICIT);
+ // Optionally, dim the background or add a visual cue
+ }
} else if (direction == Gestures.Direction.SWIPE_LEFT) {
if (searching) {
- mSearchBox.setVisibility(View.GONE);
+ mSearchBox.animate().alpha(0.0f).setDuration(150).withEndAction(() -> {
+ mSearchBox.setVisibility(View.GONE);
+ mSearchBox.setAlpha(1.0f);
+ }).start();
imm.hideSoftInputFromWindow(mSearchBox.getWindowToken(), 0);
- onResume();
+ // Reset app list to default state and padding
+ mHomeLayout.setPadding(DbUtils.getPaddingLeft(), DbUtils.getPaddingTop(), DbUtils.getPaddingRight(), DbUtils.getPaddingBottom());
+ sortApps(DbUtils.getSortsTypes());
+ searching = false;
}
}
}
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 3dfa8a7..895876b 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
@@ -61,6 +61,7 @@ public class GlobalSettingsDialog extends Dialog implements View.OnClickListener
private final Context context;
private TextView freezeSize;
private TextView doubleTapLockButton;
+ private TextView searchBarGestureButton;
public GlobalSettingsDialog(Context context, LauncherActivity launcherActivity) {
super(context);
@@ -110,6 +111,10 @@ public class GlobalSettingsDialog extends Dialog implements View.OnClickListener
doubleTapLockButton = findViewById(R.id.settings_double_tap_lock);
doubleTapLockButton.setOnClickListener(this);
+ // Search bar gesture toggle
+ searchBarGestureButton = findViewById(R.id.settings_search_bar_gesture);
+ searchBarGestureButton.setOnClickListener(this);
+ updateSearchBarGestureButtonText();
//reflect the DB value
if (DbUtils.isSizeFrozen()) {
@@ -158,6 +163,8 @@ public class GlobalSettingsDialog extends Dialog implements View.OnClickListener
launcherActivity.recreate();
} else if (id == R.id.settings_double_tap_lock) {
toggleDoubleTapToLock();
+ } else if (id == R.id.settings_search_bar_gesture) {
+ toggleSearchBarGesture();
}
}
@@ -401,4 +408,20 @@ public class GlobalSettingsDialog extends Dialog implements View.OnClickListener
popupMenu.show();
}
+ private void toggleSearchBarGesture() {
+ boolean enabled = DbUtils.isSearchBarGestureEnabled();
+ DbUtils.setSearchBarGestureEnabled(!enabled);
+ updateSearchBarGestureButtonText();
+ }
+
+ private void updateSearchBarGestureButtonText() {
+ if (DbUtils.isSearchBarGestureEnabled()) {
+ searchBarGestureButton.setText(R.string.search_bar_gesture);
+ searchBarGestureButton.setAlpha(1.0f);
+ } else {
+ searchBarGestureButton.setText(context.getString(R.string.search_bar_gesture) + " (Off)");
+ searchBarGestureButton.setAlpha(0.5f);
+ }
+ }
+
}
diff --git a/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java b/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java
index 0debfaf..22d69b1 100644
--- a/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java
+++ b/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java
@@ -62,6 +62,7 @@ public class DbUtils {
private static final String APPS_COLORS_DEFAULT = "apps_color_default";
private static final String APPS_SORTS_TYPE = "apps_sorts_types";
private static final String DOUBLE_TAP_TO_LOCK = "double_tap_to_lock";
+ private static final String SEARCH_BAR_GESTURE = "search_bar_gesture";
public static void init(Context context) {
@@ -394,6 +395,20 @@ public class DbUtils {
SpUtils.getInstance().putBoolean(DOUBLE_TAP_TO_LOCK, enabled);
}
+ /**
+ * Check if search bar gesture is enabled
+ */
+ public static boolean isSearchBarGestureEnabled() {
+ return SpUtils.getInstance().getBoolean(SEARCH_BAR_GESTURE, true);
+ }
+
+ /**
+ * Set search bar gesture preference
+ */
+ public static void setSearchBarGestureEnabled(boolean enabled) {
+ SpUtils.getInstance().putBoolean(SEARCH_BAR_GESTURE, enabled);
+ }
+
// a simple ciphered counter: "opening counter" is a private thing
// rest is on device security
private static String codeCount(int count) {
diff --git a/app/src/main/res/layout/dialog_global_settings.xml b/app/src/main/res/layout/dialog_global_settings.xml
index 60d5042..07b1ee7 100644
--- a/app/src/main/res/layout/dialog_global_settings.xml
+++ b/app/src/main/res/layout/dialog_global_settings.xml
@@ -225,6 +225,23 @@
android:background="#DEDEDE"
android:foregroundGravity="center_vertical|center_horizontal" />
+
+
+
+
Lunox Accessibility Service for lock screen functionality. This service allows double tap to lock the screen.
Set as default launcher
+
+ Enable Search Bar Gesture
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/changelogs/20.txt b/fastlane/metadata/android/en-US/changelogs/20.txt
index ac45e4e..5a46655 100644
--- a/fastlane/metadata/android/en-US/changelogs/20.txt
+++ b/fastlane/metadata/android/en-US/changelogs/20.txt
@@ -8,8 +8,11 @@
- Added Swipe Up to Open Notifications Panel
- Fixed Launcher Settings now work on all empty area
- Added Double Tap to Lock Screen Feature
-
+- Added `Set as Default Launcher` option
+- Added Toggle button for search bar gesture
* Project Shource codes Changes.
- SDK targets 28-> 34 (android 13/14)
+- Instead of Static fields, Instance fields are used in LauncherActivity.java
+- Remove code duplication from LauncherActivity.java