Skip to content

Commit 28cf122

Browse files
committed
Updated documentation.
1 parent 9cf198b commit 28cf122

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/content.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h4>Table of contents</h4>
4444

4545
<h4><a name="implementation-details">1 Implementation details</a></h4>
4646

47-
<p>The builder <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.Builder.html" target="_blank" class="code">MaterialDialog.Builder</a>, which is provided by this library, has been designed in order to be similar to the Android SDK's built-in class <a href="http://developer.android.com/reference/android/app/AlertDialog.Builder.html" target="_blank" class="code">AlertDialog.Builder</a> and therefore provides the same functionality. The builder creates a dialog, which is instatiated from the class <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.html" target="_blank" class="code">MaterialDialog</a> and whose appearance is designed according to the Android 5 "Material Desing" guidelines, which can be found <a href="http://www.google.com/design/spec/material-design/introduction.html" target="_blank" class="code">here</a>. Such a dialog can contain a title, an icon, a message and up to three buttons. All of these properties are optional. Furthermore, the dialog can be used to display a list view, which contains a specific set of list items, using a specific choice mode. It is also possible to set custom views for the dialog's title or content in order to realise a "Material Design"-styled custom dialog. How to create dialogs using these different properties will be discussed in the following sections.</p>
47+
<p>The builder <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.Builder.html" target="_blank" class="code">MaterialDialog.Builder</a>, which is provided by this library, has been designed in order to be similar to the Android SDK's built-in class <a href="http://developer.android.com/reference/android/app/AlertDialog.Builder.html" target="_blank" class="code">AlertDialog.Builder</a> and therefore provides the same functionality. The builder creates a dialog, which is instatiated from the class <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.html" target="_blank" class="code">MaterialDialog</a> and whose appearance is designed according to the Android 5 "Material Design" guidelines, which can be found <a href="http://www.google.com/design/spec/material-design/introduction.html" target="_blank" class="code">here</a>. Such a dialog can contain a title, an icon, a message and up to three buttons. All of these properties are optional. Furthermore, the dialog can be used to display a list view, which contains a specific set of list items, using a specific choice mode. It is also possible to set custom views for the dialog's title or content in order to realize a "Material Design"-styled custom dialog. How to create dialogs using these different properties will be discussed in the following sections.</p>
4848

4949
<h4><a name="specifying-title-icon-and-message">2 Specifying a title, icon and message</a></h4>
5050

@@ -66,7 +66,7 @@ <h4><a name="specifying-title-icon-and-message">2 Specifying a title, icon and m
6666
<p class="center"><tt>setIcon(int):Builder</tt></p>
6767
<p class="center"><tt>setIconAttribute(int):Builder</tt></p>
6868

69-
<p>The <tt>setIcon</tt>-methods show above allow to specify the icon by either passing an instance of the class <a href="http://developer.android.com/reference/android/graphics/drawable/Drawable.html" target="_blank" class="code">Drawable</a> or the resource ID of a drawable resource as a parameter. The <tt>setIconAttribute</tt>-method allows to pass the attribute of theme, which is currently applied on the builder's context, which specifies the drawable. An example of such an attribute is <tt>android.R.attr.alertDialogIcon</tt>.</p>
69+
<p>The <tt>setIcon</tt>-methods shown above allow to specify the icon by either passing an instance of the class <a href="http://developer.android.com/reference/android/graphics/drawable/Drawable.html" target="_blank" class="code">Drawable</a> or the resource ID of a drawable resource as a parameter. The <tt>setIconAttribute</tt>-method allows to pass the attribute of theme, which is currently applied on the builder's context to specify the drawable. An example of such an attribute is <tt>android.R.attr.alertDialogIcon</tt>.</p>
7070

7171
<h4><a name="specifying-the-buttons">3 Specifying the dialog's buttons</a></h4>
7272

@@ -81,7 +81,7 @@ <h4><a name="specifying-the-buttons">3 Specifying the dialog's buttons</a></h4>
8181

8282
<p>The second parameter of all methods shown above allows to pass a listener, which therefore must implement the interface <a href="http://developer.android.com/reference/android/content/DialogInterface.OnClickListener.html" target="_blank" class="code">DialogInterface.OnClickListener</a>, to the button. The listener is invoked when the user closes the dialog by clicking the appropriate button. Passing a <tt>null</tt> reference instead of a listener implementation, does not cause the app to crash and the dialog will be closed anyways, when the button is clicked.</p>
8383

