Browse Source

More internal dialog theming fixes, removed unused method.

Aidan Follestad 10 years ago
parent
commit
048308fced

+ 2 - 16
library/src/main/java/com/afollestad/materialdialogs/DialogBase.java

@@ -18,23 +18,9 @@ class DialogBase extends AlertDialog implements DialogInterface.OnShowListener,
     private OnCancelListener mCancelListener;
     protected ContextThemeWrapper mThemedContext;
 
-    protected DialogBase(Context context) {
+    protected DialogBase(ContextThemeWrapper context) {
         super(context);
-    }
-
-    protected void setVerticalMargins(View view, int topMargin, int bottomMargin) {
-        ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
-        boolean changed = false;
-        if (topMargin > -1 && params.topMargin != topMargin) {
-            params.topMargin = topMargin;
-            changed = true;
-        }
-        if (bottomMargin > -1 && params.bottomMargin != bottomMargin) {
-            params.bottomMargin = bottomMargin;
-            changed = true;
-        }
-        if (changed)
-            view.setLayoutParams(params);
+        mThemedContext = context;
     }
 
     public final Context getThemedContext() {

+ 1 - 2
library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

@@ -76,9 +76,8 @@ public class MaterialDialog extends DialogBase implements
 
     @SuppressLint("InflateParams")
     protected MaterialDialog(Builder builder) {
-        super(builder.context);
+        super(DialogInit.getTheme(builder));
         mBuilder = builder;
-        mThemedContext = DialogInit.getTheme(builder);
         final LayoutInflater inflater = LayoutInflater.from(getThemedContext());
         view = (MDRootLayout) inflater.inflate(DialogInit.getInflateLayout(builder), null);
         DialogInit.init(this);