Merge "Hide dismissal swipe background before slice gets ready" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-07 15:34:24 +00:00
committed by Android (Google) Code Review
3 changed files with 31 additions and 1 deletions

View File

@@ -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()) {