[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:
Александр Зацепин 2020-05-22 17:53:15 +03:00 committed by yoksnod
parent 6b08e7d5ce
commit 8ab79eed18

View file

@ -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;
}
}