Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TouHou.FM
Client
fm.touhou.touhoufm
Commits
170d285e
Verified
Commit
170d285e
authored
May 21, 2021
by
Daniel Sonck
Browse files
Fix always saying beta tester
parent
0e63b652
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
170d285e
...
...
@@ -30,7 +30,7 @@ deploy:
-
build
stage
:
deploy
script
:
-
cp
$KEYS_JSON app/keys.json
-
ln
$KEYS_JSON app/keys.json
-
./gradlew publishReleaseBundle --track internal
after_script
:
-
rm -rf app/keys.json
...
...
app/src/main/java/fm/touhou/touhoufm/ui/MainActivity.kt
View file @
170d285e
...
...
@@ -53,7 +53,6 @@ import androidx.navigation.fragment.NavHostFragment
import
androidx.navigation.ui.*
import
ch.derlin.changelog.Changelog
import
com.android.volley.RequestQueue
import
com.android.volley.Response
import
com.android.volley.toolbox.JsonObjectRequest
import
com.android.volley.toolbox.Volley
import
com.google.android.material.navigation.NavigationView
...
...
@@ -97,7 +96,7 @@ class MainActivity : AppCompatActivity() {
val
lastKnownVersion
=
prefs
.
getInt
(
"LatestReleaseVersion"
,
0
)
val
jsonRequest
=
JsonObjectRequest
(
"https://www.touhou.fm/app-release.json"
,
null
,
Response
.
Listener
{
response
:
JSONObject
->
{
response
:
JSONObject
->
val
supported
:
Boolean
when
{
appVersion
<
response
.
getInt
(
"supported"
)
->
{
...
...
@@ -140,6 +139,9 @@ class MainActivity : AppCompatActivity() {
.
show
()
}
}
appVersion
<
response
.
getInt
(
"beta"
)
->
{
supported
=
true
}
appVersion
<
response
.
getInt
(
"alpha"
)
->
{
supported
=
true
Toast
.
makeText
(
this
,
"Thanks for being a beta tester"
,
LENGTH_LONG
).
show
()
...
...
@@ -153,7 +155,7 @@ class MainActivity : AppCompatActivity() {
prefs
.
edit
().
putInt
(
"LatestVersion"
,
appVersion
).
apply
()
Changelog
.
createDialog
(
this
,
versionCode
=
lastVersion
).
show
()
}
},
Response
.
ErrorListener
{
},
{
Toast
.
makeText
(
this
,
"Failed to check latest version"
,
LENGTH_LONG
).
show
()
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment