Merge "[Settings] Remove logic to restore highlight to 0th item in SettingsActivity." into main

This commit is contained in:
Kevin Lim authored and Android (Google) Code Review committed 2023-11-03 18:12:09 +00:00
commit ab242020a2
1 file changed
-13
@@ -18,7 +18,6 @@ package com.android.launcher3.settings;
import static android.provider.Settings.Global.DEVELOPMENT_SETTINGS_ENABLED;
import static androidx.core.view.accessibility.AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS;
import static androidx.preference.PreferenceFragmentCompat.ARG_PREFERENCE_ROOT;
import static com.android.launcher3.BuildConfig.IS_DEBUG_DEVICE;
@@ -34,7 +33,6 @@ import android.text.TextUtils;
import android.view.MenuItem;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
import androidx.core.view.WindowCompat;
@@ -290,8 +288,6 @@ public class SettingsActivity extends FragmentActivity
if (highlighter != null) {
getView().postDelayed(highlighter, DELAY_HIGHLIGHT_DURATION_MILLIS);
mPreferenceHighlighted = true;
} else {
requestAccessibilityFocus(getListView());
}
}
@@ -350,14 +346,5 @@ public class SettingsActivity extends FragmentActivity
list, position, screen.findPreference(mHighLightKey))
: null;
}
private void requestAccessibilityFocus(@NonNull final RecyclerView rv) {
rv.post(() -> {
if (!rv.hasFocus() && rv.getChildCount() > 0) {
rv.getChildAt(0)
.performAccessibilityAction(ACTION_ACCESSIBILITY_FOCUS, null);
}
});
}
}
}