se muestra version en pantalla About

This commit is contained in:
erik-everardo 2024-04-06 20:08:34 -06:00
parent 061814e7e8
commit ff1733de01
3 changed files with 13 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.browser.customtabs.CustomTabsIntent import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.net.toUri import androidx.core.net.toUri
import com.isolaatti.BuildConfig import com.isolaatti.BuildConfig
import com.isolaatti.R
import com.isolaatti.databinding.ActivityAboutBinding import com.isolaatti.databinding.ActivityAboutBinding
class AboutActivity : AppCompatActivity() { class AboutActivity : AppCompatActivity() {
@ -51,5 +52,7 @@ class AboutActivity : AppCompatActivity() {
.build() .build()
.launchUrl(this, BuildConfig.terms.toUri()) .launchUrl(this, BuildConfig.terms.toUri())
} }
binding.appVersion.text = getString(R.string.app_version, BuildConfig.VERSION_NAME)
} }
} }

View File

@ -2,7 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBarLayout" android:id="@+id/appBarLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -48,6 +49,13 @@
android:text="@string/app_description" android:text="@string/app_description"
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
android:textAlignment="center"/> android:textAlignment="center"/>
<TextView
android:id="@+id/app_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="v 1.0"
android:layout_marginHorizontal="24dp"
android:textAlignment="center"/>
<com.google.android.material.card.MaterialCardView <com.google.android.material.card.MaterialCardView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -203,4 +203,5 @@
<string name="see_all">See all</string> <string name="see_all">See all</string>
<string name="go_to_hashtags">Go to hashtags</string> <string name="go_to_hashtags">Go to hashtags</string>
<string name="browse_profiles">Browse profiles</string> <string name="browse_profiles">Browse profiles</string>
<string name="app_version">v%s</string>
</resources> </resources>