From 8b07cd9052f00df300581652f36eddfc44fabb3c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 2 Sep 2019 00:15:28 +0200 Subject: [PATCH 1/3] Prevent EditText getting focus and showing keyboard on startup on old Android versions --- app/src/main/res/layout/addfeed.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml index ef8251a06..a7f7d9f12 100644 --- a/app/src/main/res/layout/addfeed.xml +++ b/app/src/main/res/layout/addfeed.xml @@ -10,6 +10,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" + android:focusableInTouchMode="true" android:padding="8dp"> Date: Mon, 2 Sep 2019 00:15:54 +0200 Subject: [PATCH 2/3] Allow to press enter to search --- .../de/danoeh/antennapod/fragment/AddFeedFragment.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java index 35bcaa76e..3ef010f88 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java @@ -70,11 +70,8 @@ public class AddFeedFragment extends Fragment { combinedFeedSearchBox = root.findViewById(R.id.combinedFeedSearchBox); combinedFeedSearchBox.setOnEditorActionListener((v, actionId, event) -> { - if (actionId == EditorInfo.IME_ACTION_SEARCH) { - performSearch(); - return true; - } - return false; + performSearch(); + return true; }); } From 7cc5f86979c9345a67670745374fdd0deca4613d Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 2 Sep 2019 00:19:56 +0200 Subject: [PATCH 3/3] Do not crash when cancelling gpodder podcast loading --- .../core/util/exception/RxJavaErrorHandlerSetup.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java b/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java index f34ca75be..12f0c1c6e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/exception/RxJavaErrorHandlerSetup.java @@ -1,6 +1,7 @@ package de.danoeh.antennapod.core.util.exception; import android.util.Log; +import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException; import io.reactivex.exceptions.UndeliverableException; import io.reactivex.plugins.RxJavaPlugins; @@ -13,16 +14,21 @@ public class RxJavaErrorHandlerSetup { } public static void setupRxJavaErrorHandler() { - RxJavaPlugins.setErrorHandler(e -> { + RxJavaPlugins.setErrorHandler(originalCause -> { + Throwable e = originalCause; if (e instanceof UndeliverableException) { e = e.getCause(); } + if (e instanceof GpodnetServiceException) { + e = e.getCause(); + } if (e instanceof InterruptedException || e instanceof InterruptedIOException) { // fine, some blocking code was interrupted by a dispose call - Log.d("RxJavaErrorHandler", "Ignored exception: " + Log.getStackTraceString(e)); + Log.d("RxJavaErrorHandler", "Ignored exception: " + Log.getStackTraceString(originalCause)); return; } - Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e); + Thread.currentThread().getUncaughtExceptionHandler() + .uncaughtException(Thread.currentThread(), originalCause); }); } }