diff --git a/alertdialogpro-core/src/main/java/com/alertdialogpro/internal/AlertController.java b/alertdialogpro-core/src/main/java/com/alertdialogpro/internal/AlertController.java
index 515142e..8d685b8 100644
--- a/alertdialogpro-core/src/main/java/com/alertdialogpro/internal/AlertController.java
+++ b/alertdialogpro-core/src/main/java/com/alertdialogpro/internal/AlertController.java
@@ -5,8 +5,10 @@
import android.content.res.TypedArray;
import android.database.Cursor;
import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.os.Handler;
import android.os.Message;
+import android.support.v7.internal.widget.ContentFrameLayout;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
@@ -190,10 +192,57 @@ static boolean canTextInput(View v) {
public void installContent() {
/* We use a custom title so never request a window title */
mWindow.requestFeature(Window.FEATURE_NO_TITLE);
- mWindow.setContentView(mAlertDialogLayout);
+
+ /* On API 11 and below:
+ * Inflate the base DecorView of all dialogs,
+ * this is used to backport the windowMinWidthMajor,windowMinWidthMinor etc. attributes,
+ * in the same way AppCompat does
+ * */
+ if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
+
+ //FitWindowsLinearLayout decorView = (FitWindowsLinearLayout) mWindow.getLayoutInflater().inflate(R.layout.adp_alert_dialog_base, null, false);
+ ContentFrameLayout frameLayout = (ContentFrameLayout) mWindow.getLayoutInflater().inflate(R.layout.adp_alert_dialog_base, null, false);
+
+ //ContentFrameLayout frameLayout = (ContentFrameLayout) mWindow.getDecorView();
+ LayoutInflater.from(frameLayout.getContext()).inflate(mAlertDialogLayout, frameLayout, true);
+ //mWindow.setContentView(mAlertDialogLayout);
+ mWindow.setContentView(frameLayout);
+
+ applyFixedSizeWindow(frameLayout);
+ } else {
+ mWindow.setContentView(mAlertDialogLayout);
+ }
+
+
setupView();
}
+ private void applyFixedSizeWindow(ContentFrameLayout contentFrameLayout) {
+ TypedArray a = contentFrameLayout.getContext().obtainStyledAttributes(R.styleable.Theme);
+ a.getValue(R.styleable.Theme_windowMinWidthMajor, contentFrameLayout.getMinWidthMajor());
+ a.getValue(R.styleable.Theme_windowMinWidthMinor, contentFrameLayout.getMinWidthMinor());
+
+ if (a.hasValue(R.styleable.Theme_windowFixedWidthMajor)) {
+ a.getValue(R.styleable.Theme_windowFixedWidthMajor,
+ contentFrameLayout.getFixedWidthMajor());
+ }
+ if (a.hasValue(R.styleable.Theme_windowFixedWidthMinor)) {
+ a.getValue(R.styleable.Theme_windowFixedWidthMinor,
+ contentFrameLayout.getFixedWidthMinor());
+ }
+ if (a.hasValue(R.styleable.Theme_windowFixedHeightMajor)) {
+ a.getValue(R.styleable.Theme_windowFixedHeightMajor,
+ contentFrameLayout.getFixedHeightMajor());
+ }
+ if (a.hasValue(R.styleable.Theme_windowFixedHeightMinor)) {
+ a.getValue(R.styleable.Theme_windowFixedHeightMinor,
+ contentFrameLayout.getFixedHeightMinor());
+ }
+ a.recycle();
+
+ contentFrameLayout.requestLayout();
+ }
+
public void setTitle(CharSequence title) {
mTitle = title;
if (mTitleView != null) {
diff --git a/alertdialogpro-core/src/main/res/layout/adp_alert_dialog_base.xml b/alertdialogpro-core/src/main/res/layout/adp_alert_dialog_base.xml
new file mode 100644
index 0000000..326af3b
--- /dev/null
+++ b/alertdialogpro-core/src/main/res/layout/adp_alert_dialog_base.xml
@@ -0,0 +1,7 @@
+
+
diff --git a/alertdialogpro-core/src/main/res/values-large/adp_core_dimens.xml b/alertdialogpro-core/src/main/res/values-large/adp_core_dimens.xml
new file mode 100644
index 0000000..b2adcbf
--- /dev/null
+++ b/alertdialogpro-core/src/main/res/values-large/adp_core_dimens.xml
@@ -0,0 +1,5 @@
+
+
+ - 55%
+ - 80%
+
\ No newline at end of file
diff --git a/alertdialogpro-core/src/main/res/values-v11/adp_core_themes.xml b/alertdialogpro-core/src/main/res/values-v11/adp_core_themes.xml
index 1abd852..c5cdd13 100644
--- a/alertdialogpro-core/src/main/res/values-v11/adp_core_themes.xml
+++ b/alertdialogpro-core/src/main/res/values-v11/adp_core_themes.xml
@@ -1,13 +1,16 @@
+
-
\ No newline at end of file
+
diff --git a/alertdialogpro-core/src/main/res/values-xlarge/adp_core_dimens.xml b/alertdialogpro-core/src/main/res/values-xlarge/adp_core_dimens.xml
new file mode 100644
index 0000000..5a084e0
--- /dev/null
+++ b/alertdialogpro-core/src/main/res/values-xlarge/adp_core_dimens.xml
@@ -0,0 +1,5 @@
+
+
+ - 45%
+ - 72%
+
\ No newline at end of file
diff --git a/alertdialogpro-core/src/main/res/values/adp_core_dimens.xml b/alertdialogpro-core/src/main/res/values/adp_core_dimens.xml
new file mode 100644
index 0000000..b63ce50
--- /dev/null
+++ b/alertdialogpro-core/src/main/res/values/adp_core_dimens.xml
@@ -0,0 +1,5 @@
+
+
+ - 65%
+ - 95%
+
\ No newline at end of file
diff --git a/alertdialogpro-core/src/main/res/values/adp_core_themes.xml b/alertdialogpro-core/src/main/res/values/adp_core_themes.xml
index 84388c5..43b36b5 100644
--- a/alertdialogpro-core/src/main/res/values/adp_core_themes.xml
+++ b/alertdialogpro-core/src/main/res/values/adp_core_themes.xml
@@ -1,49 +1,14 @@
-
+