Merge "[Panlingual] Set focus to the drag list to avoid the overlapping" into udc-qpr-dev am: 593028ca32 am: db4bede383

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

Change-Id: Ia07c39769f77ed05dab029a8cedf57f1008402ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Zoey Chen
2023-06-09 06:34:21 +00:00
committed by Automerger Merge Worker
4 changed files with 4 additions and 42 deletions

View File

@@ -27,11 +27,11 @@
android:clipChildren="true" android:clipChildren="true"
android:orientation="vertical"> android:orientation="vertical">
<com.android.settings.localepicker.LocaleRecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/dragList" android:id="@+id/dragList"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scrollbars="vertical"/> android:scrollbars="none"/>
<Button <Button
android:id="@+id/add_language" android:id="@+id/add_language"

View File

@@ -18,7 +18,7 @@
<PreferenceScreen <PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto" xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/language_settings"> android:title="@string/language_picker_title">
<com.android.settingslib.widget.TopIntroPreference <com.android.settingslib.widget.TopIntroPreference
android:title="@string/desc_introduction_of_language_picker" android:title="@string/desc_introduction_of_language_picker"

View File

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