Skip to content

Commit

Permalink
about: display app version (fixes #2550) (#2591)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Oct 9, 2023
1 parent f957a29 commit cf6d2ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1088
versionName "0.10.88"
versionCode 1089
versionName "0.10.89"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.ole.planet.myplanet.ui.dashboard

import android.R
import android.os.Build
import android.os.Bundle
import android.text.Html
Expand All @@ -17,7 +18,11 @@ class AboutFragment : Fragment() {
@RequiresApi(Build.VERSION_CODES.N)
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
fragmentAboutBinding = FragmentAboutBinding.inflate(inflater, container, false)
fragmentAboutBinding.tvDisclaimer.text = Html.fromHtml(getString(Constants.ABOUT), HtmlCompat.FROM_HTML_MODE_LEGACY)
val versionString = "${resources.getText(org.ole.planet.myplanet.R.string.version)}: ${resources.getText(org.ole.planet.myplanet.R.string.app_version)}"
val aboutText = getString(Constants.ABOUT)

val newAboutText: String = aboutText.replace("<h3>MyPlanet</h3>", "<h3>MyPlanet</h3>\n<h4>$versionString</h4>")
fragmentAboutBinding.tvDisclaimer.text = Html.fromHtml(newAboutText, HtmlCompat.FROM_HTML_MODE_LEGACY)
return fragmentAboutBinding.root
}
}
}

0 comments on commit cf6d2ba

Please sign in to comment.