mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2024-12-25 08:21:59 +01:00
Tiny add feed improvements
This commit is contained in:
parent
bb13b1e5f3
commit
8486c33815
@ -573,6 +573,13 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
|
||||
titles.add(urlsMap.get(url));
|
||||
}
|
||||
|
||||
if (urls.size() == 1) {
|
||||
// Skip dialog and display the item directly
|
||||
resetIntent(urls.get(0), titles.get(0));
|
||||
startFeedDownload(urls.get(0), null, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
final ArrayAdapter<String> adapter = new ArrayAdapter<>(OnlineFeedViewActivity.this, R.layout.ellipsize_start_listitem, R.id.txtvTitle, titles);
|
||||
DialogInterface.OnClickListener onClickListener = (dialog, which) -> {
|
||||
String selectedUrl = urls.get(which);
|
||||
|
@ -63,6 +63,9 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> {
|
||||
holder.description.setTag(Boolean.FALSE); // not expanded
|
||||
holder.preview.setVisibility(View.GONE);
|
||||
holder.preview.setOnClickListener(v -> {
|
||||
if (item.getMedia() == null) {
|
||||
return;
|
||||
}
|
||||
Playable playable = new RemoteMedia(item);
|
||||
if (!NetworkUtils.isStreamingAllowed()) {
|
||||
new StreamingConfirmationDialog(getContext(), playable).show();
|
||||
|
@ -76,7 +76,10 @@ public class AddFeedFragment extends Fragment {
|
||||
EditText editText = content.findViewById(R.id.text);
|
||||
editText.setHint(R.string.add_podcast_by_url_hint);
|
||||
ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
editText.setText(clipboard.getText());
|
||||
String clipboardContent = clipboard.getText().toString();
|
||||
if (clipboardContent.startsWith("http")) {
|
||||
editText.setText(clipboardContent);
|
||||
}
|
||||
builder.setView(content);
|
||||
builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> addUrl(editText.getText().toString()));
|
||||
builder.setNegativeButton(R.string.cancel_label, null);
|
||||
|
Loading…
Reference in New Issue
Block a user