diff options
Diffstat (limited to 'app')
8 files changed, 32 insertions, 16 deletions
diff --git a/app/proguard.cfg b/app/proguard.cfg index 12fc358b1..a70b226cd 100644 --- a/app/proguard.cfg +++ b/app/proguard.cfg @@ -52,15 +52,6 @@ # android-iconify -keep class com.joanzapata.** { *; } -# Glide --keep public class * implements com.bumptech.glide.module.GlideModule --keep public class * extends com.bumptech.glide.module.AppGlideModule --keep public enum com.bumptech.glide.load.ImageHeaderParser$** { - **[] $VALUES; - public *; -} --dontwarn com.bumptech.glide.load.resource.bitmap.VideoDecoder - #### Proguard rules for fyyd client # Retrofit 2.0 -dontwarn retrofit2.** diff --git a/app/src/main/assets/website-languages.txt b/app/src/main/assets/website-languages.txt new file mode 100644 index 000000000..b52b558f9 --- /dev/null +++ b/app/src/main/assets/website-languages.txt @@ -0,0 +1,4 @@ +en +fr +nl +it diff --git a/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java index 4ffed949e..52293091e 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/SelectSubscriptionActivity.java @@ -118,7 +118,7 @@ public class SelectSubscriptionActivity extends AppCompatActivity { Glide.with(this) .asBitmap() .load(feed.getImageUrl()) - .apply(new RequestOptions().override(iconSize, iconSize)) + .apply(RequestOptions.overrideOf(iconSize, iconSize)) .listener(new RequestListener<Bitmap>() { @Override public boolean onLoadFailed(@Nullable GlideException e, Object model, diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java index 82b1c0d00..20a50308f 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java @@ -108,7 +108,7 @@ public class ChaptersListAdapter extends RecyclerView.Adapter<ChaptersListAdapte .apply(new RequestOptions() .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .dontAnimate() - .transforms(new FitCenter(), new RoundedCorners((int) + .transform(new FitCenter(), new RoundedCorners((int) (4 * context.getResources().getDisplayMetrics().density)))) .into(holder.image); } diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java index 40c2029d6..9b514dd98 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java @@ -85,7 +85,7 @@ public class ItunesAdapter extends ArrayAdapter<PodcastSearchResult> { .apply(new RequestOptions() .placeholder(R.color.light_gray) .diskCacheStrategy(DiskCacheStrategy.NONE) - .transforms(new FitCenter(), + .transform(new FitCenter(), new RoundedCorners((int) (4 * context.getResources().getDisplayMetrics().density))) .dontAnimate()) .into(viewHolder.coverView); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 2d448faa8..5b030f0c2 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -310,7 +310,7 @@ public class CoverFragment extends Fragment { RequestOptions options = new RequestOptions() .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) .dontAnimate() - .transforms(new FitCenter(), + .transform(new FitCenter(), new RoundedCorners((int) (16 * getResources().getDisplayMetrics().density))); RequestBuilder<Drawable> cover = Glide.with(this) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 83dc0c554..3bdc0e49f 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -293,7 +293,7 @@ public class ItemFragment extends Fragment { RequestOptions options = new RequestOptions() .error(R.color.light_gray) .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) - .transforms(new FitCenter(), + .transform(new FitCenter(), new RoundedCorners((int) (4 * getResources().getDisplayMetrics().density))) .dontAnimate(); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java index e2c5036df..7f5205db4 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java @@ -17,6 +17,13 @@ import de.danoeh.antennapod.activity.BugReportActivity; import de.danoeh.antennapod.activity.PreferenceActivity; import de.danoeh.antennapod.core.util.IntentUtils; import de.danoeh.antennapod.fragment.preferences.about.AboutFragment; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ArrayUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Locale; public class MainPreferencesFragment extends PreferenceFragmentCompat { @@ -106,7 +113,7 @@ public class MainPreferencesFragment extends PreferenceFragmentCompat { } ); findPreference(PREF_DOCUMENTATION).setOnPreferenceClickListener(preference -> { - IntentUtils.openInBrowser(getContext(), "https://antennapod.org/documentation/"); + IntentUtils.openInBrowser(getContext(), getLocalizedWebsiteLink() + "/documentation/"); return true; }); findPreference(PREF_VIEW_FORUM).setOnPreferenceClickListener(preference -> { @@ -114,7 +121,7 @@ public class MainPreferencesFragment extends PreferenceFragmentCompat { return true; }); findPreference(PREF_CONTRIBUTE).setOnPreferenceClickListener(preference -> { - IntentUtils.openInBrowser(getContext(), "https://antennapod.org/contribute/"); + IntentUtils.openInBrowser(getContext(), getLocalizedWebsiteLink() + "/contribute/"); return true; }); findPreference(PREF_SEND_BUG_REPORT).setOnPreferenceClickListener(preference -> { @@ -123,6 +130,20 @@ public class MainPreferencesFragment extends PreferenceFragmentCompat { }); } + private String getLocalizedWebsiteLink() { + try (InputStream is = getContext().getAssets().open("website-languages.txt")) { + String[] languages = IOUtils.toString(is, StandardCharsets.UTF_8.name()).split("\n"); + String deviceLanguage = Locale.getDefault().getLanguage(); + if (ArrayUtils.contains(languages, deviceLanguage) && !"en".equals(deviceLanguage)) { + return "https://antennapod.org/" + deviceLanguage; + } else { + return "https://antennapod.org"; + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + private void setupSearch() { SearchPreference searchPreference = findPreference("searchPreference"); SearchConfiguration config = searchPreference.getSearchConfiguration(); |