Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix multi window support

ammarahm-ed1be0e641c29b
diff --git a/apps/mobile/android/app/src/main/AndroidManifest.xml b/apps/mobile/android/app/src/main/AndroidManifest.xml
index 96293bc26..e8fa64912 100644
--- a/apps/mobile/android/app/src/main/AndroidManifest.xml
+++ b/apps/mobile/android/app/src/main/AndroidManifest.xml
@@ -24,9 +24,10 @@
<activity
android:name=".MainActivity"
- android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:label="@string/app_name"
android:launchMode="singleTask"
+ android:resizeableActivity="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
diff --git a/apps/mobile/src/components/Container/ContainerBottomButton.js b/apps/mobile/src/components/Container/ContainerBottomButton.js
index f2271c555..6ce1c5f72 100644
--- a/apps/mobile/src/components/Container/ContainerBottomButton.js
+++ b/apps/mobile/src/components/Container/ContainerBottomButton.js
@@ -4,13 +4,15 @@ import Animated, {Easing} from 'react-native-reanimated';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {notesnook} from '../../../e2e/test.ids';
-import {useTracked} from '../../provider';
-import {DDS} from '../../services/DeviceDetection';
-import {editing, getElevation, showContext, showTooltip, TOOLTIP_POSITIONS} from '../../utils';
+import {useSettingStore} from '../../provider/stores';
+import {
+ editing,
+ getElevation,
+ showTooltip,
+ TOOLTIP_POSITIONS,
+} from '../../utils';
import {normalize, SIZE} from '../../utils/SizeUtils';
import {PressableButton} from '../PressableButton';
-import RNTooltips from 'react-native-tooltips';
-import { useSettingStore } from '../../provider/stores';
const translateY = new Animated.Value(0);
export const ContainerBottomButton = ({
@@ -20,7 +22,7 @@ export const ContainerBottomButton = ({
shouldShow = false,
}) => {
const insets = useSafeAreaInsets();
- const deviceMode = useSettingStore(state => state.deviceMode)
+ const deviceMode = useSettingStore(state => state.deviceMode);
function animate(translate) {
Animated.timing(translateY, {
@@ -31,16 +33,14 @@ export const ContainerBottomButton = ({
}
const onKeyboardHide = async () => {
- console.log('called hide')
editing.keyboardState = false;
- if (DDS.isTab) return;
+ if (deviceMode !== 'mobile') return;
animate(0);
};
const onKeyboardShow = async () => {
- console.log('called show');
editing.keyboardState = true;
- if (DDS.isTab) return;
+ if (deviceMode !== 'mobile') return;
animate(150);
};
@@ -51,16 +51,18 @@ export const ContainerBottomButton = ({
Keyboard.removeListener('keyboardDidShow', onKeyboardShow);
Keyboard.removeListener('keyboardDidHide', onKeyboardHide);
};
- }, []);
+ }, [deviceMode]);
- return deviceMode !== "mobile" && !shouldShow ? null : (
+ return deviceMode !== 'mobile' && !shouldShow ? null : (
<Animated.View
style={{
position: 'absolute',
right: 12,
bottom:
Platform.OS === 'ios' && insets.bottom !== 0
- ? Platform.isPad ? insets.bottom - 12 : insets.bottom - 24
+ ? Platform.isPad
+ ? insets.bottom - 12
+ : insets.bottom - 24
: insets.bottom + 12,
zIndex: 10,
transform: [
@@ -70,7 +72,7 @@ export const ContainerBottomButton = ({
{
translateX: translateY,
},
- ],
+ ],
}}>
<PressableButton
testID={notesnook.ids.default.addBtn}
@@ -81,8 +83,8 @@ export const ContainerBottomButton = ({
...getElevation(5),
borderRadius: 100,
}}
- onLongPress={(event) => {
- showTooltip(event,title,TOOLTIP_POSITIONS.LEFT)
+ onLongPress={event => {
+ showTooltip(event, title, TOOLTIP_POSITIONS.LEFT);
}}
onPress={onPress}>
<View