mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
update status bar color always
This commit is contained in:
@@ -109,6 +109,7 @@ const Overlay = ({onLoad}) => {
|
|||||||
});
|
});
|
||||||
setOpacity(false);
|
setOpacity(false);
|
||||||
await sleep(150);
|
await sleep(150);
|
||||||
|
eSendEvent(eOpenSideMenu);
|
||||||
Animated.timing(opacityV, {
|
Animated.timing(opacityV, {
|
||||||
toValue: 0,
|
toValue: 0,
|
||||||
duration: 150,
|
duration: 150,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import PremiumService from './src/services/PremiumService';
|
|||||||
import SettingsService from './src/services/SettingsService';
|
import SettingsService from './src/services/SettingsService';
|
||||||
import Sync from './src/services/Sync';
|
import Sync from './src/services/Sync';
|
||||||
import {APP_VERSION, editing} from './src/utils';
|
import {APP_VERSION, editing} from './src/utils';
|
||||||
import {COLOR_SCHEME} from './src/utils/Colors';
|
import {COLOR_SCHEME, updateStatusBarColor} from './src/utils/Colors';
|
||||||
import {db} from './src/utils/DB';
|
import {db} from './src/utils/DB';
|
||||||
import {
|
import {
|
||||||
eClearEditor,
|
eClearEditor,
|
||||||
@@ -36,16 +36,6 @@ let prevTransactionId = null;
|
|||||||
let subsriptionSuccessListener;
|
let subsriptionSuccessListener;
|
||||||
let subsriptionErrorListener;
|
let subsriptionErrorListener;
|
||||||
|
|
||||||
function updateStatusBarColor() {
|
|
||||||
StatusBar.setBarStyle(
|
|
||||||
COLOR_SCHEME.night ? 'light-content' : 'dark-content',
|
|
||||||
true,
|
|
||||||
);
|
|
||||||
if (Platform.OS === 'android') {
|
|
||||||
StatusBar.setBackgroundColor('transparent', true);
|
|
||||||
StatusBar.setTranslucent(true, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function storeAppState() {
|
async function storeAppState() {
|
||||||
if (editing.currentlyEditing) {
|
if (editing.currentlyEditing) {
|
||||||
|
|||||||
@@ -1,39 +1,41 @@
|
|||||||
import {
|
import {
|
||||||
activateKeepAwake,
|
activateKeepAwake,
|
||||||
deactivateKeepAwake
|
deactivateKeepAwake,
|
||||||
} from '@sayem314/react-native-keep-awake';
|
} from '@sayem314/react-native-keep-awake';
|
||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, {useCallback, useEffect, useState} from 'react';
|
||||||
import { Dimensions, View } from 'react-native';
|
import {Dimensions, View} from 'react-native';
|
||||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||||
import { notesnook } from './e2e/test.ids';
|
import {notesnook} from './e2e/test.ids';
|
||||||
import ContextMenu from './src/components/ContextMenu';
|
import ContextMenu from './src/components/ContextMenu';
|
||||||
import { DialogManager } from './src/components/DialogManager';
|
import {DialogManager} from './src/components/DialogManager';
|
||||||
import { DummyText } from './src/components/DummyText';
|
import {DummyText} from './src/components/DummyText';
|
||||||
import { Menu } from './src/components/Menu';
|
import {Menu} from './src/components/Menu';
|
||||||
import Splash from './src/components/SplashScreen';
|
import Splash from './src/components/SplashScreen';
|
||||||
import { Toast } from './src/components/Toast';
|
import {Toast} from './src/components/Toast';
|
||||||
import { NavigationStack } from './src/navigation/Drawer';
|
import {NavigationStack} from './src/navigation/Drawer';
|
||||||
import { NavigatorStack } from './src/navigation/NavigatorStack';
|
import {NavigatorStack} from './src/navigation/NavigatorStack';
|
||||||
import { useTracked } from './src/provider';
|
import {useTracked} from './src/provider';
|
||||||
import { Actions } from './src/provider/Actions';
|
import {Actions} from './src/provider/Actions';
|
||||||
import { DDS } from './src/services/DeviceDetection';
|
import {DDS} from './src/services/DeviceDetection';
|
||||||
import {
|
import {
|
||||||
eSendEvent,
|
eSendEvent,
|
||||||
eSubscribeEvent,
|
eSubscribeEvent,
|
||||||
eUnSubscribeEvent
|
eUnSubscribeEvent,
|
||||||
} from './src/services/EventManager';
|
} from './src/services/EventManager';
|
||||||
import { editing, setWidthHeight } from './src/utils';
|
import {editing, setWidthHeight} from './src/utils';
|
||||||
|
import {updateStatusBarColor} from './src/utils/Colors';
|
||||||
import {
|
import {
|
||||||
eClearEditor,
|
eClearEditor,
|
||||||
eCloseFullscreenEditor,
|
eCloseFullscreenEditor,
|
||||||
eCloseSideMenu,
|
eCloseSideMenu,
|
||||||
eOnLoadNote,
|
eOnLoadNote,
|
||||||
eOpenFullscreenEditor,
|
eOpenFullscreenEditor,
|
||||||
eOpenSideMenu
|
eOpenSideMenu,
|
||||||
} from './src/utils/Events';
|
} from './src/utils/Events';
|
||||||
import { editorRef, tabBarRef } from './src/utils/Refs';
|
import {editorRef, tabBarRef} from './src/utils/Refs';
|
||||||
import { EditorWrapper } from './src/views/Editor/EditorWrapper';
|
import {sleep} from './src/utils/TimeUtils';
|
||||||
import { EditorWebView, getNote } from './src/views/Editor/Functions';
|
import {EditorWrapper} from './src/views/Editor/EditorWrapper';
|
||||||
|
import {EditorWebView, getNote} from './src/views/Editor/Functions';
|
||||||
import tiny from './src/views/Editor/tiny/tiny';
|
import tiny from './src/views/Editor/tiny/tiny';
|
||||||
let {width, height} = Dimensions.get('window');
|
let {width, height} = Dimensions.get('window');
|
||||||
let layoutTimer = null;
|
let layoutTimer = null;
|
||||||
@@ -51,13 +53,17 @@ const onChangeTab = async (obj) => {
|
|||||||
eSendEvent(eOnLoadNote, {type: 'new'});
|
eSendEvent(eOnLoadNote, {type: 'new'});
|
||||||
editing.currentlyEditing = true;
|
editing.currentlyEditing = true;
|
||||||
}
|
}
|
||||||
|
sleep(1000).then(() => {
|
||||||
|
updateStatusBarColor();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
if (obj.from === 1) {
|
if (obj.from === 1) {
|
||||||
|
updateStatusBarColor();
|
||||||
deactivateKeepAwake();
|
deactivateKeepAwake();
|
||||||
if (getNote()?.locked) {
|
if (getNote()?.locked) {
|
||||||
eSendEvent(eClearEditor);
|
eSendEvent(eClearEditor);
|
||||||
}
|
}
|
||||||
eSendEvent("showTooltip");
|
eSendEvent('showTooltip');
|
||||||
editing.movedAway = true;
|
editing.movedAway = true;
|
||||||
tiny.call(EditorWebView, tiny.blur);
|
tiny.call(EditorWebView, tiny.blur);
|
||||||
}
|
}
|
||||||
@@ -182,7 +188,6 @@ const AppStack = React.memo(
|
|||||||
let size = event?.nativeEvent?.layout;
|
let size = event?.nativeEvent?.layout;
|
||||||
updatedDimensions = size;
|
updatedDimensions = size;
|
||||||
if (!size || (size.width === dimensions.width && deviceMode !== null)) {
|
if (!size || (size.width === dimensions.width && deviceMode !== null)) {
|
||||||
|
|
||||||
DDS.setSize(size);
|
DDS.setSize(size);
|
||||||
//console.log(deviceMode, 'MODE__');
|
//console.log(deviceMode, 'MODE__');
|
||||||
dispatch({type: Actions.DEVICE_MODE, state: deviceMode});
|
dispatch({type: Actions.DEVICE_MODE, state: deviceMode});
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const fixedColors = {
|
|||||||
fg: ACCENT.color,
|
fg: ACCENT.color,
|
||||||
normal: 'black',
|
normal: 'black',
|
||||||
icon: 'gray',
|
icon: 'gray',
|
||||||
transGray:"#00000010",
|
transGray: '#00000010',
|
||||||
errorBg: '#FFB6C1',
|
errorBg: '#FFB6C1',
|
||||||
errorText: '#ff6961',
|
errorText: '#ff6961',
|
||||||
successBg: '#DFF2BF',
|
successBg: '#DFF2BF',
|
||||||
@@ -103,3 +103,14 @@ export function setAccentColor(color) {
|
|||||||
|
|
||||||
return ACCENT;
|
return ACCENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateStatusBarColor() {
|
||||||
|
StatusBar.setBarStyle(
|
||||||
|
COLOR_SCHEME.night ? 'light-content' : 'dark-content',
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
if (Platform.OS === 'android') {
|
||||||
|
StatusBar.setBackgroundColor('transparent', true);
|
||||||
|
StatusBar.setTranslucent(true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user