Fix lambdas
This commit is contained in:
parent
fa30bc5447
commit
002ba1753d
@ -106,9 +106,7 @@ public class DownloadServiceTest {
|
|||||||
// OPEN: Ideally, I'd like the download time long enough so that multiple in-progress DownloadEvents
|
// OPEN: Ideally, I'd like the download time long enough so that multiple in-progress DownloadEvents
|
||||||
// are generated (to simulate typical download), but it'll make download time quite long (1-2 seconds)
|
// are generated (to simulate typical download), but it'll make download time quite long (1-2 seconds)
|
||||||
// to do so
|
// to do so
|
||||||
DownloadService.setDownloaderFactory(new StubDownloaderFactory(50, downloadStatus -> {
|
DownloadService.setDownloaderFactory(new StubDownloaderFactory(50, DownloadStatus::setSuccessful));
|
||||||
downloadStatus.setSuccessful();
|
|
||||||
}));
|
|
||||||
|
|
||||||
UserPreferences.setEnqueueDownloadedEpisodes(enqueueDownloaded);
|
UserPreferences.setEnqueueDownloadedEpisodes(enqueueDownloaded);
|
||||||
withFeedItemEventListener(feedItemEventListener -> {
|
withFeedItemEventListener(feedItemEventListener -> {
|
||||||
@ -146,9 +144,8 @@ public class DownloadServiceTest {
|
|||||||
private void doTestCancelDownload_UndoEnqueue(boolean itemAlreadyInQueue) throws Exception {
|
private void doTestCancelDownload_UndoEnqueue(boolean itemAlreadyInQueue) throws Exception {
|
||||||
Context context = InstrumentationRegistry.getTargetContext();
|
Context context = InstrumentationRegistry.getTargetContext();
|
||||||
// let download take longer to ensure the test can cancel the download in time
|
// let download take longer to ensure the test can cancel the download in time
|
||||||
DownloadService.setDownloaderFactory(new StubDownloaderFactory(30000, downloadStatus -> {
|
DownloadService.setDownloaderFactory(
|
||||||
downloadStatus.setSuccessful();
|
new StubDownloaderFactory(30000, DownloadStatus::setSuccessful));
|
||||||
}));
|
|
||||||
UserPreferences.setEnqueueDownloadedEpisodes(true);
|
UserPreferences.setEnqueueDownloadedEpisodes(true);
|
||||||
UserPreferences.setEnableAutodownload(false);
|
UserPreferences.setEnableAutodownload(false);
|
||||||
|
|
||||||
|
@ -42,9 +42,8 @@ public class BugReportActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
crashDetailsTextView.setText(crashDetailsText);
|
crashDetailsTextView.setText(crashDetailsText);
|
||||||
|
|
||||||
findViewById(R.id.btn_open_bug_tracker).setOnClickListener(v -> {
|
findViewById(R.id.btn_open_bug_tracker).setOnClickListener(v -> IntentUtils.openInBrowser(
|
||||||
IntentUtils.openInBrowser(BugReportActivity.this, "https://github.com/AntennaPod/AntennaPod/issues");
|
BugReportActivity.this, "https://github.com/AntennaPod/AntennaPod/issues"));
|
||||||
});
|
|
||||||
|
|
||||||
findViewById(R.id.btn_copy_log).setOnClickListener(v -> {
|
findViewById(R.id.btn_copy_log).setOnClickListener(v -> {
|
||||||
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
@ -51,9 +51,7 @@ public abstract class FilterDialog {
|
|||||||
filterValues.remove(values[which]);
|
filterValues.remove(values[which]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> {
|
builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> updateFilter(filterValues));
|
||||||
updateFilter(filterValues);
|
|
||||||
});
|
|
||||||
builder.setNegativeButton(R.string.cancel_label, null);
|
builder.setNegativeButton(R.string.cancel_label, null);
|
||||||
builder.create().show();
|
builder.create().show();
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package de.danoeh.antennapod.dialog;
|
|||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -68,24 +67,17 @@ public class ShareDialog extends DialogFragment {
|
|||||||
|
|
||||||
setupOptions();
|
setupOptions();
|
||||||
|
|
||||||
builder.setPositiveButton(R.string.share_label, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.share_label, (dialog, id) -> {
|
||||||
@Override
|
boolean includePlaybackPosition = checkBoxStartAt.isChecked();
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
if (radioEpisodeWebsite.isChecked()) {
|
||||||
boolean includePlaybackPosition = checkBoxStartAt.isChecked();
|
ShareUtils.shareFeedItemLink(ctx, item, includePlaybackPosition);
|
||||||
if (radioEpisodeWebsite.isChecked()) {
|
prefs.edit().putString(PREF_SHARE_DIALOG_OPTION, "website").apply();
|
||||||
ShareUtils.shareFeedItemLink(ctx, item, includePlaybackPosition);
|
} else {
|
||||||
prefs.edit().putString(PREF_SHARE_DIALOG_OPTION, "website").apply();
|
ShareUtils.shareFeedItemDownloadLink(ctx, item, includePlaybackPosition);
|
||||||
} else {
|
prefs.edit().putString(PREF_SHARE_DIALOG_OPTION, "media").apply();
|
||||||
ShareUtils.shareFeedItemDownloadLink(ctx, item, includePlaybackPosition);
|
|
||||||
prefs.edit().putString(PREF_SHARE_DIALOG_OPTION, "media").apply();
|
|
||||||
}
|
|
||||||
prefs.edit().putBoolean(PREF_SHARE_EPISODE_START_AT, includePlaybackPosition).apply();
|
|
||||||
}
|
}
|
||||||
}).setNegativeButton(R.string.cancel_label, new DialogInterface.OnClickListener() {
|
prefs.edit().putBoolean(PREF_SHARE_EPISODE_START_AT, includePlaybackPosition).apply();
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
}).setNegativeButton(R.string.cancel_label, (dialog, id) -> dialog.dismiss());
|
||||||
dialog.dismiss();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return builder.create();
|
return builder.create();
|
||||||
}
|
}
|
||||||
|
@ -85,9 +85,8 @@ public class NavDrawerFragment extends Fragment implements AdapterView.OnItemCli
|
|||||||
registerForContextMenu(navList);
|
registerForContextMenu(navList);
|
||||||
updateSelection();
|
updateSelection();
|
||||||
|
|
||||||
root.findViewById(R.id.nav_settings).setOnClickListener(v -> {
|
root.findViewById(R.id.nav_settings).setOnClickListener(v ->
|
||||||
startActivity(new Intent(getActivity(), PreferenceActivity.class));
|
startActivity(new Intent(getActivity(), PreferenceActivity.class)));
|
||||||
});
|
|
||||||
getContext().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE)
|
getContext().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE)
|
||||||
.registerOnSharedPreferenceChangeListener(this);
|
.registerOnSharedPreferenceChangeListener(this);
|
||||||
return root;
|
return root;
|
||||||
|
@ -118,9 +118,8 @@ public class AutoUpdateManager {
|
|||||||
*/
|
*/
|
||||||
public static void runImmediate(@NonNull Context context) {
|
public static void runImmediate(@NonNull Context context) {
|
||||||
Log.d(TAG, "Run auto update immediately in background.");
|
Log.d(TAG, "Run auto update immediately in background.");
|
||||||
new Thread(() -> {
|
new Thread(() -> DBTasks.refreshAllFeeds(
|
||||||
DBTasks.refreshAllFeeds(context.getApplicationContext(), true);
|
context.getApplicationContext(), true), "ManualRefreshAllFeeds").start();
|
||||||
}, "ManualRefreshAllFeeds").start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void disableAutoUpdate(Context context) {
|
public static void disableAutoUpdate(Context context) {
|
||||||
|
@ -13,6 +13,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import de.danoeh.antennapod.core.feed.FeedComponent;
|
||||||
import de.danoeh.antennapod.core.feed.FeedItem;
|
import de.danoeh.antennapod.core.feed.FeedItem;
|
||||||
import de.danoeh.antennapod.core.feed.FeedMedia;
|
import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||||
import de.danoeh.antennapod.core.feed.FeedMother;
|
import de.danoeh.antennapod.core.feed.FeedMother;
|
||||||
@ -254,7 +255,7 @@ public class ItemEnqueuePositionCalculatorTest {
|
|||||||
Collections.unmodifiableList(Arrays.asList(
|
Collections.unmodifiableList(Arrays.asList(
|
||||||
createFeedItem(11), createFeedItem(12), createFeedItem(13), createFeedItem(14)));
|
createFeedItem(11), createFeedItem(12), createFeedItem(13), createFeedItem(14)));
|
||||||
static final List<Long> QUEUE_DEFAULT_IDS =
|
static final List<Long> QUEUE_DEFAULT_IDS =
|
||||||
QUEUE_DEFAULT.stream().map(fi -> fi.getId()).collect(Collectors.toList());
|
QUEUE_DEFAULT.stream().map(FeedComponent::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
static Playable getCurrentlyPlaying(long idCurrentlyPlaying) {
|
static Playable getCurrentlyPlaying(long idCurrentlyPlaying) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user