Merge pull request #1046 from TomHennen/fix935
Remove Flattr this App button
This commit is contained in:
commit
dd6d07ada1
|
@ -52,7 +52,6 @@ import de.danoeh.antennapod.dialog.VariableSpeedDialog;
|
|||
*/
|
||||
public class PreferenceController {
|
||||
private static final String TAG = "PreferenceController";
|
||||
public static final String PREF_FLATTR_THIS_APP = "prefFlattrThisApp";
|
||||
public static final String PREF_FLATTR_SETTINGS = "prefFlattrSettings";
|
||||
public static final String PREF_FLATTR_AUTH = "pref_flattr_authenticate";
|
||||
public static final String PREF_FLATTR_REVOKE = "prefRevokeAccess";
|
||||
|
@ -108,23 +107,6 @@ public class PreferenceController {
|
|||
);
|
||||
}
|
||||
|
||||
ui.findPreference(PreferenceController.PREF_FLATTR_THIS_APP).setOnPreferenceClickListener(
|
||||
new Preference.OnPreferenceClickListener() {
|
||||
|
||||
@Override
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
new FlattrClickWorker(activity,
|
||||
new SimpleFlattrThing(activity.getString(R.string.app_name),
|
||||
FlattrUtils.APP_URL,
|
||||
new FlattrStatus(FlattrStatus.STATUS_QUEUE)
|
||||
)
|
||||
).executeAsync();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
ui.findPreference(PreferenceController.PREF_FLATTR_REVOKE).setOnPreferenceClickListener(
|
||||
new Preference.OnPreferenceClickListener() {
|
||||
|
||||
|
|
|
@ -204,11 +204,6 @@
|
|||
<Preference
|
||||
android:title="@string/choose_data_directory"
|
||||
android:key="prefChooseDataDir"/>
|
||||
<Preference
|
||||
android:key="prefFlattrThisApp"
|
||||
android:summary="@string/pref_flattr_this_app_sum"
|
||||
android:title="@string/pref_flattr_this_app_title">
|
||||
</Preference>
|
||||
<Preference
|
||||
android:key="prefOpmlExport"
|
||||
android:title="@string/opml_export_label"/>
|
||||
|
|
|
@ -274,11 +274,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
|
|||
public void setContentEncoded(String contentEncoded) {
|
||||
this.contentEncoded = contentEncoded;
|
||||
}
|
||||
|
||||
public void setFlattrStatus(FlattrStatus status) {
|
||||
this.flattrStatus = status;
|
||||
}
|
||||
|
||||
|
||||
public FlattrStatus getFlattrStatus() {
|
||||
return flattrStatus;
|
||||
}
|
||||
|
|
|
@ -42,12 +42,6 @@ public class FlattrUtils {
|
|||
|
||||
private static final String PREF_ACCESS_TOKEN = "de.danoeh.antennapod.preference.flattrAccessToken";
|
||||
|
||||
// Flattr URL for this app.
|
||||
public static final String APP_URL = "http://antennapod.com";
|
||||
// Human-readable flattr-page.
|
||||
public static final String APP_LINK = "https://flattr.com/thing/745609/";
|
||||
public static final String APP_THING_ID = "745609";
|
||||
|
||||
private static volatile AccessToken cachedToken;
|
||||
|
||||
private static AndroidAuthenticator createAuthenticator() {
|
||||
|
@ -110,18 +104,6 @@ public class FlattrUtils {
|
|||
storeToken(null);
|
||||
}
|
||||
|
||||
public static Thing getAppThing(Context context) {
|
||||
FlattrService fs = FlattrServiceCreator.getService(retrieveToken());
|
||||
try {
|
||||
Thing thing = fs.getThing(Thing.withId(APP_THING_ID));
|
||||
return thing;
|
||||
} catch (FlattrException e) {
|
||||
e.printStackTrace();
|
||||
showErrorDialog(context, e.getMessage());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void clickUrl(Context context, String url)
|
||||
throws FlattrException {
|
||||
if (hasToken()) {
|
||||
|
@ -245,37 +227,6 @@ public class FlattrUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static void showForbiddenDialog(final Context context,
|
||||
final String url) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(R.string.action_forbidden_title);
|
||||
builder.setMessage(R.string.action_forbidden_msg);
|
||||
builder.setPositiveButton(R.string.authenticate_now_label,
|
||||
new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
context.startActivity(
|
||||
ClientConfig.flattrCallbacks.getFlattrAuthenticationActivityIntent(context));
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
builder.setNegativeButton(R.string.visit_website_label,
|
||||
new OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Uri uri = Uri.parse(url);
|
||||
context.startActivity(new Intent(Intent.ACTION_VIEW,
|
||||
uri));
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
builder.create().show();
|
||||
}
|
||||
|
||||
public static void showErrorDialog(final Context context, final String msg) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(R.string.error_label);
|
||||
|
|
Loading…
Reference in New Issue