Commits

Julian Brost  committed b652951

Show version on about screen and move URLs to resources, see #35.

  • Participants
  • Parent commits cab04f4

Comments (0)

Files changed (3)

File res/values/values.xml

     <dimen name="padding_large">16dp</dimen>
 
     <string name="template_error_report_message">Hello,\nSomething went wrong!\n\n(Please describe here shortly what you did before the error happened)\n\n%s</string>
+    <string name="url_volksempfaenger_website">http://volksempfaenger.0x4a42.net/</string>
+    <string name="url_volksempfaenger_flattr">http://flattr.com/thing/735145/Volksempfanger</string>
 
 </resources>

File res/xml/preference_about.xml

         android:title="@string/settings_about_version" />
     <Preference
         android:key="about_website"
+        android:summary="@string/url_volksempfaenger_website"
         android:title="@string/settings_about_website" >
         <intent
             android:action="android.intent.action.VIEW"
-            android:data="http://volksempfaenger.0x4a42.net/" />
+            android:data="@string/url_volksempfaenger_website" />
     </Preference>
     <Preference
         android:key="about_license"
         android:title="@string/settings_about_flattr" >
         <intent
             android:action="android.intent.action.VIEW"
-            android:data="http://flattr.com/thing/735145/Volksempfanger" />
+            android:data="@string/url_volksempfaenger_flattr" />
     </Preference>
 
 </PreferenceScreen>

File src/net/x4a42/volksempfaenger/ui/SettingsActivity.java

 
 import java.util.List;
 
+import net.x4a42.volksempfaenger.PreferenceKeys;
 import net.x4a42.volksempfaenger.R;
+import net.x4a42.volksempfaenger.VolksempfaengerApplication;
 
 import android.os.Bundle;
+import android.preference.Preference;
 import android.preference.PreferenceActivity;
 import android.preference.PreferenceFragment;
+import android.preference.PreferenceScreen;
 
 public class SettingsActivity extends PreferenceActivity {
 
 		public void onCreate(Bundle savedInstanceState) {
 			super.onCreate(savedInstanceState);
 			addPreferencesFromResource(R.xml.preference_about);
+
+			PreferenceScreen prefScreen = getPreferenceScreen();
+			VolksempfaengerApplication application = (VolksempfaengerApplication) getActivity()
+					.getApplication();
+
+			Preference version = prefScreen
+					.findPreference(PreferenceKeys.ABOUT_VERSION);
+
+			version.setSummary(application.getVersionName());
 		}
 
 	}