mirror of
https://github.com/playmusicexporter/playmusicexporter
synced 2024-04-28 19:16: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.os.Build;
|
||||
|
||||
import de.arcus.framework.BuildConfig;
|
||||
import de.arcus.framework.activities.CrashActivity;
|
||||
import de.arcus.framework.logger.Logger;
|
||||
|
||||
|
@ -83,9 +84,11 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
|
|||
|
||||
|
||||
// Information
|
||||
logBuilder.append("---------- Information -----------\n");
|
||||
logBuilder.append("---------- App Information -----------\n");
|
||||
logBuilder.append("PackageName: ").append(mActivity.getPackageName()).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");
|
||||
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ android {
|
|||
jackOptions {
|
||||
enabled true
|
||||
}
|
||||
buildConfigField "java.util.Date", "BUILD_TIME", "new java.util.Date(" + System.currentTimeMillis() + "L)"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
|
|
@ -23,6 +23,7 @@ import re.jcg.playmusicexporter.services.ExportAllJob;
|
|||
import re.jcg.playmusicexporter.services.ExportAllService;
|
||||
import re.jcg.playmusicexporter.settings.PlayMusicExporterPreferences;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -305,6 +306,10 @@ public class SettingsActivity extends AppCompatPreferenceActivity {
|
|||
super.onCreate(savedInstanceState);
|
||||
addPreferencesFromResource(R.xml.pref_about);
|
||||
setHasOptionsMenu(true);
|
||||
findPreference("about_version_number").setSummary(BuildConfig.VERSION_NAME);
|
||||
findPreference("about_build_date")
|
||||
.setSummary(SimpleDateFormat.getDateInstance().format(BuildConfig.BUILD_TIME));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -50,11 +50,11 @@
|
|||
<!-- TODO change Version number and build date with releases -->
|
||||
<!-- Version number-->
|
||||
<Preference
|
||||
android:summary="0.9.4"
|
||||
android:key="about_version_number"
|
||||
android:title="@string/settings_version_number" />
|
||||
<!-- Build date-->
|
||||
<Preference
|
||||
android:summary="01.02.2017"
|
||||
android:key="about_build_date"
|
||||
android:title="@string/settings_build_date" />
|
||||
</PreferenceCategory>
|
||||
|
||||
|
|
Loading…
Reference in a new issue