Skip to content

Commit 62a4129

Browse files
committed
feat: new manual example
1 parent 7d6de6f commit 62a4129

File tree

81 files changed

+26441
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+26441
-74
lines changed

README.md

Lines changed: 162 additions & 72 deletions
Large diffs are not rendered by default.

example/App.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
StyleSheet,
1010
} from 'react-native';
1111
import AppleHeader from 'react-native-apple-header';
12+
import BottomSearchBar from 'react-native-bottom-search-bar';
1213
import RNBounceable from '@freakycoder/react-native-bounceable';
1314
import BouncyCheckbox, {BouncyCheckboxHandle} from './build/dist';
1415

@@ -92,7 +93,7 @@ const App: React.FC = () => {
9293
);
9394

9495
const renderCheckboxOnly = () => (
95-
<View style={styles.checkboxesContainer}>
96+
<View>
9697
<Text style={styles.title}>Checkbox Only</Text>
9798
<View style={styles.checkboxOnlyContainer}>
9899
<BouncyCheckbox
@@ -148,7 +149,7 @@ const App: React.FC = () => {
148149
);
149150

150151
const renderSyntheticCheckboxControl = () => (
151-
<View style={styles.checkboxesContainer}>
152+
<View style={styles.checkboxSynthetic}>
152153
<Text style={styles.titleSynthetic}>Synthetic Checkbox</Text>
153154
<Text style={styles.checkboxSyntheticSubtitle}>
154155
Control Checkbox with Another Button
@@ -193,6 +194,7 @@ const App: React.FC = () => {
193194
{renderCheckboxes()}
194195
{renderCheckboxOnly()}
195196
{renderSyntheticCheckboxControl()}
197+
<BottomSearchBar />
196198
</SafeAreaView>
197199
</View>
198200
);
@@ -237,6 +239,9 @@ const styles = StyleSheet.create({
237239
color: 'gray',
238240
fontWeight: '300',
239241
},
242+
checkboxSynthetic: {
243+
marginTop: 16,
244+
},
240245
checkboxSyntheticContainer: {
241246
marginTop: 16,
242247
width: '100%',

exampleManual/.buckconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

exampleManual/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

exampleManual/.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
parser: '@typescript-eslint/parser',
5+
plugins: ['@typescript-eslint'],
6+
overrides: [
7+
{
8+
files: ['*.ts', '*.tsx'],
9+
rules: {
10+
'@typescript-eslint/no-shadow': ['error'],
11+
'no-shadow': 'off',
12+
'no-undef': 'off',
13+
},
14+
},
15+
],
16+
};

exampleManual/.gitignore

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
35+
# node.js
36+
#
37+
node_modules/
38+
npm-debug.log
39+
yarn-error.log
40+
41+
# BUCK
42+
buck-out/
43+
\.buckd/
44+
*.keystore
45+
!debug.keystore
46+
47+
# fastlane
48+
#
49+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
50+
# screenshots whenever they are needed.
51+
# For more information about the recommended setup visit:
52+
# https://docs.fastlane.tools/best-practices/source-control/
53+
54+
**/fastlane/report.xml
55+
**/fastlane/Preview.html
56+
**/fastlane/screenshots
57+
**/fastlane/test_output
58+
59+
# Bundle artifact
60+
*.jsbundle
61+
62+
# Ruby / CocoaPods
63+
/ios/Pods/
64+
/vendor/bundle/

exampleManual/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

exampleManual/.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.5

exampleManual/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

exampleManual/App.tsx

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
import React, {useRef} from 'react';
2+
import {ImageBackground, StyleSheet, Text, View} from 'react-native';
3+
import RNBounceable from '@freakycoder/react-native-bounceable';
4+
import BouncyCheckbox, {BouncyCheckboxHandle} from './build/dist';
5+
6+
const App = () => {
7+
const bouncyCheckboxRef = useRef<BouncyCheckboxHandle>(null);
8+
9+
const [checkboxState, setCheckboxState] = React.useState(false);
10+
11+
return (
12+
<ImageBackground
13+
style={styles.container}
14+
source={require('./assets/bg.jpg')}>
15+
<View
16+
style={[
17+
styles.stateContainer,
18+
{
19+
backgroundColor: checkboxState ? '#34eb83' : '#eb4034',
20+
},
21+
]}>
22+
<Text
23+
style={
24+
styles.stateTextStyle
25+
}>{`Check Status: ${checkboxState.toString()}`}</Text>
26+
</View>
27+
<BouncyCheckbox
28+
size={50}
29+
textStyle={styles.textStyle}
30+
style={{marginTop: 16}}
31+
iconImageStyle={styles.iconImageStyle}
32+
fillColor={'#00C0EE'}
33+
unFillColor={'transparent'}
34+
ref={bouncyCheckboxRef}
35+
isChecked={checkboxState}
36+
text="Synthetic Checkbox"
37+
onPress={() => setCheckboxState(!checkboxState)}
38+
/>
39+
<RNBounceable
40+
style={styles.syntheticButton}
41+
onPress={() => {
42+
bouncyCheckboxRef.current?.onCheckboxPress();
43+
}}>
44+
<Text style={{color: '#fff'}}>Synthetic Checkbox Press</Text>
45+
</RNBounceable>
46+
</ImageBackground>
47+
);
48+
};
49+
50+
const styles = StyleSheet.create({
51+
container: {
52+
flex: 1,
53+
alignItems: 'center',
54+
justifyContent: 'center',
55+
},
56+
stateContainer: {
57+
height: 45,
58+
width: 175,
59+
alignItems: 'center',
60+
justifyContent: 'center',
61+
borderRadius: 12,
62+
marginBottom: 12,
63+
},
64+
stateTextStyle: {
65+
color: '#fff',
66+
fontWeight: 'bold',
67+
},
68+
syntheticButton: {
69+
height: 50,
70+
marginTop: 64,
71+
borderRadius: 12,
72+
width: '60%',
73+
alignItems: 'center',
74+
justifyContent: 'center',
75+
backgroundColor: '#00C0EE',
76+
},
77+
iconImageStyle: {
78+
width: 20,
79+
height: 20,
80+
},
81+
textStyle: {
82+
color: '#010101',
83+
fontWeight: '600',
84+
},
85+
});
86+
87+
export default App;

0 commit comments

Comments
 (0)