Add app version in about activity

This commit is contained in:
Shinokuni 2019-09-19 20:45:25 +02:00
parent 1b959995b4
commit 7d329bf0fc
2 changed files with 18 additions and 2 deletions

View File

@ -2,9 +2,11 @@ package com.readrops.app.activities;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.readrops.app.BuildConfig;
import com.readrops.app.R;
public class AboutActivity extends AppCompatActivity {
@ -13,6 +15,9 @@ public class AboutActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
TextView appVersion = findViewById(R.id.app_version);
appVersion.setText(BuildConfig.VERSION_NAME);
}
@Override

View File

@ -30,15 +30,26 @@
app:layout_constraintTop_toBottomOf="@+id/app_logo" />
<TextView
android:id="@+id/app_licence"
android:id="@+id/app_version"
style="@style/TextAppearance.AppCompat.Subhead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/app_name"
tools:text="1.0.1" />
<TextView
android:id="@+id/app_licence"
style="@style/TextAppearance.AppCompat.Subhead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/app_licence"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/app_name" />
app:layout_constraintTop_toBottomOf="@+id/app_version" />
<TextView
android:id="@+id/app_source_code"