aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-10-05 22:13:03 +0530
committerAkshay Nair <phenax5@gmail.com>2024-10-05 22:13:03 +0530
commit8dc2e23927a6f61d9dc0405b854e0fc1e158d613 (patch)
tree052186bcea51d1fdeb4b83b52c0006f14e7d3af4
parent365f18b617fd0a6954ee832138762d14d4dd6539 (diff)
downloaddaft-launcher-8dc2e23927a6f61d9dc0405b854e0fc1e158d613.tar.gz
daft-launcher-8dc2e23927a6f61d9dc0405b854e0fc1e158d613.zip
Disable the default back button behavior
-rw-r--r--App.tsx10
-rw-r--r--android/app/src/main/AndroidManifest.xml2
-rw-r--r--src/components/Favorites.tsx2
3 files changed, 10 insertions, 4 deletions
diff --git a/App.tsx b/App.tsx
index 76ea9f1..08886a0 100644
--- a/App.tsx
+++ b/App.tsx
@@ -1,10 +1,16 @@
-import React, {Suspense} from 'react';
-import {SafeAreaView, View} from 'react-native';
+import React, {Suspense, useEffect} from 'react';
+import {BackHandler, SafeAreaView, View} from 'react-native';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {AppView} from './src/AppView';
import {Provider as JotaiProvider} from 'jotai';
const App: React.FC = () => {
+ // Disable back button
+ useEffect(() => {
+ const sub = BackHandler.addEventListener('hardwareBackPress', () => true);
+ return () => sub.remove();
+ }, []);
+
return (
<Suspense fallback={<View className="flex flex-1 bg-black" />}>
<JotaiProvider>
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 9bae7a2..66ed10a 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -8,7 +8,7 @@
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
- android:allowBackup="false"
+ android:allowBackup="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
diff --git a/src/components/Favorites.tsx b/src/components/Favorites.tsx
index 4c8dc37..54f876c 100644
--- a/src/components/Favorites.tsx
+++ b/src/components/Favorites.tsx
@@ -65,7 +65,7 @@ export const Favorites: React.FC<{active: boolean}> = (_) => {
disabled={isActive}
hitSlop={10}
className="pr-2 py-3">
- <Icon name="drag-indicator" size={21} color="#222" />
+ <Icon name="drag-indicator" size={21} color="#333" />
</TouchableOpacity>
<AppLabel app={app} />