diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-07-12 16:06:10 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-07-12 16:06:10 +0200 |
commit | f3c19b6da20dadc3b93b6e1d2fd8481f9afb561b (patch) | |
tree | f3d95837895d5bd0b3b6167f8bbd1ea74bd1f5d1 | |
parent | 0e8909807d5a4c7e74c4c2ab877b68e172f17a6f (diff) | |
download | AntennaPod-f3c19b6da20dadc3b93b6e1d2fd8481f9afb561b.zip |
Added preference item to flattr this app
-rw-r--r-- | res/values/strings.xml | 4 | ||||
-rw-r--r-- | res/xml/preferences.xml | 6 | ||||
-rw-r--r-- | src/de/podfetcher/activity/PreferenceActivity.java | 15 |
3 files changed, 23 insertions, 2 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 5d83dc80d..739c651fc 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -61,7 +61,7 @@ <string name="position_default_label">00:00:00</string> <string name="queue_label">Queue</string> <string name="visit_website_label">Visit Website</string> - <string name="support_label">Support</string> + <string name="support_label">Flattr this</string> <string name="download_error_parser_exception">Parser Exception</string> <string name="download_error_unsupported_type">Unsupported Feed type</string> <string name="error_label">Error</string> @@ -114,5 +114,7 @@ <string name="action_forbidden_title">Action forbidden</string> <string name="action_forbidden_msg">Antennapod has no permission for this action. The reason for this could be that the access token of Antennapod to your account has been revoked. You can either re-reauthenticate or visit the website of the thing instead.</string> <string name="flattr_click_success">Successfully flattred this thing!</string> + <string name="pref_flattr_this_app_title">Flattr this app</string> + <string name="pref_flattr_this_app_sum">Support the development of Antennacast by flattring it. Thanks!</string> </resources>
\ No newline at end of file diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index 00a8b5f64..2521d3c83 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -35,8 +35,12 @@ <PreferenceScreen android:summary="@string/pref_flattr_auth_sum" android:title="@string/pref_flattr_auth_title" > - <intent android:action=".activities.FlattrAuthActivity"/> + <intent android:action=".activities.FlattrAuthActivity" /> </PreferenceScreen> + <Preference + android:summary="@string/pref_flattr_this_app_sum" + android:title="@string/pref_flattr_this_app_title" android:key="prefFlattrThisApp"> + </Preference> </PreferenceCategory> <PreferenceCategory android:title="@string/other_pref" > <Preference android:title="@string/version_pref" /> diff --git a/src/de/podfetcher/activity/PreferenceActivity.java b/src/de/podfetcher/activity/PreferenceActivity.java index fc6ee19fa..1fa85940e 100644 --- a/src/de/podfetcher/activity/PreferenceActivity.java +++ b/src/de/podfetcher/activity/PreferenceActivity.java @@ -1,6 +1,9 @@ package de.podfetcher.activity; import android.os.Bundle; +import android.preference.Preference; +import android.preference.Preference.OnPreferenceClickListener; +import android.util.Log; import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.actionbarsherlock.view.Menu; @@ -9,11 +12,23 @@ import com.actionbarsherlock.view.MenuItem; import de.podfetcher.R; public class PreferenceActivity extends SherlockPreferenceActivity { + private static final String TAG = "PreferenceActivity"; + + private static final String PREF_FLATTR_THIS_APP = "prefFlattrThisApp"; + + @SuppressWarnings("deprecation") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getSupportActionBar().setDisplayHomeAsUpEnabled(true); addPreferencesFromResource(R.xml.preferences); + findPreference(PREF_FLATTR_THIS_APP).setOnPreferenceClickListener(new OnPreferenceClickListener() { + + @Override + public boolean onPreferenceClick(Preference preference) { + Log.d(TAG, "Flattring this app"); + return true; + }}); } @Override |