Merge "Sort keyboard layouts" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
1dde9a3aeb
@@ -83,6 +83,7 @@ public class NewKeyboardLayoutPickerController extends BasePreferenceController
|
||||
mFinalSelectedLayout = mLayout;
|
||||
mKeyboardLayouts = mIm.getKeyboardLayoutListForInputDevice(
|
||||
mInputDeviceIdentifier, mUserId, mInputMethodInfo, mInputMethodSubtype);
|
||||
NewKeyboardSettingsUtils.sortKeyboardLayoutsByLabel(mKeyboardLayouts);
|
||||
parent.getActivity().setTitle(mTitle);
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,8 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.view.inputmethod.InputMethodSubtype;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -123,4 +125,11 @@ public class NewKeyboardSettingsUtils {
|
||||
InputDeviceIdentifier identifier, InputMethodInfo info, InputMethodSubtype subtype) {
|
||||
return inputManager.getKeyboardLayoutForInputDevice(identifier, userId, info, subtype);
|
||||
}
|
||||
|
||||
static void sortKeyboardLayoutsByLabel(KeyboardLayout[] keyboardLayouts) {
|
||||
Arrays.sort(
|
||||
keyboardLayouts,
|
||||
Comparator.comparing(KeyboardLayout::getLabel)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user