Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab242020 authored by Kevin Lim's avatar Kevin Lim Committed by Android (Google) Code Review
Browse files

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

parents 3baa1e09 a8ada531
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -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);
                }
            });
        }
    }
}