mirror of
https://github.com/playmusicexporter/playmusicexporter
synced 2024-05-14 06:46:42 +00:00
Automated "About" preference screen values (version and build date)
This commit is contained in:
parent
6c7832f1e6
commit
d1f0823f3c
|
@ -26,6 +26,7 @@ import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
|
import de.arcus.framework.BuildConfig;
|
||||||
import de.arcus.framework.activities.CrashActivity;
|
import de.arcus.framework.activities.CrashActivity;
|
||||||
import de.arcus.framework.logger.Logger;
|
import de.arcus.framework.logger.Logger;
|
||||||
|
|
||||||
|
@ -83,9 +84,11 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
|
||||||
|
|
||||||
|
|
||||||
// Information
|
// Information
|
||||||
logBuilder.append("---------- Information -----------\n");
|
logBuilder.append("---------- App Information -----------\n");
|
||||||
logBuilder.append("PackageName: ").append(mActivity.getPackageName()).append("\n");
|
logBuilder.append("PackageName: ").append(mActivity.getPackageName()).append("\n");
|
||||||
logBuilder.append("Crashed activity: ").append(mActivity.getLocalClassName()).append("\n");
|
logBuilder.append("Crashed activity: ").append(mActivity.getLocalClassName()).append("\n");
|
||||||
|
logBuilder.append("Version number: ").append(BuildConfig.VERSION_NAME).append("\n");
|
||||||
|
logBuilder.append("Version code: ").append(BuildConfig.VERSION_CODE).append("\n");
|
||||||
logBuilder.append("\n");
|
logBuilder.append("\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ android {
|
||||||
jackOptions {
|
jackOptions {
|
||||||
enabled true
|
enabled true
|
||||||
}
|
}
|
||||||
|
buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + System.currentTimeMillis() + "L)"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
|
|
@ -23,6 +23,7 @@ import re.jcg.playmusicexporter.services.ExportAllJob;
|
||||||
import re.jcg.playmusicexporter.services.ExportAllService;
|
import re.jcg.playmusicexporter.services.ExportAllService;
|
||||||
import re.jcg.playmusicexporter.settings.PlayMusicExporterPreferences;
|
import re.jcg.playmusicexporter.settings.PlayMusicExporterPreferences;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -305,6 +306,10 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
addPreferencesFromResource(R.xml.pref_about);
|
addPreferencesFromResource(R.xml.pref_about);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
|
findPreference("about_version_number").setSummary(BuildConfig.VERSION_NAME);
|
||||||
|
findPreference("about_build_date")
|
||||||
|
.setSummary(SimpleDateFormat.getDateInstance().format(BuildConfig.BUILD_TIME));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -50,11 +50,11 @@
|
||||||
<!-- TODO change Version number and build date with releases -->
|
<!-- TODO change Version number and build date with releases -->
|
||||||
<!-- Version number-->
|
<!-- Version number-->
|
||||||
<Preference
|
<Preference
|
||||||
android:summary="0.9.4"
|
android:key="about_version_number"
|
||||||
android:title="@string/settings_version_number" />
|
android:title="@string/settings_version_number" />
|
||||||
<!-- Build date-->
|
<!-- Build date-->
|
||||||
<Preference
|
<Preference
|
||||||
android:summary="01.02.2017"
|
android:key="about_build_date"
|
||||||
android:title="@string/settings_build_date" />
|
android:title="@string/settings_build_date" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue