forked from organicmaps/organicmaps
[android] Added handling of possibility that active guide is not within gallery, i.e. in case when it goes out from viewport during viewport drag/move
This commit is contained in:
parent
6b08e7d5ce
commit
8ab79eed18
1 changed files with 4 additions and 1 deletions
|
@ -294,6 +294,9 @@ public class GuidesGalleryViewRenderer implements PlacePageViewRenderer<PlacePag
|
|||
boolean animate)
|
||||
{
|
||||
int activePosition = findPositionByGuideId(gallery, guideId);
|
||||
if (activePosition == RecyclerView.NO_POSITION)
|
||||
return;
|
||||
|
||||
if (animate)
|
||||
{
|
||||
mRecyclerView.post(() -> smoothScrollToPosition(activePosition));
|
||||
|
@ -314,6 +317,6 @@ public class GuidesGalleryViewRenderer implements PlacePageViewRenderer<PlacePag
|
|||
return i;
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Guide with id '" + guideId + "' not found in gallery!");
|
||||
return RecyclerView.NO_POSITION;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue