diff --git a/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java b/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java index c6133c59c..8b17b362e 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/DialogsTest.java @@ -23,6 +23,8 @@ import org.junit.runner.RunWith; import static androidx.test.espresso.Espresso.onView; import static androidx.test.espresso.action.ViewActions.clearText; import static androidx.test.espresso.action.ViewActions.click; +import static androidx.test.espresso.action.ViewActions.closeSoftKeyboard; +import static androidx.test.espresso.action.ViewActions.scrollTo; import static androidx.test.espresso.action.ViewActions.typeText; import static androidx.test.espresso.assertion.ViewAssertions.matches; import static androidx.test.espresso.matcher.RootMatchers.isDialog; @@ -56,10 +58,12 @@ public class DialogsTest { String url = "https://omny.fm/shows/silence-is-not-an-option/why-not-being-racist-is-not-enough"; - onView(withId(R.id.btn_add_via_url)).perform(click()); + onView(withId(R.id.btn_add_via_url)).perform(scrollTo()).perform(click()); onView(withId(R.id.text)).perform(clearText(), typeText(url)); onView(withText(R.string.confirm_label)).inRoot(isDialog()) .check(matches(isDisplayed())) + .perform(closeSoftKeyboard()) + .perform(scrollTo()) .perform(click()); Thread.sleep(5000); onView(withId(R.id.butSubscribe)).perform(click()); @@ -72,21 +76,22 @@ public class DialogsTest { @Test public void testShareDialogDisplayed() { - onView(withText(R.string.share_label)).perform(click()); - onView(withText(R.string.share_episode_label)).check(matches(isDisplayed())); + onView(withText(R.string.share_label)).perform(scrollTo()).perform(click()); + onView(allOf(isDisplayed(), withText(R.string.share_episode_label))); } @Test public void testShareDialogShareButton() throws InterruptedException { - onView(withText(R.string.share_label)).perform(click()); - onView(withText(R.string.share_label)).check(matches(isDisplayed())); - onView(withText(R.string.share_label)).perform(click()); - Thread.sleep(3000); + onView(withText(R.string.share_label)).perform(scrollTo()).perform(click()); + onView(allOf(isDisplayed(), withText(R.string.share_label))); + Thread.sleep(1000); + onView(withText(R.string.share_episode_positive_label_button)).perform(scrollTo()).perform(click()); + Thread.sleep(2000); } @Test public void testShareDialogCancelButton() { - onView(withText(R.string.share_label)).perform(click()); + onView(withText(R.string.share_label)).perform(scrollTo()).perform(click()); onView(withText(R.string.cancel_label)).check(matches(isDisplayed())); } diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ShareDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ShareDialog.java index 7bc7f5e67..32887b9dc 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ShareDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ShareDialog.java @@ -10,6 +10,7 @@ import android.view.View; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.Switch; +import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -54,7 +55,7 @@ public class ShareDialog extends DialogFragment { setupOptions(); builder - .setPositiveButton(R.string.share_label, new DialogInterface.OnClickListener() { + .setPositiveButton(R.string.share_episode_positive_label_button, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { if (radioEpisodeWebsite.isChecked()) { @@ -107,6 +108,11 @@ public class ShareDialog extends DialogFragment { boolean radioMediaIsChecked = prefs.getBoolean(UserPreferences.PREF_SHARE_EPISODE_MEDIA, false); radioMediaFile.setChecked(radioMediaIsChecked); + + if (!radioEpisodeWebsiteIsChecked && !radioMediaIsChecked) { + radioGroup.clearCheck(); + radioEpisodeWebsite.setChecked(true); + } } boolean switchIsChecked = prefs.getBoolean(UserPreferences.PREF_SHARE_EPISODE_START_AT, false); diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 3a2ae59df..9560e9b56 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -767,6 +767,7 @@ Share… + Share Include: Start at (timer) Media file URL