Add payload for condition card to reuse the viewholder
Bug: 30319913 Test: make RunSettingsRoboTests Change-Id: Ib08a301203f4075f0553386f7db1a68d69bde436
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.android.settings.dashboard;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.util.DiffUtil;
|
||||
import android.text.TextUtils;
|
||||
import com.android.settings.dashboard.conditional.Condition;
|
||||
@@ -350,6 +351,15 @@ public class DashboardData {
|
||||
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
|
||||
return mOldItems.get(oldItemPosition).equals(mNewItems.get(newItemPosition));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getChangePayload(int oldItemPosition, int newItemPosition) {
|
||||
if (mOldItems.get(oldItemPosition).type == Item.TYPE_CONDITION_CARD) {
|
||||
return "condition"; // return anything but null to mark the payload
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user