react-native-sheet2 1.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +79 -0
- package/android/build.gradle +83 -0
- package/android/gradle.properties +6 -0
- package/android/src/main/AndroidManifest.xml +12 -0
- package/android/src/main/java/com/behavior/BottomSheetBehavior.java +2329 -0
- package/android/src/main/java/com/behavior/InsetsAnimationCallback.java +83 -0
- package/android/src/main/java/com/modal/FullScreenDialog.kt +100 -0
- package/android/src/main/java/com/modal/TopModalView.kt +77 -0
- package/android/src/main/java/com/modal/TopModalViewManager.kt +83 -0
- package/android/src/main/java/com/modal/TopModalViewModule.kt +36 -0
- package/android/src/main/java/com/sheet/AppFittedSheet.kt +149 -0
- package/android/src/main/java/com/sheet/BaseRNView.kt +73 -0
- package/android/src/main/java/com/sheet/CustomBottomSheetDialog.java +238 -0
- package/android/src/main/java/com/sheet/DialogRootViewGroup.kt +159 -0
- package/android/src/main/java/com/sheet/FragmentModalBottomSheet.kt +54 -0
- package/android/src/main/java/com/sheet/ReactNativeReflection.java +24 -0
- package/android/src/main/java/com/sheet/SheetPackage.kt +20 -0
- package/android/src/main/java/com/sheet/SheetViewManager.kt +144 -0
- package/android/src/main/java/com/sheet/SheetViewModule.kt +43 -0
- package/android/src/main/java/com/sheet/utils.kt +71 -0
- package/android/src/main/java/com/transparent/activity/ActivityModalView.kt +71 -0
- package/android/src/main/java/com/transparent/activity/TransparentActivity.kt +48 -0
- package/android/src/main/java/com/transparent/activity/TransparentActivityManager.kt +63 -0
- package/android/src/main/java/com/transparent/activity/TransparentActivityModule.kt +28 -0
- package/android/src/main/res/anim/fade_in.xml +8 -0
- package/android/src/main/res/anim/fade_out.xml +11 -0
- package/android/src/main/res/anim/slide_down.xml +8 -0
- package/android/src/main/res/anim/slide_up.xml +8 -0
- package/android/src/main/res/layout/dialog_bottom_sheet.xml +64 -0
- package/android/src/main/res/layout/item_full.xml +14 -0
- package/android/src/main/res/values/colors.xml +15 -0
- package/android/src/main/res/values/styles.xml +75 -0
- package/ios/FittedSheets/Compatible.swift +55 -0
- package/ios/FittedSheets/InitialTouchPanGestureRecognizer.swift +19 -0
- package/ios/FittedSheets/SheetContentViewController.swift +326 -0
- package/ios/FittedSheets/SheetContentViewDelegate.swift +17 -0
- package/ios/FittedSheets/SheetOptions.swift +100 -0
- package/ios/FittedSheets/SheetSize.swift +20 -0
- package/ios/FittedSheets/SheetTransition.swift +153 -0
- package/ios/FittedSheets/SheetView.swift +21 -0
- package/ios/FittedSheets/SheetViewController.swift +761 -0
- package/ios/FittedSheets/SheetViewDelegate.swift +16 -0
- package/ios/FittedSheets/UIColorExtension.swift +59 -0
- package/ios/FittedSheets/UIViewControllerExtension.swift +27 -0
- package/ios/FittedSheets/Yalta.swift +420 -0
- package/ios/LBBottomSheet/BottomSheetConstant.swift +48 -0
- package/ios/LBBottomSheet/Model/BottomSheetController+Behavior.swift +262 -0
- package/ios/LBBottomSheet/Model/BottomSheetController+Theme.swift +156 -0
- package/ios/LBBottomSheet/Protocols/BottomSheetInteractionDelegate.swift +29 -0
- package/ios/LBBottomSheet/Protocols/BottomSheetPositionDelegate.swift +31 -0
- package/ios/LBBottomSheet/UI/BottomSheet.storyboard +105 -0
- package/ios/LBBottomSheet/UI/BottomSheetController.swift +601 -0
- package/ios/LBBottomSheet/Utils/Components/ForwardingEventsView.swift +60 -0
- package/ios/LBBottomSheet/Utils/Extensions/CACornerMask+Extension.swift +33 -0
- package/ios/LBBottomSheet/Utils/Extensions/Mirror+Extension.swift +47 -0
- package/ios/LBBottomSheet/Utils/Extensions/UIApplication+Extension.swift +35 -0
- package/ios/LBBottomSheet/Utils/Extensions/UIColor+Extension.swift +61 -0
- package/ios/LBBottomSheet/Utils/Extensions/UIGestureRecognizer+Extensions.swift +28 -0
- package/ios/LBBottomSheet/Utils/Extensions/UIScreen+Extension.swift +28 -0
- package/ios/LBBottomSheet/Utils/Extensions/UIScrollView+Extension.swift +25 -0
- package/ios/LBBottomSheet/Utils/Extensions/UIView+Extension.swift +52 -0
- package/ios/LBBottomSheet/Utils/Extensions/UIViewController+Extension.swift +104 -0
- package/ios/Sheet-Bridging-Header.h +1 -0
- package/ios/Sheet.xcodeproj/project.pbxproj +377 -0
- package/ios/SheetViewManager.m +27 -0
- package/ios/SheetViewManager.swift +351 -0
- package/ios/TopModalViewManager.swift +196 -0
- package/package.json +103 -0
- package/react-native-sheet.podspec +21 -0
- package/src/FittedSheet.tsx +177 -0
- package/src/TopModal.tsx +94 -0
- package/src/TransparentActivity.tsx +98 -0
- package/src/index.tsx +16 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Sergei Golishnikov
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# react-native-bottom-sheet
|
|
2
|
+
|
|
3
|
+
Native implementation of Bottom sheet
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
"react-native-sheet": "sergeymild/react-native-sheet#0.8.12"
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import {
|
|
17
|
+
FITTED_SHEET_SCROLL_VIEW,
|
|
18
|
+
FittedSheet,
|
|
19
|
+
} from 'react-native-sheet';
|
|
20
|
+
import { ScrollView, TouchableOpacity } from 'react-native';
|
|
21
|
+
|
|
22
|
+
const App: React.FC = () => {
|
|
23
|
+
const sheetRef = useRef<FittedSheet>(null);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
<TouchableOpacity onPress={() => {
|
|
28
|
+
// pass data object which will be available in child render function
|
|
29
|
+
sheetRef.current?.show({field: 'value'})
|
|
30
|
+
|
|
31
|
+
// also there is `showElement` method
|
|
32
|
+
// which accept function for lazy require component and render it
|
|
33
|
+
sheetRef.current?.showElement(() => require('./someLazyView').default, {field: 'value'})
|
|
34
|
+
}}>
|
|
35
|
+
<Text>Show sheet</Text>
|
|
36
|
+
</TouchableOpacity>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<FittedSheet
|
|
40
|
+
ref={sheetRef}
|
|
41
|
+
params={{
|
|
42
|
+
// top left right corner sheet view radius
|
|
43
|
+
topLeftRightCornerRadius: 20,
|
|
44
|
+
// background color of sheet view
|
|
45
|
+
backgroundColor: 'purple',
|
|
46
|
+
// max allowed height of sheet view
|
|
47
|
+
maxHeight: 600
|
|
48
|
+
}}
|
|
49
|
+
ref={sheetRef}
|
|
50
|
+
>
|
|
51
|
+
// this all doesn't need it `showElement`
|
|
52
|
+
// was call as FittedSheet will render require component
|
|
53
|
+
{(data) => {
|
|
54
|
+
return (
|
|
55
|
+
<ScrollView
|
|
56
|
+
// used for find scrollView in Native Code
|
|
57
|
+
nativeId={FITTED_SHEET_SCROLL_VIEW}
|
|
58
|
+
// used in android which allows scrollView/FlatList scroll
|
|
59
|
+
nestedScrollEnabled
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}}
|
|
63
|
+
</FittedSheet>
|
|
64
|
+
</>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## More examples
|
|
70
|
+
More detailed examples may be found in `example` project
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Contributing
|
|
74
|
+
|
|
75
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["Sheet_kotlinVersion"]
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
dependencies {
|
|
11
|
+
classpath "com.android.tools.build:gradle:7.2.1"
|
|
12
|
+
// noinspection DifferentKotlinGradleVersion
|
|
13
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
def isNewArchitectureEnabled() {
|
|
18
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
apply plugin: "com.android.library"
|
|
22
|
+
apply plugin: "kotlin-android"
|
|
23
|
+
|
|
24
|
+
if (isNewArchitectureEnabled()) {
|
|
25
|
+
apply plugin: "com.facebook.react"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
def getExtOrDefault(name) {
|
|
29
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Sheet_" + name]
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
def getExtOrIntegerDefault(name) {
|
|
33
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Sheet_" + name]).toInteger()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
android {
|
|
37
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
38
|
+
|
|
39
|
+
defaultConfig {
|
|
40
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
41
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
42
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
43
|
+
}
|
|
44
|
+
buildTypes {
|
|
45
|
+
release {
|
|
46
|
+
minifyEnabled false
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
lintOptions {
|
|
51
|
+
disable "GradleCompatible"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
compileOptions {
|
|
55
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
56
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
repositories {
|
|
62
|
+
mavenCentral()
|
|
63
|
+
google()
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
67
|
+
|
|
68
|
+
dependencies {
|
|
69
|
+
// For < 0.71, this will be from the local maven repo
|
|
70
|
+
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
|
71
|
+
//noinspection GradleDynamicVersion
|
|
72
|
+
implementation "com.facebook.react:react-native"
|
|
73
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
74
|
+
implementation 'com.google.android.material:material:1.9.0'
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (isNewArchitectureEnabled()) {
|
|
78
|
+
react {
|
|
79
|
+
jsRootDir = file("../src/")
|
|
80
|
+
libraryName = "SheetView"
|
|
81
|
+
codegenJavaPackageName = "com.sheet"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
package="com.sheet">
|
|
3
|
+
|
|
4
|
+
<application>
|
|
5
|
+
<activity
|
|
6
|
+
android:name="com.transparent.activity.TransparentActivity"
|
|
7
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
8
|
+
android:windowSoftInputMode="adjustResize"
|
|
9
|
+
android:exported="false"
|
|
10
|
+
android:theme="@style/Theme.Transparent"/>
|
|
11
|
+
</application>
|
|
12
|
+
</manifest>
|