display the app version name in About, not the library one

This commit is contained in:
tibbi 2016-12-26 23:18:26 +01:00
parent 6440f9f980
commit de2a73b7f1
3 changed files with 6 additions and 7 deletions

View file

@ -6,11 +6,11 @@ import android.os.Bundle
import android.text.Html
import android.text.method.LinkMovementMethod
import android.view.View
import com.simplemobiletools.commons.BuildConfig
import com.simplemobiletools.commons.R
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.APP_LICENSES
import com.simplemobiletools.commons.helpers.APP_NAME
import com.simplemobiletools.commons.helpers.APP_VERSION_NAME
import kotlinx.android.synthetic.main.activity_about.*
import java.util.*
@ -126,7 +126,7 @@ class AboutActivity : BaseSimpleActivity() {
}
private fun setupCopyright() {
val versionName = BuildConfig.VERSION_NAME
val versionName = intent.getStringExtra(APP_VERSION_NAME) ?: ""
val year = Calendar.getInstance().get(Calendar.YEAR)
about_copyright.text = String.format(getString(R.string.copyright), versionName, year)
}

View file

@ -11,10 +11,7 @@ import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.MenuItem
import com.simplemobiletools.commons.extensions.isShowingWritePermissions
import com.simplemobiletools.commons.helpers.APP_LICENSES
import com.simplemobiletools.commons.helpers.APP_NAME
import com.simplemobiletools.commons.helpers.BaseConfig
import com.simplemobiletools.commons.helpers.OPEN_DOCUMENT_TREE
import com.simplemobiletools.commons.helpers.*
import java.io.File
open class BaseSimpleActivity : AppCompatActivity() {
@ -75,10 +72,11 @@ open class BaseSimpleActivity : AppCompatActivity() {
contentResolver.takePersistableUriPermission(treeUri, takeFlags)
}
fun startAboutActivity(appNameId: Int, licenseMask: Int) {
fun startAboutActivity(appNameId: Int, licenseMask: Int, versionName: String) {
Intent(applicationContext, AboutActivity::class.java).apply {
putExtra(APP_NAME, getString(appNameId))
putExtra(APP_LICENSES, licenseMask)
putExtra(APP_VERSION_NAME, versionName)
startActivity(this)
}
}

View file

@ -2,6 +2,7 @@ package com.simplemobiletools.commons.helpers
val APP_NAME = "app_name"
val APP_LICENSES = "app_licenses"
val APP_VERSION_NAME = "app_version_name"
// shared preferences
val PREFS_KEY = "Prefs"