Loading api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -1179,6 +1179,7 @@ package android { field public static final deprecated int shownWeekCount = 16843585; // 0x1010341 field public static final int shrinkColumns = 16843082; // 0x101014a field public static final deprecated int singleLine = 16843101; // 0x101015d field public static final int singleLineTitle = 16844127; // 0x101055f field public static final int singleUser = 16843711; // 0x10103bf field public static final int slideEdge = 16843824; // 0x1010430 field public static final int smallIcon = 16843422; // 0x101029e Loading Loading @@ -32028,6 +32029,7 @@ package android.preference { method public boolean isPersistent(); method public boolean isRecycleEnabled(); method public boolean isSelectable(); method public boolean isSingleLineTitle(); method protected void notifyChanged(); method public void notifyDependencyChange(boolean); method protected void notifyHierarchyChanged(); Loading Loading @@ -32069,6 +32071,7 @@ package android.preference { method public void setRecycleEnabled(boolean); method public void setSelectable(boolean); method public void setShouldDisableView(boolean); method public void setSingleLineTitle(boolean); method public void setSummary(java.lang.CharSequence); method public void setSummary(int); method public void setTitle(java.lang.CharSequence); api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -1296,6 +1296,7 @@ package android { field public static final deprecated int shownWeekCount = 16843585; // 0x1010341 field public static final int shrinkColumns = 16843082; // 0x101014a field public static final deprecated int singleLine = 16843101; // 0x101015d field public static final int singleLineTitle = 16844127; // 0x101055f field public static final int singleUser = 16843711; // 0x10103bf field public static final int slideEdge = 16843824; // 0x1010430 field public static final int smallIcon = 16843422; // 0x101029e Loading Loading @@ -34878,6 +34879,7 @@ package android.preference { method public boolean isPersistent(); method public boolean isRecycleEnabled(); method public boolean isSelectable(); method public boolean isSingleLineTitle(); method protected void notifyChanged(); method public void notifyDependencyChange(boolean); method protected void notifyHierarchyChanged(); Loading Loading @@ -34919,6 +34921,7 @@ package android.preference { method public void setRecycleEnabled(boolean); method public void setSelectable(boolean); method public void setShouldDisableView(boolean); method public void setSingleLineTitle(boolean); method public void setSummary(java.lang.CharSequence); method public void setSummary(int); method public void setTitle(java.lang.CharSequence); api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -1179,6 +1179,7 @@ package android { field public static final deprecated int shownWeekCount = 16843585; // 0x1010341 field public static final int shrinkColumns = 16843082; // 0x101014a field public static final deprecated int singleLine = 16843101; // 0x101015d field public static final int singleLineTitle = 16844127; // 0x101055f field public static final int singleUser = 16843711; // 0x10103bf field public static final int slideEdge = 16843824; // 0x1010430 field public static final int smallIcon = 16843422; // 0x101029e Loading Loading @@ -32153,6 +32154,7 @@ package android.preference { method public boolean isPersistent(); method public boolean isRecycleEnabled(); method public boolean isSelectable(); method public boolean isSingleLineTitle(); method protected void notifyChanged(); method public void notifyDependencyChange(boolean); method protected void notifyHierarchyChanged(); Loading Loading @@ -32194,6 +32196,7 @@ package android.preference { method public void setRecycleEnabled(boolean); method public void setSelectable(boolean); method public void setShouldDisableView(boolean); method public void setSingleLineTitle(boolean); method public void setSummary(java.lang.CharSequence); method public void setSummary(int); method public void setTitle(java.lang.CharSequence); core/java/android/preference/Preference.java +28 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ import java.util.Set; * @attr ref android.R.styleable#Preference_defaultValue * @attr ref android.R.styleable#Preference_shouldDisableView * @attr ref android.R.styleable#Preference_recycleEnabled * @attr ref android.R.styleable#Preference_singleLineTitle */ public class Preference implements Comparable<Preference> { /** Loading Loading @@ -133,6 +134,7 @@ public class Preference implements Comparable<Preference> { private boolean mDependencyMet = true; private boolean mParentDependencyMet = true; private boolean mRecycleEnabled = true; private boolean mSingleLineTitle = true; /** * @see #setShouldDisableView(boolean) Loading Loading @@ -296,6 +298,10 @@ public class Preference implements Comparable<Preference> { case com.android.internal.R.styleable.Preference_recycleEnabled: mRecycleEnabled = a.getBoolean(attr, mRecycleEnabled); break; case com.android.internal.R.styleable.Preference_singleLineTitle: mSingleLineTitle = a.getBoolean(attr, mSingleLineTitle); break; } } a.recycle(); Loading Loading @@ -597,6 +603,7 @@ public class Preference implements Comparable<Preference> { if (!TextUtils.isEmpty(title)) { titleView.setText(title); titleView.setVisibility(View.VISIBLE); titleView.setSingleLine(mSingleLineTitle); } else { titleView.setVisibility(View.GONE); } Loading Loading @@ -902,6 +909,27 @@ public class Preference implements Comparable<Preference> { return mRecycleEnabled; } /** * Sets whether to constrain the title of this Preference to a single line instead of * letting it wrap onto multiple lines. * * @param singleLineTitle set {@code true} if the title should be constrained to one line */ public void setSingleLineTitle(boolean singleLineTitle) { mSingleLineTitle = singleLineTitle; notifyChanged(); } /** * Gets whether the title of this preference is constrained to a single line. * * @see #setSingleLineTitle(boolean) * @return {@code true} if the title of this preference is constrained to a single line */ public boolean isSingleLineTitle() { return mSingleLineTitle; } /** * Returns a unique ID for this Preference. This ID should be unique across all * Preference objects in a hierarchy. Loading core/res/res/values/attrs.xml +3 −0 Original line number Diff line number Diff line Loading @@ -7198,6 +7198,9 @@ <!-- Whether the preference has enabled to have its view recycled when used in the list view. This is true by default. --> <attr name="recycleEnabled" format="boolean" /> <!-- Whether to use single line for the preference title text. By default, preference title will be constrained to one line, so the default value of this attribute is true. --> <attr name="singleLineTitle" format="boolean" /> </declare-styleable> <!-- Base attributes available to CheckBoxPreference. --> Loading Loading
api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -1179,6 +1179,7 @@ package android { field public static final deprecated int shownWeekCount = 16843585; // 0x1010341 field public static final int shrinkColumns = 16843082; // 0x101014a field public static final deprecated int singleLine = 16843101; // 0x101015d field public static final int singleLineTitle = 16844127; // 0x101055f field public static final int singleUser = 16843711; // 0x10103bf field public static final int slideEdge = 16843824; // 0x1010430 field public static final int smallIcon = 16843422; // 0x101029e Loading Loading @@ -32028,6 +32029,7 @@ package android.preference { method public boolean isPersistent(); method public boolean isRecycleEnabled(); method public boolean isSelectable(); method public boolean isSingleLineTitle(); method protected void notifyChanged(); method public void notifyDependencyChange(boolean); method protected void notifyHierarchyChanged(); Loading Loading @@ -32069,6 +32071,7 @@ package android.preference { method public void setRecycleEnabled(boolean); method public void setSelectable(boolean); method public void setShouldDisableView(boolean); method public void setSingleLineTitle(boolean); method public void setSummary(java.lang.CharSequence); method public void setSummary(int); method public void setTitle(java.lang.CharSequence);
api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -1296,6 +1296,7 @@ package android { field public static final deprecated int shownWeekCount = 16843585; // 0x1010341 field public static final int shrinkColumns = 16843082; // 0x101014a field public static final deprecated int singleLine = 16843101; // 0x101015d field public static final int singleLineTitle = 16844127; // 0x101055f field public static final int singleUser = 16843711; // 0x10103bf field public static final int slideEdge = 16843824; // 0x1010430 field public static final int smallIcon = 16843422; // 0x101029e Loading Loading @@ -34878,6 +34879,7 @@ package android.preference { method public boolean isPersistent(); method public boolean isRecycleEnabled(); method public boolean isSelectable(); method public boolean isSingleLineTitle(); method protected void notifyChanged(); method public void notifyDependencyChange(boolean); method protected void notifyHierarchyChanged(); Loading Loading @@ -34919,6 +34921,7 @@ package android.preference { method public void setRecycleEnabled(boolean); method public void setSelectable(boolean); method public void setShouldDisableView(boolean); method public void setSingleLineTitle(boolean); method public void setSummary(java.lang.CharSequence); method public void setSummary(int); method public void setTitle(java.lang.CharSequence);
api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -1179,6 +1179,7 @@ package android { field public static final deprecated int shownWeekCount = 16843585; // 0x1010341 field public static final int shrinkColumns = 16843082; // 0x101014a field public static final deprecated int singleLine = 16843101; // 0x101015d field public static final int singleLineTitle = 16844127; // 0x101055f field public static final int singleUser = 16843711; // 0x10103bf field public static final int slideEdge = 16843824; // 0x1010430 field public static final int smallIcon = 16843422; // 0x101029e Loading Loading @@ -32153,6 +32154,7 @@ package android.preference { method public boolean isPersistent(); method public boolean isRecycleEnabled(); method public boolean isSelectable(); method public boolean isSingleLineTitle(); method protected void notifyChanged(); method public void notifyDependencyChange(boolean); method protected void notifyHierarchyChanged(); Loading Loading @@ -32194,6 +32196,7 @@ package android.preference { method public void setRecycleEnabled(boolean); method public void setSelectable(boolean); method public void setShouldDisableView(boolean); method public void setSingleLineTitle(boolean); method public void setSummary(java.lang.CharSequence); method public void setSummary(int); method public void setTitle(java.lang.CharSequence);
core/java/android/preference/Preference.java +28 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ import java.util.Set; * @attr ref android.R.styleable#Preference_defaultValue * @attr ref android.R.styleable#Preference_shouldDisableView * @attr ref android.R.styleable#Preference_recycleEnabled * @attr ref android.R.styleable#Preference_singleLineTitle */ public class Preference implements Comparable<Preference> { /** Loading Loading @@ -133,6 +134,7 @@ public class Preference implements Comparable<Preference> { private boolean mDependencyMet = true; private boolean mParentDependencyMet = true; private boolean mRecycleEnabled = true; private boolean mSingleLineTitle = true; /** * @see #setShouldDisableView(boolean) Loading Loading @@ -296,6 +298,10 @@ public class Preference implements Comparable<Preference> { case com.android.internal.R.styleable.Preference_recycleEnabled: mRecycleEnabled = a.getBoolean(attr, mRecycleEnabled); break; case com.android.internal.R.styleable.Preference_singleLineTitle: mSingleLineTitle = a.getBoolean(attr, mSingleLineTitle); break; } } a.recycle(); Loading Loading @@ -597,6 +603,7 @@ public class Preference implements Comparable<Preference> { if (!TextUtils.isEmpty(title)) { titleView.setText(title); titleView.setVisibility(View.VISIBLE); titleView.setSingleLine(mSingleLineTitle); } else { titleView.setVisibility(View.GONE); } Loading Loading @@ -902,6 +909,27 @@ public class Preference implements Comparable<Preference> { return mRecycleEnabled; } /** * Sets whether to constrain the title of this Preference to a single line instead of * letting it wrap onto multiple lines. * * @param singleLineTitle set {@code true} if the title should be constrained to one line */ public void setSingleLineTitle(boolean singleLineTitle) { mSingleLineTitle = singleLineTitle; notifyChanged(); } /** * Gets whether the title of this preference is constrained to a single line. * * @see #setSingleLineTitle(boolean) * @return {@code true} if the title of this preference is constrained to a single line */ public boolean isSingleLineTitle() { return mSingleLineTitle; } /** * Returns a unique ID for this Preference. This ID should be unique across all * Preference objects in a hierarchy. Loading
core/res/res/values/attrs.xml +3 −0 Original line number Diff line number Diff line Loading @@ -7198,6 +7198,9 @@ <!-- Whether the preference has enabled to have its view recycled when used in the list view. This is true by default. --> <attr name="recycleEnabled" format="boolean" /> <!-- Whether to use single line for the preference title text. By default, preference title will be constrained to one line, so the default value of this attribute is true. --> <attr name="singleLineTitle" format="boolean" /> </declare-styleable> <!-- Base attributes available to CheckBoxPreference. --> Loading