Skip to content

Commit

Permalink
- [安卓] upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
czy0729 committed Aug 6, 2023
1 parent 5f23800 commit 28d2649
Show file tree
Hide file tree
Showing 164 changed files with 2,812 additions and 2,614 deletions.
3 changes: 1 addition & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
* @Author: czy0729
* @Date: 2019-03-13 05:15:36
* @Last Modified by: czy0729
* @Last Modified time: 2023-04-05 13:33:36
* @Last Modified time: 2023-08-05 05:21:04
*/
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint/eslint-plugin', 'prettier'],
extends: ['@react-native-community', 'prettier'],
ignorePatterns: [
'/node_modules',
'/components/@/*',
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
.expo
.expo-shared
.vscode
.cxx

# Bangumi App
# ----------------------------------------------------------------------------
Expand Down
40 changes: 21 additions & 19 deletions App.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
* @Author: czy0729
* @Date: 2019-03-30 19:25:19
* @Last Modified by: czy0729
* @Last Modified time: 2023-03-02 23:21:14
* @Last Modified time: 2023-07-28 17:11:23
*/
import '@utils/thirdParty/stable-sort'
import 'react-native-gesture-handler'
import React, { useEffect } from 'react'
import { LogBox } from 'react-native'
import { GestureHandlerRootView } from 'react-native-gesture-handler'
import { enableScreens } from 'react-native-screens'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import Provider from '@ant-design/react-native/lib/provider'
import Stacks from '@src/navigations'
import { DEV, NavigationContainer, DeepLink, BackAndroid } from '@components'
import { DEV, DeepLink, BackAndroid } from '@components'
import { AppCommon } from '@_'
import { _ } from '@stores'
import { androidKeyboardAdjust } from '@utils'
Expand All @@ -29,6 +28,7 @@ import { WSA } from '@constants'
import theme from '@styles/theme'
import { ANDROID_DEV_MENU } from './config'

enableScreens(true)
LogBox.ignoreAllLogs(true)

export default function App() {
Expand All @@ -49,34 +49,36 @@ export default function App() {

// 键盘模式设置为不调整画面大小, 需要动态改变的在页面内自行设置
useMount(() => {
enableScreens(false)
androidKeyboardAdjust('setAdjustPan')
})

// App启动稳定后统一做的操作
// App 启动稳定后统一做的操作
useGlobalMount()

// WSA 子系统窗口是可以随意改变大小的
const { window } = useDimensions()
useEffect(() => {
requestAnimationFrame(() => {
if (WSA) _.updateLayout()
})
if (WSA) {
requestAnimationFrame(() => {
_.updateLayout()
})
}
}, [window])

if (!isLoadingComplete) return null

return (
<SafeAreaProvider style={_.container.flex}>
<Provider theme={theme}>
<NavigationContainer>
<GestureHandlerRootView style={_.container.flex}>
<SafeAreaProvider style={_.container.flex}>
{/* @ts-expect-error */}
<Provider theme={theme}>
<Stacks />
</NavigationContainer>
<AppCommon />
<BackAndroid />
<DeepLink />
{ANDROID_DEV_MENU && <DEV />}
</Provider>
</SafeAreaProvider>
<AppCommon />
<BackAndroid />
<DeepLink />
{ANDROID_DEV_MENU && <DEV />}
</Provider>
</SafeAreaProvider>
</GestureHandlerRootView>
)
}
1 change: 1 addition & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default function App() {

return (
<SafeAreaProvider style={_.container.flex}>
{/* @ts-expect-error */}
<Provider theme={theme}>
<HoldMenuProvider>
<NavigationContainer>
Expand Down
15 changes: 15 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# OSX
#
.DS_Store

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
*.hprof

# Bundle artifacts
*.jsbundle
55 changes: 0 additions & 55 deletions android/app/BUCK

This file was deleted.

Loading

0 comments on commit 28d2649

Please sign in to comment.