Roll android_tools support library to 25.1.0
[android_tools.git] / sdk / sources / android-23 / com / android / inputmethodcommon / InputMethodSettingsFragment.java
blob49f0b87f1dc7f3556791d52ef9576a2b007ac92f
1 /*
2 * Copyright (C) 2011 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.android.inputmethodcommon;
19 import android.content.Context;
20 import android.graphics.drawable.Drawable;
21 import android.os.Bundle;
22 import android.preference.PreferenceFragment;
24 /**
25 * This is a helper class for an IME's settings preference fragment. It's recommended for every
26 * IME to have its own settings preference fragment which inherits this class.
28 public abstract class InputMethodSettingsFragment extends PreferenceFragment
29 implements InputMethodSettingsInterface {
30 private final InputMethodSettingsImpl mSettings = new InputMethodSettingsImpl();
31 @Override
32 public void onCreate(Bundle savedInstanceState) {
33 super.onCreate(savedInstanceState);
34 final Context context = getActivity();
35 setPreferenceScreen(getPreferenceManager().createPreferenceScreen(context));
36 mSettings.init(context, getPreferenceScreen());
39 /**
40 * {@inheritDoc}
42 @Override
43 public void setInputMethodSettingsCategoryTitle(int resId) {
44 mSettings.setInputMethodSettingsCategoryTitle(resId);
47 /**
48 * {@inheritDoc}
50 @Override
51 public void setInputMethodSettingsCategoryTitle(CharSequence title) {
52 mSettings.setInputMethodSettingsCategoryTitle(title);
55 /**
56 * {@inheritDoc}
58 @Override
59 public void setSubtypeEnablerTitle(int resId) {
60 mSettings.setSubtypeEnablerTitle(resId);
63 /**
64 * {@inheritDoc}
66 @Override
67 public void setSubtypeEnablerTitle(CharSequence title) {
68 mSettings.setSubtypeEnablerTitle(title);
71 /**
72 * {@inheritDoc}
74 @Override
75 public void setSubtypeEnablerIcon(int resId) {
76 mSettings.setSubtypeEnablerIcon(resId);
79 /**
80 * {@inheritDoc}
82 @Override
83 public void setSubtypeEnablerIcon(Drawable drawable) {
84 mSettings.setSubtypeEnablerIcon(drawable);
87 /**
88 * {@inheritDoc}
90 @Override
91 public void onResume() {
92 super.onResume();
93 mSettings.updateSubtypeEnabler();