summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/inputmethod/KeyboardLayoutPicker.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-04-09 13:24:34 -0700
committerJeff Brown <jeffbrown@google.com>2012-04-10 18:23:59 -0700
commit4397f406a3c9e09ca2d5174ba46328345faa504e (patch)
tree7f4de219d77dff350da5a5aaca931a02f7434038 /src/com/android/settings/inputmethod/KeyboardLayoutPicker.java
parent7939df818209d2e7f468929c28b842b0d6923c51 (diff)
downloadpackages_apps_Settings-4397f406a3c9e09ca2d5174ba46328345faa504e.zip
packages_apps_Settings-4397f406a3c9e09ca2d5174ba46328345faa504e.tar.gz
packages_apps_Settings-4397f406a3c9e09ca2d5174ba46328345faa504e.tar.bz2
Update use of input manager API in settings.
Change-Id: I7aa033df8b5eec69cc6002b0bcc20b1d9902e4e0
Diffstat (limited to 'src/com/android/settings/inputmethod/KeyboardLayoutPicker.java')
-rw-r--r--src/com/android/settings/inputmethod/KeyboardLayoutPicker.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/com/android/settings/inputmethod/KeyboardLayoutPicker.java b/src/com/android/settings/inputmethod/KeyboardLayoutPicker.java
index 472df3a..4cfae56 100644
--- a/src/com/android/settings/inputmethod/KeyboardLayoutPicker.java
+++ b/src/com/android/settings/inputmethod/KeyboardLayoutPicker.java
@@ -24,19 +24,17 @@ import android.content.AsyncTaskLoader;
import android.content.Context;
import android.content.Loader;
import android.hardware.input.InputManager;
-import android.hardware.input.InputManager.KeyboardLayout;
+import android.hardware.input.KeyboardLayout;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ArrayAdapter;
-import android.widget.ListAdapter;
import android.widget.ListView;
-import java.util.Collections;
-import java.util.List;
+import java.util.Arrays;
public class KeyboardLayoutPicker extends ListFragment
- implements LoaderCallbacks<List<KeyboardLayout>> {
+ implements LoaderCallbacks<KeyboardLayout[]> {
private static final String TAG = "KeyboardLayoutPicker";
private String mInputDeviceDescriptor;
@@ -73,46 +71,46 @@ public class KeyboardLayoutPicker extends ListFragment
if (mInputDeviceDescriptor != null) {
KeyboardLayout c = (KeyboardLayout)l.getItemAtPosition(position);
InputManager im = (InputManager)getActivity().getSystemService(Context.INPUT_SERVICE);
- im.setInputDeviceKeyboardLayoutDescriptor(mInputDeviceDescriptor, c.getDescriptor());
+ im.setKeyboardLayoutForInputDevice(mInputDeviceDescriptor, c.getDescriptor());
}
getActivity().finish();
}
@Override
- public Loader<List<KeyboardLayout>> onCreateLoader(int id, Bundle args) {
+ public Loader<KeyboardLayout[]> onCreateLoader(int id, Bundle args) {
return new KeyboardLayoutLoader(getActivity());
}
@Override
- public void onLoadFinished(Loader<List<KeyboardLayout>> loader,
- List<KeyboardLayout> data) {
+ public void onLoadFinished(Loader<KeyboardLayout[]> loader,
+ KeyboardLayout[] data) {
setListAdapter(new KeyboardLayoutAdapter(getActivity(), data));
}
@Override
- public void onLoaderReset(Loader<List<KeyboardLayout>> loader) {
+ public void onLoaderReset(Loader<KeyboardLayout[]> loader) {
setListAdapter(null);
}
private static final class KeyboardLayoutAdapter
extends ArrayAdapter<KeyboardLayout> {
- public KeyboardLayoutAdapter(Context context, List<KeyboardLayout> list) {
+ public KeyboardLayoutAdapter(Context context, KeyboardLayout[] list) {
super(context, android.R.layout.simple_list_item_1, list);
}
}
private static final class KeyboardLayoutLoader
- extends AsyncTaskLoader<List<KeyboardLayout>> {
+ extends AsyncTaskLoader<KeyboardLayout[]> {
public KeyboardLayoutLoader(Context context) {
super(context);
}
@Override
- public List<KeyboardLayout> loadInBackground() {
+ public KeyboardLayout[] loadInBackground() {
InputManager im = (InputManager)getContext().getSystemService(Context.INPUT_SERVICE);
- List<KeyboardLayout> list = im.getKeyboardLayouts();
- Collections.sort(list);
+ KeyboardLayout[] list = im.getKeyboardLayouts();
+ Arrays.sort(list);
return list;
}