Firstly, this is a work in progress but I thought I would share to get some feedback from the B4A community. Not all dialogs types are implemented yet.
This is a B4A wrapper library of Aidan Follestads Material Dialogs library on GitHub
His library supports material style dialogs all the way back to API level 8. If you would like to see examples of the library Aidan has an app on the Play Store (well worth downloading). The library is updated frequently.
Secondly this is similar to thedesolatesoul's MSMaterialDialogs library. He has provided great advice on the road to getting this library working. So thanks thedesolatesoul!
Thirdly, as with thedesolatesoul's MSMaterialDialogs library these dialogs are not modal and use callbacks (see the example project).
To get this running you need;
1) The wrapper library (download from here)
2) android-support-v4.jar (must be version 22.1 or later, use Android SDK-Manager to update your copy)
3) android-support-v7-appcompat.jar
4) android-support-v7-recyclerview.jar
5) The android.support.v7.appcompat additional resources
6) The afollestad_material-dialogs additional resources
7) All additional libraries must be in your B4A additional libraries folder
8) See note 1 below regarding dialog text colours (and themes).
9) Make sure that you reference a android.jar with platform version 21 or above in the IDE under the "Tools/Configure Paths" menu. (Thanks to corwin42)
Please refer to the sample project to see where to place the additional resources. The sample project uses a menu to initiate the dialogs.
NOTE 1: When using the library in your own app the dialog colours may not be the correct "Material" colours. The example app defines the correct colours via a theme under ..\MDTest\Objects\res\values\theme.xml (this file must be made read only otherwise it will be overwritten). Read this forum post for more info on themes.
NOTE 2: Please, please, please make sure you have version 22.1 or later of the support libraries and that the 3 libraries are copied to your additional libraries folder for B4A.
Whats New?
06/05/2015
Documentation
MaterialDialogs
Comment: This is a B4A wrapper library of Aidan Follestads Material Dialogs library on GitHub
MD_BasicDialog is a basic dialog
MD_InputDialog is an input dialog
MD_ListDialog is a list dialog showing items
MD_MultiChoiceDialog is a choice dialog showing items and allowing multiple selections
MD_SingleChoiceDialog is a choice dialog showing items and allowing a single selections
MD_FolderSelectorDialog is a folder selection dialog
MD_ProgressDialog is a progress dialog
Author: Trevor Hart
Version: 0.731
This is a B4A wrapper library of Aidan Follestads Material Dialogs library on GitHub
His library supports material style dialogs all the way back to API level 8. If you would like to see examples of the library Aidan has an app on the Play Store (well worth downloading). The library is updated frequently.
Secondly this is similar to thedesolatesoul's MSMaterialDialogs library. He has provided great advice on the road to getting this library working. So thanks thedesolatesoul!
Thirdly, as with thedesolatesoul's MSMaterialDialogs library these dialogs are not modal and use callbacks (see the example project).
To get this running you need;
1) The wrapper library (download from here)
2) android-support-v4.jar (must be version 22.1 or later, use Android SDK-Manager to update your copy)
3) android-support-v7-appcompat.jar
4) android-support-v7-recyclerview.jar
5) The android.support.v7.appcompat additional resources
6) The afollestad_material-dialogs additional resources
7) All additional libraries must be in your B4A additional libraries folder
8) See note 1 below regarding dialog text colours (and themes).
9) Make sure that you reference a android.jar with platform version 21 or above in the IDE under the "Tools/Configure Paths" menu. (Thanks to corwin42)
Please refer to the sample project to see where to place the additional resources. The sample project uses a menu to initiate the dialogs.
NOTE 1: When using the library in your own app the dialog colours may not be the correct "Material" colours. The example app defines the correct colours via a theme under ..\MDTest\Objects\res\values\theme.xml (this file must be made read only otherwise it will be overwritten). Read this forum post for more info on themes.
NOTE 2: Please, please, please make sure you have version 22.1 or later of the support libraries and that the 3 libraries are copied to your additional libraries folder for B4A.
B4X:
<resources>
<!-- http://www.google.com/design/spec/style/color.html#color-color-palette -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#3F51B5</item>
<item name="colorPrimaryDark">#3949AB</item>
<item name="colorAccent">#E91E63</item>
</style>
</resources>
Whats New?
06/05/2015
- Updated to 0.7.3.1 of afollestad material-dialogs library
- Split out dialogs into seperate objects (all have MD_ prefix)
- Added/tidied up documentation (including events)
- Included progress dialogs and folder selection dialog
- Updated to 0.7.4.1 of afollestad material-dialogs library
Documentation
MaterialDialogs
Comment: This is a B4A wrapper library of Aidan Follestads Material Dialogs library on GitHub
MD_BasicDialog is a basic dialog
MD_InputDialog is an input dialog
MD_ListDialog is a list dialog showing items
MD_MultiChoiceDialog is a choice dialog showing items and allowing multiple selections
MD_SingleChoiceDialog is a choice dialog showing items and allowing a single selections
MD_FolderSelectorDialog is a folder selection dialog
MD_ProgressDialog is a progress dialog
Author: Trevor Hart
Version: 0.731
- MD_BasicDialog
Events:- ButtonPress (Result As Int)
- Cancel
- Dismiss
- Show
- Initialize (EventName As String)
- Show (title As String, content As String, positiveText As String, negativeText As String, neutralText As String, icon As Bitmap, limitIconToDefaultSize As Boolean, forceStacking As Boolean)
- android.permission.READ_EXTERNAL_STORAGE
- MD_FolderSelectorDialog
Events:- ButtonPress (Result As Int)
- Cancel
- Dismiss
- FolderSelection (Result As String)
- Show
- Initialize (EventName As String)
- Show (InitialFolder As String)
- MD_InputDialog
Events:- ButtonPress (Result As Int)
- Cancel
- Dismiss
- Input (Result As String)
- Show
- Initialize (EventName As String)
- Show (title As String, content As String, hint As String, prefill As String, allowEmptyInput As Boolean, inputMaxLength As Int, positiveText As String, negativeText As String, neutralText As String, icon As Bitmap, limitIconToDefaultSize As Boolean, forceStacking As Boolean)
- MD_ListDialog
Events:- ButtonPress (Result As Int)
- Cancel
- Dismiss
- ItemSelected (Index As Int, Text As String)
- Show
- Initialize (EventName As String)
- Show (title As String, items As List, positiveText As String, negativeText As String)
- MD_MultiChoiceDialog
Events:- ButtonPress (Result As Int)
- Cancel
- Dismiss
- MultiChoice (Result As Map)
- Show
- Initialize (EventName As String)
- Show (title As String, items As Map, positiveText As String, negativeText As String)
- MD_ProgressDialog
Events:- ButtonPress (Result As Int)
- Cancel
- Dismiss
- Show
- CurrentProgress As Int
- Dismiss
- IncrementProgress (Increment As Int)
- Initialize (EventName As String)
- Show (title As String, content As String, negativeText As String, Indeterminate As Boolean, Max As Int, showMinMax As Boolean)
- MD_SingleChoiceDialog
Events:- ButtonPress (Result As Int)
- Cancel
- Dismiss
- Show
- SingleChoice (Index As Int, Text As String)
- Initialize (EventName As String)
- Show (title As String, items As List, selectedIndex As Int, positiveText As String, negativeText As String)
Last edited: