1
0
Aidan Follestad 8 жил өмнө
parent
commit
cf8e9b0694

+ 6 - 5
README.md

@@ -100,7 +100,7 @@ You can create basic, list, single/multi choice, progress, input, etc. dialogs w
 ```gradle
 dependencies {
 	// ... other dependencies here
-    compile 'com.afollestad.material-dialogs:core:0.8.6.2'
+    compile 'com.afollestad.material-dialogs:core:0.9.0.0'
 }
 ```
 
@@ -112,7 +112,7 @@ The *commons* module contains extensions to the library that not everyone may ne
 ```gradle
 dependencies {
     // ... other dependencies here
-    compile 'com.afollestad.material-dialogs:commons:0.8.6.2'
+    compile 'com.afollestad.material-dialogs:commons:0.9.0.0'
 }
 ```
 
@@ -490,18 +490,19 @@ You can also pass a literal integer array (`int[]`) in place of an array resourc
 # Custom List Dialogs
 
 Like Android's native dialogs, you can also pass in your own adapter via `.adapter()` to customize
-exactly how you want your list to work. **Note that Material Dialogs only
+exactly how you want your list to work.
 
 ```java
 new MaterialDialog.Builder(this)
         .title(R.string.socialNetworks)
+         // second parameter is an optional layout manager. Must be a LinearLayoutManager or GridLayoutManager.
         .adapter(new ButtonItemAdapter(this, R.array.socialNetworks), null)
         .show();
 ```
 
 **Note** that with newer releases, Material Dialogs no longer supports `ListView` and `ListAdapter`.
-It's about time that everyone uses `RecyclerView`. *Your custom adapters will have to handle item click
-events on their own; this library's classes have some good examples of how that is done correctly.*
+It's about time that everyone uses `RecyclerView`. **Your custom adapters will have to handle item click
+events on their own; this library's classes and sample project have some good examples of how that is done correctly.**
 
 If you need access to the `RecyclerView`, you can use the `MaterialDialog` instance:
 

BIN
sample/sample.apk


+ 1 - 1
sample/src/main/AndroidManifest.xml

@@ -6,7 +6,7 @@
 
     <application
         android:allowBackup="false"
-        android:icon="@drawable/ic_launcher"
+        android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:supportsRtl="true"
         android:theme="@style/AppTheme"

+ 6 - 6
sample/src/main/java/com/afollestad/materialdialogssample/MainActivity.java

@@ -148,7 +148,7 @@ public class MainActivity extends AppCompatActivity implements
     @OnClick(R.id.basicIcon)
     public void showBasicIcon() {
         new MaterialDialog.Builder(this)
-                .iconRes(R.drawable.ic_launcher)
+                .iconRes(R.mipmap.ic_launcher)
                 .limitIconToDefaultSize() // limits the displayed icon size to 48dp
                 .title(R.string.useGoogleLocationServices)
                 .content(R.string.useGoogleLocationServicesPrompt)
@@ -160,7 +160,7 @@ public class MainActivity extends AppCompatActivity implements
     @OnClick(R.id.basicCheckPrompt)
     public void showBasicCheckPrompt() {
         new MaterialDialog.Builder(this)
-                .iconRes(R.drawable.ic_launcher)
+                .iconRes(R.mipmap.ic_launcher)
                 .limitIconToDefaultSize()
                 .title(Html.fromHtml(getString(R.string.permissionSample, getString(R.string.app_name))))
                 .positiveText(R.string.allow)
@@ -507,10 +507,10 @@ public class MainActivity extends AppCompatActivity implements
 
         int widgetColor = ThemeSingleton.get().widgetColor;
         MDTintHelper.setTint(checkbox,
-                widgetColor == 0 ? ContextCompat.getColor(this, R.color.material_blue) : widgetColor);
+                widgetColor == 0 ? ContextCompat.getColor(this, R.color.accent) : widgetColor);
 
         MDTintHelper.setTint(passwordInput,
-                widgetColor == 0 ? ContextCompat.getColor(this, R.color.material_blue) : widgetColor);
+                widgetColor == 0 ? ContextCompat.getColor(this, R.color.accent) : widgetColor);
 
         dialog.show();
         positiveAction.setEnabled(false); // disabled by default
@@ -520,7 +520,7 @@ public class MainActivity extends AppCompatActivity implements
     public void showCustomWebView() {
         int accentColor = ThemeSingleton.get().widgetColor;
         if (accentColor == 0)
-            accentColor = ContextCompat.getColor(this, R.color.material_blue);
+            accentColor = ContextCompat.getColor(this, R.color.accent);
         ChangelogDialog.create(false, accentColor)
                 .show(getSupportFragmentManager(), "changelog");
     }
