diff options
author | ByteHamster <info@bytehamster.com> | 2019-07-12 19:28:22 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-07-12 19:28:22 +0200 |
commit | 641ee60cbf7404530e26dcef2927910dcc34e840 (patch) | |
tree | 967b0f7de01060e967db20df31bca4be148983de /app/src/main/java/de/danoeh/antennapod/activity | |
parent | 14c9fd2fa251171c584c06d4283c32c1906791ce (diff) | |
download | AntennaPod-641ee60cbf7404530e26dcef2927910dcc34e840.zip |
Removed Flattr support
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/activity')
4 files changed, 0 insertions, 137 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java index bfa694e5c..26e360bd3 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -199,8 +199,6 @@ public class FeedInfoActivity extends AppCompatActivity { @Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); - menu.findItem(R.id.support_item).setVisible( - feed != null && feed.getPaymentLink() != null); menu.findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null); menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null && IntentUtils.isCallable(this, new Intent(Intent.ACTION_VIEW, Uri.parse(feed.getLink())))); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java deleted file mode 100644 index 2b4384a02..000000000 --- a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java +++ /dev/null @@ -1,120 +0,0 @@ -package de.danoeh.antennapod.activity; - - -import android.content.Intent; -import android.net.Uri; -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.widget.Button; -import android.widget.TextView; - -import org.shredzone.flattr4j.exception.FlattrException; - -import de.danoeh.antennapod.BuildConfig; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.util.flattr.FlattrUtils; - -/** Guides the user through the authentication process */ - -public class FlattrAuthActivity extends AppCompatActivity { - private static final String TAG = "FlattrAuthActivity"; - - private TextView txtvExplanation; - private Button butAuthenticate; - private Button butReturn; - - private boolean authSuccessful; - - private static FlattrAuthActivity singleton; - - @Override - protected void onCreate(Bundle savedInstanceState) { - setTheme(UserPreferences.getTheme()); - super.onCreate(savedInstanceState); - singleton = this; - authSuccessful = false; - if (BuildConfig.DEBUG) Log.d(TAG, "Activity created"); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - setContentView(R.layout.flattr_auth); - txtvExplanation = findViewById(R.id.txtvExplanation); - butAuthenticate = findViewById(R.id.but_authenticate); - butReturn = findViewById(R.id.but_return_home); - - butReturn.setOnClickListener(v -> { - Intent intent = new Intent(FlattrAuthActivity.this, MainActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - }); - - butAuthenticate.setOnClickListener(v -> { - try { - FlattrUtils.startAuthProcess(FlattrAuthActivity.this); - } catch (FlattrException e) { - e.printStackTrace(); - } - }); - } - - public static FlattrAuthActivity getInstance() { - return singleton; - } - - @Override - protected void onResume() { - super.onResume(); - if (BuildConfig.DEBUG) Log.d(TAG, "Activity resumed"); - Uri uri = getIntent().getData(); - if (uri != null) { - if (BuildConfig.DEBUG) Log.d(TAG, "Received uri"); - FlattrUtils.handleCallback(this, uri); - } - } - - public void handleAuthenticationSuccess() { - authSuccessful = true; - txtvExplanation.setText(R.string.flattr_auth_success); - butAuthenticate.setEnabled(false); - butReturn.setVisibility(View.VISIBLE); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - super.onCreateOptionsMenu(menu); - return true; - } - - - - @Override - protected void onPause() { - super.onPause(); - if (authSuccessful) { - finish(); - } - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - if (authSuccessful) { - Intent intent = new Intent(this, PreferenceActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - } else { - finish(); - } - break; - default: - return false; - } - return true; - } - - -} diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index 3d5c59a4a..3946400a4 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -330,11 +330,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements Playable media = controller.getMedia(); boolean isFeedMedia = media != null && (media instanceof FeedMedia); - menu.findItem(R.id.support_item).setVisible(isFeedMedia && media.getPaymentLink() != null && - ((FeedMedia) media).getItem() != null && - ((FeedMedia) media).getItem().getFlattrStatus().flattrable() - ); - boolean hasWebsiteLink = ( getWebsiteLinkWithFallback(media) != null ); menu.findItem(R.id.visit_website_item).setVisible(hasWebsiteLink); @@ -603,11 +598,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements Uri uri = Uri.parse(getWebsiteLinkWithFallback(media)); startActivity(new Intent(Intent.ACTION_VIEW, uri)); break; - case R.id.support_item: - if (media instanceof FeedMedia) { - DBTasks.flattrItemIfLoggedIn(this, ((FeedMedia) media).getItem()); - } - break; case R.id.share_link_item: if (media instanceof FeedMedia) { ShareUtils.shareFeedItemLink(this, ((FeedMedia) media).getItem()); diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java index c13f713e0..7e0ae173f 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -15,7 +15,6 @@ import com.bytehamster.lib.preferencesearch.SearchPreferenceResultListener; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.fragment.preferences.AutoDownloadPreferencesFragment; -import de.danoeh.antennapod.fragment.preferences.FlattrPreferencesFragment; import de.danoeh.antennapod.fragment.preferences.GpodderPreferencesFragment; import de.danoeh.antennapod.fragment.preferences.IntegrationsPreferencesFragment; import de.danoeh.antennapod.fragment.preferences.MainPreferencesFragment; @@ -64,8 +63,6 @@ public class PreferenceActivity extends AppCompatActivity implements SearchPrefe prefFragment = new AutoDownloadPreferencesFragment(); } else if (screen == R.xml.preferences_gpodder) { prefFragment = new GpodderPreferencesFragment(); - } else if (screen == R.xml.preferences_flattr) { - prefFragment = new FlattrPreferencesFragment(); } else if (screen == R.xml.preferences_playback) { prefFragment = new PlaybackPreferencesFragment(); } @@ -86,8 +83,6 @@ public class PreferenceActivity extends AppCompatActivity implements SearchPrefe return R.string.user_interface_label; case R.xml.preferences_integrations: return R.string.integrations_label; - case R.xml.preferences_flattr: - return R.string.flattr_label; case R.xml.preferences_gpodder: return R.string.gpodnet_main_label; default: |