在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):franmontiel/FullScreenDialog开源软件地址(OpenSource Url):https://github.com/franmontiel/FullScreenDialog开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):FullScreenDialogA DialogFragment that implements the Full-screen dialog pattern defined in the Material Design guidelines. DownloadStep 1. Add the JitPack repository in your root build.gradle at the end of repositories: allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
} Step 2. Add the dependency dependencies {
compile 'com.github.franmontiel:FullScreenDialog:1.0.1'
} UsageJust create a new new FullScreenDialogFragment.Builder(MainActivity.this)
.setTitle(R.string.dialog_title)
.setConfirmButton(R.string.dialog_positive_button)
.setOnConfirmListener(onConfirmListener)
.setOnDiscardListener(onDiscardListener)
.setContent(ContentFragment.class, argumentsBundle)
.build(); The contentThe content of the dialog must be a The content will be wrapped by the Through the Styling the dialogIt is possible to show the dialog in a default dialog window calling To style the dialog Toolbar a style called <style name="FullScreenDialogToolbar">
<item name="android:background">@color/colorPrimaryDark</item>
<item name="android:theme">@style/ThemeOverlay.AppCompat.Dark</item>
</style> Listening to eventsTo be notified when the dialog is closed due to a confirmation or a dismiss action it is possible set a
Back key press handlingTo notify the back key press to the dialog, what will fire the discard button click event notification to the content, the @Override
public void onBackPressed() {
if (dialogFragment != null && dialogFragment.isAdded()) {
dialogFragment.onBackPressed();
} else {
super.onBackPressed();
}
} License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论