From e8385b562456157fdd1e851bfff9b71c16bf31f3 Mon Sep 17 00:00:00 2001 From: czy0729 <402731062@qq.com> Date: Thu, 5 Sep 2019 20:47:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=80=E4=BA=9B=E6=B2=89?= =?UTF-8?q?=E6=B5=B8=E7=9A=84=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/status-bar-events.js | 28 ++++++++++++++---------- screens/discovery/award/index.js | 3 ++- screens/discovery/random/list.js | 6 +++-- screens/home/subject/index.js | 4 ++-- utils/decorators/withTransitionHeader.js | 3 ++- 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/components/status-bar-events.js b/components/status-bar-events.js index d3c283352..60b714ba7 100644 --- a/components/status-bar-events.js +++ b/components/status-bar-events.js @@ -5,7 +5,7 @@ * @Author: czy0729 * @Date: 2019-08-11 14:02:16 * @Last Modified by: czy0729 - * @Last Modified time: 2019-09-05 19:29:28 + * @Last Modified time: 2019-09-05 20:31:35 */ import React from 'react' import { StatusBar } from 'react-native' @@ -17,24 +17,29 @@ function StatusBarEvents({ barStyle, translucent, animated, - ...other + action }) { + const events = () => { + StatusBar.setBackgroundColor(backgroundColor, animated) + StatusBar.setBarStyle(barStyle, animated) + StatusBar.setTranslucent(translucent, animated) + } + const props = { + onDidFocus: () => events() + } + if (action === 'onWillFocus') { + props.onWillFocus = () => events() + } + return ( <> - { - StatusBar.setBackgroundColor(backgroundColor, animated) - StatusBar.setBarStyle(barStyle, animated) - StatusBar.setTranslucent(translucent, animated) - }} - /> + ) } @@ -43,7 +48,8 @@ StatusBarEvents.defaultProps = { backgroundColor: '#ffffff', barStyle: 'dark-content', translucent: !IOS, - animated: IOS + animated: IOS, + action: 'onDidFocus' } export default StatusBarEvents diff --git a/screens/discovery/award/index.js b/screens/discovery/award/index.js index 5b4bba761..faa4c3188 100644 --- a/screens/discovery/award/index.js +++ b/screens/discovery/award/index.js @@ -3,7 +3,7 @@ * @Author: czy0729 * @Date: 2019-05-29 19:37:12 * @Last Modified by: czy0729 - * @Last Modified time: 2019-09-05 16:11:34 + * @Last Modified time: 2019-09-05 20:15:17 */ import React from 'react' import { StyleSheet, View, WebView } from 'react-native' @@ -96,6 +96,7 @@ class Award extends React.Component { {loading && ( ( contentContainerStyle={_.container.bottom} keyExtractor={item => String(item.id)} data={$.random} - ListHeaderComponent={} + ListHeaderComponent={ + + } renderItem={({ item }) => } onHeaderRefresh={() => $.fetchRandom(true)} onFooterRefresh={$.fetchRandom} diff --git a/screens/home/subject/index.js b/screens/home/subject/index.js index 32ed5e861..227730cdd 100644 --- a/screens/home/subject/index.js +++ b/screens/home/subject/index.js @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2019-03-23 04:16:27 * @Last Modified by: czy0729 - * @Last Modified time: 2019-09-05 15:49:00 + * @Last Modified time: 2019-09-05 20:36:35 */ import React from 'react' import { StyleSheet } from 'react-native' @@ -154,7 +154,7 @@ const styles = StyleSheet.create({ top: 0, left: 0, right: 0, - height: _.window.height * 0.5 + height: _.window.height * 0.4 }, contentContainerStyle: { paddingTop: _.headerHeight, diff --git a/utils/decorators/withTransitionHeader.js b/utils/decorators/withTransitionHeader.js index d190b3bbd..e97016c35 100644 --- a/utils/decorators/withTransitionHeader.js +++ b/utils/decorators/withTransitionHeader.js @@ -2,7 +2,7 @@ * @Author: czy0729 * @Date: 2019-05-01 16:57:57 * @Last Modified by: czy0729 - * @Last Modified time: 2019-09-05 16:10:36 + * @Last Modified time: 2019-09-05 20:10:21 */ import React from 'react' import { StyleSheet, View } from 'react-native' @@ -191,6 +191,7 @@ const withTransitionHeader = ({