added feature thumbnail recyclerview moves corresponding to the current picture (#4748)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
This commit is contained in:
Pratham Pahariya 2022-01-06 18:18:09 +05:30 committed by GitHub
parent 81cadf09dd
commit 35e9a2c267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,6 +469,8 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
if (index < fragments.size() - 1) { if (index < fragments.size() - 1) {
vpUpload.setCurrentItem(index + 1, false); vpUpload.setCurrentItem(index + 1, false);
fragments.get(index + 1).onBecameVisible(); fragments.get(index + 1).onBecameVisible();
((LinearLayoutManager) rvThumbnails.getLayoutManager())
.scrollToPositionWithOffset((index > 0) ? index-1 : 0, 0);
} else { } else {
if(defaultKvStore.getInt(COUNTER_OF_CONSECUTIVE_UPLOADS_WITHOUT_COORDINATES, 0) >= 10){ if(defaultKvStore.getInt(COUNTER_OF_CONSECUTIVE_UPLOADS_WITHOUT_COORDINATES, 0) >= 10){
DialogUtil.showAlertDialog(this, DialogUtil.showAlertDialog(this,
@ -490,6 +492,8 @@ public class UploadActivity extends BaseActivity implements UploadContract.View,
if (index != 0) { if (index != 0) {
vpUpload.setCurrentItem(index - 1, true); vpUpload.setCurrentItem(index - 1, true);
fragments.get(index - 1).onBecameVisible(); fragments.get(index - 1).onBecameVisible();
((LinearLayoutManager) rvThumbnails.getLayoutManager())
.scrollToPositionWithOffset((index > 3) ? index-2 : 0, 0);
} }
} }