From 138d56323bd4fc06edfba222cc1178acc37267c0 Mon Sep 17 00:00:00 2001 From: pedrofsn Date: Thu, 9 Apr 2015 18:10:41 -0300 Subject: [PATCH 1/3] updating lib and gradle --- build.gradle | 2 +- library/build.gradle | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 88583e9d..18afaf4b 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:0.14.1' + classpath 'com.android.tools.build:gradle:1.0.0' } } diff --git a/library/build.gradle b/library/build.gradle index 8e4eabc6..07f3bee0 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -17,7 +17,5 @@ android { } dependencies { - compile 'com.pnikosis:materialish-progress:1.0' -} - -apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle' \ No newline at end of file + compile 'com.pnikosis:materialish-progress:1.5' +} \ No newline at end of file From ef43d5b6cdcd7a922163b6e6f625cd86746b744b Mon Sep 17 00:00:00 2001 From: pedrofsn Date: Thu, 9 Apr 2015 18:32:56 -0300 Subject: [PATCH 2/3] Adding view using Java --- .../java/cn/pedant/SweetAlert/SweetAlertDialog.java | 11 ++++++++++- library/src/main/res/layout/alert_dialog.xml | 10 +--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java b/library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java index 77be52dd..60841c6f 100644 --- a/library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java +++ b/library/src/main/java/cn/pedant/SweetAlert/SweetAlertDialog.java @@ -3,6 +3,7 @@ import android.app.Dialog; import android.content.Context; +import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; @@ -56,6 +57,8 @@ public class SweetAlertDialog extends Dialog implements View.OnClickListener { private OnSweetClickListener mConfirmClickListener; private boolean mCloseFromCancel; + private ProgressWheel progressWheel; + public static final int NORMAL_TYPE = 0; public static final int ERROR_TYPE = 1; public static final int SUCCESS_TYPE = 2; @@ -139,6 +142,10 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.alert_dialog); + progressWheel = new ProgressWheel(getContext()); + progressWheel.setBarColor(Color.BLUE); + progressWheel.setBarWidth(80); + mDialogView = getWindow().getDecorView().findViewById(android.R.id.content); mTitleTextView = (TextView)findViewById(R.id.title_text); mContentTextView = (TextView)findViewById(R.id.content_text); @@ -153,7 +160,7 @@ protected void onCreate(Bundle savedInstanceState) { mWarningFrame = (FrameLayout)findViewById(R.id.warning_frame); mConfirmButton = (Button)findViewById(R.id.confirm_button); mCancelButton = (Button)findViewById(R.id.cancel_button); - mProgressHelper.setProgressWheel((ProgressWheel)findViewById(R.id.progressWheel)); + mProgressHelper.setProgressWheel(progressWheel); mConfirmButton.setOnClickListener(this); mCancelButton.setOnClickListener(this); @@ -163,6 +170,8 @@ protected void onCreate(Bundle savedInstanceState) { setConfirmText(mConfirmText); changeAlertType(mAlertType, true); + mProgressFrame.addView(progressWheel); + } private void restore () { diff --git a/library/src/main/res/layout/alert_dialog.xml b/library/src/main/res/layout/alert_dialog.xml index 7972157f..0f81d5eb 100644 --- a/library/src/main/res/layout/alert_dialog.xml +++ b/library/src/main/res/layout/alert_dialog.xml @@ -107,15 +107,7 @@ android:layout_marginTop="9dp" android:layout_gravity="center" android:orientation="vertical" - android:visibility="gone"> - - - + android:visibility="gone"/> Date: Thu, 9 Apr 2015 18:36:33 -0300 Subject: [PATCH 3/3] Resizing button to fill space and be equals space if exists more than one button --- library/src/main/res/values/styles.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/src/main/res/values/styles.xml b/library/src/main/res/values/styles.xml index 3bb566c8..9bbd33b0 100644 --- a/library/src/main/res/values/styles.xml +++ b/library/src/main/res/values/styles.xml @@ -13,7 +13,9 @@