diff --git a/apps/mobile/android/app/proguard-rules.pro b/apps/mobile/android/app/proguard-rules.pro
index 40a9b0a32..279ea497f 100644
--- a/apps/mobile/android/app/proguard-rules.pro
+++ b/apps/mobile/android/app/proguard-rules.pro
@@ -28,4 +28,13 @@
# Samsung Fingerprint
-keep class com.samsung.android.sdk.** { *; }
--dontwarn com.samsung.android.sdk.**
\ No newline at end of file
+-dontwarn com.samsung.android.sdk.**
+
+-keep public class com.dylanvann.fastimage.* {*;}
+-keep public class com.dylanvann.fastimage.** {*;}
+-keep public class * implements com.bumptech.glide.module.GlideModule
+-keep public class * extends com.bumptech.glide.module.AppGlideModule
+-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
+ **[] $VALUES;
+ public *;
+}
\ No newline at end of file
diff --git a/apps/mobile/index.js b/apps/mobile/index.js
index 965afc613..5a9878e62 100644
--- a/apps/mobile/index.js
+++ b/apps/mobile/index.js
@@ -2,7 +2,8 @@ import 'react-native-gesture-handler';
import React from 'react';
import {AppRegistry} from 'react-native';
import {name as appName} from './app.json';
-
+import { enableScreens } from 'react-native-screens';
+enableScreens(true);
let Provider;
let App;
let NotesnookShare;
diff --git a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj
index 9f1bc7d10..6da9dc0d4 100644
--- a/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj
+++ b/apps/mobile/ios/Notesnook.xcodeproj/project.pbxproj
@@ -1147,8 +1147,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Notesnook/Notesnook.entitlements;
- CODE_SIGN_IDENTITY = "iPhone Distribution";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1340;
DEVELOPMENT_TEAM = 53CWBG3QUC;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
@@ -1228,7 +1228,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook;
PRODUCT_NAME = Notesnook;
- PROVISIONING_PROFILE_SPECIFIER = "Notesnook iOS Distribution";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "Notesnook-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1476,8 +1476,8 @@
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_ENTITLEMENTS = "Make Note/Make Note.entitlements";
- CODE_SIGN_IDENTITY = "iPhone Distribution";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1340;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -1556,7 +1556,7 @@
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share;
PRODUCT_NAME = "$(TARGET_NAME)";
- PROVISIONING_PROFILE_SPECIFIER = "Notesnook Extension iOS Distribution 2";
+ PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Make Note/Make Note-Bridging-Header.h";
SWIFT_VERSION = 5.0;
diff --git a/apps/mobile/src/components/Container/ContainerTopSection.js b/apps/mobile/src/components/Container/ContainerTopSection.js
index c3c2d6e8c..bbb3fc472 100644
--- a/apps/mobile/src/components/Container/ContainerTopSection.js
+++ b/apps/mobile/src/components/Container/ContainerTopSection.js
@@ -3,7 +3,7 @@ import { View } from 'react-native';
import { useTracked } from '../../provider';
import { Header } from '../Header';
-export const ContainerTopSection = ({root}) => {
+export const ContainerTopSection = ({children}) => {
const [state] = useTracked();
const {colors, selectionMode} = state;
@@ -20,7 +20,7 @@ export const ContainerTopSection = ({root}) => {
},
],
}}>
-
+ {children}
);
};
diff --git a/apps/mobile/src/components/Container/index.js b/apps/mobile/src/components/Container/index.js
index cafb09194..84e2ce731 100644
--- a/apps/mobile/src/components/Container/index.js
+++ b/apps/mobile/src/components/Container/index.js
@@ -1,11 +1,10 @@
import React from 'react';
-import {KeyboardAvoidingView, Platform, SafeAreaView} from 'react-native';
+import { KeyboardAvoidingView, Platform, SafeAreaView } from 'react-native';
import Animated from 'react-native-reanimated';
import { useTracked } from '../../provider';
-import { getElevation } from '../../utils';
import { ContainerScale } from '../../utils/Animations';
import SelectionHeader from '../SelectionHeader';
-import {ContainerTopSection} from './ContainerTopSection';
+import { ContainerTopSection } from './ContainerTopSection';
const AnimatedView = Animated.createAnimatedComponent(SafeAreaView);
export const Container = ({children, root}) => {
const [state] = useTracked();
@@ -30,8 +29,7 @@ export const Container = ({children, root}) => {
}
]
}}>
-
-
+
{children}
diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js
index 7ac642d2a..ec192db89 100644
--- a/apps/mobile/src/components/DialogManager/index.js
+++ b/apps/mobile/src/components/DialogManager/index.js
@@ -379,7 +379,7 @@ export class DialogManager extends Component {
-
+
>
diff --git a/apps/mobile/src/components/Header/HeaderLeftMenu.js b/apps/mobile/src/components/Header/HeaderLeftMenu.js
index 5e8ca0809..0d8430692 100644
--- a/apps/mobile/src/components/Header/HeaderLeftMenu.js
+++ b/apps/mobile/src/components/Header/HeaderLeftMenu.js
@@ -1,11 +1,10 @@
-import React, { useEffect, useState } from 'react';
-import {notesnook} from '../../../e2e/test.ids';
-import {useTracked} from '../../provider';
+import React from 'react';
+import { notesnook } from '../../../e2e/test.ids';
+import { useTracked } from '../../provider';
import { DDS } from '../../services/DeviceDetection';
-import { eSubscribeEvent, eUnSubscribeEvent } from '../../services/EventManager';
import Navigation from '../../services/Navigation';
-import {SIZE} from '../../utils/SizeUtils';
-import {ActionIcon} from '../ActionIcon';
+import { SIZE } from '../../utils/SizeUtils';
+import { ActionIcon } from '../ActionIcon';
export const HeaderLeftMenu = ({currentScreen,headerMenuState}) => {
const [state] = useTracked();
diff --git a/apps/mobile/src/components/Header/HeaderRightMenu.js b/apps/mobile/src/components/Header/HeaderRightMenu.js
index 7e253fcc7..66369f08f 100644
--- a/apps/mobile/src/components/Header/HeaderRightMenu.js
+++ b/apps/mobile/src/components/Header/HeaderRightMenu.js
@@ -1,19 +1,17 @@
-import React, {useEffect, useState} from 'react';
-import {ActivityIndicator, StyleSheet, View} from 'react-native';
-import {notesnook} from '../../../e2e/test.ids';
-import {useTracked} from '../../provider';
-import {DDS} from '../../services/DeviceDetection';
-import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
+import React from 'react';
+import { ActivityIndicator, StyleSheet, View } from 'react-native';
+import { notesnook } from '../../../e2e/test.ids';
+import { useTracked } from '../../provider';
+import { DDS } from '../../services/DeviceDetection';
import Navigation from '../../services/Navigation';
-import {dWidth} from '../../utils';
-import {SIZE} from '../../utils/SizeUtils';
-import {ActionIcon} from '../ActionIcon';
-import {Button} from '../Button';
+import { SIZE } from '../../utils/SizeUtils';
+import { ActionIcon } from '../ActionIcon';
+import { Button } from '../Button';
export const HeaderRightMenu = ({currentScreen}) => {
const [state] = useTracked();
- const {colors, containerBottomButton, syncing} = state;
-
+ const {colors, syncing} = state;
+
return (
{syncing && }
@@ -33,11 +31,9 @@ export const HeaderRightMenu = ({currentScreen}) => {
/>
)}
- {DDS.isLargeTablet() && containerBottomButton.onPress ? (
+ {DDS.isLargeTablet() ? (
);
};
diff --git a/apps/mobile/src/components/SimpleList/empty.js b/apps/mobile/src/components/SimpleList/empty.js
index 6ee4059e6..54fbc04d4 100644
--- a/apps/mobile/src/components/SimpleList/empty.js
+++ b/apps/mobile/src/components/SimpleList/empty.js
@@ -1,45 +1,34 @@
-import React, {useEffect, useState} from 'react';
-import {ActivityIndicator, useWindowDimensions, View} from 'react-native';
-
-import {useSafeAreaInsets} from 'react-native-safe-area-context';
-import {useTracked} from '../../provider';
-import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager';
-import Navigation from '../../services/Navigation';
-import {COLORS_NOTE} from '../../utils/Colors';
-import {SIZE} from '../../utils/SizeUtils';
-import {Button} from '../Button';
+import React from 'react';
+import { ActivityIndicator, useWindowDimensions, View } from 'react-native';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
+import { useTracked } from '../../provider';
+import { COLORS_NOTE } from '../../utils/Colors';
+import { SIZE } from '../../utils/SizeUtils';
+import { Button } from '../Button';
import Seperator from '../Seperator';
import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph';
-export const Empty = ({loading = true, placeholderData,absolute}) => {
+
+export const Empty = ({
+ loading = true,
+ placeholderData,
+ absolute,
+ headerProps,
+}) => {
const [state] = useTracked();
const {colors} = state;
- const [headerTextState, setHeaderTextState] = useState(
- Navigation.getHeaderState(),
- );
const insets = useSafeAreaInsets();
const {height} = useWindowDimensions();
- const onHeaderStateChange = (event) => {
- if (!event) return;
- setHeaderTextState(event);
- };
- useEffect(() => {
- eSubscribeEvent('onHeaderStateChange', onHeaderStateChange);
- return () => {
- eUnSubscribeEvent('onHeaderStateChange', onHeaderStateChange);
- };
- }, []);
-
return (
@@ -69,16 +58,16 @@ export const Empty = ({loading = true, placeholderData,absolute}) => {
fontSize={SIZE.md}
accentColor="bg"
accentText={
- COLORS_NOTE[headerTextState?.heading?.toLowerCase()]
- ? headerTextState.heading?.toLowerCase()
+ COLORS_NOTE[headerProps?.heading?.toLowerCase()]
+ ? headerProps.heading?.toLowerCase()
: 'accent'
}
/>
) : loading ? (
diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js
index 869c30616..088a80990 100644
--- a/apps/mobile/src/components/SimpleList/index.js
+++ b/apps/mobile/src/components/SimpleList/index.js
@@ -1,18 +1,15 @@
-import React, {useEffect, useState} from 'react';
-import {View} from 'react-native';
+import React, {useEffect, useRef, useState} from 'react';
import {RefreshControl, useWindowDimensions} from 'react-native';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import {DataProvider, LayoutProvider, RecyclerListView} from 'recyclerlistview';
import {useTracked} from '../../provider';
import {DDS} from '../../services/DeviceDetection';
import {eSendEvent} from '../../services/EventManager';
-import Navigation from '../../services/Navigation';
-import SettingsService from '../../services/SettingsService';
import Sync from '../../services/Sync';
import {dHeight} from '../../utils';
import {COLORS_NOTE} from '../../utils/Colors';
import {eScrollEvent} from '../../utils/Events';
-import {sleep} from '../../utils/TimeUtils';
+import JumpToDialog from '../JumpToDialog';
import {NotebookWrapper} from '../NotebookItem/wrapper';
import {NoteWrapper} from '../NoteItem/wrapper';
import TagItem from '../TagItem';
@@ -26,6 +23,10 @@ const header = {
type: 'MAIN_HEADER',
};
+const empty = {
+ type: 'empty',
+};
+
const SimpleList = ({
listData,
type,
@@ -33,23 +34,23 @@ const SimpleList = ({
customRefreshing,
refreshCallback,
sortMenuButton,
- scrollRef,
jumpToDialog,
placeholderData,
loading,
headerProps = {
heading: 'Home',
},
+ screen
}) => {
const [state] = useTracked();
const {colors, deviceMode, messageBoardState} = state;
- const [_loading, setLoading] = useState(true);
- const [loaded, setLoaded] = useState(false);
+ const [_loading, _setLoading] = useState(true);
const [dataProvider, setDataProvider] = useState(
new DataProvider((r1, r2) => {
return r1 !== r2;
- }),
+ }).cloneWithRows([header, empty]),
);
+ const scrollRef = useRef();
const insets = useSafeAreaInsets();
const {width, fontScale} = useWindowDimensions();
@@ -57,28 +58,20 @@ const SimpleList = ({
const dataType = type;
useEffect(() => {
- if (loading) {
- setDataProvider(dataProvider.cloneWithRows([header, {type: 'empty'}]));
- setLoaded(false);
- }
-
if (!loading) {
setDataProvider(
dataProvider.cloneWithRows(
!listData || listData.length === 0
- ? [header, {type: 'empty'}]
+ ? [header, empty]
: [header].concat(listData),
),
);
- setLoading(false);
- setTimeout(
- () => {
- setLoaded(true);
- },
- Navigation.getCurrentScreen() === SettingsService.get().homepage
- ? 1000
- : 150,
- );
+ setTimeout(() => {
+ _setLoading(false);
+ }, 500);
+ } else {
+ _setLoading(true);
+ setDataProvider(dataProvider.cloneWithRows([header, empty]));
}
}, [listData, deviceMode, loading]);
@@ -92,7 +85,10 @@ const SimpleList = ({
const _onScroll = event => {
if (!event) return;
let y = event.nativeEvent.contentOffset.y;
- eSendEvent(eScrollEvent, y);
+ eSendEvent(eScrollEvent, {
+ y,
+ screen
+ });
};
const _layoutProvider = new LayoutProvider(
@@ -199,6 +195,7 @@ const SimpleList = ({
);
}
@@ -237,49 +234,25 @@ const SimpleList = ({
};
return (
<>
- {loaded && !loading ? null : (
- <>
-
-
-
-
- >
- )}
-
- {_loading ? null : (
- <>
-
-
- >
+ {!loading && (
+
)}
+
+
>
);
};
diff --git a/apps/mobile/src/components/SplashScreen/index.js b/apps/mobile/src/components/SplashScreen/index.js
index b4fe2842a..c5dab7b20 100644
--- a/apps/mobile/src/components/SplashScreen/index.js
+++ b/apps/mobile/src/components/SplashScreen/index.js
@@ -81,7 +81,7 @@ const SplashScreen = () => {
useEffect(() => {
Storage.read('introCompleted').then(async r => {
requestAnimationFrame(() => {
- if (r) {
+ if (!r) {
setVisible(true);
timing(opacity, {
toValue: 1,
diff --git a/apps/mobile/src/navigation/NavigatorStack.js b/apps/mobile/src/navigation/NavigatorStack.js
index 4ff4148a9..5e6947b1e 100644
--- a/apps/mobile/src/navigation/NavigatorStack.js
+++ b/apps/mobile/src/navigation/NavigatorStack.js
@@ -14,6 +14,7 @@ import {
} from '../services/EventManager';
import Navigation from '../services/Navigation';
import SettingsService from '../services/SettingsService';
+import {editing, history} from '../utils';
import {eOpenSideMenu} from '../utils/Events';
import {rootNavigatorRef} from '../utils/Refs';
import {sleep} from '../utils/TimeUtils';
@@ -74,8 +75,8 @@ const forSlide = ({current, next, inverted, layouts: {screen}}) => {
};
const screenOptionsForAnimation = {
- animationEnabled: false,
- cardStyleInterpolator: forSlide,
+ animationEnabled: true,
+ cardStyleInterpolator: forFade,
gestureEnabled: true,
};
@@ -84,8 +85,10 @@ export const NavigatorStack = React.memo(
const [, dispatch] = useTracked();
const [render, setRender] = React.useState(false);
const onStateChange = React.useCallback(() => {
- dispatch({type: Actions.SELECTION_MODE, enabled: false});
- dispatch({type: Actions.CLEAR_SELECTION});
+ if (history.selectionMode) {
+ dispatch({type: Actions.SELECTION_MODE, enabled: false});
+ dispatch({type: Actions.CLEAR_SELECTION});
+ }
eSendEvent('navigate');
});
@@ -102,7 +105,6 @@ export const NavigatorStack = React.memo(
id: SettingsService.get().homepage.toLowerCase() + '_navigation',
},
);
-
}
};
@@ -126,6 +128,7 @@ export const NavigatorStack = React.memo(
headerShown: false,
animationEnabled: false,
gestureEnabled: false,
+
}}>
diff --git a/apps/mobile/src/provider/Reducer.js b/apps/mobile/src/provider/Reducer.js
index 6a84bc088..9c9f4bafb 100644
--- a/apps/mobile/src/provider/Reducer.js
+++ b/apps/mobile/src/provider/Reducer.js
@@ -8,14 +8,10 @@ import {defaultState} from './DefaultState';
export const reducer = (state, action) => {
switch (action.type) {
-
case Actions.ALL: {
return {
...state,
- notes: db.notes.group(
- SORT[sortSettings.sort],
- sortSettings.sortOrder,
- ),
+ notes: db.notes.group(SORT[sortSettings.sort], sortSettings.sortOrder),
notebooks: db.notebooks.all,
trash: db.trash.all,
tags: db.tags.all,
@@ -56,10 +52,7 @@ export const reducer = (state, action) => {
case Actions.NOTES:
return {
...state,
- notes: db.notes.group(
- SORT[sortSettings.sort],
- sortSettings.sortOrder,
- )
+ notes: db.notes.group(SORT[sortSettings.sort], sortSettings.sortOrder),
};
case Actions.THEME: {
return {
@@ -134,7 +127,7 @@ export const reducer = (state, action) => {
} else {
eSendEvent(eOpenSideMenu);
}
-
+ history.selectionMode = action.enabled;
return {
...state,
selectionMode: action.enabled,
@@ -157,15 +150,18 @@ export const reducer = (state, action) => {
if (selectedItems.length === 0) {
eSendEvent(eOpenSideMenu);
}
+ history.selectionMode =
+ selectedItems.length > 0 ? state.selectionMode : false;
return {
...state,
selectedItemsList: selectedItems,
- selectionMode: selectedItems.length > 0 ? state.selectionMode : false,
+ selectionMode: history.selectionMode,
};
}
case Actions.CLEAR_SELECTION: {
history.selectedItemsList = [];
eSendEvent(eOpenSideMenu);
+ history.selectionMode = false;
return {
...state,
selectedItemsList: [],
@@ -280,7 +276,7 @@ export const reducer = (state, action) => {
return {
...state,
searching: action.searching.isSearching,
- searchStatus:action.searching.status
+ searchStatus: action.searching.status,
};
}
case Actions.PREMIUM: {
diff --git a/apps/mobile/src/services/Navigation.js b/apps/mobile/src/services/Navigation.js
index f8df4089b..bdd0a3d0f 100755
--- a/apps/mobile/src/services/Navigation.js
+++ b/apps/mobile/src/services/Navigation.js
@@ -9,7 +9,6 @@ import SettingsService from './SettingsService';
let currentScreen = 'Notes';
let homeLoaded = false;
-
function getHomeLoaded() {
return homeLoaded;
}
@@ -47,8 +46,8 @@ function getHeaderState() {
function clearRouteFromUpdates(routeName) {
if (routesToUpdate.indexOf(routeName) !== -1) {
- routesToUpdate = [...new Set(routesToUpdate)]
- routesToUpdate.splice(routesToUpdate.indexOf(routeName), 1);
+ routesToUpdate = [...new Set(routesToUpdate)];
+ routesToUpdate.splice(routesToUpdate.indexOf(routeName), 1);
}
}
@@ -60,19 +59,18 @@ function routeNeedsUpdate(routeName, callback) {
}
/**
- *
- * @param {array} routes
+ *
+ * @param {array} routes
*/
function setRoutesToUpdate(routes) {
-
- console.log(currentScreen, "current");
+ console.log(currentScreen, 'current');
if (routes.indexOf(currentScreen) > -1) {
console.log('updating screen', currentScreen);
if (
- currentScreen === routeNames.NotesPage||
+ currentScreen === routeNames.NotesPage ||
currentScreen === routeNames.Notebook
) {
- console.log(currentScreen ,"CURRENT");
+ console.log(currentScreen, 'CURRENT');
eSendEvent(
currentScreen === routeNames.NotesPage
? refreshNotesPage
@@ -124,7 +122,7 @@ function setHeaderState(name, params, item) {
headerState.currentScreen = name;
headerState.verticalMenu = params.menu;
if (headerState) {
- eSendEvent('onHeaderStateChange', {...headerState});
+ eSendEvent('onHeaderStateChange', {id: headerState.id});
}
}
@@ -133,15 +131,13 @@ function goBack() {
}
function push(name, params, item) {
- currentScreen = name;
setHeaderState(name, params, item);
rootNavigatorRef.current?.dispatch(StackActions.push(name, params));
}
function replace(name, params, item) {
- currentScreen = name;
setHeaderState(name, params, item);
- rootNavigatorRef.current?.dispatch(StackActions.replace(name,params));
+ rootNavigatorRef.current?.dispatch(StackActions.replace(name, params));
}
function popToTop() {
@@ -181,5 +177,5 @@ export default {
routeNeedsUpdate,
routeNames,
getHomeLoaded,
- setHomeLoaded
+ setHomeLoaded,
};
diff --git a/apps/mobile/src/services/Sync.js b/apps/mobile/src/services/Sync.js
index 9bdd341ac..0303397d2 100644
--- a/apps/mobile/src/services/Sync.js
+++ b/apps/mobile/src/services/Sync.js
@@ -19,7 +19,6 @@ const run = async (context = 'global') => {
context: context,
});
} catch (e) {
- console.log(e);
if (e.message === 'You need to login to sync.') {
ToastEvent.show({
heading:"Enable sync",
diff --git a/apps/mobile/src/utils/DB.js b/apps/mobile/src/utils/DB.js
index 5df3ec398..c37cc685d 100644
--- a/apps/mobile/src/utils/DB.js
+++ b/apps/mobile/src/utils/DB.js
@@ -16,9 +16,9 @@ export const db = new Database(
*/
db.host( __DEV__ ? {
- API_HOST: 'https://api.notesnook.com',
- AUTH_HOST: 'https://auth.streetwriters.co',
- SSE_HOST: 'https://events.streetwriters.co',
+ API_HOST: 'http://192.168.10.3:5264',
+ AUTH_HOST: 'http://192.168.10.3:8264',
+ SSE_HOST: 'http://192.168.10.3:7264',
} : {
API_HOST: 'https://api.notesnook.com',
AUTH_HOST: 'https://auth.streetwriters.co',
diff --git a/apps/mobile/src/utils/index.js b/apps/mobile/src/utils/index.js
index 02cd59329..aca4df1e2 100755
--- a/apps/mobile/src/utils/index.js
+++ b/apps/mobile/src/utils/index.js
@@ -1,5 +1,9 @@
import {createRef} from 'react';
-import {Dimensions, NativeModules, Platform} from 'react-native';
+import {
+ Dimensions,
+ NativeModules,
+ Platform,
+} from 'react-native';
import RNTooltips from 'react-native-tooltips';
import {updateEvent} from '../components/DialogManager/recievers';
import {dummyRef} from '../components/DummyText';
@@ -11,7 +15,7 @@ import {tabBarRef} from './Refs';
import {SIZE} from './SizeUtils';
export const InteractionManager = {
- runAfterInteractions: (func, time = 150) => setTimeout(func, time),
+ runAfterInteractions: (func, time = 400) => setTimeout(func, time),
};
export const APP_VERSION = 1350;
@@ -68,6 +72,7 @@ export const selection = {
export const history = {
selectedItemsList: [],
+ selectionMode: false,
};
export async function showContext(event, title) {
diff --git a/apps/mobile/src/views/Favorites/index.js b/apps/mobile/src/views/Favorites/index.js
index 66bfd19f5..731df4601 100644
--- a/apps/mobile/src/views/Favorites/index.js
+++ b/apps/mobile/src/views/Favorites/index.js
@@ -1,5 +1,8 @@
import React, {useCallback, useEffect} from 'react';
+import {ContainerTopSection} from '../../components/Container/ContainerTopSection';
+import {Header} from '../../components/Header';
import {Placeholder} from '../../components/ListPlaceholders';
+import SelectionHeader from '../../components/SelectionHeader';
import SimpleList from '../../components/SimpleList';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
@@ -7,7 +10,7 @@ import {DDS} from '../../services/DeviceDetection';
import {eSendEvent} from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import SearchService from '../../services/SearchService';
-import { InteractionManager } from '../../utils';
+import {InteractionManager} from '../../utils';
import {eScrollEvent} from '../../utils/Events';
export const Favorites = ({route, navigation}) => {
const [state, dispatch] = useTracked();
@@ -17,16 +20,16 @@ export const Favorites = ({route, navigation}) => {
let pageIsLoaded = false;
let ranAfterInteractions = false;
-
+
const runAfterInteractions = () => {
InteractionManager.runAfterInteractions(() => {
if (localLoad) {
setLocalLoad(false);
}
- Navigation.routeNeedsUpdate('Favorites',() => {
- dispatch({type:Actions.FAVORITES})
- })
+ Navigation.routeNeedsUpdate('Favorites', () => {
+ dispatch({type: Actions.FAVORITES});
+ });
eSendEvent(eScrollEvent, {name: 'Favorites', type: 'in'});
updateSearch();
@@ -94,26 +97,33 @@ export const Favorites = ({route, navigation}) => {
};
return (
- {
- dispatch({type: Actions.FAVORITES});
- }}
- loading={loading || localLoad}
- placeholderData={{
- heading: 'Your favorites',
- paragraph: 'You have not added any notes to favorites yet.',
- button: null,
- loading: 'Loading your favorites',
- }}
- headerProps={{
- heading: 'Favorites',
- }}
- focused={() => navigation.isFocused()}
- placeholder={}
- placeholderText="Notes you favorite appear here"
- />
+ <>
+
+
+
+
+ {
+ dispatch({type: Actions.FAVORITES});
+ }}
+ screen="Favorites"
+ loading={loading || localLoad}
+ placeholderData={{
+ heading: 'Your favorites',
+ paragraph: 'You have not added any notes to favorites yet.',
+ button: null,
+ loading: 'Loading your favorites',
+ }}
+ headerProps={{
+ heading: 'Favorites',
+ }}
+ focused={() => navigation.isFocused()}
+ placeholder={}
+ placeholderText="Notes you favorite appear here"
+ />
+ >
);
};
diff --git a/apps/mobile/src/views/Folders/index.js b/apps/mobile/src/views/Folders/index.js
index 971603967..90ec72175 100644
--- a/apps/mobile/src/views/Folders/index.js
+++ b/apps/mobile/src/views/Folders/index.js
@@ -11,6 +11,9 @@ import {eScrollEvent} from '../../utils/Events';
import Navigation from '../../services/Navigation';
import {DDS} from '../../services/DeviceDetection';
import {InteractionManager} from '../../utils';
+import { ContainerTopSection } from '../../components/Container/ContainerTopSection';
+import { Header } from '../../components/Header';
+import SelectionHeader from '../../components/SelectionHeader';
export const Folders = ({route, navigation}) => {
const [state, dispatch] = useTracked();
@@ -97,9 +100,19 @@ export const Folders = ({route, navigation}) => {
return (
<>
+
+
+
+
navigation.isFocused()}
loading={loading}
placeholderData={{
diff --git a/apps/mobile/src/views/Home/index.js b/apps/mobile/src/views/Home/index.js
index 6834f9a17..944050514 100755
--- a/apps/mobile/src/views/Home/index.js
+++ b/apps/mobile/src/views/Home/index.js
@@ -1,16 +1,19 @@
-import React, { useCallback, useEffect, useState } from 'react';
-import { ContainerBottomButton } from '../../components/Container/ContainerBottomButton';
+import React, {useCallback, useEffect, useState} from 'react';
+import {ContainerBottomButton} from '../../components/Container/ContainerBottomButton';
+import {ContainerTopSection} from '../../components/Container/ContainerTopSection';
import SimpleList from '../../components/SimpleList';
-import { useTracked } from '../../provider';
-import { Actions } from '../../provider/Actions';
-import { DDS } from '../../services/DeviceDetection';
-import { eSendEvent } from '../../services/EventManager';
+import {useTracked} from '../../provider';
+import {Actions} from '../../provider/Actions';
+import {DDS} from '../../services/DeviceDetection';
+import {eSendEvent} from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import SearchService from '../../services/SearchService';
-import { InteractionManager, scrollRef } from '../../utils';
-import { db } from '../../utils/DB';
-import { eOnLoadNote, eScrollEvent } from '../../utils/Events';
-import { tabBarRef } from '../../utils/Refs';
+import {InteractionManager, scrollRef} from '../../utils';
+import {db} from '../../utils/DB';
+import {eOnLoadNote, eScrollEvent} from '../../utils/Events';
+import {tabBarRef} from '../../utils/Refs';
+import {Header} from '../../components/Header/index';
+import SelectionHeader from '../../components/SelectionHeader';
export const Home = ({route, navigation}) => {
const [state, dispatch] = useTracked();
const {loading} = state;
@@ -93,8 +96,6 @@ export const Home = ({route, navigation}) => {
}, [notes]);
const updateSearch = () => {
-
-
SearchService.update({
placeholder: 'Type a keyword to search in notes',
data: db?.notes?.all,
@@ -104,7 +105,6 @@ export const Home = ({route, navigation}) => {
};
const _onPressBottomButton = async () => {
-
if (!DDS.isLargeTablet()) {
tabBarRef.current?.goToPage(1);
} else {
@@ -114,12 +114,23 @@ export const Home = ({route, navigation}) => {
return (
<>
+
+
+
+
+
{
const [topics, setTopics] = useState(route.params.notebook.topics);
const [loading, setLoading] = useState(true);
let params = route.params;
let pageIsLoaded = false;
-
let ranAfterInteractions = false;
- const runAfterInteractions = (time = 150) => {
+ const runAfterInteractions = (time = 400) => {
InteractionManager.runAfterInteractions(() => {
let notebook = db.notebooks.notebook(params.notebook?.id).data;
params.notebook = notebook;
@@ -36,14 +37,14 @@ export const Notebook = ({route, navigation}) => {
if (loading) {
setLoading(false);
}
- },10)
+ }, 10);
Navigation.routeNeedsUpdate('Notebook', () => {
onLoad();
});
eSendEvent(eScrollEvent, {name: params.title, type: 'in'});
if (params.menu) {
navigation.setOptions({
- animationEnabled: false,
+ animationEnabled: true,
gestureEnabled: false,
});
} else {
@@ -56,13 +57,13 @@ export const Notebook = ({route, navigation}) => {
ranAfterInteractions = false;
}, time);
};
- const onLoad = (data) => {
+ const onLoad = data => {
if (data) {
setLoading(true);
params = data;
}
- runAfterInteractions(data ? 150 : 1);
+ runAfterInteractions(data ? 400 : 1);
};
useEffect(() => {
@@ -125,12 +126,22 @@ export const Notebook = ({route, navigation}) => {
return (
<>
+
+
+
+
{
onLoad();
}}
+ screen="Notebook"
headerProps={{
heading: params.title,
paragraph: 'Edit notebook',
diff --git a/apps/mobile/src/views/Notes/index.js b/apps/mobile/src/views/Notes/index.js
index bdacbccc1..078062189 100644
--- a/apps/mobile/src/views/Notes/index.js
+++ b/apps/mobile/src/views/Notes/index.js
@@ -1,6 +1,9 @@
import React, {useCallback, useEffect, useState} from 'react';
import {Platform} from 'react-native';
import {ContainerBottomButton} from '../../components/Container/ContainerBottomButton';
+import {ContainerTopSection} from '../../components/Container/ContainerTopSection';
+import {Header} from '../../components/Header';
+import SelectionHeader from '../../components/SelectionHeader';
import SimpleList from '../../components/SimpleList';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
@@ -32,7 +35,7 @@ export const Notes = ({route, navigation}) => {
let pageIsLoaded = false;
let ranAfterInteractions = false;
- const runAfterInteractions = (time = 150) => {
+ const runAfterInteractions = (time = 400) => {
InteractionManager.runAfterInteractions(() => {
Navigation.routeNeedsUpdate('NotesPage', () => {
init();
@@ -61,7 +64,7 @@ export const Notes = ({route, navigation}) => {
}
if (params.menu) {
navigation.setOptions({
- animationEnabled: false,
+ animationEnabled: true,
gestureEnabled: false,
});
} else {
@@ -128,7 +131,7 @@ export const Notes = ({route, navigation}) => {
setActionAfterFirstSave();
if (!ranAfterInteractions) {
ranAfterInteractions = true;
- runAfterInteractions(data ? 150 : 1);
+ runAfterInteractions(data ? 400 : 1);
}
if (!pageIsLoaded) {
@@ -257,9 +260,19 @@ export const Notes = ({route, navigation}) => {
return (
<>
+
+
+
+
{
};
}, []);
-
-
return (
<>
+
+
+
+
navigation.isFocused()}
placeholderText={`Notes you write appear here`}
jumpToDialog={true}
@@ -68,7 +74,7 @@ export const Search = ({route, navigation}) => {
SearchService.getSearchInformation().title
}`,
button: null,
- loading:"Searching..."
+ loading: 'Searching...',
}}
/>
>
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index ae2f91762..9d13c49dc 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -1,8 +1,7 @@
import React, {createRef, useCallback, useEffect, useState} from 'react';
-import {Linking} from 'react-native';
import {
Appearance,
- InteractionManager,
+ Linking,
Platform,
ScrollView,
TouchableOpacity,
@@ -13,10 +12,12 @@ import Menu, {MenuItem} from 'react-native-reanimated-material-menu';
import AnimatedProgress from 'react-native-reanimated-progress-bar';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {Button} from '../../components/Button';
+import {ContainerTopSection} from '../../components/Container/ContainerTopSection';
import BaseDialog from '../../components/Dialog/base-dialog';
import DialogButtons from '../../components/Dialog/dialog-buttons';
import DialogContainer from '../../components/Dialog/dialog-container';
import DialogHeader from '../../components/Dialog/dialog-header';
+import {Header as TopHeader} from '../../components/Header/index';
import Input from '../../components/Input';
import {PressableButton} from '../../components/PressableButton';
import Seperator from '../../components/Seperator';
@@ -42,10 +43,8 @@ import SettingsService from '../../services/SettingsService';
import {
AndroidModule,
APP_VERSION,
- dWidth,
- getElevation,
+ InteractionManager,
MenuItemsList,
- setSetting,
SUBSCRIPTION_PROVIDER,
SUBSCRIPTION_STATUS_STRINGS,
} from '../../utils';
@@ -75,7 +74,7 @@ import {sleep, timeConverter} from '../../utils/TimeUtils';
let menuRef = createRef();
-const format = (ver) => {
+const format = ver => {
let parts = ver.toString().split('');
return `v${parts[0]}.${parts[1]}.${parts[2]}${
parts[3] === '0' ? '' : parts[3]
@@ -86,20 +85,11 @@ export const Settings = ({navigation}) => {
const [state, dispatch] = useTracked();
const {colors} = state;
const [version, setVersion] = useState(null);
-
+ const [loading, setLoading] = useState(true);
let pageIsLoaded = false;
const onFocus = useCallback(() => {
eSendEvent(eScrollEvent, {name: 'Settings', type: 'in'});
- if (DDS.isLargeTablet()) {
- dispatch({
- type: Actions.CONTAINER_BOTTOM_BUTTON,
- state: {
- onPress: null,
- },
- });
- }
-
eSendEvent(eUpdateSearchState, {
placeholder: '',
data: [],
@@ -125,13 +115,16 @@ export const Settings = ({navigation}) => {
}, []);
useEffect(() => {
- navigation.addListener('focus', onFocus);
- db.version()
- .then((ver) => {
- console.log(ver, 'VERSION');
- setVersion(ver);
- })
- .catch((e) => console.log(e, 'VER'));
+ InteractionManager.runAfterInteractions(() => {
+ setLoading(false);
+ navigation.addListener('focus', onFocus);
+ db.version()
+ .then(ver => {
+ console.log(ver, 'VERSION');
+ setVersion(ver);
+ })
+ .catch(e => console.log(e, 'VER'));
+ });
return () => {
pageIsLoaded = false;
@@ -243,47 +236,61 @@ export const Settings = ({navigation}) => {
];
return (
-
-
- eSendEvent(eScrollEvent, e.nativeEvent.contentOffset.y)
- }
- scrollEventThrottle={1}
+ <>
+
+
+
+
- {!DDS.isLargeTablet() && (
-
- )}
-
-
-
-
-
-
-
- {otherItems.map((item) => (
-
- ))}
-
-
-
-
+ eSendEvent(eScrollEvent, {
+ y:e.nativeEvent.contentOffset.y,
+ screen:"Settings"
+ })
+ }
+ scrollEventThrottle={1}
style={{
- height: 400,
- }}
- />
-
-
+ paddingHorizontal: 0,
+ }}>
+ {!DDS.isLargeTablet() && (
+
+ )}
+
+
+
+
+ {!loading && (
+ <>
+
+
+ >
+ )}
+
+
+
+ {otherItems.map(item => (
+
+ ))}
+
+
+
+
+
+
+ >
);
};
@@ -386,7 +393,7 @@ const AccoutLogoutSection = () => {
{
+ onChangeText={v => {
passwordValue = v;
}}
secureTextEntry={true}
@@ -543,7 +550,7 @@ const SettingsUserSection = () => {
type: 5,
},
}; */
- const getTimeLeft = (t2) => {
+ const getTimeLeft = t2 => {
let d1 = new Date(Date.now());
let d2 = new Date(t2);
let diff = d2.getTime() - d1.getTime();
@@ -816,7 +823,7 @@ const SettingsUserSection = () => {
},
desc: 'Setup a new password for your account.',
},
- ].map((item) => (
+ ].map(item => (
{
'#FF1744',
'#B71C1C',
'#ffadad',
- ].map((item) => (
+ ].map(item => (
{
const checkVaultStatus = useCallback(() => {
InteractionManager.runAfterInteractions(() => {
- db.vault.exists().then(async (r) => {
+ db.vault.exists().then(async r => {
let available = await BiometricService.isBiometryAvailable();
let fingerprint = await BiometricService.hasInternetCredentials();
@@ -1134,7 +1141,7 @@ const SettingsPrivacyAndSecurity = () => {
paragraph="Select the level of security you want to enable."
/>
- {modes.map((item) => (
+ {modes.map(item => (
{
<>
- {backupItemsList.map((item) => (
+ {backupItemsList.map(item => (
{
title: 'Weekly',
value: 'weekly',
},
- ].map((item) => (
+ ].map(item => (
{
diff --git a/apps/mobile/src/views/Tags/index.js b/apps/mobile/src/views/Tags/index.js
index 6190599eb..4f8c6cade 100644
--- a/apps/mobile/src/views/Tags/index.js
+++ b/apps/mobile/src/views/Tags/index.js
@@ -1,5 +1,8 @@
import React, {useCallback, useEffect, useState} from 'react';
+import {ContainerTopSection} from '../../components/Container/ContainerTopSection';
+import {Header} from '../../components/Header';
import {Placeholder} from '../../components/ListPlaceholders';
+import SelectionHeader from '../../components/SelectionHeader';
import SimpleList from '../../components/SimpleList';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
@@ -7,7 +10,7 @@ import {DDS} from '../../services/DeviceDetection';
import {eSendEvent} from '../../services/EventManager';
import Navigation from '../../services/Navigation';
import SearchService from '../../services/SearchService';
-import { InteractionManager } from '../../utils';
+import {InteractionManager} from '../../utils';
import {eScrollEvent} from '../../utils/Events';
export const Tags = ({route, navigation}) => {
@@ -17,7 +20,6 @@ export const Tags = ({route, navigation}) => {
let pageIsLoaded = false;
let ranAfterInteractions = false;
-
const runAfterInteractions = () => {
InteractionManager.runAfterInteractions(() => {
@@ -25,33 +27,23 @@ export const Tags = ({route, navigation}) => {
setLoading(false);
}
- Navigation.routeNeedsUpdate('Tags',() => {
- dispatch({type:Actions.TAGS})
- })
+ Navigation.routeNeedsUpdate('Tags', () => {
+ dispatch({type: Actions.TAGS});
+ });
eSendEvent(eScrollEvent, {name: 'Tags', type: 'in'});
- if (DDS.isLargeTablet()) {
- dispatch({
- type: Actions.CONTAINER_BOTTOM_BUTTON,
- state: {
- onPress: null,
- },
- });
- }
+
updateSearch();
ranAfterInteractions = false;
});
-
-
};
const onFocus = useCallback(() => {
if (!ranAfterInteractions) {
-
ranAfterInteractions = true;
runAfterInteractions();
}
-
+
if (!pageIsLoaded) {
pageIsLoaded = true;
return;
@@ -75,7 +67,7 @@ export const Tags = ({route, navigation}) => {
}
navigation.addListener('focus', onFocus);
return () => {
- pageIsLoaded = false;
+ pageIsLoaded = false;
ranAfterInteractions = false;
eSendEvent(eScrollEvent, {name: 'Tags', type: 'back'});
navigation.removeListener('focus', onFocus);
@@ -93,28 +85,35 @@ export const Tags = ({route, navigation}) => {
placeholder: 'Search in tags',
data: tags,
type: 'tags',
- title:"Tags"
+ title: 'Tags',
});
};
return (
- navigation.isFocused()}
- placeholderData={{
- heading: 'Your tags',
- paragraph: 'You have not created any tags for your notes yet.',
- button: null,
- loading: 'Loading your tags.',
- }}
- placeholder={}
- placeholderText="Tags added to notes appear here"
- />
+ <>
+
+
+
+
+ navigation.isFocused()}
+ placeholderData={{
+ heading: 'Your tags',
+ paragraph: 'You have not created any tags for your notes yet.',
+ button: null,
+ loading: 'Loading your tags.',
+ }}
+ placeholder={}
+ placeholderText="Tags added to notes appear here"
+ />
+ >
);
};
diff --git a/apps/mobile/src/views/Trash/index.js b/apps/mobile/src/views/Trash/index.js
index faf76e371..2de40b957 100644
--- a/apps/mobile/src/views/Trash/index.js
+++ b/apps/mobile/src/views/Trash/index.js
@@ -1,9 +1,12 @@
import React, {useCallback, useEffect, useState} from 'react';
import {ContainerBottomButton} from '../../components/Container/ContainerBottomButton';
+import {ContainerTopSection} from '../../components/Container/ContainerTopSection';
import {simpleDialogEvent} from '../../components/DialogManager/recievers';
import {TEMPLATE_EMPTY_TRASH} from '../../components/DialogManager/Templates';
+import {Header} from '../../components/Header';
import {Placeholder} from '../../components/ListPlaceholders';
+import SelectionHeader from '../../components/SelectionHeader';
import SimpleList from '../../components/SimpleList';
import {useTracked} from '../../provider';
import {Actions} from '../../provider/Actions';
@@ -33,14 +36,7 @@ export const Trash = ({route, navigation}) => {
});
eSendEvent(eScrollEvent, {name: 'Trash', type: 'in'});
- if (DDS.isLargeTablet()) {
- dispatch({
- type: Actions.CONTAINER_BOTTOM_BUTTON,
- state: {
- onPress: null,
- },
- });
- }
+
updateSearch();
ranAfterInteractions = false;
});
@@ -101,9 +97,19 @@ export const Trash = ({route, navigation}) => {
return (
<>
+
+
+
+
navigation.isFocused()}
loading={loading}
placeholderData={{