Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions App.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-03-30 19:25:19
* @Last Modified by: czy0729
* @Last Modified time: 2022-03-24 21:45:18
* @Last Modified time: 2022-04-10 12:18:14
*/
import '@utils/thirdParty/stable-sort'
import 'react-native-gesture-handler'
Expand All @@ -11,7 +11,7 @@ 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 { NavigationContainer, DeepLink, BackAndroid } from '@components'
import { DEV, NavigationContainer, DeepLink, BackAndroid } from '@components'
import { AppCommon } from '@_'
import { _ } from '@stores'
import {
Expand Down Expand Up @@ -62,6 +62,7 @@ export default function App() {
<BackAndroid />
<DeepLink />
</Provider>
<DEV />
</SafeAreaProvider>
)
}
36 changes: 13 additions & 23 deletions App.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,40 @@
* @Author: czy0729
* @Date: 2019-03-30 19:25:19
* @Last Modified by: czy0729
* @Last Modified time: 2022-03-07 22:43:10
* @Last Modified time: 2022-04-11 09:36:36
*/
import React, { useEffect } from 'react'
import * as ReactNativeScreens from 'react-native-screens'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { NavigationContainer } from '@react-navigation/native'
import { createNativeStackNavigator } from '@react-navigation/native-stack'
import Provider from '@ant-design/react-native/lib/provider'
import { DeepLink } from '@components'
import Stacks from '@src/navigations'
import { DeepLink, NavigationContainer } from '@components'
import { HoldMenuProvider } from '@components/@/react-native-hold-menu'
import { AppCommon } from '@screens/_'
import { AppCommon } from '@_'
import { _ } from '@stores'
import { useCachedResources, useOrientation } from '@utils/hooks'
import { useCachedResources, useOrientation, useGlobalMount } from '@utils/hooks'
import theme from '@styles/theme'
import { Home, Subject, Notify } from '@screens'
// import { createNavigator } from './src/navigations/index'

ReactNativeScreens.enableScreens()

const Stack = createNativeStackNavigator()

