Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
polysoft-nafmii
/
polysoft-android
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 637bbe00
authored
Oct 25, 2021
by
amateur
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
e6a1380e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
app/src/main/java/com/polysoft/nafmii/fragment/dialog/UpdateDialog.java
app/src/main/java/com/polysoft/nafmii/fragment/dialog/UpdateDialog.java
View file @
637bbe0
...
...
@@ -32,12 +32,12 @@ import java.io.File;
public
class
UpdateDialog
extends
DialogFragment
implements
View
.
OnClickListener
{
public
static
UpdateDialog
show
(
FragmentManager
mgr
,
UpdateVersion
info
)
{
if
(
null
==
info
)
{
info
=
new
UpdateVersion
();
info
.
setIsForce
(
"0"
);
info
.
setvNumber
(
"2.1.1"
);
info
.
setLocation
(
"https://cos.pgyer.com/319735d279de31ab4aea67d07c0706e3.apk?sign=34fa92d8e78cc084322dc868a10299ab&t=1634904770&response-content-disposition=attachment%3Bfilename%3DNAFMII%E4%B9%8B%E7%AA%97-qp_2.1.apk"
);
}
//
if (null == info) {
//
info = new UpdateVersion();
//
info.setIsForce("0");
//
info.setvNumber("2.1.1");
//
info.setLocation("https://cos.pgyer.com/319735d279de31ab4aea67d07c0706e3.apk?sign=34fa92d8e78cc084322dc868a10299ab&t=1634904770&response-content-disposition=attachment%3Bfilename%3DNAFMII%E4%B9%8B%E7%AA%97-qp_2.1.apk");
//
}
UpdateDialog
dialog
=
new
UpdateDialog
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"data"
,
JSON
.
toJSONString
(
info
));
...
...
@@ -164,6 +164,13 @@ public class UpdateDialog extends DialogFragment implements View.OnClickListener
void
download
()
{
this
.
updateProgress
(
0
);
String
url
=
this
.
versionInfo
.
getLocation
();
if
(
TextUtils
.
isEmpty
(
url
))
{
showFailTips
();
return
;
}
if
(!
url
.
startsWith
(
"http"
))
{
url
=
BuildConfig
.
IMG_API
+
url
;
}
String
version
=
this
.
versionInfo
.
getvNumber
();
String
name
=
String
.
format
(
"nafmii-%s.apk"
,
version
);
File
file
=
new
File
(
FileUtils
.
getSysDownLoadDir
(),
name
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment