workspace / bottomsheetdialog-compose Goto Github PK
View Code? Open in Web Editor NEWThe most convenient way to use BottomSheetDialog in Jetpack Compose
License: Apache License 2.0
The most convenient way to use BottomSheetDialog in Jetpack Compose
License: Apache License 2.0
BottomSheetDialog`์ content์ ์คํฌ๋กค ์๋ Column์ ์ฌ์ฉํ๋ฉด ๋๋๊ทธ๊ฐ ์๋๋ ๋ฌธ์ ๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค.
Modifier.verticalScroll(scrollState)
๋ฅผ ์ถ๊ฐํ๋ฉด ์ ์์ ์ผ๋ก ๋์ํฉ๋๋ค.
์ด๊ฒ ๋ฒ๊ทธ์ธ์ง ์๋ํ์ ๋ถ๋ถ์ธ์ง ๋ชจ๋ฅด๊ฒ ์ด์ ์ด์๋ก ๋จ๊น๋๋ค.
BottomSheetDialog() {
Column(
modifier = Modifier
.fillMaxWidth()
.background(Color.White)
.verticalScroll(scrollState) // ์ด ๋ถ๋ถ์ ์ถ๊ฐํ๋ฉด ์ ์์ ์ผ๋ก ๋๋๊ทธ ๋จ.
) {
// children..
}
}
Hi, There was a ๏ฟฝissue while using library.
If there is an input in the bottomSheet and the keyboard is raised due to focus on the input, the button fixed at the bottom is hidden behind the keyboard.
The activity is set to adjustResize . I checked to see if there is a way to solve this, but I'm not sure. If this function is not supported, could you add a function to raise the area of โโthe bottomSheet as much as the keyboard area? Thank you.
Hi, I really like you library and I'm trying to integrate it with my own Compose Navigation lib. I've noticed that swiping down causes the current BottomSheetDialog to call onDismissRequest
twice, which breaks some logic for me. In all other cases this callback is always called once.
Could you maybe fix this issue and make it be called only once on swipe down? The current behaviour is very much unexpected and error-prone.
The issue can be reproduced directly using the current demo.
Step 1: Disable the "isDraggable" option.
Step 2: Click "Show" and then try scrolling the list in the popup window. You will notice that the scrolling inertia is gone.
First of all, thanks for the library! I'm trying to solve the same problem and this library looks like exactly what I need.
The problem is that the library doesn't work in Android with API levels 22 and 23. The app from your repository crashes on Android with these API versions.
Here is the stack trace:
Process: su.ati.common.sample, PID: 23247
android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:302)
at com.holix.android.bottomsheetdialog.compose.BottomSheetDialogWrapper.<init>(BottomSheetDialog.kt:391)
at com.holix.android.bottomsheetdialog.compose.BottomSheetDialogKt.BottomSheetDialog(BottomSheetDialog.kt:274)
at su.ati.common.sample.compose.components.BottomSheetDialogDemoFragment.ScreenUi(BottomSheetDialogDemoFragment.kt:62)
at su.ati.common.sample.compose.components.BottomSheetDialogDemoFragment.access$ScreenUi(BottomSheetDialogDemoFragment.kt:32)
at su.ati.common.sample.compose.components.BottomSheetDialogDemoFragment$ScreenUi$2.invoke(BottomSheetDialogDemoFragment.kt)
at su.ati.common.sample.compose.components.BottomSheetDialogDemoFragment$ScreenUi$2.invoke(BottomSheetDialogDemoFragment.kt)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:145)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2375)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2643)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3260)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3238)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3238)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3203)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:771)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1031)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:125)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:534)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:503)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:765)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:549)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I'm using version 1.2.1 . In landscape mode,dialog will dispay juest display a part of top, cannot display all
On the Galaxy Z Flip, it's displayed on the navigation area
In the Galaxy S23 Ultra, it is displayed from the navigation area.
Is there a reason?
I use 1.2.2 SDK version
Info
Problem
bottomDialog๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด ํด๋น ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ syncํ์ฌ ์ฌ์ฉ์ค์ ์์ต๋๋ค.
TodoList๋ฅผ ๋ง๋๋ ์ค์ธ๋ฐ, LazyColumn์ Item์ ํด๋ฆญ์ ํด๋น BottomDialog ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ฌ ์คํฌ๋ฆฐ์ ๋์ธ๋ ค๊ณ ํ๋๋ฐ ํด๋ฆญํ๋ฉด ์ฑ์ด ํ๊ธฐ๋ฉฐ ์๋ฌ๊ฐ ๋ฐ์ํฉ๋๋ค.
compose๋ฅผ 1.3.2 ๋ฒ์ ์ ์ฌ์ฉํ๊ณ ์์ด์, README์ ์ค๋ช ๋๋ฏ์ด 1.1.1 ๋ฒ์ ์ผ๋ก ์ฌ์ฉ์ค์ธ๋ฐ๋ ํด๊ฒฐ์ด ์๋ผ์ ์ง๋ฌธํฉ๋๋ค ใ ใ
gradle
buildscript {
ext {
// compose_version = '1.1.0-beta01'
compose_version = '1.3.2'
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
compileSdk 33
defaultConfig {
applicationId "com.example.todo_android"
minSdk 21
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation 'androidx.compose.material3:material3:1.1.0-alpha04'
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
// Custom BottomSheet
implementation "com.holix.android:bottomsheetdialog-compose:1.1.1"
}
consider this :
`
BottomSheetDialog(
edgeToEdge
){
Box(modifier = Modifier.navigationBarPadding()) {
content()
}
}
`
I want to make the content a scroll view with isDraggable set to false.
Column(
modifier = modifier
.clip(RoundedCornerShape(topStart = 20.dp, topEnd = 20.dp))
.background(color = "#ffffff".color)
.padding(start = 24.dp, top = 30.dp, end = 24.dp, bottom = 24.dp)
.verticalScroll(rememberScrollState())
)
Even if you configure it in that format, it will not scroll.
Is there a way to do this without specifying maxheight?
ํน์ compose 1.4์์๋ ๊ธฐ๋ฅ ์๋์ด ์ ๋๋์??
ํ
์คํธํด๋ดค์๋ crash๊ฐ ๋ฐ์ํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
v1.2.0 ์ดํ๋ก ํค๋ณด๋ ๋์์ด ์ด์ํด์ง ๊ฑฐ ๊ฐ์ต๋๋ค.
BottomSheetDialog
๋ด๋ถ์ TextField
๊ฐ ์์ผ๋ฉด ํค๋ณด๋๊ฐ ๋ํ๋์ง ์๊ณ ,
ํ์
์ด ๋ซํ๋ฉด ๊ทธ๋์์ผ ํค๋ณด๋๊ฐ ์ฌ๋ผ์ต๋๋ค.
์๋ ์์์ ์ํ ์ฝ๋์์ TextField
๋ง ์ถ๊ฐํด์ ํ
์คํธํ์ต๋๋ค.
hello. I'm using your library very well.
While using the library, I found that there is no expand function.
So, when I want a bottomSheet that covers the entire screen, I have to open the bottomSheet twice by swiping.
Can you fix this by adding a property for expand? If this property is added, the usability of the library will be better.
(By the way, your library is really cool)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.