items;
+ private Callback callback;
+
+ public MaterialSimpleListAdapter(Callback callback) {
+ items = new ArrayList<>(4);
+ this.callback = callback;
+ }
+
+ public void add(MaterialSimpleListItem item) {
+ items.add(item);
+ notifyItemInserted(items.size() - 1);
+ }
+
+ public void clear() {
+ items.clear();
+ notifyDataSetChanged();
+ }
+
+ public MaterialSimpleListItem getItem(int index) {
+ return items.get(index);
+ }
+
+ @Override
+ public void setDialog(MaterialDialog dialog) {
+ this.dialog = dialog;
+ }
+
+ @Override
+ public SimpleListVH onCreateViewHolder(ViewGroup parent, int viewType) {
+ final View view =
+ LayoutInflater.from(parent.getContext())
+ .inflate(R.layout.md_simplelist_item, parent, false);
+ return new SimpleListVH(view, this);
+ }
+
+ @Override
+ public void onBindViewHolder(SimpleListVH holder, int position) {
+ if (dialog != null) {
+ final MaterialSimpleListItem item = items.get(position);
+ if (item.getIcon() != null) {
+ holder.icon.setImageDrawable(item.getIcon());
+ holder.icon.setPadding(
+ item.getIconPadding(),
+ item.getIconPadding(),
+ item.getIconPadding(),
+ item.getIconPadding());
+ holder
+ .icon
+ .getBackground()
+ .setColorFilter(item.getBackgroundColor(), PorterDuff.Mode.SRC_ATOP);
+ } else {
+ holder.icon.setVisibility(View.GONE);
+ }
+ holder.title.setTextColor(dialog.getBuilder().getItemColor());
+ holder.title.setText(item.getContent());
+ dialog.setTypeface(holder.title, dialog.getBuilder().getRegularFont());
+ }
+ }
+
+ @Override
+ public int getItemCount() {
+ return items.size();
+ }
+
+ public interface Callback {
+
+ void onMaterialListItemSelected(MaterialDialog dialog, int index, MaterialSimpleListItem item);
+ }
+
+ static class SimpleListVH extends RecyclerView.ViewHolder implements View.OnClickListener {
+
+ final ImageView icon;
+ final TextView title;
+ final MaterialSimpleListAdapter adapter;
+
+ SimpleListVH(View itemView, MaterialSimpleListAdapter adapter) {
+ super(itemView);
+ icon = (ImageView) itemView.findViewById(android.R.id.icon);
+ title = (TextView) itemView.findViewById(android.R.id.title);
+ this.adapter = adapter;
+ itemView.setOnClickListener(this);
+ }
+
+ @Override
+ public void onClick(View view) {
+ if (adapter.callback != null) {
+ adapter.callback.onMaterialListItemSelected(
+ adapter.dialog, getAdapterPosition(), adapter.getItem(getAdapterPosition()));
+ }
+ }
+ }
+}
diff --git a/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/simplelist/MaterialSimpleListItem.java b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/simplelist/MaterialSimpleListItem.java
new file mode 100644
index 00000000..b947f3a9
--- /dev/null
+++ b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/simplelist/MaterialSimpleListItem.java
@@ -0,0 +1,142 @@
+package com.afollestad.materialdialogs.simplelist;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.util.TypedValue;
+import androidx.annotation.AttrRes;
+import androidx.annotation.ColorInt;
+import androidx.annotation.ColorRes;
+import androidx.annotation.DimenRes;
+import androidx.annotation.DrawableRes;
+import androidx.annotation.IntRange;
+import androidx.annotation.Nullable;
+import androidx.annotation.StringRes;
+import androidx.core.content.ContextCompat;
+import com.afollestad.materialdialogs.util.DialogUtils;
+
+/** @author Aidan Follestad (afollestad) */
+public class MaterialSimpleListItem {
+
+ private final Builder builder;
+
+ private MaterialSimpleListItem(Builder builder) {
+ this.builder = builder;
+ }
+
+ public Drawable getIcon() {
+ return builder.icon;
+ }
+
+ public CharSequence getContent() {
+ return builder.content;
+ }
+
+ public int getIconPadding() {
+ return builder.iconPadding;
+ }
+
+ @ColorInt
+ public int getBackgroundColor() {
+ return builder.backgroundColor;
+ }
+
+ public long getId() {
+ return builder.id;
+ }
+
+ @Nullable
+ public Object getTag() {
+ return builder.tag;
+ }
+
+ @Override
+ public String toString() {
+ if (getContent() != null) {
+ return getContent().toString();
+ } else {
+ return "(no content)";
+ }
+ }
+
+ public static class Builder {
+
+ private final Context context;
+ protected Drawable icon;
+ protected CharSequence content;
+ protected long id;
+
+ int iconPadding;
+ int backgroundColor;
+ Object tag;
+
+ public Builder(Context context) {
+ this.context = context;
+ backgroundColor = Color.parseColor("#BCBCBC");
+ }
+
+ public Builder icon(Drawable icon) {
+ this.icon = icon;
+ return this;
+ }
+
+ public Builder icon(@DrawableRes int iconRes) {
+ return icon(ContextCompat.getDrawable(context, iconRes));
+ }
+
+ public Builder iconPadding(@IntRange(from = 0, to = Integer.MAX_VALUE) int padding) {
+ this.iconPadding = padding;
+ return this;
+ }
+
+ public Builder iconPaddingDp(@IntRange(from = 0, to = Integer.MAX_VALUE) int paddingDp) {
+ this.iconPadding =
+ (int)
+ TypedValue.applyDimension(
+ TypedValue.COMPLEX_UNIT_DIP,
+ paddingDp,
+ context.getResources().getDisplayMetrics());
+ return this;
+ }
+
+ public Builder iconPaddingRes(@DimenRes int paddingRes) {
+ return iconPadding(context.getResources().getDimensionPixelSize(paddingRes));
+ }
+
+ public Builder content(CharSequence content) {
+ this.content = content;
+ return this;
+ }
+
+ public Builder content(@StringRes int contentRes) {
+ return content(context.getString(contentRes));
+ }
+
+ public Builder backgroundColor(@ColorInt int color) {
+ this.backgroundColor = color;
+ return this;
+ }
+
+ public Builder backgroundColorRes(@ColorRes int colorRes) {
+ return backgroundColor(DialogUtils.getColor(context, colorRes));
+ }
+
+ public Builder backgroundColorAttr(@AttrRes int colorAttr) {
+ return backgroundColor(DialogUtils.resolveColor(context, colorAttr));
+ }
+
+ public Builder id(long id) {
+ this.id = id;
+ return this;
+ }
+
+ public Builder tag(@Nullable Object tag) {
+ this.tag = tag;
+ return this;
+ }
+
+ public MaterialSimpleListItem build() {
+ return new MaterialSimpleListItem(this);
+ }
+ }
+}
diff --git a/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/DialogUtils.java b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/DialogUtils.java
new file mode 100644
index 00000000..6a1a0726
--- /dev/null
+++ b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/DialogUtils.java
@@ -0,0 +1,298 @@
+package com.afollestad.materialdialogs.util;
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.res.ColorStateList;
+import android.content.res.TypedArray;
+import android.graphics.Color;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.os.IBinder;
+import android.util.TypedValue;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+import androidx.annotation.ArrayRes;
+import androidx.annotation.AttrRes;
+import androidx.annotation.ColorInt;
+import androidx.annotation.ColorRes;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
+import com.afollestad.materialdialogs.GravityEnum;
+import com.afollestad.materialdialogs.MaterialDialog;
+
+/** @author Aidan Follestad (afollestad) */
+public class DialogUtils {
+
+ // @SuppressWarnings("ConstantConditions")
+ // public static float resolveFloat(Context context, int attr) {
+ // TypedArray a = context.obtainStyledAttributes(null, new int[]{attr});
+ // try {
+ // return a.getFloat(0, 0);
+ // } finally {
+ // a.recycle();
+ // }
+ // }
+
+ @ColorInt
+ public static int getDisabledColor(Context context) {
+ final int primaryColor = resolveColor(context, android.R.attr.textColorPrimary);
+ final int disabledColor = isColorDark(primaryColor) ? Color.BLACK : Color.WHITE;
+ return adjustAlpha(disabledColor, 0.3f);
+ }
+
+ @ColorInt
+ public static int adjustAlpha(
+ @ColorInt int color, @SuppressWarnings("SameParameterValue") float factor) {
+ int alpha = Math.round(Color.alpha(color) * factor);
+ int red = Color.red(color);
+ int green = Color.green(color);
+ int blue = Color.blue(color);
+ return Color.argb(alpha, red, green, blue);
+ }
+
+ @ColorInt
+ public static int resolveColor(Context context, @AttrRes int attr) {
+ return resolveColor(context, attr, 0);
+ }
+
+ @ColorInt
+ public static int resolveColor(Context context, @AttrRes int attr, int fallback) {
+ TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
+ try {
+ return a.getColor(0, fallback);
+ } finally {
+ a.recycle();
+ }
+ }
+
+ // Try to resolve the colorAttr attribute.
+ public static ColorStateList resolveActionTextColorStateList(
+ Context context, @AttrRes int colorAttr, ColorStateList fallback) {
+ TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{colorAttr});
+ try {
+ final TypedValue value = a.peekValue(0);
+ if (value == null) {
+ return fallback;
+ }
+ if (value.type >= TypedValue.TYPE_FIRST_COLOR_INT
+ && value.type <= TypedValue.TYPE_LAST_COLOR_INT) {
+ return getActionTextStateList(context, value.data);
+ } else {
+ final ColorStateList stateList = a.getColorStateList(0);
+ if (stateList != null) {
+ return stateList;
+ } else {
+ return fallback;
+ }
+ }
+ } finally {
+ a.recycle();
+ }
+ }
+
+ // Get the specified color resource, creating a ColorStateList if the resource
+ // points to a color value.
+ public static ColorStateList getActionTextColorStateList(Context context, @ColorRes int colorId) {
+ final TypedValue value = new TypedValue();
+ context.getResources().getValue(colorId, value, true);
+ if (value.type >= TypedValue.TYPE_FIRST_COLOR_INT
+ && value.type <= TypedValue.TYPE_LAST_COLOR_INT) {
+ return getActionTextStateList(context, value.data);
+ } else {
+ return context.getColorStateList(colorId);
+ }
+ }
+
+ /**
+ * Returns a color associated with a particular resource ID
+ *
+ * Starting in {@link android.os.Build.VERSION_CODES#M}, the returned color will be styled for
+ * the specified Context's theme.
+ *
+ * @param colorId The desired resource identifier, as generated by the aapt tool. This integer
+ * encodes the package, type, and resource entry. The value 0 is an invalid identifier.
+ * @return A single color value in the form 0xAARRGGBB.
+ */
+ @ColorInt
+ public static int getColor(Context context, @ColorRes int colorId) {
+ return ContextCompat.getColor(context, colorId);
+ }
+
+ public static String resolveString(Context context, @AttrRes int attr) {
+ TypedValue v = new TypedValue();
+ context.getTheme().resolveAttribute(attr, v, true);
+ return (String) v.string;
+ }
+
+ private static int gravityEnumToAttrInt(GravityEnum value) {
+ switch (value) {
+ case CENTER:
+ return 1;
+ case END:
+ return 2;
+ default:
+ return 0;
+ }
+ }
+
+ public static GravityEnum resolveGravityEnum(
+ Context context, @AttrRes int attr, GravityEnum defaultGravity) {
+ TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
+ try {
+ switch (a.getInt(0, gravityEnumToAttrInt(defaultGravity))) {
+ case 1:
+ return GravityEnum.CENTER;
+ case 2:
+ return GravityEnum.END;
+ default:
+ return GravityEnum.START;
+ }
+ } finally {
+ a.recycle();
+ }
+ }
+
+ public static Drawable resolveDrawable(Context context, @AttrRes int attr) {
+ return resolveDrawable(context, attr, null);
+ }
+
+ private static Drawable resolveDrawable(
+ Context context,
+ @AttrRes int attr,
+ @SuppressWarnings("SameParameterValue") Drawable fallback) {
+ TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
+ try {
+ Drawable d = a.getDrawable(0);
+ if (d == null && fallback != null) {
+ d = fallback;
+ }
+ return d;
+ } finally {
+ a.recycle();
+ }
+ }
+
+ public static int resolveDimension(Context context, @AttrRes int attr) {
+ return resolveDimension(context, attr, -1);
+ }
+
+ private static int resolveDimension(Context context, @AttrRes int attr, int fallback) {
+ TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
+ try {
+ return a.getDimensionPixelSize(0, fallback);
+ } finally {
+ a.recycle();
+ }
+ }
+
+ public static boolean resolveBoolean(Context context, @AttrRes int attr, boolean fallback) {
+ TypedArray a = context.getTheme().obtainStyledAttributes(new int[]{attr});
+ try {
+ return a.getBoolean(0, fallback);
+ } finally {
+ a.recycle();
+ }
+ }
+
+ public static boolean resolveBoolean(Context context, @AttrRes int attr) {
+ return resolveBoolean(context, attr, false);
+ }
+
+ public static boolean isColorDark(@ColorInt int color) {
+ double darkness =
+ 1
+ - (0.299 * Color.red(color) + 0.587 * Color.green(color) + 0.114 * Color.blue(color))
+ / 255;
+ return darkness >= 0.5;
+ }
+
+ public static void setBackgroundCompat(View view, Drawable d) {
+ view.setBackground(d);
+ }
+
+ public static void showKeyboard(
+ @NonNull final DialogInterface di, @NonNull final MaterialDialog.Builder builder) {
+ final MaterialDialog dialog = (MaterialDialog) di;
+ if (dialog.getInputEditText() == null) {
+ return;
+ }
+ dialog
+ .getInputEditText()
+ .post(
+ new Runnable() {
+ @Override
+ public void run() {
+ dialog.getInputEditText().requestFocus();
+ InputMethodManager imm =
+ (InputMethodManager)
+ builder.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+ if (imm != null) {
+ imm.showSoftInput(dialog.getInputEditText(), InputMethodManager.SHOW_IMPLICIT);
+ }
+ }
+ });
+ }
+
+ public static void hideKeyboard(
+ @NonNull final DialogInterface di, @NonNull final MaterialDialog.Builder builder) {
+ final MaterialDialog dialog = (MaterialDialog) di;
+ if (dialog.getInputEditText() == null) {
+ return;
+ }
+ InputMethodManager imm =
+ (InputMethodManager) builder.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+ if (imm != null) {
+ final View currentFocus = dialog.getCurrentFocus();
+ IBinder windowToken = null;
+ if (currentFocus != null) {
+ windowToken = currentFocus.getWindowToken();
+ } else if (dialog.getView() != null) {
+ windowToken = dialog.getView().getWindowToken();
+ }
+ if (windowToken != null) {
+ imm.hideSoftInputFromWindow(windowToken, 0);
+ }
+ }
+ }
+
+ public static ColorStateList getActionTextStateList(Context context, int newPrimaryColor) {
+ final int fallBackButtonColor =
+ DialogUtils.resolveColor(context, android.R.attr.textColorPrimary);
+ if (newPrimaryColor == 0) {
+ newPrimaryColor = fallBackButtonColor;
+ }
+ int[][] states =
+ new int[][]{
+ new int[]{-android.R.attr.state_enabled}, // disabled
+ new int[]{} // enabled
+ };
+ int[] colors = new int[]{DialogUtils.adjustAlpha(newPrimaryColor, 0.4f), newPrimaryColor};
+ return new ColorStateList(states, colors);
+ }
+
+ public static int[] getColorArray(@NonNull Context context, @ArrayRes int array) {
+ if (array == 0) {
+ return null;
+ }
+ TypedArray ta = context.getResources().obtainTypedArray(array);
+ int[] colors = new int[ta.length()];
+ for (int i = 0; i < ta.length(); i++) {
+ colors[i] = ta.getColor(i, 0);
+ }
+ ta.recycle();
+ return colors;
+ }
+
+ public static boolean isIn(@NonNull T find, @Nullable T[] ary) {
+ if (ary == null || ary.length == 0) {
+ return false;
+ }
+ for (T item : ary) {
+ if (item.equals(find)) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/RippleHelper.java b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/RippleHelper.java
new file mode 100644
index 00000000..88a264b0
--- /dev/null
+++ b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/RippleHelper.java
@@ -0,0 +1,19 @@
+package com.afollestad.materialdialogs.util;
+
+import android.annotation.TargetApi;
+import android.content.res.ColorStateList;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.RippleDrawable;
+import android.os.Build;
+import androidx.annotation.ColorInt;
+
+/** @author Aidan Follestad (afollestad) */
+@TargetApi(Build.VERSION_CODES.LOLLIPOP)
+public class RippleHelper {
+
+ public static void applyColor(Drawable d, @ColorInt int color) {
+ if (d instanceof RippleDrawable) {
+ ((RippleDrawable) d).setColor(ColorStateList.valueOf(color));
+ }
+ }
+}
diff --git a/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/TypefaceHelper.java b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/TypefaceHelper.java
new file mode 100644
index 00000000..27a7f379
--- /dev/null
+++ b/modules/material-dialogs/src/main/java/com/afollestad/materialdialogs/util/TypefaceHelper.java
@@ -0,0 +1,45 @@
+package com.afollestad.materialdialogs.util;
+
+import android.content.Context;
+import android.graphics.Typeface;
+import androidx.collection.SimpleArrayMap;
+
+/*
+ Each call to Typeface.createFromAsset will load a new instance of the typeface into memory,
+ and this memory is not consistently get garbage collected
+ http://code.google.com/p/android/issues/detail?id=9904
+ (It states released but even on Lollipop you can see the typefaces accumulate even after
+ multiple GC passes)
+
+ You can detect this by running:
+ adb shell dumpsys meminfo com.your.packagenage
+
+ You will see output like:
+
+ Asset Allocations
+ zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K
+ zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K
+ zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K
+ zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Regular.ttf: 123K
+ zip:/data/app/com.your.packagenage-1.apk:/assets/Roboto-Medium.ttf: 125K
+
+*/
+public class TypefaceHelper {
+
+ private static final SimpleArrayMap cache = new SimpleArrayMap<>();
+
+ public static Typeface get(Context c, String name) {
+ synchronized (cache) {
+ if (!cache.containsKey(name)) {
+ try {
+ Typeface t = Typeface.createFromAsset(c.getAssets(), String.format("fonts/%s", name));
+ cache.put(name, t);
+ return t;
+ } catch (RuntimeException e) {
+ return null;
+ }
+ }
+ return cache.get(name);
+ }
+ }
+}
diff --git a/modules/material-dialogs/src/main/res/anim/decelerate_cubic.xml b/modules/material-dialogs/src/main/res/anim/decelerate_cubic.xml
new file mode 100644
index 00000000..9f46713f
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/anim/decelerate_cubic.xml
@@ -0,0 +1,3 @@
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/anim/popup_enter.xml b/modules/material-dialogs/src/main/res/anim/popup_enter.xml
new file mode 100644
index 00000000..51039efb
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/anim/popup_enter.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/anim/popup_exit.xml b/modules/material-dialogs/src/main/res/anim/popup_exit.xml
new file mode 100644
index 00000000..457d02ac
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/anim/popup_exit.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable-v21/md_btn_selector_ripple.xml b/modules/material-dialogs/src/main/res/drawable-v21/md_btn_selector_ripple.xml
new file mode 100644
index 00000000..732eea4e
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable-v21/md_btn_selector_ripple.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable-v21/md_btn_selector_ripple_dark.xml b/modules/material-dialogs/src/main/res/drawable-v21/md_btn_selector_ripple_dark.xml
new file mode 100644
index 00000000..732eea4e
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable-v21/md_btn_selector_ripple_dark.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable-v21/md_btn_shape.xml b/modules/material-dialogs/src/main/res/drawable-v21/md_btn_shape.xml
new file mode 100644
index 00000000..a0060c7b
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable-v21/md_btn_shape.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/gray_circle.xml b/modules/material-dialogs/src/main/res/drawable/gray_circle.xml
new file mode 100644
index 00000000..4c36a36c
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/gray_circle.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_btn_selected.xml b/modules/material-dialogs/src/main/res/drawable/md_btn_selected.xml
new file mode 100644
index 00000000..65d97c86
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_btn_selected.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_btn_selected_dark.xml b/modules/material-dialogs/src/main/res/drawable/md_btn_selected_dark.xml
new file mode 100644
index 00000000..f91e7d78
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_btn_selected_dark.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_btn_selector.xml b/modules/material-dialogs/src/main/res/drawable/md_btn_selector.xml
new file mode 100644
index 00000000..ead9d212
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_btn_selector.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_btn_selector_dark.xml b/modules/material-dialogs/src/main/res/drawable/md_btn_selector_dark.xml
new file mode 100644
index 00000000..564e1410
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_btn_selector_dark.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_ic_more.png b/modules/material-dialogs/src/main/res/drawable/md_ic_more.png
new file mode 100644
index 00000000..de851fc5
Binary files /dev/null and b/modules/material-dialogs/src/main/res/drawable/md_ic_more.png differ
diff --git a/modules/material-dialogs/src/main/res/drawable/md_item_selected.xml b/modules/material-dialogs/src/main/res/drawable/md_item_selected.xml
new file mode 100644
index 00000000..10bf840b
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_item_selected.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_item_selected_dark.xml b/modules/material-dialogs/src/main/res/drawable/md_item_selected_dark.xml
new file mode 100644
index 00000000..b9252007
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_item_selected_dark.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_nav_back.xml b/modules/material-dialogs/src/main/res/drawable/md_nav_back.xml
new file mode 100644
index 00000000..a95494b7
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_nav_back.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_selector.xml b/modules/material-dialogs/src/main/res/drawable/md_selector.xml
new file mode 100644
index 00000000..df3322b3
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_selector.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_selector_dark.xml b/modules/material-dialogs/src/main/res/drawable/md_selector_dark.xml
new file mode 100644
index 00000000..8c599e92
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_selector_dark.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/drawable/md_transparent.xml b/modules/material-dialogs/src/main/res/drawable/md_transparent.xml
new file mode 100644
index 00000000..261a644c
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/drawable/md_transparent.xml
@@ -0,0 +1,5 @@
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout-ldrtl/md_listitem_multichoice.xml b/modules/material-dialogs/src/main/res/layout-ldrtl/md_listitem_multichoice.xml
new file mode 100644
index 00000000..5dc1acfa
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout-ldrtl/md_listitem_multichoice.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout-ldrtl/md_listitem_singlechoice.xml b/modules/material-dialogs/src/main/res/layout-ldrtl/md_listitem_singlechoice.xml
new file mode 100644
index 00000000..7a720350
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout-ldrtl/md_listitem_singlechoice.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress.xml b/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress.xml
new file mode 100644
index 00000000..3bfc4ed9
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress_indeterminate.xml b/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress_indeterminate.xml
new file mode 100644
index 00000000..3c4517ae
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress_indeterminate.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress_indeterminate_horizontal.xml b/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress_indeterminate_horizontal.xml
new file mode 100644
index 00000000..b34cfd3f
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout-v14/md_stub_progress_indeterminate_horizontal.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_basic.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_basic.xml
new file mode 100644
index 00000000..1983a02a
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_basic.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_basic_check.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_basic_check.xml
new file mode 100644
index 00000000..57cbbaa2
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_basic_check.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_colorchooser.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_colorchooser.xml
new file mode 100644
index 00000000..930c66d3
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_colorchooser.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_custom.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_custom.xml
new file mode 100644
index 00000000..42bcfbc8
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_custom.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_input.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_input.xml
new file mode 100644
index 00000000..58ddcea7
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_input.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_input_check.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_input_check.xml
new file mode 100644
index 00000000..12d3623e
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_input_check.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_list.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_list.xml
new file mode 100644
index 00000000..e455ac3b
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_list.xml
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_list_check.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_list_check.xml
new file mode 100644
index 00000000..687cc0b2
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_list_check.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_progress.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_progress.xml
new file mode 100644
index 00000000..1fb39b76
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_progress.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_progress_indeterminate.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_progress_indeterminate.xml
new file mode 100644
index 00000000..9cf4670e
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_progress_indeterminate.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_dialog_progress_indeterminate_horizontal.xml b/modules/material-dialogs/src/main/res/layout/md_dialog_progress_indeterminate_horizontal.xml
new file mode 100644
index 00000000..e2aa2585
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_dialog_progress_indeterminate_horizontal.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_listitem.xml b/modules/material-dialogs/src/main/res/layout/md_listitem.xml
new file mode 100644
index 00000000..ca89f80b
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_listitem.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_listitem_multichoice.xml b/modules/material-dialogs/src/main/res/layout/md_listitem_multichoice.xml
new file mode 100644
index 00000000..4b52a083
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_listitem_multichoice.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_listitem_singlechoice.xml b/modules/material-dialogs/src/main/res/layout/md_listitem_singlechoice.xml
new file mode 100644
index 00000000..4ed2bce3
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_listitem_singlechoice.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_preference_custom.xml b/modules/material-dialogs/src/main/res/layout/md_preference_custom.xml
new file mode 100644
index 00000000..842a9ab9
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_preference_custom.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_simplelist_item.xml b/modules/material-dialogs/src/main/res/layout/md_simplelist_item.xml
new file mode 100644
index 00000000..8a085e0c
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_simplelist_item.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_actionbuttons.xml b/modules/material-dialogs/src/main/res/layout/md_stub_actionbuttons.xml
new file mode 100644
index 00000000..ad15a6c4
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_actionbuttons.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_colorchooser_custom.xml b/modules/material-dialogs/src/main/res/layout/md_stub_colorchooser_custom.xml
new file mode 100644
index 00000000..6de905eb
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_colorchooser_custom.xml
@@ -0,0 +1,235 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_colorchooser_grid.xml b/modules/material-dialogs/src/main/res/layout/md_stub_colorchooser_grid.xml
new file mode 100644
index 00000000..a4e7c839
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_colorchooser_grid.xml
@@ -0,0 +1,14 @@
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_inputpref.xml b/modules/material-dialogs/src/main/res/layout/md_stub_inputpref.xml
new file mode 100644
index 00000000..26d9d928
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_inputpref.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_progress.xml b/modules/material-dialogs/src/main/res/layout/md_stub_progress.xml
new file mode 100644
index 00000000..f107f11b
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_progress.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_progress_indeterminate.xml b/modules/material-dialogs/src/main/res/layout/md_stub_progress_indeterminate.xml
new file mode 100644
index 00000000..a31fa1dc
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_progress_indeterminate.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_progress_indeterminate_horizontal.xml b/modules/material-dialogs/src/main/res/layout/md_stub_progress_indeterminate_horizontal.xml
new file mode 100644
index 00000000..259f73cf
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_progress_indeterminate_horizontal.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_titleframe.xml b/modules/material-dialogs/src/main/res/layout/md_stub_titleframe.xml
new file mode 100644
index 00000000..00183c2f
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_titleframe.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/layout/md_stub_titleframe_lesspadding.xml b/modules/material-dialogs/src/main/res/layout/md_stub_titleframe_lesspadding.xml
new file mode 100644
index 00000000..5d840ead
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/layout/md_stub_titleframe_lesspadding.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/menu/md_more_options.xml b/modules/material-dialogs/src/main/res/menu/md_more_options.xml
new file mode 100644
index 00000000..1fe7aa6d
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/menu/md_more_options.xml
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values-large/dimens.xml b/modules/material-dialogs/src/main/res/values-large/dimens.xml
new file mode 100644
index 00000000..ed362496
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values-large/dimens.xml
@@ -0,0 +1,6 @@
+
+
+
+ 28dp
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values-sw600dp/dimens.xml b/modules/material-dialogs/src/main/res/values-sw600dp/dimens.xml
new file mode 100644
index 00000000..e1cf92f6
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values-sw600dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+
+ 446dp
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values-sw720dp-land/dimens.xml b/modules/material-dialogs/src/main/res/values-sw720dp-land/dimens.xml
new file mode 100644
index 00000000..93690aa7
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values-sw720dp-land/dimens.xml
@@ -0,0 +1,6 @@
+
+
+
+ 564dp
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values-sw720dp/dimens.xml b/modules/material-dialogs/src/main/res/values-sw720dp/dimens.xml
new file mode 100644
index 00000000..acf0656f
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values-sw720dp/dimens.xml
@@ -0,0 +1,6 @@
+
+
+
+ 496dp
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values-v11/styles.xml b/modules/material-dialogs/src/main/res/values-v11/styles.xml
new file mode 100644
index 00000000..b2096deb
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values-v11/styles.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values-v21/styles.xml b/modules/material-dialogs/src/main/res/values-v21/styles.xml
new file mode 100644
index 00000000..1c7fc215
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values-v21/styles.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values/attrs.xml b/modules/material-dialogs/src/main/res/values/attrs.xml
new file mode 100644
index 00000000..567daa38
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values/attrs.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values/colors.xml b/modules/material-dialogs/src/main/res/values/colors.xml
new file mode 100644
index 00000000..6b12d9cc
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values/colors.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+ #33969696
+ #40CBCBCB
+
+ #10000000
+ #10FFFFFF
+
+ #2196F3
+ #1565C0
+
+ #DD2C00
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values/dimens.xml b/modules/material-dialogs/src/main/res/values/dimens.xml
new file mode 100644
index 00000000..0d0e9ac3
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values/dimens.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+ 24dp
+
+ 12dp
+ 6dp
+
+ 16dp
+
+ 20dp
+
+ 8dp
+ 8dp
+
+ 72dp
+
+ 6dp
+ 4dp
+ 1dp
+ 8dp
+ 4dp
+ 32dp
+
+ 12dp
+ 12dp
+
+
+ 8dp
+ 8dp
+ 48dp
+ 20sp
+ 16sp
+ 14sp
+ 16sp
+ 48dp
+ 6dp
+ 16dp
+ 48dp
+ 24dp
+ 2dp
+ 1dp
+
+ 2dp
+ 4dp
+ 12dp
+ 8dp
+
+ 356dp
+ 52dp
+ 28dp
+
+ 62dp
+ 40dp
+ 16dp
+ 18sp
+
+ 16dp
+ 56dp
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values/ids.xml b/modules/material-dialogs/src/main/res/values/ids.xml
new file mode 100644
index 00000000..020f6c31
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values/ids.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values/public.xml b/modules/material-dialogs/src/main/res/values/public.xml
new file mode 100644
index 00000000..31e19d84
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values/public.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/modules/material-dialogs/src/main/res/values/strings.xml b/modules/material-dialogs/src/main/res/values/strings.xml
new file mode 100644
index 00000000..3e958b77
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values/strings.xml
@@ -0,0 +1,12 @@
+
+
+ Back
+ Done
+ Cancel
+ Choose
+ Error
+ Your app has not been granted the READ_EXTERNAL_STORAGE permission.
+ Custom
+ Presets
+ New Folder
+
\ No newline at end of file
diff --git a/modules/material-dialogs/src/main/res/values/styles.xml b/modules/material-dialogs/src/main/res/values/styles.xml
new file mode 100644
index 00000000..5133c89e
--- /dev/null
+++ b/modules/material-dialogs/src/main/res/values/styles.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 1fadec0c..50644f5d 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -30,6 +30,7 @@ private val modules = listOf(
"apk-signer",
"apk-parser",
"color-picker",
+ "material-dialogs",
"material-date-time-picker",
)