Merge "Fix searched item isn't highlighted"
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user