diff options
author | MStrecke <MStrecke@users.noreply.github.com> | 2021-02-25 23:08:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-25 23:08:00 +0100 |
commit | 519d6ce9d699e895bf6adb00f3ec9d0238cc570b (patch) | |
tree | a27d2ca1671cc48503bdee8e1b26fe2c80b5ca85 /app/src | |
parent | 1cd680a2af9bc7ae9717fac84109c25542e81f06 (diff) | |
download | AntennaPod-519d6ce9d699e895bf6adb00f3ec9d0238cc570b.zip |
use full URL for custom gpodder server (#4932)
Diffstat (limited to 'app/src')
5 files changed, 24 insertions, 10 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java b/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java index 53237579f..6de2186e0 100644 --- a/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java +++ b/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java @@ -18,7 +18,7 @@ public class GpodnetPodcastSearcher implements PodcastSearcher { return Single.create((SingleOnSubscribe<List<PodcastSearchResult>>) subscriber -> { try { GpodnetService service = new GpodnetService(AntennapodHttpClient.getHttpClient(), - GpodnetPreferences.getHostname()); + GpodnetPreferences.getHosturl()); List<GpodnetPodcast> gpodnetPodcasts = service.searchPodcasts(query, 0); List<PodcastSearchResult> results = new ArrayList<>(); for (GpodnetPodcast podcast : gpodnetPodcasts) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java index 1f5434688..be9699348 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java @@ -71,7 +71,7 @@ public abstract class PodcastListFragment extends Fragment { protected List<GpodnetPodcast> doInBackground(Void... params) { try { GpodnetService service = new GpodnetService(AntennapodHttpClient.getHttpClient(), - GpodnetPreferences.getHostname()); + GpodnetPreferences.getHosturl()); return loadPodcastData(service); } catch (GpodnetServiceException e) { exception = e; diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java index 2c41ee070..a26ec9e84 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/TagListFragment.java @@ -54,7 +54,7 @@ public class TagListFragment extends ListFragment { @Override protected List<GpodnetTag> doInBackground(Void... params) { GpodnetService service = new GpodnetService(AntennapodHttpClient.getHttpClient(), - GpodnetPreferences.getHostname()); + GpodnetPreferences.getHosturl()); try { return service.getTopTags(COUNT); } catch (GpodnetServiceException e) { diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderAuthenticationFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderAuthenticationFragment.java index 187e8480b..6eb19aff2 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderAuthenticationFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderAuthenticationFragment.java @@ -82,8 +82,9 @@ public class GpodderAuthenticationFragment extends DialogFragment { final Button selectHost = view.findViewById(R.id.chooseHostButton); final RadioGroup serverRadioGroup = view.findViewById(R.id.serverRadioGroup); final EditText serverUrlText = view.findViewById(R.id.serverUrlText); - if (!GpodnetService.DEFAULT_BASE_HOST.equals(GpodnetPreferences.getHostname())) { - serverUrlText.setText(GpodnetPreferences.getHostname()); + + if (!GpodnetService.DEFAULT_BASE_HOST.equals(GpodnetPreferences.getHosturl())) { + serverUrlText.setText(GpodnetPreferences.getHosturl()); } final TextInputLayout serverUrlTextInput = view.findViewById(R.id.serverUrlTextInput); serverRadioGroup.setOnCheckedChangeListener((group, checkedId) -> { @@ -91,12 +92,12 @@ public class GpodderAuthenticationFragment extends DialogFragment { }); selectHost.setOnClickListener(v -> { if (serverRadioGroup.getCheckedRadioButtonId() == R.id.customServerRadio) { - GpodnetPreferences.setHostname(serverUrlText.getText().toString()); + GpodnetPreferences.setHosturl(serverUrlText.getText().toString()); } else { - GpodnetPreferences.setHostname(GpodnetService.DEFAULT_BASE_HOST); + GpodnetPreferences.setHosturl(GpodnetService.DEFAULT_BASE_HOST); } - service = new GpodnetService(AntennapodHttpClient.getHttpClient(), GpodnetPreferences.getHostname()); - getDialog().setTitle(GpodnetPreferences.getHostname()); + service = new GpodnetService(AntennapodHttpClient.getHttpClient(), GpodnetPreferences.getHosturl()); + getDialog().setTitle(GpodnetPreferences.getHosturl()); advance(); }); } @@ -108,10 +109,14 @@ public class GpodderAuthenticationFragment extends DialogFragment { final TextView txtvError = view.findViewById(R.id.credentialsError); final ProgressBar progressBar = view.findViewById(R.id.progBarLogin); final TextView createAccount = view.findViewById(R.id.createAccountButton); + final TextView createAccountWarning = view.findViewById(R.id.createAccountWarning); createAccount.setPaintFlags(createAccount.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); createAccount.setOnClickListener(v -> IntentUtils.openInBrowser(getContext(), "https://gpodder.net/register/")); + if (GpodnetPreferences.getHosturl().startsWith("http://")) { + createAccountWarning.setVisibility(View.VISIBLE); + } password.setOnEditorActionListener((v, actionID, event) -> actionID == EditorInfo.IME_ACTION_GO && login.performClick()); diff --git a/app/src/main/res/layout/gpodnetauth_credentials.xml b/app/src/main/res/layout/gpodnetauth_credentials.xml index 291b98da3..9fcf67cff 100644 --- a/app/src/main/res/layout/gpodnetauth_credentials.xml +++ b/app/src/main/res/layout/gpodnetauth_credentials.xml @@ -29,6 +29,15 @@ android:text="@string/create_account"/> </LinearLayout> + <TextView + android:id="@+id/createAccountWarning" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/gpodnetauth_encryption_warning" + android:textColor="#F44336" + android:textStyle="bold" + android:visibility="invisible" /> + <com.google.android.material.textfield.TextInputLayout style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" @@ -94,4 +103,4 @@ android:text="@string/gpodnetauth_login_butLabel"/> </LinearLayout> -</LinearLayout>
\ No newline at end of file +</LinearLayout> |