forked from upstream-mirrors/OpenTracks
Add menu option to view photo in gallery
This commit is contained in:
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 |
@@ -30,4 +30,9 @@ limitations under the License.
|
|||||||
android:id="@+id/marker_detail_delete"
|
android:id="@+id/marker_detail_delete"
|
||||||
android:showAsAction="ifRoom"
|
android:showAsAction="ifRoom"
|
||||||
android:title="@string/menu_delete"/>
|
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>
|
</menu>
|
||||||
@@ -1240,6 +1240,12 @@ limitations under the License.
|
|||||||
Character limit: ~20 (1 line)">
|
Character limit: ~20 (1 line)">
|
||||||
Terrain
|
Terrain
|
||||||
</string>
|
</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"
|
<string name="menu_voice_frequency"
|
||||||
translation_description="In the menu, to configure the voice frequency, how frequent to announce
|
translation_description="In the menu, to configure the voice frequency, how frequent to announce
|
||||||
status.
|
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_edit).setVisible(!isSharedWithMe);
|
||||||
menu.findItem(R.id.marker_detail_delete).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
|
@Override
|
||||||
@@ -202,6 +206,12 @@ public class MarkerDetailFragment extends Fragment {
|
|||||||
DeleteMarkerDialogFragment.newInstance(new long[] { markerId })
|
DeleteMarkerDialogFragment.newInstance(new long[] { markerId })
|
||||||
.show(getChildFragmentManager(), DeleteMarkerDialogFragment.DELETE_MARKER_DIALOG_TAG);
|
.show(getChildFragmentManager(), DeleteMarkerDialogFragment.DELETE_MARKER_DIALOG_TAG);
|
||||||
return true;
|
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:
|
default:
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user