Merge "Fix unexpected highlight" am: e763da5884 am: 6e347e61ca am: b03d666b47

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1490657

Change-Id: I60dbfab818b97007025b1a295d1c8d157320279a
This commit is contained in:
Treehugger Robot
2020-11-25 11:05:55 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 2 deletions

View File

@@ -23,7 +23,6 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
@@ -114,7 +113,9 @@ public class HighlightablePreferenceGroupAdapter extends PreferenceGroupAdapter
@VisibleForTesting
void updateBackground(PreferenceViewHolder holder, int position) {
View v = holder.itemView;
if (position == mHighlightPosition) {
if (position == mHighlightPosition
&& (mHighlightKey != null
&& TextUtils.equals(mHighlightKey, getItem(position).getKey()))) {
// This position should be highlighted. If it's highlighted before - skip animation.
addHighlightBackground(v, !mFadeInAnimated);
} else if (Boolean.TRUE.equals(v.getTag(R.id.preference_highlighted))) {