[Panlingual] Set focus to the drag list to avoid the overlapping

Bug: 284401644
Test: manual
Change-Id: I6446cacec20398672d2ac675c4e8823e6912dfb9
This commit is contained in:
Zoey Chen
2023-06-08 14:39:49 +00:00
parent 8f3679ab91
commit 9263383b75
4 changed files with 4 additions and 42 deletions

View File

@@ -104,7 +104,6 @@ public class LocaleListEditor extends RestrictedSettingsFragment implements View
addPreferencesFromResource(R.xml.languages);
final Activity activity = getActivity();
activity.setTitle(R.string.language_picker_title);
mLocaleHelperPreferenceController = new LocaleHelperPreferenceController(activity);
final PreferenceScreen screen = getPreferenceScreen();
mLocalePickerPreference = screen.findPreference(KEY_LANGUAGES_PICKER);
@@ -358,12 +357,12 @@ public class LocaleListEditor extends RestrictedSettingsFragment implements View
final LocaleLinearLayoutManager llm = new LocaleLinearLayoutManager(getContext(), mAdapter);
llm.setAutoMeasureEnabled(true);
list.setLayoutManager(llm);
list.setHasFixedSize(true);
list.setNestedScrollingEnabled(false);
mAdapter.setRecyclerView(list);
list.setAdapter(mAdapter);
list.setOnTouchListener(this);
list.requestFocus();
mAddLanguage = layout.findViewById(R.id.add_language);
mAddLanguage.setOnClickListener(new View.OnClickListener() {

View File

@@ -1,37 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.localepicker;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import androidx.recyclerview.widget.RecyclerView;
class LocaleRecyclerView extends RecyclerView {
public LocaleRecyclerView(Context context) {
super(context);
}
public LocaleRecyclerView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public LocaleRecyclerView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
}