Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Phecda
/
NGPlay
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Phecda
2020-04-10 01:06:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eb84b3cafb4d0a7296bd1b047afc99ee25ce8ea7
eb84b3ca
1 parent
fd92265e
feat: simple divider
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
src/component/View/list.tsx
src/screen/SystemInfo.tsx
src/component/View/list.tsx
View file @
eb84b3c
...
...
@@ -5,6 +5,7 @@ import {
useDynamicStyleSheet,
} from 'react-native-dark-mode';
import { colorPreset } from '../../design';
import { View, StyleSheet } from 'react-native';
const dynamicStyles = new DynamicStyleSheet({
containerStyle: {
...
...
@@ -22,8 +23,18 @@ const dynamicStyles = new DynamicStyleSheet({
rightSubtitleStyle: {
color: colorPreset.labelColor.primary,
},
opaqueSeparator: {
backgroundColor: colorPreset.separator.opaque,
height: StyleSheet.hairlineWidth,
marginLeft: 16,
},
});
export const Divider = () => {
const styles = useDynamicStyleSheet(dynamicStyles);
return <View style={styles.opaqueSeparator} />;
};
export const ListItem = ({
containerStyle,
titleStyle,
...
...
src/screen/SystemInfo.tsx
View file @
eb84b3c
import React from 'react';
import { useWindowDimensions } from 'react-native';
import { ListItem, BGScroll, Card } from '../component/View';
import { ListItem, BGScroll, Card
, Divider
} from '../component/View';
export default () => {
const { width, height, fontScale, scale } = useWindowDimensions();
...
...
@@ -12,12 +12,15 @@ export default () => {
rightTitle={`${width}pt`}
rightSubtitle={`${width * scale}px`}
/>
<Divider />
<ListItem
title={'height'}
rightTitle={`${height}pt`}
rightSubtitle={`${height * scale}px`}
/>
<Divider />
<ListItem title={'fontScale'} rightTitle={fontScale.toString()} />
<Divider />
<ListItem title={'scale'} rightTitle={scale.toString()} />
</Card>
</BGScroll>
...
...
Please
register
or
login
to post a comment