Skip to content

Commit 5f4a6a1

Browse files
committed
Merge branch 'master' into release
2 parents 2df0b14 + 897689a commit 5f4a6a1

File tree

143 files changed

+714
-3667
lines changed

Some content is hidden

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

143 files changed

+714
-3667
lines changed

.flowconfig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ node_modules/react-native/Libraries/polyfills/.*
1111
; Flow doesn't support platforms
1212
.*/Libraries/Utilities/LoadingView.js
1313

14-
exact_by_default=true
15-
1614
[untyped]
1715
.*/node_modules/@react-native-community/cli/.*/.*
1816

@@ -25,8 +23,7 @@ node_modules/react-native/flow/
2523
[options]
2624
emoji=true
2725

28-
esproposal.optional_chaining=enable
29-
esproposal.nullish_coalescing=enable
26+
exact_by_default=true
3027

3128
module.file_ext=.js
3229
module.file_ext=.json
@@ -52,7 +49,6 @@ deprecated-type=warn
5249
unsafe-getters-setters=warn
5350
unnecessary-invariant=warn
5451
signature-verification-failure=warn
55-
deprecated-utility=error
5652

5753
[strict]
5854
deprecated-type
@@ -64,4 +60,4 @@ untyped-import
6460
untyped-type-import
6561

6662
[version]
67-
^0.137.0
63+
^0.149.0