@@ -602,7 +602,7 @@ public class MainActivity extends AppCompatActivity implements
                 .titleColorRes(R.color.material_red_400)
                 .contentColorRes(android.R.color.white)
                 .backgroundColorRes(R.color.material_blue_grey_800)
-                .dividerColorRes(R.color.material_blue)
+                .dividerColorRes(R.color.accent)
                 .btnSelector(R.drawable.md_btn_selector_custom, DialogAction.POSITIVE)
                 .positiveColor(Color.WHITE)
                 .negativeColorAttr(android.R.attr.textColorSecondaryInverse)

BIN
sample/src/main/res/drawable-hdpi/ic_launcher.png


BIN
sample/src/main/res/drawable-mdpi/ic_launcher.png


BIN
sample/src/main/res/drawable-xhdpi/ic_launcher.png


BIN
sample/src/main/res/drawable-xxhdpi/ic_launcher.png


BIN
sample/src/main/res/drawable-xxxhdpi/ic_launcher.png


BIN
sample/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
sample/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
sample/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
sample/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 4 - 4
sample/src/main/res/values-v21/styles.xml

@@ -2,11 +2,11 @@
 
     <!-- http://www.google.com/design/spec/style/color.html#color-color-palette -->
     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
-        <item name="colorPrimary">@color/material_indigo_500</item>
-        <item name="colorPrimaryDark">@color/material_indigo_600</item>
-        <item name="colorAccent">@color/material_blue</item>
+        <item name="colorPrimary">@color/primary</item>
+        <item name="colorPrimaryDark">@color/primaryDark</item>
+        <item name="colorAccent">@color/accent</item>
 
-        <item name="android:navigationBarColor">@color/material_indigo_500</item>
+        <item name="android:navigationBarColor">@color/primary</item>
     </style>
 
 </resources>

+ 3 - 3
sample/src/main/res/values/colors.xml

@@ -2,9 +2,9 @@
 <resources>
 
     <!-- http://www.google.com/design/spec/style/color.html#color-color-palette -->
-    <color name="material_indigo_500">#3F51B5</color>
-    <color name="material_indigo_600">#3949AB</color>
-    <color name="material_blue">#2196F3</color>
+    <color name="primary">#7B1FA2</color>
+    <color name="primaryDark">#6A1B9A</color>
+    <color name="accent">#DD2C00</color>
     <color name="material_red_400">#EF5350</color>
 
 </resources>

+ 1 - 1
sample/src/main/res/values/strings.xml

@@ -1,6 +1,6 @@
 <resources>
 
-    <string name="app_name">MaterialDialogs</string>
+    <string name="app_name">Material Dialogs</string>
 
     <string name="agree">Agree</string>
     <string name="disagree">Disagree</string>

+ 3 - 3
sample/src/main/res/values/styles.xml

@@ -2,9 +2,9 @@
 
     <!-- http://www.google.com/design/spec/style/color.html#color-color-palette -->
     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
-        <item name="colorPrimary">@color/material_indigo_500</item>
-        <item name="colorPrimaryDark">@color/material_indigo_600</item>
-        <item name="colorAccent">@color/material_blue</item>
+        <item name="colorPrimary">@color/primary</item>
+        <item name="colorPrimaryDark">@color/primaryDark</item>
+        <item name="colorAccent">@color/accent</item>
     </style>
 
     <style name="SampleHeader">

+ 1 - 1
sample/src/main/res/xml-v11/preferences.xml

@@ -2,7 +2,7 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
 
     <com.afollestad.materialdialogs.prefs.MaterialDialogPreference
-        android:dialogIcon="@drawable/ic_launcher"
+        android:dialogIcon="@mipmap/ic_launcher"
         android:dialogMessage="@string/preference_dialog_message"
         android:dialogTitle="@string/preference_dialog_title"
         android:key="unused_key00"

+ 1 - 1
sample/src/main/res/xml/preferences.xml

@@ -2,7 +2,7 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
 
     <com.afollestad.materialdialogs.prefs.MaterialDialogPreference
-        android:dialogIcon="@drawable/ic_launcher"
+        android:dialogIcon="@mipmap/ic_launcher"
         android:dialogMessage="@string/preference_dialog_message"
         android:dialogTitle="@string/preference_dialog_title"
         android:key="unused_key00"