Android: Reinstate code with previous album-switch bug
This commit is contained in:
parent
de5be5e3ad
commit
b4cbdd4b1a
|
@ -308,15 +308,11 @@ public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.AbsViewH
|
|||
@Override
|
||||
public void run() {
|
||||
if (!view.isComputingLayout()) {
|
||||
// TODO revisit this sequence
|
||||
if (Math.min(preCount, postCount) > 0) {
|
||||
notifyItemRangeChanged(0, Math.min(preCount, postCount));
|
||||
}
|
||||
|
||||
if (postCount > preCount) {
|
||||
notifyItemRangeInserted(preCount, postCount - preCount);
|
||||
} else if (postCount < preCount) {
|
||||
notifyItemRangeRemoved(postCount, preCount - postCount);
|
||||
if (preCount == 0) {
|
||||
notifyItemRangeInserted(0, postCount);
|
||||
} else {
|
||||
view.swapAdapter(GalleryAdapter.this, true);
|
||||
view.getLayoutManager().requestLayout();
|
||||
}
|
||||
} else {
|
||||
view.postDelayed(new Runnable() {
|
||||
|
|
Loading…
Reference in New Issue