Merge "Fix searched item isn't highlighted" am: 363c529dc6

am: 1d07de566d

Change-Id: I908c237db46ffcca743b66dd1c5fa5b0fab17a06
This commit is contained in:
Qi Ding
2016-10-13 01:28:00 +00:00
committed by android-build-merger

View File

@@ -757,14 +757,16 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
super.onBindViewHolder(holder, position);
if (position == mHighlightPosition) {
View v = holder.itemView;
if (v.getBackground() != null) {
final int centerX = v.getWidth() / 2;
final int centerY = v.getHeight() / 2;
v.getBackground().setHotspot(centerX, centerY);
}
v.setPressed(true);
v.setPressed(false);
mHighlightPosition = -1;
v.post(() -> {
if (v.getBackground() != null) {
final int centerX = v.getWidth() / 2;
final int centerY = v.getHeight() / 2;
v.getBackground().setHotspot(centerX, centerY);
}
v.setPressed(true);
v.setPressed(false);
mHighlightPosition = -1;
});
}
}
}