Added information about android version and device to AboutActivity

This commit is contained in:
vanitasvitae 2016-09-05 18:45:22 +02:00
parent 05d9edbbdb
commit e7f74eb08d
4 changed files with 27 additions and 1 deletions

View File

@ -21,6 +21,7 @@ package com.github.dfa.diaspora_android.activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.TabLayout;
@ -194,6 +195,8 @@ public class AboutActivity extends AppCompatActivity {
View rootView = inflater.inflate(R.layout.fragment_debug, container, false);
TextView packageName = (TextView) rootView.findViewById(R.id.fragment_debug__package_name);
TextView appVersion = (TextView) rootView.findViewById(R.id.fragment_debug__app_version);
TextView osVersion = (TextView) rootView.findViewById(R.id.fragment_debug__android_version);
TextView deviceName = (TextView) rootView.findViewById(R.id.fragment_debug__device_name);
TextView podDomain = (TextView) rootView.findViewById(R.id.fragment_debug__pod_domain);
if (isAdded()) {
@ -203,6 +206,9 @@ public class AboutActivity extends AppCompatActivity {
packageName.setText(pInfo.packageName);
appVersion.setText(getString(R.string.fragment_debug__app_version, pInfo.versionName + " (" + pInfo.versionCode + ")"));
osVersion.setText(getString(R.string.fragment_debug__android_version, Build.VERSION.RELEASE));
deviceName.setText(getString(R.string.fragment_debug__device_name, Build.MANUFACTURER+" "+Build.MODEL));
podDomain.setText(getString(R.string.fragment_debug__pod_domain, settings.getPodDomain()));
} catch (PackageManager.NameNotFoundException e) {

View File

@ -34,6 +34,23 @@
android:layout_height="wrap_content"
android:id="@+id/fragment_debug__app_version"/>
<TextView
android:id="@+id/fragment_debug__section_device"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/fragment_debug__section_device"
android:paddingTop="@dimen/activity_vertical_margin"
style="@android:style/TextAppearance.DeviceDefault.Large"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/fragment_debug__android_version"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/fragment_debug__device_name"/>
<TextView
android:id="@+id/fragment_debug__section_pod"

View File

@ -2,4 +2,4 @@ NEWENTRY Gregor Santner (gsantner)
SUBTABBY https://gsantner.github.io
NEWENTRY Paul Schaub (vanitasvitae)
SUBTABBY https://github.com/vanitasvitaes
SUBTABBY https://github.com/vanitasvitae

View File

@ -11,9 +11,12 @@
<string name="about_activity__title_about_license">License</string>
<string name="about_activity__title_debug_info">Debugging</string>
<string name="fragment_debug__section_app">Application</string>
<string name="fragment_debug__section_device">Device</string>
<string name="fragment_debug__section_pod">Diaspora Pod</string>
<string name="fragment_debug__app_version">App Version: %1$s</string>
<string name="fragment_debug__package_name">Package Name: %1$s</string>
<string name="fragment_debug__android_version">Android Version: %1$s</string>
<string name="fragment_debug__device_name">Device Name: %1$s</string>
<string name="fragment_debug__pod_domain">Pod Domain: %1$s</string>
<string name="fragment_license__3rd_party_libs_title">Used 3rd Party Libraries</string>