84-
<p>By default the dialog's buttons are align horizontally, but as the "Material Design" guidelines introduced an alternative way of aligning a dialog's buttons, the builder's method <tt>stackButtons(boolean):Builder</tt> can be used to align the buttons vertically. The following screenshots shows a dialog, whose buttons are stacked:<p>
84+
<p>By default the dialog's buttons are aligned horizontally, but as the "Material Design" guidelines introduced an alternative way of aligning a dialog's buttons, the builder's method <tt>stackButtons(boolean):Builder</tt> can be used to align the buttons vertically. The following screenshots shows a dialog, whose buttons are stacked:<p>
8585

8686
<p><center><a href="images/example.png" target="_blank".><img src="images/example-stacked-buttons.png" width="320" alt="Example"></center></a></p>
8787

@@ -136,7 +136,7 @@ <h4><a name="modifying-the-appearance">4 Modifying the dialog's appearance</a></
136136

137137
<p>If a dialog, which is created by the class <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.Builder.html" target="_blank" class="code">MaterialDialog.Builder</a>, should use an individual theme instead of the App's default theme, the theme's resource ID can be passed to the builder's constructor.</p>
138138

139-
<p>Besides using the setter methods mentioned above, theme attributes can be used to change the appearance of dialogs. The following table shows all available attributes. They must either be defined in the app's global theme or in the theme, whose ID is pased to the builder's constructor, if any.</p>
139+
<p>Besides using the setter methods mentioned above, theme attributes can be used to change the appearance of dialogs. The following table shows all available attributes. They must either be defined in the app's global theme or in the theme, whose ID is passed to the builder's constructor, if any.</p>
140140

141141
<table>
142142
<tr>
@@ -232,7 +232,7 @@ <h4><a name="creating-and-showing-the-dialog">7 Creating and showing the dialog<
232232

233233
<h4><a name="validating-the-dialog-content">8 Validating the dialog's content</a></h4>
234234

235-
<p>It is also possible to validate a dialog's content when its positive button is clicked by the user. Therfore the interface <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.Validator.html" target="_blank" class="code">MaterialDialog.Validator</a> has to be implemented. It defines the method <tt>validate():boolean</tt>, which has to be overridden in order to return, whether the dialog's content is valid, or not. Multiple instances of this interface can be added to an instance of the class <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.Builder.html" target="_blank" class="code">MaterialDialog.Builder</a> by using its method <tt>addValidator(Validator):Builder</tt> or <tt>addAllValidators(Collection):Builder</tt>. Previously added instances can be removed by using the method <tt>removeValidator(Validator):Builder</tt> or <tt>removeAllValidators(Collection):Builder</tt> afterwards. When the dialog's positive button is clicked by the user, all added validators will be executed. If one of them returns <tt>false</tt> from its <tt>validate</tt>-method, the dialog will not be dismissed. When the negative or neutral button is clicked instead, no validation will be performed.</p>
235+
<p>It is also possible to validate a dialog's content when its positive button is clicked by the user. Therfore the interface <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.Validator.html" target="_blank" class="code">MaterialDialog.Validator</a> has to be implemented. It defines the method <tt>validate(MaterialDialog):boolean</tt>, which has to be overridden in order to return, whether the dialog's content is valid, or not. Multiple instances of this interface can be added to an instance of the class <a href="javadoc/de/mrapp/android/dialog/MaterialDialog.Builder.html" target="_blank" class="code">MaterialDialog.Builder</a> by using its method <tt>addValidator(Validator):Builder</tt> or <tt>addAllValidators(Collection):Builder</tt>. Previously added instances can be removed by using the method <tt>removeValidator(Validator):Builder</tt> or <tt>removeAllValidators(Collection):Builder</tt> afterwards. When the dialog's positive button is clicked by the user, all added validators will be executed. If one of them returns <tt>false</tt> from its <tt>validate</tt>-method, the dialog will not be dismissed. When the negative or neutral button is clicked instead, no validation will be performed.</p>
236236

237237
<h4>External references:</h4>
238238
<div class="reference"><a name="reference1" class="reference">[1]</a><a href="http://developer.android.com/reference/android/app/AlertDialog.Builder.html" target="_blank">http://developer.android.com/reference/android/app/AlertDialog.Builder.html</a> &#150; Class AlterDialog.Builder</div>

0 commit comments

Comments
 (0)