Skip to content

Commit

Permalink
创建Dialog接口参数里增加Postcard对象。
Browse files Browse the repository at this point in the history
  • Loading branch information
FengChenSunshine committed Jun 25, 2019
1 parent 2f6ba8e commit 1f74801
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ext {
, versionName_dev : "dev0.0.1"
, versionCode_beta : 1
, versionName_beta : "beta0.0.1"
, versionCode_release: 2
, versionName_release: "v1.0.1"
, versionCode_release: 3
, versionName_release: "v1.0.2"
]
library = [
junit : "junit:junit:4.12",
Expand Down
1 change: 1 addition & 0 deletions version_update/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

<application>
<!--API24 Android7.0以上需要FileProvider-->
<provider
android:name="com.duanlu.upload.VersionUpdateFileProvider"
android:authorities="${applicationId}.version_update"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Dialog;
import android.content.Context;
import android.support.annotation.NonNull;

/********************************
* @name DialogProvider
Expand All @@ -16,10 +17,10 @@ public interface DialogProvider {
/**
* 新版本提醒Dialog,必须回调NewVersionActionCallback相关方法.
*/
Dialog createNewVersionDialog(Context context, NewVersionActionCallback callback);
Dialog createNewVersionDialog(@NonNull Context context, @NonNull Postcard postcard, @NonNull NewVersionActionCallback callback);

/**
* 下载进度Dialog,必须实现OnDownloadStatusListener方法.
*/
Dialog createDownloadDialog(Context context);
Dialog createDownloadDialog(@NonNull Context context, @NonNull Postcard postcard);
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void cancel() {

private void ensureNewVersionDialog() {
if (null == mNewVersionDialog && null != mDialogProvider) {
mNewVersionDialog = mDialogProvider.createNewVersionDialog(mContext, this);
mNewVersionDialog = mDialogProvider.createNewVersionDialog(mContext, mPostcard, this);
}
if (null == mNewVersionDialog) {
throw new RuntimeException("NewVersionDialog is Null!");
Expand All @@ -128,7 +128,7 @@ private void ensureNewVersionDialog() {

private void ensureDownloadDialog() {
if (null == mDownloadDialog && null != mDialogProvider) {
mDownloadDialog = mDialogProvider.createDownloadDialog(mContext);
mDownloadDialog = mDialogProvider.createDownloadDialog(mContext, mPostcard);
}

if (!(mDownloadDialog instanceof OnDownloadStatusListener)) {
Expand Down

0 comments on commit 1f74801

Please sign in to comment.