android/app/build.gradle

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ android {
1717
compileSdkVersion rootProject.ext.compileSdkVersion
1818
ndkVersion rootProject.ext.ndkVersion
1919

20-
compileOptions {
21-
sourceCompatibility JavaVersion.VERSION_1_8
22-
targetCompatibility JavaVersion.VERSION_1_8
23-
}
24-
2520
defaultConfig {
2621
applicationId "com.rnuilib"
2722
minSdkVersion rootProject.ext.minSdkVersion
@@ -111,7 +106,7 @@ dependencies {
111106
// Run this once to be able to run the application with BUCK
112107
// puts all compile dependencies into folder libs for BUCK to use
113108
task copyDownloadableDepsToLibs(type: Copy) {
114-
from configurations.compile
109+
from configurations.implementation
115110
into 'libs'
116111
}
117112

android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "29.0.3"
5+
buildToolsVersion = "30.0.2"
66
minSdkVersion = 21
7-
compileSdkVersion = 29
8-
targetSdkVersion = 29
7+
compileSdkVersion = 30
8+
targetSdkVersion = 30
99
ndkVersion = "20.1.5948944"
1010
RNNKotlinVersion = "1.3.61" // Or any version above 1.3.x
1111
}
1212
repositories {
1313
mavenLocal()
1414
mavenCentral()
1515
google()
16-
jcenter()
1716
}
1817
dependencies {
1918
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$RNNKotlinVersion"
20-
classpath("com.android.tools.build:gradle:4.1.0")
19+
classpath("com.android.tools.build:gradle:4.2.1")
2120

2221
// NOTE: Do not place your application dependencies here; they belong
2322
// in the individual module build.gradle files
@@ -26,6 +25,7 @@ buildscript {
2625

2726
allprojects {
2827
repositories {
28+
mavenCentral()
2929
mavenLocal()
3030
maven {
3131
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ android.useAndroidX=true
2121
android.enableJetifier=true
2222

2323
# Version of flipper SDK to use with React Native
24-
FLIPPER_VERSION=0.75.1
24+
FLIPPER_VERSION=0.93.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

demo/src/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ module.exports = {
6666
get HintsScreen() {
6767
return require('./screens/componentScreens/HintsScreen').default;
6868
},
69+
get IconScreen() {
70+
return require('./screens/componentScreens/IconScreen').default;
71+
},
6972
get ImageScreen() {
7073
return require('./screens/componentScreens/ImageScreen').default;
7174
},
@@ -235,10 +238,10 @@ module.exports = {
235238
return require('./screens/realExamples/ListActions/ListActionsScreen').default;
236239
},
237240
get ProductPage() {
238-
return require('./screens/realExamples/ProductPage');
241+
return require('./screens/realExamples/ProductPage').default;
239242
},
240243
get Twitter() {
241-
return require('./screens/realExamples/Twitter');
244+
return require('./screens/realExamples/Twitter').default;
242245
},
243246
// wrapperScreens
244247
get TouchableOpacityScreen() {

demo/src/screens/MenuStructure.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const navigationData = {
3333
{title: 'Connection Status Bar', tags: 'connection status bar', screen: 'unicorn.components.ConnectionStatusBar'},
3434
{title: 'Chip', tags: 'chip', screen: 'unicorn.components.ChipScreen'},
3535
{title: 'ExpandableSection', tags: 'expandable section', screen: 'unicorn.components.ExpandableSectionScreen'},
36+
{title: 'Icon', tags: 'image icon assets', screen: 'unicorn.components.IconScreen'},
3637
// {title: 'Overlays', tags: 'overlay image', screen: 'unicorn.components.OverlaysScreen'},
3738
{title: 'Page Control', tags: 'page', screen: 'unicorn.components.PageControlScreen'},
3839
{title: 'ProgressBar', tags: 'progress bar animated', screen: 'unicorn.animations.ProgressBarScreen'},

demo/src/screens/componentScreens/CarouselScreen.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ interface State {
3636

3737
class CarouselScreen extends Component<Props, State> {
3838
carousel = React.createRef<typeof Carousel>();
39+
private dimensionsChangeListener: any;
3940

4041
constructor(props: Props) {
4142
super(props);
@@ -51,11 +52,11 @@ class CarouselScreen extends Component<Props, State> {
5152
}
5253

5354
componentDidMount() {
54-
Constants.addDimensionsEventListener(this.onOrientationChange);
55+
this.dimensionsChangeListener = Constants.addDimensionsEventListener(this.onOrientationChange);
5556
}
5657

5758
componentWillUnmount() {
58-
Constants.removeDimensionsEventListener(this.onOrientationChange);
59+
Constants.removeDimensionsEventListener(this.dimensionsChangeListener || this.onOrientationChange);
5960
}
6061

6162
onOrientationChange = () => {
@@ -116,7 +117,6 @@ class CarouselScreen extends Component<Props, State> {
116117
pageControlProps={{onPagePress: this.onPagePress, limitShownPages}}
117118
// showCounter
118119
allowAccessibleLayout
119-
loop
120120
>
121121
{_.map([...Array(numberOfPagesShown)], (item, index) => (
122122
<Page style={{backgroundColor: BACKGROUND_COLORS[index]}} key={index}>
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React, {useState} from 'react';
2+
import {Assets, View, Icon, Text, Slider, Switch, GradientSlider} from 'react-native-ui-lib';
3+
4+
const IconScreen = () => {
5+
const [size, setSize] = useState(24);
6+
const [customSize, setCustomSize] = useState(false);
7+
const [color, setColor] = useState<string | number>();
8+
const [customColor, setCustomColor] = useState(false);
9+
10+
return (
11+
<View padding-page>
12+
<Text h1 marginB-s4>
13+
Icon Screen
14+
</Text>
15+
<View center>
16+
<Icon
17+
margin-30
18+
size={customSize ? size : undefined}
19+
tintColor={customColor ? color as string : undefined}
20+
source={Assets.icons.search}
21+
/>
22+
</View>
23+
24+
<View marginB-s3 row>
25+
<Text marginR-s2>Custom Size</Text>
26+
<Switch value={customSize} onValueChange={setCustomSize}/>
27+
</View>
28+
<Slider maximumValue={100} value={24} step={1} onValueChange={setSize}/>
29+
<Text marginB-50 marginT-s2>
30+
Custom size: {size}
31+
</Text>
32+
33+
<View marginB-s3 row>
34+
<Text marginR-s2>Custom Color</Text>
35+
<Switch value={customColor} onValueChange={setCustomColor}/>
36+
</View>
37+
<GradientSlider type={GradientSlider.types.HUE} color={color as string} onValueChange={setColor}/>
38+
<Text marginT-s2>Custom color: {color || '#000000'}</Text>
39+
</View>
40+
);
41+
};
42+
43+
export default IconScreen;

demo/src/screens/componentScreens/SectionsWheelPickerScreen.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const SectionsWheelPickerScreen = () => {
102102
<SegmentedControl
103103
segments={[{label: '1 section'}, {label: '2 sections'}, {label: '3 sections'}]}
104104
onChangeIndex={onChangeIndex}
105+
throttleTime={400}
105106
/>
106107
<Text text50 marginV-20>
107108
Pick a duration

demo/src/screens/componentScreens/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function registerScreens(registrar) {
2020
registrar('unicorn.components.ChipsInputScreen', () => require('./ChipsInputScreen').default);
2121
registrar('unicorn.components.HapticScreen', () => require('./HapticScreen').default);
2222
registrar('unicorn.components.HintsScreen', () => require('./HintsScreen').default);
23+
registrar('unicorn.components.IconScreen', () => require('./IconScreen').default);
2324
registrar('unicorn.components.ImageScreen', () => require('./ImageScreen').default);
2425
registrar('unicorn.components.ProgressiveImageScreen', () => require('./ProgressiveImageScreen').default);
2526
registrar('unicorn.components.KeyboardAwareScrollViewScreen', () => require('./KeyboardAwareScrollViewScreen').default);

demo/src/screens/incubatorScreens/PanViewScreen.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class PanViewScreen extends Component {
8080
<PanView
8181
directions={[PanView.directions.DOWN]}
8282
dismissible
83-
springBack
83+
animateToOrigin
8484
// threshold={{y: 10}}
8585
containerStyle={styles.panView}
8686
onDismiss={this.onDialogDismissed}
@@ -113,7 +113,7 @@ class PanViewScreen extends Component {
113113
<PanView
114114
directions={[PanView.directions.LEFT, PanView.directions.DOWN, PanView.directions.RIGHT]}
115115
dismissible
116-
springBack
116+
animateToOrigin
117117
directionLock
118118
threshold={{y: 10}}
119119
containerStyle={styles.panView}

docs/getting-started/setup.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,23 @@ import {KeyboardTrackingView, KeyboardAwareInsetsView, KeyboardRegistry, Keyboar
2626

2727
First, run `npm install react-native-ui-lib`
2828

29-
### Peer Dependencies
30-
If you plan on using specific components, see **UILib Packages** above.
29+
If you plan on using specific components, see **UILib Packages** above.
3130
*For some packages you might still need to install one of the peer dependencies*
3231

33-
If you want it all, install **peer dependencies**:
34-
```js
35-
npm i react-native-gesture-handler react-native-reanimated @react-native-community/blur @react-native-community/datetimepicker @react-native-community/netinfo @react-native-picker/picker
3632

37-
cd ios && pod install
38-
```
33+
### Peer Dependencies
34+
UILIb has mandatory peer dependencies on the following packages:
35+
- react-native-reanimated (Make sure to follow [Reanimated setup guide](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation))
36+
- react-native-gesture-handler
37+
38+
### Optional Dependencies
39+
Some dependencies are optional and required by specific components or features (e.g. Card's blur features requires installing `@react-native-community/blur` package)
40+
41+
The following are optional dependencies:
42+
- @react-native-community/blur
43+
- @react-native-community/datetimepicker
44+
- @react-native-community/netinfo
45+
- @react-native-picker/picker
3946

4047

4148
## Install Native Dependencies
@@ -47,7 +54,7 @@ Some of the components are using the native dependencies listed below - those ar
4754
> It's important to run `cd ios && pod install` if you are using a component that has a native dependency.
4855
4956
- "react-native-gesture-handler": ">=1.9.0" (mandatory)
50-
- "react-native-reanimated": ">=1.13.2" (mandatory)
57+
- "react-native-reanimated": ">=2.1.0" (mandatory)
5158
- "@react-native-community/blur": ">=3.4.1" (required for Card component when passing `enableBlur` prop)
5259
- "@react-native-community/datetimepicker": "^2.1.0"
5360
- "@react-native-community/netinfo": "^5.6.2" (required for ConnectionStatusBar component)

expoDemo/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

expoDemo/.buckconfig

Lines changed: 0 additions & 6 deletions
This file was deleted.

expoDemo/.expo-shared/assets.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{}
1+
{
2+
"12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true,
3+
"40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true
4+
}

expoDemo/.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

expoDemo/.gitignore

Lines changed: 12 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,13 @@
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-
project.xcworkspace
24-
25-
# Android/IntelliJ
26-
#
27-
build/
28-
.idea
29-
.gradle
30-
local.properties
31-
*.iml
32-
33-
# node.js
34-
#
351
node_modules/
36-
npm-debug.log
37-
yarn-error.log
38-
39-
# BUCK
40-
buck-out/
41-
\.buckd/
42-
*.keystore
43-
44-
# fastlane
45-
#
46-
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47-
# screenshots whenever they are needed.
48-
# For more information about the recommended setup visit:
49-
# https://docs.fastlane.tools/best-practices/source-control/
50-
51-
*/fastlane/report.xml
52-
*/fastlane/Preview.html
53-
*/fastlane/screenshots
54-
55-
# Bundle artifact
56-
*.jsbundle
57-
58-
# Expo
59-
.expo
60-
__generated__
61-
web-build
2+
.expo/
3+
npm-debug.*
4+
*.jks
5+
*.p8
6+
*.p12
7+
*.key
8+
*.mobileprovision
9+
*.orig.*
10+
web-build/
11+
12+
# macOS
13+
.DS_Store

expoDemo/App.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)