Browse Source

Allow viewing of details page (via browser intent) of search resutls.

pull/11/head v2.0-alpha3
Eric Kok 11 years ago
parent
commit
b761c6741a
  1. 6
      core/res/menu/fragment_rssitems_cab.xml
  2. 6
      core/res/menu/fragment_searchresults_cab.xml
  3. 1
      core/src/org/transdroid/core/gui/search/SearchResultsFragment.java

6
core/res/menu/fragment_rssitems_cab.xml

@ -1,11 +1,5 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_showdetails"
android:icon="?attr/ic_action_new"
android:showAsAction="always"
android:title="@string/action_showdetails" />
<item <item
android:id="@+id/action_addall" android:id="@+id/action_addall"
android:icon="?attr/ic_action_new" android:icon="?attr/ic_action_new"

6
core/res/menu/fragment_searchresults_cab.xml

@ -1,5 +1,11 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/action_showdetails"
android:icon="?attr/ic_action_website"
android:showAsAction="always"
android:title="@string/action_showdetails" />
<item <item
android:id="@+id/action_addall" android:id="@+id/action_addall"
android:icon="?attr/ic_action_new" android:icon="?attr/ic_action_new"

1
core/src/org/transdroid/core/gui/search/SearchResultsFragment.java

@ -144,6 +144,7 @@ public class SearchResultsFragment extends SherlockFragment {
} else if (itemId == R.id.action_showdetails) { } else if (itemId == R.id.action_showdetails) {
SearchResult first = checked.get(0); SearchResult first = checked.get(0);
// Open the torrent's web page in the browser // Open the torrent's web page in the browser
if (checked.size() > 1)
Toast.makeText(getActivity(), getString(R.string.search_openingdetails, first), Toast.LENGTH_LONG) Toast.makeText(getActivity(), getString(R.string.search_openingdetails, first), Toast.LENGTH_LONG)
.show(); .show();
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getDetailsUrl()))); startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(first.getDetailsUrl())));

Loading…
Cancel
Save