-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into static_asset_cdn
- Loading branch information
Showing
100 changed files
with
2,969 additions
and
1,885 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apply plugin: 'com.android.library' | ||
|
||
group = 'expo.modules.bottomsheet' | ||
version = '0.1.0' | ||
|
||
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle") | ||
apply from: expoModulesCorePlugin | ||
applyKotlinExpoModulesCorePlugin() | ||
useCoreDependencies() | ||
useExpoPublishing() | ||
|
||
// If you want to use the managed Android SDK versions from expo-modules-core, set this to true. | ||
// The Android SDK versions will be bumped from time to time in SDK releases and may introduce breaking changes in your module code. | ||
// Most of the time, you may like to manage the Android SDK versions yourself. | ||
def useManagedAndroidSdkVersions = false | ||
if (useManagedAndroidSdkVersions) { | ||
useDefaultAndroidSdkVersions() | ||
} else { | ||
buildscript { | ||
// Simple helper that allows the root project to override versions declared by this library. | ||
ext.safeExtGet = { prop, fallback -> | ||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback | ||
} | ||
} | ||
project.android { | ||
compileSdkVersion safeExtGet("compileSdkVersion", 34) | ||
defaultConfig { | ||
minSdkVersion safeExtGet("minSdkVersion", 21) | ||
targetSdkVersion safeExtGet("targetSdkVersion", 34) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace "expo.modules.bottomsheet" | ||
defaultConfig { | ||
versionCode 1 | ||
versionName "0.1.0" | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation project(':expo-modules-core') | ||
implementation 'com.google.android.material:material:1.12.0' | ||
implementation "com.facebook.react:react-native:+" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<manifest> | ||
</manifest> |
53 changes: 53 additions & 0 deletions
53
modules/bottom-sheet/android/src/main/java/expo/modules/bottomsheet/BottomSheetModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package expo.modules.bottomsheet | ||
|
||
import expo.modules.kotlin.modules.Module | ||
import expo.modules.kotlin.modules.ModuleDefinition | ||
|
||
class BottomSheetModule : Module() { | ||
override fun definition() = | ||
ModuleDefinition { | ||
Name("BottomSheet") | ||
|
||
AsyncFunction("dismissAll") { | ||
SheetManager.dismissAll() | ||
} | ||
|
||
View(BottomSheetView::class) { | ||
Events( | ||
arrayOf( | ||
"onAttemptDismiss", | ||
"onSnapPointChange", | ||
"onStateChange", | ||
), | ||
) | ||
|
||
AsyncFunction("dismiss") { view: BottomSheetView -> | ||
view.dismiss() | ||
} | ||
|
||
AsyncFunction("updateLayout") { view: BottomSheetView -> | ||
view.updateLayout() | ||
} | ||
|
||
Prop("disableDrag") { view: BottomSheetView, prop: Boolean -> | ||
view.disableDrag = prop | ||
} | ||
|
||
Prop("minHeight") { view: BottomSheetView, prop: Float -> | ||
view.minHeight = prop | ||
} | ||
|
||
Prop("maxHeight") { view: BottomSheetView, prop: Float -> | ||
view.maxHeight = prop | ||
} | ||
|
||
Prop("preventDismiss") { view: BottomSheetView, prop: Boolean -> | ||
view.preventDismiss = prop | ||
} | ||
|
||
Prop("preventExpansion") { view: BottomSheetView, prop: Boolean -> | ||
view.preventExpansion = prop | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.