|
|
@ -38,6 +38,9 @@ import android.app.Dialog; |
|
|
|
import android.app.DialogFragment; |
|
|
|
import android.app.DialogFragment; |
|
|
|
import android.app.Fragment; |
|
|
|
import android.app.Fragment; |
|
|
|
import android.app.SearchManager; |
|
|
|
import android.app.SearchManager; |
|
|
|
|
|
|
|
import android.content.ClipData; |
|
|
|
|
|
|
|
import android.content.ClipboardManager; |
|
|
|
|
|
|
|
import android.content.Context; |
|
|
|
import android.content.Intent; |
|
|
|
import android.content.Intent; |
|
|
|
import android.net.Uri; |
|
|
|
import android.net.Uri; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
@ -146,6 +149,7 @@ public class RssitemsFragment extends Fragment { |
|
|
|
|
|
|
|
|
|
|
|
int itemId = item.getItemId(); |
|
|
|
int itemId = item.getItemId(); |
|
|
|
if (itemId == R.id.action_addall) { |
|
|
|
if (itemId == R.id.action_addall) { |
|
|
|
|
|
|
|
|
|
|
|
// Start an Intent that adds multiple items at once, by supplying the urls and titles as string array
|
|
|
|
// Start an Intent that adds multiple items at once, by supplying the urls and titles as string array
|
|
|
|
// extras and setting the Intent action to ADD_MULTIPLE
|
|
|
|
// extras and setting the Intent action to ADD_MULTIPLE
|
|
|
|
Intent intent = new Intent("org.transdroid.ADD_MULTIPLE"); |
|
|
|
Intent intent = new Intent("org.transdroid.ADD_MULTIPLE"); |
|
|
@ -160,7 +164,23 @@ public class RssitemsFragment extends Fragment { |
|
|
|
startActivity(intent); |
|
|
|
startActivity(intent); |
|
|
|
mode.finish(); |
|
|
|
mode.finish(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (itemId == R.id.action_copytoclipboard) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder names = new StringBuilder(); |
|
|
|
|
|
|
|
for (int f = 0; f < checked.size(); f++) { |
|
|
|
|
|
|
|
if (f != 0) |
|
|
|
|
|
|
|
names.append("\n"); |
|
|
|
|
|
|
|
names.append(checked.get(f).getTitle()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
ClipboardManager clipboardManager = (ClipboardManager) getActivity().getSystemService( |
|
|
|
|
|
|
|
Context.CLIPBOARD_SERVICE); |
|
|
|
|
|
|
|
clipboardManager.setPrimaryClip(ClipData.newPlainText("Transdroid", names.toString())); |
|
|
|
|
|
|
|
mode.finish(); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
// The other items only operate on one (the first) selected item
|
|
|
|
// The other items only operate on one (the first) selected item
|
|
|
|
if (checked.size() < 1) |
|
|
|
if (checked.size() < 1) |
|
|
|
return false; |
|
|
|
return false; |
|
|
@ -190,7 +210,9 @@ public class RssitemsFragment extends Fragment { |
|
|
|
search.putExtra(SearchManager.QUERY, first.getTitle()); |
|
|
|
search.putExtra(SearchManager.QUERY, first.getTitle()); |
|
|
|
startActivity(search); |
|
|
|
startActivity(search); |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
mode.finish(); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|