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

Commit 9263383b authored by Zoey Chen's avatar Zoey Chen
Browse files

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

Bug: 284401644
Test: manual
Change-Id: I6446cacec20398672d2ac675c4e8823e6912dfb9
parent 8f3679ab
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,11 +27,11 @@
        android:clipChildren="true"
        android:orientation="vertical">

        <com.android.settings.localepicker.LocaleRecyclerView
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/dragList"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="vertical"/>
            android:scrollbars="none"/>

        <Button
            android:id="@+id/add_language"
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    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
        android:title="@string/desc_introduction_of_language_picker"
+1 −2
Original line number Diff line number Diff line
@@ -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() {
+0 −37
Original line number Diff line number Diff line
/*
 * 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);
    }
}