* 优化默认Dialog样式的显示细节

android
Jenly 4 years ago
parent dc5ff74a9e
commit 23a99f6cd9
  1. 36
      README.md
  2. 12
      app-dialog/src/main/java/com/king/app/dialog/AppDialog.java
  3. 10
      app-dialog/src/main/java/com/king/app/dialog/AppDialogConfig.java
  4. 8
      app-dialog/src/main/java/com/king/app/dialog/fragment/AppDialogFragment.java
  5. 6
      app-dialog/src/main/res/layout/app_dialog.xml
  6. 2
      app-dialog/src/main/res/values/colors.xml
  7. 2
      app-dialog/src/main/res/values/dimens.xml
  8. BIN
      app/release/app-release.apk
  9. 2
      app/release/output.json
  10. 1
      app/src/main/java/com/king/appupdater/MainActivity.java
  11. 9
      app/src/main/res/layout/dialog.xml
  12. 1
      app/src/main/res/layout/dialog_custom.xml
  13. 4
      versions.gradle

@ -3,7 +3,7 @@
![Image](app/src/main/ic_launcher-web.png) ![Image](app/src/main/ic_launcher-web.png)
[![Download](https://img.shields.io/badge/download-App-blue.svg)](https://raw.githubusercontent.com/jenly1314/AppUpdater/master/app/release/app-release.apk) [![Download](https://img.shields.io/badge/download-App-blue.svg)](https://raw.githubusercontent.com/jenly1314/AppUpdater/master/app/release/app-release.apk)
[![JCenter](https://img.shields.io/badge/JCenter-1.0.8-46C018.svg)](https://bintray.com/beta/#/jenly/maven/app-updater) [![JCenter](https://img.shields.io/badge/JCenter-1.0.9-46C018.svg)](https://bintray.com/beta/#/jenly/maven/app-updater)
[![JitPack](https://jitpack.io/v/jenly1314/AppUpdater.svg)](https://jitpack.io/#jenly1314/AppUpdater) [![JitPack](https://jitpack.io/v/jenly1314/AppUpdater.svg)](https://jitpack.io/#jenly1314/AppUpdater)
[![CI](https://travis-ci.org/jenly1314/AppUpdater.svg?branch=master)](https://travis-ci.org/jenly1314/AppUpdater) [![CI](https://travis-ci.org/jenly1314/AppUpdater.svg?branch=master)](https://travis-ci.org/jenly1314/AppUpdater)
[![CircleCI](https://circleci.com/gh/jenly1314/AppUpdater.svg?style=svg)](https://circleci.com/gh/jenly1314/AppUpdater) [![CircleCI](https://circleci.com/gh/jenly1314/AppUpdater.svg?style=svg)](https://circleci.com/gh/jenly1314/AppUpdater)
@ -44,7 +44,7 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
<dependency> <dependency>
<groupId>com.king.app</groupId> <groupId>com.king.app</groupId>
<artifactId>app-updater</artifactId> <artifactId>app-updater</artifactId>
<version>1.0.8</version> <version>1.0.9</version>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
@ -52,7 +52,7 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
<dependency> <dependency>
<groupId>com.king.app</groupId> <groupId>com.king.app</groupId>
<artifactId>app-dialog</artifactId> <artifactId>app-dialog</artifactId>
<version>1.0.8</version> <version>1.0.9</version>
<type>pom</type> <type>pom</type>
</dependency> </dependency>
``` ```
@ -61,25 +61,25 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
//----------AndroidX 版本 //----------AndroidX 版本
//app-updater //app-updater
implementation 'com.king.app:app-updater:1.0.8-androidx' implementation 'com.king.app:app-updater:1.0.9-androidx'
//app-dialog //app-dialog
implementation 'com.king.app:app-dialog:1.0.8-androidx' implementation 'com.king.app:app-dialog:1.0.9-androidx'
//----------Android Support 版本 //----------Android Support 版本
//app-updater //app-updater
implementation 'com.king.app:app-updater:1.0.8' implementation 'com.king.app:app-updater:1.0.9'
//app-dialog //app-dialog
implementation 'com.king.app:app-dialog:1.0.8' implementation 'com.king.app:app-dialog:1.0.9'
``` ```
### Lvy: ### Lvy:
```lvy ```lvy
//app-updater //app-updater
<dependency org='com.king.app' name='app-dialog' rev='1.0.8'> <dependency org='com.king.app' name='app-dialog' rev='1.0.9'>
<artifact name='$AID' ext='pom'></artifact> <artifact name='$AID' ext='pom'></artifact>
</dependency> </dependency>
//app-dialog //app-dialog
<dependency org='com.king.app' name='app-dialog' rev='1.0.8'> <dependency org='com.king.app' name='app-dialog' rev='1.0.9'>
<artifact name='$AID' ext='pom'></artifact> <artifact name='$AID' ext='pom'></artifact>
</dependency> </dependency>
``` ```
@ -131,7 +131,7 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
.serUrl(mUrl) .serUrl(mUrl)
.setFilename("AppUpdater.apk") .setFilename("AppUpdater.apk")
.build(getContext()) .build(getContext())
.setHttpManager(OkHttpManager.getInstance())//使用OkHttpClient实现下载,需依赖okhttp库 .setHttpManager(OkHttpManager.getInstance())//不设置HttpManager时,默认使用HttpsURLConnection下载,如果使用OkHttpClient实现下载,需依赖okhttp库
.start(); .start();
AppDialog.INSTANCE.dismissDialogFragment(getSupportFragmentManager()); AppDialog.INSTANCE.dismissDialogFragment(getSupportFragmentManager());
} }
@ -142,8 +142,17 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
更多使用详情,请查看[app](app)中的源码使用示例或直接查看[API帮助文档](https://jenly1314.github.io/projects/AppUpdater/doc/) 更多使用详情,请查看[app](app)中的源码使用示例或直接查看[API帮助文档](https://jenly1314.github.io/projects/AppUpdater/doc/)
## 混淆
**app-updater** [Proguard rules](blob/master/app-updater/proguard-rules.pro)
**app-dialog** [Proguard rules](blob/master/app-dialog/proguard-rules.pro)
## 版本记录 ## 版本记录
#### v1.0.9:2020-12-11
* 优化默认Dialog样式的显示细节
#### v1.0.8:2020-1-2 #### v1.0.8:2020-1-2
* 支持MD5校验 * 支持MD5校验
* 对外提供获取Dialog方法 * 对外提供获取Dialog方法
@ -192,12 +201,15 @@ AppUpdater for Android 是一个专注于App更新,一键傻瓜式集成App版
CSDN: <a title="CSDN博客" href="http://blog.csdn.net/jenly121" target="_blank">jenly121</a> CSDN: <a title="CSDN博客" href="http://blog.csdn.net/jenly121" target="_blank">jenly121</a>
CNBlog: <a title="博客园" href="https://www.cnblogs.com/jenly" target="_blank">jenly</a> CNBlogs: <a title="博客园" href="https://www.cnblogs.com/jenly" target="_blank">jenly</a>
GitHub: <a title="GitHub开源项目" href="https://github.com/jenly1314" target="_blank">jenly1314</a>
Github: <a title="Github开源项目" href="https://github.com/jenly1314" target="_blank">jenly1314</a> Gitee: <a title="Gitee开源项目" href="https://gitee.com/jenly1314" target="_blank">jenly1314</a>
加入QQ群: <a title="点击加入QQ群" href="http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1411582c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad" target="_blank">20867961</a> 加入QQ群: <a title="点击加入QQ群" href="http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1411582c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad" target="_blank">20867961</a>
<div> <div>
<img src="https://jenly1314.github.io/image/jenly666.png"> <img src="https://jenly1314.github.io/image/jenly666.png">
<img src="https://jenly1314.github.io/image/qqgourp.png"> <img src="https://jenly1314.github.io/image/qqgourp.png">
</div> </div>

@ -52,14 +52,10 @@ public enum AppDialog {
btnDialogCancel.setOnClickListener(config.getOnClickCancel() != null ? config.getOnClickCancel() : mOnClickDismissDialog); btnDialogCancel.setOnClickListener(config.getOnClickCancel() != null ? config.getOnClickCancel() : mOnClickDismissDialog);
btnDialogCancel.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE); btnDialogCancel.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE);
try{ //不强制要求要有中间的线
//不强制要求要有中间的线 View line = view.findViewById(config.getLineId());
View line = view.findViewById(R.id.line); if(line != null){
if(line != null){ line.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE);
line.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE);
}
}catch (Exception e){
} }
Button btnDialogOK = view.findViewById(config.getOkId()); Button btnDialogOK = view.findViewById(config.getOkId());

@ -35,7 +35,7 @@ public class AppDialogConfig {
/** /**
* 按钮中间分割线ID * 按钮中间分割线ID
*/ */
private @IdRes int line = R.id.line; private @IdRes int lineId = R.id.line;
/** /**
* 标题文本 * 标题文本
*/ */
@ -112,12 +112,12 @@ public class AppDialogConfig {
return this; return this;
} }
public @IdRes int getLine() { public @IdRes int getLineId() {
return line; return lineId;
} }
public AppDialogConfig setLine(@IdRes int line) { public AppDialogConfig setLineId(@IdRes int lineId) {
this.line = line; this.lineId = lineId;
return this; return this;
} }

@ -46,12 +46,10 @@ public class AppDialogFragment extends BaseDialogFragment {
btnDialogCancel.setOnClickListener(config.getOnClickCancel() != null ? config.getOnClickCancel() : getOnClickDismiss()); btnDialogCancel.setOnClickListener(config.getOnClickCancel() != null ? config.getOnClickCancel() : getOnClickDismiss());
btnDialogCancel.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE); btnDialogCancel.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE);
try{ //不强制要求要有中间的线
//不强制要求要有中间的线 View line = rootView.findViewById(config.getLineId());
View line = rootView.findViewById(R.id.line); if(line != null){
line.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE); line.setVisibility(config.isHideCancel() ? View.GONE : View.VISIBLE);
}catch (Exception e){
} }
Button btnDialogOK = rootView.findViewById(config.getOkId()); Button btnDialogOK = rootView.findViewById(config.getOkId());

@ -11,8 +11,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:minHeight="40dp" android:padding="10dp"
android:padding="6dp"
android:lines="1" android:lines="1"
android:textSize="@dimen/app_dialog_title_text_size" android:textSize="@dimen/app_dialog_title_text_size"
android:textColor="@color/app_dialog_title_color" android:textColor="@color/app_dialog_title_color"
@ -24,9 +23,8 @@
android:padding="10dp" android:padding="10dp"
android:textSize="@dimen/app_dialog_content_text_size" android:textSize="@dimen/app_dialog_content_text_size"
android:textColor="@color/app_dialog_content_color" android:textColor="@color/app_dialog_content_color"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:lineSpacingMultiplier="1" /> android:lineSpacingMultiplier="1.2" />
<include layout="@layout/app_dialog_line_h"/> <include layout="@layout/app_dialog_line_h"/>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"

@ -8,6 +8,6 @@
<color name="app_dialog_button_normal_color">#333333</color> <color name="app_dialog_button_normal_color">#333333</color>
<color name="app_dialog_button_pressed_color">@color/colorAccent</color> <color name="app_dialog_button_pressed_color">@color/colorAccent</color>
<color name="app_dialog_line_color">#d2d2d2</color> <color name="app_dialog_line_color">#f2f2f2</color>
</resources> </resources>

@ -6,5 +6,5 @@
<dimen name="app_dialog_title_text_size">16sp</dimen> <dimen name="app_dialog_title_text_size">16sp</dimen>
<dimen name="app_dialog_content_text_size">16sp</dimen> <dimen name="app_dialog_content_text_size">16sp</dimen>
<dimen name="app_dialog_button_text_size">18sp</dimen> <dimen name="app_dialog_button_text_size">16sp</dimen>
</resources> </resources>

Binary file not shown.

@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":13,"versionName":"1.0.8","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":15,"versionName":"1.0.9","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

@ -3,6 +3,7 @@ package com.king.appupdater;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater; import android.view.LayoutInflater;

@ -11,8 +11,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:minHeight="40dp" android:padding="10dp"
android:padding="6dp"
android:lines="1" android:lines="1"
android:textSize="16sp" android:textSize="16sp"
android:background="@drawable/dialog_title_bg" android:background="@drawable/dialog_title_bg"
@ -22,8 +21,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp" android:padding="10dp"
android:layout_marginBottom="6dp" android:textSize="@dimen/app_dialog_content_text_size"
android:lineSpacingMultiplier="1" /> android:textColor="@color/app_dialog_content_color"
android:layout_marginBottom="16dp"
android:lineSpacingMultiplier="1.2" />
<include layout="@layout/app_dialog_line_h"/> <include layout="@layout/app_dialog_line_h"/>
<LinearLayout <LinearLayout
android:orientation="horizontal" android:orientation="horizontal"

@ -11,7 +11,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:minHeight="40dp"
android:padding="6dp" android:padding="6dp"
android:lines="1" android:lines="1"
android:textSize="16sp" android:textSize="16sp"

@ -1,7 +1,7 @@
//App //App
def app_version = [:] def app_version = [:]
app_version.versionCode = 13 //androidx 14 app_version.versionCode = 15 //androidx 16
app_version.versionName = "1.0.8" app_version.versionName = "1.0.9"
ext.app_version = app_version ext.app_version = app_version
//build version //build version

Loading…
Cancel
Save