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 b5815a8c
authored
Oct 25, 2021
by
amateur
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1
1 parent
ec6a8cce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
app/src/main/java/com/polysoft/nafmii/utils/SpUtils.java
app/src/main/java/com/polysoft/nafmii/utils/WebVersionUtils.java
app/src/main/java/com/whaty/nafmii/activity/MainActivity.java
app/src/main/java/com/polysoft/nafmii/utils/SpUtils.java
View file @
b5815a8
...
...
@@ -7,7 +7,10 @@ public class SpUtils {
private
static
final
String
SP_NAME
=
"NAFMII"
;
public
static
final
String
WEB_VERSION_KEY
=
"WEB_VERSION"
;
// 首次运行
public
static
final
String
KEY_FIRST_RUN
=
"FIRST_RUN"
;
// H5版本
public
static
final
String
KEY_H5_VERSION
=
"H5_VERSION"
;
public
static
void
putBoolean
(
String
key
,
boolean
val
)
{
SharedPreferences
.
Editor
edit
=
getSpMgr
().
edit
();
...
...
app/src/main/java/com/polysoft/nafmii/utils/WebVersionUtils.java
View file @
b5815a8
...
...
@@ -7,11 +7,11 @@ import java.io.File;
public
class
WebVersionUtils
{
public
static
String
getVersion
()
{
return
SpUtils
.
getString
(
SpUtils
.
WEB_VERSION_KEY
,
BuildConfig
.
WEB_VERSION
);
return
SpUtils
.
getString
(
SpUtils
.
KEY_H5_VERSION
,
BuildConfig
.
WEB_VERSION
);
}
public
static
void
setVersion
(
String
name
)
{
SpUtils
.
putString
(
SpUtils
.
WEB_VERSION_KEY
,
name
);
SpUtils
.
putString
(
SpUtils
.
KEY_H5_VERSION
,
name
);
}
public
static
File
getIndex
()
{
...
...
app/src/main/java/com/whaty/nafmii/activity/MainActivity.java
View file @
b5815a8
...
...
@@ -108,7 +108,7 @@ public class MainActivity extends BaseActivity {
}
private
boolean
isFirstRun
()
{
return
SpUtils
.
getBoolean
(
Constants
.
FIRST_RUN_KEY
,
false
);
return
SpUtils
.
getBoolean
(
SpUtils
.
KEY_FIRST_RUN
,
false
);
}
}
\ No newline at end of file
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