From 56afccdded67d9fb886ebcd675ed54f63504e992 Mon Sep 17 00:00:00 2001 From: xuexiangjys Date: Wed, 12 Feb 2020 00:19:14 +0800 Subject: [PATCH 01/10] =?UTF-8?q?1.=E5=88=87=E5=88=86=E5=87=BA1.1.3?= =?UTF-8?q?=E5=88=86=E6=94=AF=202.=E4=BF=AE=E6=94=B9MaterialDialog?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 10 ++++----- .../dialog/materialdialog/MaterialDialog.java | 22 ++++++------------- .../src/main/res/values/xui_styles_widget.xml | 4 ++-- 3 files changed, 14 insertions(+), 22 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index be283311..baf08f58 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,8 +14,8 @@ android { applicationId "com.xuexiang.xuidemo" minSdkVersion 17 targetSdkVersion build_versions.target_sdk - versionCode 13 - versionName "1.1.2" + versionCode 14 + versionName "1.1.3" multiDexEnabled true vectorDrawables.useSupportLibrary = true @@ -102,8 +102,8 @@ dependencies { implementation 'com.github.bumptech.glide:glide:4.8.0' //XUI框架 -// implementation project(':xui_lib') - implementation 'com.github.xuexiangjys:XUI:1.1.2' + implementation project(':xui_lib') +// implementation 'com.github.xuexiangjys:XUI:1.1.2' // implementation 'com.qmuiteam:qmui:1.2.0' //工具类 @@ -192,7 +192,7 @@ dependencies { implementation 'com.github.xuexiangjys:CameraView:1.0.3' //版本更新 - implementation 'com.github.xuexiangjys:XUpdate:1.1.1' + implementation 'com.github.xuexiangjys:XUpdate:1.1.3' implementation 'com.zhy:okhttputils:2.6.2' //腾讯的键值对存储mmkv implementation 'com.tencent:mmkv:1.0.22' diff --git a/xui_lib/src/main/java/com/xuexiang/xui/widget/dialog/materialdialog/MaterialDialog.java b/xui_lib/src/main/java/com/xuexiang/xui/widget/dialog/materialdialog/MaterialDialog.java index 345a8766..adcddbe4 100755 --- a/xui_lib/src/main/java/com/xuexiang/xui/widget/dialog/materialdialog/MaterialDialog.java +++ b/xui_lib/src/main/java/com/xuexiang/xui/widget/dialog/materialdialog/MaterialDialog.java @@ -58,13 +58,13 @@ import androidx.annotation.Nullable; import androidx.annotation.StringRes; import androidx.annotation.UiThread; -import androidx.core.content.res.ResourcesCompat; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.xuexiang.xui.R; import com.xuexiang.xui.XUI; +import com.xuexiang.xui.utils.ResUtils; import com.xuexiang.xui.utils.ThemeUtils; import com.xuexiang.xui.widget.dialog.materialdialog.internal.MDButton; import com.xuexiang.xui.widget.dialog.materialdialog.internal.MDRootLayout; @@ -80,9 +80,6 @@ import java.util.List; import java.util.Locale; -import java.lang.String; -import java.lang.CharSequence; - /** * Material Design Dialog @@ -307,8 +304,7 @@ public boolean onItemSelected( final Drawable getListSelector() { if (builder.listSelector != 0) { - return ResourcesCompat.getDrawable( - builder.context.getResources(), builder.listSelector, null); + return ResUtils.getDrawable(builder.context, builder.listSelector); } final Drawable d = ThemeUtils.resolveDrawable(builder.context, R.attr.md_list_selector); if (d != null) { @@ -335,8 +331,7 @@ public void setPromptCheckBoxChecked(boolean checked) { /* package */ Drawable getButtonSelector(DialogAction which, boolean isStacked) { if (isStacked) { if (builder.btnSelectorStacked != 0) { - return ResourcesCompat.getDrawable( - builder.context.getResources(), builder.btnSelectorStacked, null); + return ResUtils.getDrawable(builder.context, builder.btnSelectorStacked); } final Drawable d = ThemeUtils.resolveDrawable(builder.context, R.attr.md_btn_stacked_selector); @@ -349,8 +344,7 @@ public void setPromptCheckBoxChecked(boolean checked) { switch (which) { case NEUTRAL: if (builder.btnSelectorNeutral != 0) { - return ResourcesCompat.getDrawable( - builder.context.getResources(), builder.btnSelectorNeutral, null); + return ResUtils.getDrawable(builder.context, builder.btnSelectorNeutral); } d = ThemeUtils.resolveDrawable(builder.context, R.attr.md_btn_neutral_selector); if (d != null) { @@ -363,8 +357,7 @@ public void setPromptCheckBoxChecked(boolean checked) { break; case NEGATIVE: if (builder.btnSelectorNegative != 0) { - return ResourcesCompat.getDrawable( - builder.context.getResources(), builder.btnSelectorNegative, null); + return ResUtils.getDrawable(builder.context, builder.btnSelectorNegative); } d = ThemeUtils.resolveDrawable(builder.context, R.attr.md_btn_negative_selector); if (d != null) { @@ -377,8 +370,7 @@ public void setPromptCheckBoxChecked(boolean checked) { break; default: if (builder.btnSelectorPositive != 0) { - return ResourcesCompat.getDrawable( - builder.context.getResources(), builder.btnSelectorPositive, null); + return ResUtils.getDrawable(builder.context, builder.btnSelectorPositive); } d = ThemeUtils.resolveDrawable(builder.context, R.attr.md_btn_positive_selector); if (d != null) { @@ -1504,7 +1496,7 @@ public Builder icon(@NonNull Drawable icon) { public Builder iconRes(@DrawableRes int icon) { if (icon != -1) { - this.icon = ResourcesCompat.getDrawable(context.getResources(), icon, null); + this.icon = ResUtils.getDrawable(context, icon); } return this; } diff --git a/xui_lib/src/main/res/values/xui_styles_widget.xml b/xui_lib/src/main/res/values/xui_styles_widget.xml index c19cefbb..3e95c838 100644 --- a/xui_lib/src/main/res/values/xui_styles_widget.xml +++ b/xui_lib/src/main/res/values/xui_styles_widget.xml @@ -18,8 +18,8 @@ + * MaterialDialog * + **********************************************-->