All Projects → franmontiel → Fullscreendialog

franmontiel / Fullscreendialog

Licence: apache-2.0
A DialogFragment that implements the Full-screen dialog pattern defined in the Material Design guidelines.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Fullscreendialog

Noty
A simple library for creating animated warnings/dialogs/alerts for Android.
Stars: ✭ 136 (+22.52%)
Mutual labels:  material-design, dialog
Pickimage
Shows a DialogFragment with camera and gallery options. User can choose wich provider wants to pick images from. 📸 🖼️
Stars: ✭ 386 (+247.75%)
Mutual labels:  material-design, dialog
Androidmaterialdialog
Provides builders, which allow to create various "Material Design"-styled dialogs
Stars: ✭ 161 (+45.05%)
Mutual labels:  material-design, dialog
React Native Material Dialog
Material design dialogs for React Native 💬
Stars: ✭ 135 (+21.62%)
Mutual labels:  material-design, dialog
Fullscreendialog
Android Material full screen dialog
Stars: ✭ 11 (-90.09%)
Mutual labels:  material-design, dialog
Fancyalertdialog Android
Make your native android Dialog Fancy. A library that takes the standard Android Dialog to the next level with a variety of styling options. Style your dialog from code.
Stars: ✭ 260 (+134.23%)
Mutual labels:  material-design, dialog
Aestheticdialogs
📱 An Android Library for 💫fluid, 😍beautiful, 🎨custom Dialogs.
Stars: ✭ 352 (+217.12%)
Mutual labels:  material-design, dialog
Fancygifdialog Android
Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.
Stars: ✭ 409 (+268.47%)
Mutual labels:  material-design, dialog
Bottomdialogs
An Android library that shows a customizable Material-based bottom sheet. API 11+ required.
Stars: ✭ 624 (+462.16%)
Mutual labels:  material-design, dialog
Materialdialog Android
📱Android Library to implement animated, 😍beautiful, 🎨stylish Material Dialog in android apps easily.
Stars: ✭ 602 (+442.34%)
Mutual labels:  material-design, dialog
Materialstyleddialogs
A library that shows a beautiful and customizable Material-based dialog with header. API 14+ required.
Stars: ✭ 1,139 (+926.13%)
Mutual labels:  material-design, dialog
Lovelydialog
This library is a set of simple wrapper classes that are aimed to help you easily create fancy material dialogs.
Stars: ✭ 1,043 (+839.64%)
Mutual labels:  material-design, dialog
Simpledialogfragments
A collection of easy to use and extendable DialogFragment's for Android
Stars: ✭ 94 (-15.32%)
Mutual labels:  material-design, dialog
Youqu master
友趣app,一款可以交朋友并且十分有趣的应用。Rxjava+Retrofit+Glide+ijkplayer结合的MVP框架(精选图书,妹纸福利图片,火爆视频,各种炫酷特效)
Stars: ✭ 107 (-3.6%)
Mutual labels:  material-design
Materialize
Materialize, a CSS Framework based on Material Design
Stars: ✭ 38,630 (+34701.8%)
Mutual labels:  material-design
Mui Treasury
A collection of ready-to-use components based on Material-UI
Stars: ✭ 1,821 (+1540.54%)
Mutual labels:  material-design
Popmenu
自定义对话框的使用,仿照ios。从底部弹出,类似pop窗口。包括消息、图片、列表及对话框。
Stars: ✭ 106 (-4.5%)
Mutual labels:  dialog
Smartmaterialspinner
The powerful android spinner library for your application
Stars: ✭ 108 (-2.7%)
Mutual labels:  material-design
Appintro
Make a cool intro for your Android app.
Stars: ✭ 9,989 (+8899.1%)
Mutual labels:  material-design
Pentagonfloatingactionbutton
Android property animation - The Value Animator
Stars: ✭ 106 (-4.5%)
Mutual labels:  material-design

FullScreenDialog

A DialogFragment that implements the Full-screen dialog pattern defined in the Material Design guidelines.

FullScreenDialog Sample GIF

Download

Step 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'
}

Usage

Just create a new FullScreenDialogFragment using the Builder

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 content

The content of the dialog must be a Fragment that implements the FullScreenDialogContent interface.

The content will be wrapped by the FullScreenDialogFragment. This allows to use as a dialog any Fragment without the need of making it inherit from DialogFragment.

Through the FullScreenDialogContent interface the content Fragment is able to receive events and control the dialog.

Styling the dialog

It is possible to show the dialog in a default dialog window calling setFullScreen(false) on the Builder.

To style the dialog Toolbar a style called FullScreenDialogToolbar must be created.

<style name="FullScreenDialogToolbar">
    <item name="android:background">@color/colorPrimaryDark</item>
    <item name="android:theme">@style/ThemeOverlay.AppCompat.Dark</item>
</style>

Listening to events

To be notified when the dialog is closed due to a confirmation or a dismiss action it is possible set a OnConfirmListener and a OnDiscardListener.

FullScreenDialogContent interface allows the content Fragment to receive the dialog click events through the onConfirmClick and onDiscardClick methods.

Back key press handling

To notify the back key press to the dialog, what will fire the discard button click event notification to the content, the onBackPressed method of FullScreenDialogFragment must be invoked from the Activity method of the same name. This is only needed if the dialog is in fullscreen due to the Fragments lack of ability to detect back key press.

@Override
public void onBackPressed() {
    if (dialogFragment != null && dialogFragment.isAdded()) {
        dialogFragment.onBackPressed();
    } else {
        super.onBackPressed();
    }
}

License

Copyright (C) 2017 Francisco José Montiel Navarro

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].