Hide dismissal swipe background before slice gets ready
Only make swipe background visible once slice has a successfual binding. Bug: 131843256 Test: robotests Change-Id: I7866873a217e8ca882634a48108939022713c87b
This commit is contained in:
@@ -110,7 +110,10 @@ public class SliceContextualCardRenderer implements ContextualCardRenderer, Life
|
||||
mSliceLiveDataMap.put(uri, sliceLiveData);
|
||||
}
|
||||
|
||||
final View swipeBackground = holder.itemView.findViewById(R.id.dismissal_swipe_background);
|
||||
sliceLiveData.removeObservers(mLifecycleOwner);
|
||||
// set the background to Gone in case the holder is reused.
|
||||
swipeBackground.setVisibility(View.GONE);
|
||||
sliceLiveData.observe(mLifecycleOwner, slice -> {
|
||||
if (slice == null) {
|
||||
Log.w(TAG, "Slice is null");
|
||||
@@ -137,6 +140,8 @@ public class SliceContextualCardRenderer implements ContextualCardRenderer, Life
|
||||
default:
|
||||
mFullCardHelper.bindView(holder, card, slice);
|
||||
}
|
||||
|
||||
swipeBackground.setVisibility(View.VISIBLE);
|
||||
});
|
||||
|
||||
switch (holder.getItemViewType()) {
|
||||
|
Reference in New Issue
Block a user