From 45138b33698210f030e4225ee1a2d79fe2557e36 Mon Sep 17 00:00:00 2001 From: yate Date: Tue, 4 Nov 2014 21:51:16 -0500 Subject: [PATCH] increment version --- app/AndroidManifest.xml | 4 ++-- app/res/values/version.xml | 7 ------- .../com/chanapps/four/fragment/AboutFragment.java | 12 +++++++++--- 3 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 app/res/values/version.xml diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml index d93b85a6..795ac68c 100644 --- a/app/AndroidManifest.xml +++ b/app/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="80" + android:versionName="2.0.4"> - - 79 - 2.0.3 - 2014.10.16 - - diff --git a/app/src/com/chanapps/four/fragment/AboutFragment.java b/app/src/com/chanapps/four/fragment/AboutFragment.java index 86315ee1..7960233d 100644 --- a/app/src/com/chanapps/four/fragment/AboutFragment.java +++ b/app/src/com/chanapps/four/fragment/AboutFragment.java @@ -1,10 +1,14 @@ package com.chanapps.four.fragment; +import android.content.Context; import android.content.Intent; +import android.content.pm.PackageInfo; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceFragment; import android.util.Log; + +import com.android.gallery3d.app.PackagesMonitor; import com.chanapps.four.activity.R; import com.chanapps.four.component.ActivityDispatcher; import com.chanapps.four.component.URLFormatComponent; @@ -49,9 +53,11 @@ protected void versionPreference(final String pref) { if (DEBUG) Log.i(TAG, "versionPreference"); Preference p = findPreference(pref); try { - String version = getString(R.string.versionName); - String yyyymmdd = getString(R.string.versionDate); - Date d = DateUtils.parseDate(yyyymmdd, VERSION_DATE_FORMAT); + PackageInfo info = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0); + + String version = info.versionName; + Date d = new Date(info.lastUpdateTime); + String dateStr = DateFormat.getDateInstance(DateFormat.MEDIUM).format(d); String title = String.format(getString(R.string.pref_about_application_version), version); String summary = String.format(getString(R.string.pref_about_application_version_sum), dateStr);