Merge "Fix Spell Checker layout padding"

This commit is contained in:
Fabrice Di Meglio
2014-06-18 23:28:52 +00:00
committed by Android (Google) Code Review
3 changed files with 19 additions and 3 deletions

View File

@@ -18,8 +18,11 @@
android:id="@+id/pref_all" android:id="@+id/pref_all"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:minHeight="?android:attr/listPreferredItemHeight" android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"> android:gravity="center_vertical">
<LinearLayout <LinearLayout
android:id="@+id/pref_left_button" android:id="@+id/pref_left_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -29,12 +32,14 @@
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:background="?android:attr/selectableItemBackground"> android:background="?android:attr/selectableItemBackground">
<RadioButton <RadioButton
android:id="@+id/pref_radio" android:id="@+id/pref_radio"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:clickable="false" android:clickable="false"
android:focusable="false" /> android:focusable="false" />
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -42,6 +47,7 @@
android:layout_marginTop="6dip" android:layout_marginTop="6dip"
android:layout_marginBottom="6dip" android:layout_marginBottom="6dip"
android:layout_weight="1"> android:layout_weight="1">
<TextView <TextView
android:id="@+android:id/title" android:id="@+android:id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -50,6 +56,7 @@
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:ellipsize="marquee" android:ellipsize="marquee"
android:fadingEdge="horizontal" /> android:fadingEdge="horizontal" />
<TextView <TextView
android:id="@android:id/summary" android:id="@android:id/summary"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -61,8 +68,11 @@
android:textSize="13sp" android:textSize="13sp"
android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorSecondary"
android:maxLines="4" /> android:maxLines="4" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/pref_right_button1" android:id="@+id/pref_right_button1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -72,12 +82,14 @@
android:focusable="true" android:focusable="true"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/spellchecker_quick_settings" > android:contentDescription="@string/spellchecker_quick_settings" >
<View <View
android:layout_width="2dip" android:layout_width="2dip"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="5dip" android:layout_marginTop="5dip"
android:layout_marginBottom="5dip" android:layout_marginBottom="5dip"
android:background="@android:drawable/divider_horizontal_dark" /> android:background="@android:drawable/divider_horizontal_dark" />
<ImageView <ImageView
android:layout_width="40dip" android:layout_width="40dip"
android:layout_height="fill_parent" android:layout_height="fill_parent"
@@ -86,7 +98,9 @@
android:src="@drawable/ic_sysbar_quicksettings" android:src="@drawable/ic_sysbar_quicksettings"
android:layout_gravity="center" android:layout_gravity="center"
android:contentDescription="@string/spellchecker_quick_settings" /> android:contentDescription="@string/spellchecker_quick_settings" />
</LinearLayout> </LinearLayout>
<View <View
android:id="@+id/pref_right_separator2" android:id="@+id/pref_right_separator2"
android:layout_width="2dip" android:layout_width="2dip"
@@ -94,6 +108,7 @@
android:layout_marginTop="5dip" android:layout_marginTop="5dip"
android:layout_marginBottom="5dip" android:layout_marginBottom="5dip"
android:background="@android:drawable/divider_horizontal_dark" /> android:background="@android:drawable/divider_horizontal_dark" />
<ImageView <ImageView
android:id="@+id/pref_right_button2" android:id="@+id/pref_right_button2"
android:layout_width="40dip" android:layout_width="40dip"
@@ -106,4 +121,5 @@
android:focusable="true" android:focusable="true"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/spellchecker_language" /> android:contentDescription="@string/spellchecker_language" />
</LinearLayout> </LinearLayout>

View File

@@ -57,8 +57,8 @@ public class SingleSpellCheckerPreference extends Preference {
private Intent mSettingsIntent; private Intent mSettingsIntent;
private boolean mSelected; private boolean mSelected;
public SingleSpellCheckerPreference(SpellCheckersSettings fragment, Intent settingsIntent, public SingleSpellCheckerPreference(SpellCheckersSettings fragment, SpellCheckerInfo sci,
SpellCheckerInfo sci, TextServicesManager tsm) { TextServicesManager tsm) {
super(fragment.getActivity(), null, 0); super(fragment.getActivity(), null, 0);
mFragment = fragment; mFragment = fragment;
mRes = fragment.getActivity().getResources(); mRes = fragment.getActivity().getResources();

View File

@@ -90,7 +90,7 @@ public class SpellCheckersSettings extends SettingsPreferenceFragment
for (int i = 0; i < mEnabledScis.length; ++i) { for (int i = 0; i < mEnabledScis.length; ++i) {
final SpellCheckerInfo sci = mEnabledScis[i]; final SpellCheckerInfo sci = mEnabledScis[i];
final SingleSpellCheckerPreference scPref = new SingleSpellCheckerPreference( final SingleSpellCheckerPreference scPref = new SingleSpellCheckerPreference(
this, null, sci, mTsm); this, sci, mTsm);
mSpellCheckers.add(scPref); mSpellCheckers.add(scPref);
scPref.setTitle(sci.loadLabel(pm)); scPref.setTitle(sci.loadLabel(pm));
scPref.setSelected(mCurrentSci != null && mCurrentSci.getId().equals(sci.getId())); scPref.setSelected(mCurrentSci != null && mCurrentSci.getId().equals(sci.getId()));