프로젝트
GitHub에서 보기
Commit451/ModalBottomSheetDialogFragment
소개
Material Guidelines를 기반으로 한 모달 바텀 시트 다이얼로그
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalModalBottomSheetDialogFragment
Modal bottom sheet dialog based on the Material Guidelines

Dependency
Add the library to your project build.gradle:
dependencies {
implementation("com.commit451:modalbottomsheetdialogfragment:latest.version.here")
}
Usage
ModalBottomSheetDialogFragments are typically inflated via a menu item resource. The menu item resource defines the title, icon, and ID is of each Option. The menu item resource might looks something like this:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_favorite"
android:icon="@drawable/ic_favorite_black_24dp"
android:title="Favorite" />
<item
android:id="@+id/action_share"
android:icon="@drawable/ic_share_black_24dp"
android:title="Share" />
<item
android:id="@+id/action_edit"
android:icon="@drawable/ic_edit_black_24dp"
android:title="Edit" />
</menu>
Use the builder to create and show the bottom sheet dialog:
ModalBottomSheetDialogFragment.Builder()
.add(R.menu.options)
.show(supportFragmentManager, "options")
Make sure that your Activity or Fragment implements ModalBottomSheetDialogFragment.Listener. For example:
override fun onModalOptionSelected(tag: String?, option: Option) {
when (option.id) {
R.id.action_edit -> {
// edit something
}
R.id.action_delete -> {
// delete something
}
}
Snackbar.make(root, "Selected option ${option.title} from fragment with tag $tag", Snackbar.LENGTH_SHORT)
.show()
}
You can also customize things to your liking:
ModalBottomSheetDialogFragment.Builder()
.add(R.menu.option_lots)
//custom option, without needing menu XML
.add(OptionRequest(123, "Custom", R.drawable.ic_bluetooth_black_24dp))
.layout(R.layout.item_custom)
.theme(R.style.CustomTheme)
.header("Neat")
.columns(3)
.show(supportFragmentManager, "custom")
See the sample app for more.
License
Copyright 2022 Commit 451
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
관련 프로젝트 살펴보기
불러오는 중…