am 5d9e0a1a: am 99a8e1d2: Merge "More preference item visual adjustments for smaller tablets. DO NOT MERGE" into honeycomb-mr2
* commit '5d9e0a1a867aa5b6162a972288cbef41fd68a29b': More preference item visual adjustments for smaller tablets. DO NOT MERGE
This commit is contained in:
@@ -470,11 +470,15 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis
|
|||||||
|
|
||||||
final View layout = layoutInflater.inflate(mLayoutResId, parent, false);
|
final View layout = layoutInflater.inflate(mLayoutResId, parent, false);
|
||||||
|
|
||||||
|
final ViewGroup widgetFrame = (ViewGroup) layout
|
||||||
|
.findViewById(com.android.internal.R.id.widget_frame);
|
||||||
|
if (widgetFrame != null) {
|
||||||
if (mWidgetLayoutResId != 0) {
|
if (mWidgetLayoutResId != 0) {
|
||||||
final ViewGroup widgetFrame = (ViewGroup)layout.findViewById(com.android.internal.R.id.widget_frame);
|
|
||||||
layoutInflater.inflate(mWidgetLayoutResId, widgetFrame);
|
layoutInflater.inflate(mWidgetLayoutResId, widgetFrame);
|
||||||
|
} else {
|
||||||
|
widgetFrame.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,15 +516,18 @@ public class Preference implements Comparable<Preference>, OnDependencyChangeLis
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImageView imageView = (ImageView) view.findViewById(com.android.internal.R.id.icon);
|
ImageView imageView = (ImageView) view.findViewById(com.android.internal.R.id.icon);
|
||||||
if (imageView != null && (mIconResId != 0 || mIcon != null)) {
|
if (imageView != null) {
|
||||||
|
if (mIconResId != 0 || mIcon != null) {
|
||||||
if (mIcon == null) {
|
if (mIcon == null) {
|
||||||
mIcon = getContext().getResources().getDrawable(mIconResId);
|
mIcon = getContext().getResources().getDrawable(mIconResId);
|
||||||
}
|
}
|
||||||
if (mIcon != null) {
|
if (mIcon != null) {
|
||||||
imageView.setImageDrawable(mIcon);
|
imageView.setImageDrawable(mIcon);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
imageView.setVisibility(mIcon != null ? View.VISIBLE : View.GONE);
|
imageView.setVisibility(mIcon != null ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mShouldDisableView) {
|
if (mShouldDisableView) {
|
||||||
setEnabledStateOnViews(view, isEnabled());
|
setEnabledStateOnViews(view, isEnabled());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,14 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
android:padding="5dip">
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:paddingBottom="8dp"
|
||||||
|
android:paddingRight="16dp">
|
||||||
|
|
||||||
<TextView android:id="@+id/locale"
|
<TextView android:id="@+id/locale"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
/>
|
/>
|
||||||
</LinearLayout >
|
</LinearLayout >
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
|
android:minWidth="48dp"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user