Add menu option to view photo in gallery

This commit is contained in:
Jimmy Shih
2013-11-04 14:20:23 -08:00
parent 5867093895
commit d96c705953
6 changed files with 21 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+5
View File
@@ -30,4 +30,9 @@ limitations under the License.
android:id="@+id/marker_detail_delete"
android:showAsAction="ifRoom"
android:title="@string/menu_delete"/>
<item
android:icon="@drawable/ic_menu_view_photo"
android:id="@+id/marker_detail_view_photo"
android:showAsAction="ifRoom"
android:title="@string/menu_view_photo"/>
</menu>
+6
View File
@@ -1240,6 +1240,12 @@ limitations under the License.
Character limit: ~20 (1 line)">
Terrain
</string>
<string name="menu_view_photo"
translation_description="In the menu, to view a photo.
Character limit: ~20 (1 line)">
View photo
</string>
<string name="menu_voice_frequency"
translation_description="In the menu, to configure the voice frequency, how frequent to announce
status.
@@ -179,6 +179,10 @@ public class MarkerDetailFragment extends Fragment {
menu.findItem(R.id.marker_detail_edit).setVisible(!isSharedWithMe);
menu.findItem(R.id.marker_detail_delete).setVisible(!isSharedWithMe);
String photoUrl = waypoint.getPhotoUrl();
boolean hasPhoto = photoUrl != null && !photoUrl.equals("");
menu.findItem(R.id.marker_detail_view_photo).setVisible(hasPhoto);
}
@Override
@@ -202,6 +206,12 @@ public class MarkerDetailFragment extends Fragment {
DeleteMarkerDialogFragment.newInstance(new long[] { markerId })
.show(getChildFragmentManager(), DeleteMarkerDialogFragment.DELETE_MARKER_DIALOG_TAG);
return true;
case R.id.marker_detail_view_photo:
intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(waypoint.getPhotoUrl()), "image/*");
startActivity(intent);
return true;
default:
return super.onOptionsItemSelected(item);
}