export default function App() {
// 加载图标等资源
const isLoadingComplete = useCachedResources()

// 获取水平状态, 只有平板允许横屏, 手机锁竖屏
const orientation = useOrientation()
useEffect(() => {
_.toggleOrientation(orientation)
}, [orientation])

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

if (!isLoadingComplete) return null

return (
<SafeAreaProvider style={_.container.flex}>
<Provider theme={theme}>
<HoldMenuProvider>
{/* {createNavigator()} */}
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name='Home' component={Home} />
<Stack.Screen
name='Subject'
component={Subject}
opition={Subject.navigationOptions}
/>
<Stack.Screen name='Notify' component={Notify} />
</Stack.Navigator>
<Stacks />
</NavigationContainer>
</HoldMenuProvider>
<DeepLink />
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2019-06-02 14:42:28
* @Last Modified by: czy0729
* @Last Modified time: 2022-04-07 07:37:14
* @Last Modified time: 2022-04-11 10:57:53
*/
export const INIT_DEV_DARK = '' // '' 不控制 | true 强制黑暗 | false 强制白天
export const INIT_ROUTE = 'Home'
Expand Down
99 changes: 50 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,65 @@
"scripts": {
"38": "mv ./node_modules ../SDK && mv ../SDK/38/node_modules ./ && mv ../SDK/node_modules ../SDK/39 && cp ./package.json ./web/ios/package.json && cp ./web/android/package.json ./package.json",
"39": "mv ./node_modules ../SDK && mv ../SDK/39/node_modules ./ && mv ../SDK/node_modules ../SDK/38 && cp ./package.json ./web/android/package.json && cp ./web/ios/package.json ./package.json",
"umeng": "mv ../SDK/Umeng/MainActivity.java ./android/app/src/main/java/com/czy0729/bangumi/MainActivity.java",
"google": "mv ../SDK/Google/MainActivity.java ./android/app/src/main/java/com/czy0729/bangumi/MainActivity.java",
"start": "EXPO_USE_EXOTIC=0 expo start",
"start:offline": "EXPO_USE_EXOTIC=0 expo start --lan --offline",
"kill": "ps -ef |grep java|awk 'NR==1 {print $2}'|xargs kill -15",
"android": "react-native run-android --no-jetifier",
"clean": "cd android && ./gradlew clean",
"build": "cd android && ./gradlew assembleRelease && cd .. && node web/rename.js",
"build": "cd android && ./gradlew assembleRelease",
"build:ios": "expo build:ios -c",
"open": "open ./android/app/build/outputs/apk/release/",
"ios": "react-native run-ios",
"build:ios": "expo build:ios -c"
"ios": "react-native run-ios"
},
"dependencies": {
"@ant-design/react-native": "3.1.3",
"@expo/vector-icons": "12.0.0",
"@gorhom/portal": "1.0.11",
"@react-native-community/async-storage": "1.12.1",
"@gorhom/portal": "^1.0.11",
"@react-native-async-storage/async-storage": "^1.13.0",
"@react-native-community/async-storage": "~1.12.0",
"@react-native-community/blur": "3.6.0",
"@react-native-community/cameraroll": "4.0.4",
"@react-native-community/viewpager": "3.3.0",
"@react-native-community/viewpager": "5.0.11",
"@react-native-masked-view/masked-view": "0.2.6",
"@react-navigation/bottom-tabs": "5.x",
"@react-navigation/native": "5.x",
"@react-navigation/native-stack": "5.x",
"@react-navigation/stack": "5.x",
"babel-preset-expo": "9.0.2",
"bangumi-data": "^0.3.83",
"axios": "^0.19.0",
"bangumi-data": "^0.3.88",
"cheerio-without-node-native": "0.20.2",
"crypto-js": "3.1.9-1",
"dayjs": "1.10.8",
"deepmerge": "4.2.2",
"expo": "38.0.0",
"expo-asset": "8.1.7",
"expo-blur": "8.1.2",
"expo-constants": "9.1.1",
"expo-file-system": "9.0.1",
"expo-font": "8.2.1",
"expo-keep-awake": "8.2.1",
"expo-linear-gradient": "8.2.1",
"expo-linking": "1.0.1",
"expo-screen-orientation": "1.1.1",
"expo-splash-screen": "0.5.0",
"expo-status-bar": "1.0.0",
"expo-web-browser": "8.3.1",
"expo": "^41.0.0",
"expo-asset": "~8.3.1",
"expo-blur": "~9.0.3",
"expo-constants": "~10.1.3",
"expo-file-system": "~11.0.2",
"expo-font": "~9.1.0",
"expo-linear-gradient": "~9.1.0",
"expo-linking": "~2.2.3",
"expo-screen-orientation": "~3.1.0",
"expo-splash-screen": "~0.10.2",
"expo-status-bar": "~1.0.4",
"expo-web-browser": "~9.1.0",
"hoist-non-react-statics": "2.5.0",
"lazy-aho-corasick": "1.2.2",
"lodash.isequal": "4.5.0",
"lazy-aho-corasick": "^1.2.2",
"lodash.isequal": "^4.5.0",
"mobx": "4.9.2",
"mobx-react": "5.4.3",
"mobx-react-lite": "2.0.7",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.62.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "0.63.4",
"react-native-actions-shortcuts": "^1.0.1",
"react-native-android-keyboard-adjust": "1.2.0",
"react-native-device-info": "8.5.0",
"react-native-draggable-grid": "2.1.4",
"react-native-exception-handler": "2.10.10",
"react-native-expo-image-cache": "4.1.0",
"react-native-device-info": "^8.4.8",
"react-native-draggable-grid": "^2.1.4",
"react-native-exception-handler": "^2.10.8",
"react-native-expo-image-cache": "^4.0.8",
"react-native-fast-image": "8.5.11",
"react-native-fs": "2.18.0",
"react-native-gesture-handler": "1.10.2",
Expand All @@ -69,32 +71,31 @@
"react-native-reanimated": "2.1.0",
"react-native-render-html": "4.1.1",
"react-native-restart": "0.0.14",
"react-native-safe-area-context": "3.1.9",
"react-native-safe-area-context": "3.2.0",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "3.11.1",
"react-native-smb": "^0.2.4",
"react-native-screens": "~3.0.0",
"react-native-tab-view": "2.14.3",
"react-native-unimodules": "0.12.0",
"react-native-webview": "11.0.0",
"react-native-unimodules": "~0.13.3",
"react-native-webview": "11.2.3",
"react-navigation": "3.0.9",
"rn-fetch-blob": "0.12.0"
"rn-fetch-blob": "^0.12.0"
},
"resolutions": {
"react-native-safe-area-view": "1.1.1"
},
"devDependencies": {
"@babel/core": "7.9.0",
"@react-native-community/eslint-config": "3.0.1",
"@types/react": "16.9.35",
"@types/react-native": "0.63.2",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"eslint": "7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-jest": "24.5.2",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-react": "7.26.1",
"typescript": "4.6.2"
"@babel/core": "~7.9.0",
"@react-native-community/eslint-config": "^3.0.1",
"@types/react": "~16.9.35",
"@types/react-native": "~0.63.2",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^24.5.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.26.1",
"typescript": "~4.0.0"
},
"private": true,
"version": "1.0.0"
Expand Down
5 changes: 3 additions & 2 deletions src/components/header/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2022-03-12 04:55:18
* @Last Modified by: czy0729
* @Last Modified time: 2022-04-05 04:20:07
* @Last Modified time: 2022-04-11 11:37:00
*/
import React, { useState, useCallback } from 'react'
import { _, systemStore } from '@stores'
Expand Down Expand Up @@ -42,6 +42,7 @@ export const updateHeader = ({
headerStyle: {
backgroundColor: backgroundColor || (mode ? 'transparent' : _.colorPlain),
borderBottomWidth: 0,
shadowOpacity: 0,
elevation: 0
},

Expand Down Expand Up @@ -82,7 +83,7 @@ export const updateHeader = ({
if (mode) {
options.headerStyle = {
...options.headerStyle,
height: 0.5, // 别问为什么留0.5, 我也想知道, 不给他留一点就是会出问题
height: IOS ? 0 : 0.5, // 别问为什么留0.5, 我也想知道, 不给他留一点就是会出问题
backgroundColor: _.colorPlain
}

Expand Down
23 changes: 19 additions & 4 deletions src/navigations/tab-bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
* @Author: czy0729
* @Date: 2022-03-09 23:42:27
* @Last Modified by: czy0729
* @Last Modified time: 2022-03-17 15:41:11
* @Last Modified time: 2022-04-11 11:33:18
*/
import React from 'react'
import { Flex, Touchable, Iconfont, Text } from '@components'
import { BlurView } from '@_'
import { _ } from '@stores'
import { ob } from '@utils/decorators'
import { IOS } from '@constants'
import { routesConfig } from './config'

function TabBar({ state, descriptors, navigation }) {
Expand All @@ -16,7 +18,8 @@ function TabBar({ state, descriptors, navigation }) {

const styles = memoStyles()
return (
<Flex style={styles.tabBar}>
<Flex style={styles.tabBar} align='start'>
{IOS && <BlurView style={styles.blurView} />}
{state.routes.map((route, index) => {
const isFocused = state.index === index
const config = routesConfig[route.name]
Expand Down Expand Up @@ -72,9 +75,14 @@ export default ob(TabBar)

const memoStyles = _.memoStyles(() => ({
tabBar: {
height: _.tabBarHeight,
position: _.ios('absolute', undefined),
zIndex: 100,
right: 0,
bottom: 0,
left: 0,
height: _.ios(_.tabBarHeight + 20, _.tabBarHeight),
backgroundColor: _.ios(
_.select(_.colorPlain, _._colorDarkModeLevel1),
'transparent',
_.select(_.colorPlain, _.deep(_._colorPlain, _._colorDarkModeLevel1))
),
borderTopWidth: _.ios(0, _.select(_.hairlineWidth, _.deep(0, _.hairlineWidth))),
Expand All @@ -89,5 +97,12 @@ const memoStyles = _.memoStyles(() => ({
icon: {
width: 24,
height: 24
},
blurView: {
position: 'absolute',
top: 0,
right: 0,
bottom: 0,
left: 0
}
}))
9 changes: 7 additions & 2 deletions src/screens/discovery/index/ds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
* @Author: czy0729
* @Date: 2021-07-16 14:21:27
* @Last Modified by: czy0729
* @Last Modified time: 2022-04-07 03:26:27
* @Last Modified time: 2022-04-11 11:17:42
*/
import { IOS } from '@constants'

export type MenuItemType = {
key: string
name: string
Expand Down Expand Up @@ -110,7 +112,8 @@ const menuMap = {
key: 'Smb',
name: '本地管理',
text: 'SMB',
size: 14
size: 14,
ios: false
},
Character: {
key: 'Character',
Expand Down Expand Up @@ -163,6 +166,8 @@ export function getMenus(discoveryMenu: MenuMapType[] = []): MenuItemType[] {
]
}

if (IOS) return menus.filter(item => item.ios !== false)

return menus
}

Expand Down
3 changes: 2 additions & 1 deletion src/screens/home/mono/header-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: czy0729
* @Date: 2020-06-12 10:43:32
* @Last Modified by: czy0729
* @Last Modified time: 2022-03-15 02:14:57
* @Last Modified time: 2022-04-11 11:47:47
*/
import React from 'react'
import { Flex, Text } from '@components'
Expand Down Expand Up @@ -53,6 +53,7 @@ export default obc(({ $ }) => {

const styles = _.create({
container: {
marginTop: _.ios(4, 0),
marginLeft: -_.sm,
marginRight: _.lg
},
Expand Down
Loading