Skip to content

Commit

Permalink
Release lightning version 0.10.0 a.k.a Miami
Browse files Browse the repository at this point in the history
Signed-off-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
vincenzopalazzo committed Jun 4, 2021
1 parent 239e33d commit 3a6655d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/lvaccaro/lamp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ class MainActivity : UriResultActivity() {
}

// Check lightning_ndk release version
val release = getPreferences(Context.MODE_PRIVATE).getString("RELEASE", Archive.RELEASE)
if (release != Archive.RELEASE) {
val release = getPreferences(Context.MODE_PRIVATE).getString("RELEASE", Archive.RELEASE.version)
if (release != Archive.RELEASE.version) {
AlertDialog.Builder(this)
.setTitle(R.string.id_update)
.setMessage("New lightning_ndk version is available: ${Archive.RELEASE}. Make a backup from Settings. Tap Update to start download.")
Expand Down Expand Up @@ -358,8 +358,8 @@ class MainActivity : UriResultActivity() {
private fun powerOff() {
contentMainOn.visibility = View.GONE
contentMainOff.visibility = View.VISIBLE
val release = getPreferences(Context.MODE_PRIVATE).getString("RELEASE", "")
versionText.text = "Version: ${BuildConfig.VERSION_NAME} - ${release}"
//val release = getPreferences(Context.MODE_PRIVATE).getString("RELEASE", "")
versionText.text = "Version: ${BuildConfig.VERSION_NAME} - ${Archive.RELEASE}"
statusText.text = "Offline. Rub the lamp to turn on."
powerImageView.off()
invalidateOptionsMenu()
Expand Down Expand Up @@ -408,7 +408,7 @@ class MainActivity : UriResultActivity() {
return

runOnUiThread {
getPreferences(Context.MODE_PRIVATE).edit().putString("RELEASE", Archive.RELEASE).apply()
getPreferences(Context.MODE_PRIVATE).edit().putString("RELEASE", Archive.RELEASE.version).apply()
statusText.text =
"Download Completed. Uncompressing..."
}
Expand Down
10 changes: 8 additions & 2 deletions app/src/main/java/com/lvaccaro/lamp/utils/Archive.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ import java.io.*

class Archive {

class Release(val name: String, val version: String) {
override fun toString(): String {
return "%s %s".format(name, version).trim()
}
}

companion object {
const val RELEASE = "v0.9.3"
val RELEASE = Release("Miami","v0.10.0")

fun arch(): String {
var abi: String?
Expand All @@ -36,7 +42,7 @@ class Archive {

fun url(): String {
val TAR_FILENAME = tarFilename()
return "https://github.com/lightningamp/lightning_ndk/releases/download/${RELEASE}/${TAR_FILENAME}"
return "https://github.com/lightningamp/lightning_ndk/releases/download/${RELEASE.version}/${TAR_FILENAME}"
}

fun delete(downloadDir: File): Boolean {
Expand Down

0 comments on commit 3a6655d

Please sign in to comment.