Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteHamster committed Feb 18, 2024
2 parents dc63386 + 0d29e44 commit 7a40a50
Show file tree
Hide file tree
Showing 101 changed files with 1,430 additions and 1,348 deletions.
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ body:
attributes:
label: Checklist
options:
- label: I have used the search function for [open](https://github.com/AntennaPod/AntennaPod/issues) **and** [closed](https://github.com/AntennaPod/AntennaPod/issues?q=is%3Aissue+is%3Aclosed) issues to see if someone else has already submitted the same bug report.
- label: I have used the search function for [**OPEN**](https://github.com/AntennaPod/AntennaPod/issues) issues to see if someone else has already submitted the same bug report.
required: true
- label: I have **also** used the search function for [**CLOSED**](https://github.com/AntennaPod/AntennaPod/issues?q=is%3Aissue+is%3Aclosed) issues to see if the problem is already solved and just waiting to be released.
required: true
- label: I will describe the problem with as much detail as possible.
required: true
Expand Down
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ body:
attributes:
label: Checklist
options:
- label: I have used the search function for [open](https://github.com/AntennaPod/AntennaPod/issues) **and** [closed](https://github.com/AntennaPod/AntennaPod/issues?q=is%3Aissue+is%3Aclosed) issues to see if someone else has already submitted the same feature request.
- label: I have used the search function for [**OPEN**](https://github.com/AntennaPod/AntennaPod/issues) issues to see if someone else has already submitted the same feature request.
required: true
- label: I have **also** used the search function for [**CLOSED**](https://github.com/AntennaPod/AntennaPod/issues?q=is%3Aissue+is%3Aclosed) issues to see if the feature was already implemented and is just waiting to be released, or if the feature was rejected.
required: true
- label: I will describe the problem with as much detail as possible.
required: true
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/close-if-no-reply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
steps:
- uses: actions/stale@v5
with:
days-before-stale: 15
days-before-close: 15
days-before-stale: 7
days-before-close: 7
only-labels: 'Awaiting reply'
stale-issue-label: 'Still awaiting reply'
stale-pr-label: 'Still awaiting reply'
stale-issue-message: "This issue will be closed when we don't get a reply within 15 days."
stale-pr-message: "This PR will be closed when we don't get a reply within 15 days."
stale-issue-message: "This issue will be closed when we don't get a reply within 7 days."
stale-pr-message: "This PR will be closed when we don't get a reply within 7 days."
labels-to-remove-when-unstale: 'Awaiting reply'
close-issue-label: "Close reason: no reply"
close-pr-label: "Close reason: no reply"
close-issue-message: "This issue was closed because we didn't get a reply for 30 days."
close-pr-message: "This PR was closed because we didn't get a reply for 30 days."
close-issue-message: "This issue was closed because we didn't get a reply for 14 days."
close-pr-message: "This PR was closed because we didn't get a reply for 14 days."
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ dependencies {
implementation "com.joanzapata.iconify:android-iconify-fontawesome:$iconifyVersion"
implementation "com.joanzapata.iconify:android-iconify-material:$iconifyVersion"
implementation 'com.leinardi.android:speed-dial:3.2.0'
implementation 'com.github.ByteHamster:SearchPreference:v2.0.0'
implementation 'com.github.ByteHamster:SearchPreference:v2.5.0'
implementation 'com.github.skydoves:balloon:1.5.3'
implementation 'com.github.xabaras:RecyclerViewSwipeDecorator:1.3'
implementation "com.annimon:stream:$annimonStreamVersion"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;

import androidx.annotation.StringRes;
import androidx.preference.PreferenceManager;
import androidx.test.filters.LargeTest;
Expand Down Expand Up @@ -30,17 +31,14 @@
import static androidx.test.espresso.action.ViewActions.scrollTo;
import static androidx.test.espresso.action.ViewActions.swipeDown;
import static androidx.test.espresso.action.ViewActions.swipeUp;
import static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isChecked;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.isRoot;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
import static de.test.antennapod.EspressoTestUtils.clickPreference;
import static de.test.antennapod.EspressoTestUtils.waitForView;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -80,38 +78,22 @@ public void testEnablePersistentPlaybackControls() {
}

@Test
public void testSetLockscreenButtons() {
public void testSetNotificationButtons() {
clickPreference(R.string.user_interface_label);
String[] buttons = res.getStringArray(R.array.compact_notification_buttons_options);
clickPreference(R.string.pref_compact_notification_buttons_title);
String[] buttons = res.getStringArray(R.array.full_notification_buttons_options);
clickPreference(R.string.pref_full_notification_buttons_title);
// First uncheck checkboxes
onView(withText(buttons[0])).perform(click());
onView(withText(buttons[1])).perform(click());

// Now try to check all checkboxes
onView(withText(buttons[0])).perform(click());
onView(withText(buttons[1])).perform(click());
onView(withText(buttons[2])).perform(click());

// Make sure that the third checkbox is unchecked
onView(withText(buttons[2])).check(matches(not(isChecked())));

String snackBarText = String.format(res.getString(
R.string.pref_compact_notification_buttons_dialog_error), 2);
Awaitility.await().ignoreExceptions().atMost(4000, MILLISECONDS)
.until(() -> {
onView(withText(snackBarText)).check(doesNotExist());
return true;
});

onView(withText(R.string.confirm_label)).perform(click());

Awaitility.await().atMost(1000, MILLISECONDS)
.until(UserPreferences::showRewindOnCompactNotification);
.until(() -> UserPreferences.showSkipOnFullNotification());
Awaitility.await().atMost(1000, MILLISECONDS)
.until(UserPreferences::showFastForwardOnCompactNotification);
.until(() -> UserPreferences.showNextChapterOnFullNotification());
Awaitility.await().atMost(1000, MILLISECONDS)
.until(() -> !UserPreferences.showSkipOnCompactNotification());
.until(() -> !UserPreferences.showPlaybackSpeedOnFullNotification());
}

@Test
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/assets/licenses.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
website="https://github.com/AntennaPod/AntennaPod"
license="GPL-3.0"
licenseText="LICENSE.txt" />
<library
name="AntennaPod-AudioPlayer"
author="The AntennaPod team"
website="https://github.com/AntennaPod/AntennaPod-AudioPlayer"
license="Apache 2.0"
licenseText="LICENSE_APACHE-2.0.txt" />
<library
name="Android Jetpack"
author="Google"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.service.playback.PlaybackServiceInterface;
import de.danoeh.antennapod.core.util.DownloadErrorLabel;
import de.danoeh.antennapod.databinding.EditTextDialogBinding;
import de.danoeh.antennapod.databinding.OnlinefeedviewHeaderBinding;
import de.danoeh.antennapod.event.EpisodeDownloadEvent;
import de.danoeh.antennapod.event.FeedListUpdateEvent;
Expand Down Expand Up @@ -95,7 +96,7 @@
public class OnlineFeedViewActivity extends AppCompatActivity {

public static final String ARG_FEEDURL = "arg.feedurl";
// Optional argument: specify a title for the actionbar.
public static final String ARG_WAS_MANUAL_URL = "manual_url";
private static final int RESULT_ERROR = 2;
private static final String TAG = "OnlineFeedViewActivity";
private static final String PREFS = "OnlineFeedViewActivityPreferences";
Expand Down Expand Up @@ -598,7 +599,10 @@ private void showErrorDialog(String errorMsg, String details) {
builder.setMessage(R.string.download_error_error_unknown);
}
builder.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.cancel());
builder.setOnDismissListener(dialog -> {
if (getIntent().getBooleanExtra(ARG_WAS_MANUAL_URL, false)) {
builder.setNeutralButton(R.string.edit_url_menu, (dialog, which) -> editUrl());
}
builder.setOnCancelListener(dialog -> {
setResult(RESULT_ERROR);
finish();
});
Expand All @@ -609,6 +613,26 @@ private void showErrorDialog(String errorMsg, String details) {
}
}

private void editUrl() {
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
builder.setTitle(R.string.edit_url_menu);
final EditTextDialogBinding dialogBinding = EditTextDialogBinding.inflate(getLayoutInflater());
if (downloader != null) {
dialogBinding.urlEditText.setText(downloader.getDownloadRequest().getSource());
}
builder.setView(dialogBinding.getRoot());
builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> {
setLoadingLayout();
lookupUrlAndDownload(dialogBinding.urlEditText.getText().toString());
});
builder.setNegativeButton(R.string.cancel_label, (dialog1, which) -> dialog1.cancel());
builder.setOnCancelListener(dialog1 -> {
setResult(RESULT_ERROR);
finish();
});
builder.show();
}

@Subscribe(threadMode = ThreadMode.MAIN)
public void playbackStateChanged(PlayerStatusEvent event) {
boolean isPlayingPreview =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.Menu;
Expand Down Expand Up @@ -45,6 +47,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

/**
* Activity for Opml Import.
Expand Down Expand Up @@ -140,15 +143,6 @@ void importUri(@Nullable Uri uri) {
return;
}
this.uri = uri;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& uri.toString().contains(Environment.getExternalStorageDirectory().toString())) {
int permission = ActivityCompat.checkSelfPermission(this,
android.Manifest.permission.READ_EXTERNAL_STORAGE);
if (permission != PackageManager.PERMISSION_GRANTED) {
requestPermission();
return;
}
}
startImport();
}

Expand Down Expand Up @@ -244,12 +238,29 @@ private void startImport() {
getTitleList());
viewBinding.feedlist.setAdapter(listAdapter);
}, e -> {
Log.d(TAG, Log.getStackTraceString(e));
String message = e.getMessage() == null ? "" : e.getMessage();
if (message.toLowerCase(Locale.ROOT).contains("permission")
&& Build.VERSION.SDK_INT >= 23) {
int permission = ActivityCompat.checkSelfPermission(this,
android.Manifest.permission.READ_EXTERNAL_STORAGE);
if (permission != PackageManager.PERMISSION_GRANTED) {
requestPermission();
return;
}
}
viewBinding.progressBar.setVisibility(View.GONE);
MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(this);
alert.setTitle(R.string.error_label);
alert.setMessage(getString(R.string.opml_reader_error) + e.getMessage());
alert.setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.dismiss());
alert.create().show();
String userReadable = getString(R.string.opml_reader_error);
String details = e.getMessage();
String total = userReadable + "\n\n" + details;
SpannableString errorMessage = new SpannableString(total);
errorMessage.setSpan(new ForegroundColorSpan(0x88888888),
userReadable.length(), total.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
alert.setMessage(errorMessage);
alert.setPositiveButton(android.R.string.ok, (dialog, which) -> finish());
alert.show();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ public boolean onPrepareOptionsMenu(Menu menu) {
menu.findItem(R.id.disable_sleeptimer_item).setVisible(controller.sleepTimerActive());

menu.findItem(R.id.player_switch_to_audio_only).setVisible(true);
menu.findItem(R.id.audio_controls).setIcon(R.drawable.ic_sliders);

menu.findItem(R.id.audio_controls).setVisible(controller.getAudioTracks().size() >= 2);
menu.findItem(R.id.playback_speed).setVisible(true);
menu.findItem(R.id.player_show_chapters).setVisible(true);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private void bindNavView(String title, int position, NavHolder holder) {
int spaceUsed = itemAccess.getNumberOfDownloadedItems()
- itemAccess.getReclaimableItems();
if (epCacheSize > 0 && spaceUsed >= epCacheSize) {
holder.count.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, R.drawable.ic_disc_full, 0);
holder.count.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, R.drawable.ic_disc_alert, 0);
holder.count.setVisibility(View.VISIBLE);
holder.count.setOnClickListener(v ->
new MaterialAlertDialogBuilder(context)
Expand Down

0 comments on commit 7a40a50

Please sign in to comment.