Tweak ime settings

Bug: 5282046
Change-Id: I8ef3913fc46c00288ac13fbc2a2d447efd531382
This commit is contained in:
satok
2011-09-13 14:46:56 +09:00
parent c6df12c1ee
commit 88b75f740a
2 changed files with 17 additions and 4 deletions

View File

@@ -56,10 +56,12 @@
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignLeft="@android:id/title"
android:paddingBottom="3dip"
android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="13sp"
android:textColor="?android:attr/textColorSecondary"
android:background="?android:attr/selectableItemBackground"
android:maxLines="4" />
</RelativeLayout>
</LinearLayout>

View File

@@ -97,7 +97,19 @@ public class InputMethodPreference extends CheckBoxPreference
});
mInputMethodSettingsButton = (ImageView)view.findViewById(R.id.inputmethod_settings);
mTitleText = (TextView)view.findViewById(android.R.id.title);
final boolean hasSubtypes = mImi.getSubtypeCount() > 1;
final String imiId = mImi.getId();
mSummaryText = (TextView)view.findViewById(android.R.id.summary);
mSummaryText.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
final Bundle bundle = new Bundle();
bundle.putString(Settings.EXTRA_INPUT_METHOD_ID, imiId);
startFragment(mFragment, InputMethodAndSubtypeEnabler.class.getName(),
0, bundle);
}
});
if (mSettingsIntent != null) {
mInputMethodSettingsButton.setOnClickListener(
new OnClickListener() {
@@ -113,8 +125,6 @@ public class InputMethodPreference extends CheckBoxPreference
}
});
}
final boolean hasSubtypes = mImi.getSubtypeCount() > 1;
final String imiId = mImi.getId();
if (hasSubtypes) {
final OnLongClickListener listener = new OnLongClickListener() {
@Override
@@ -142,8 +152,8 @@ public class InputMethodPreference extends CheckBoxPreference
}
private void enableSettingsButton() {
final boolean checked = isChecked();
if (mInputMethodSettingsButton != null) {
final boolean checked = isChecked();
mInputMethodSettingsButton.setEnabled(checked);
mInputMethodSettingsButton.setClickable(checked);
mInputMethodSettingsButton.setFocusable(checked);
@@ -155,7 +165,8 @@ public class InputMethodPreference extends CheckBoxPreference
mTitleText.setEnabled(true);
}
if (mSummaryText != null) {
mSummaryText.setEnabled(true);
mSummaryText.setEnabled(checked);
mSummaryText.setClickable(checked);
}
}