@@ -73,11 +73,11 @@ private void init() {
73
73
protected void onMeasure (int widthMeasureSpec , int heightMeasureSpec ) {
74
74
75
75
int height = 0 ;
76
- for (int i = 0 ; i < getChildCount (); i ++) {
76
+ for (int i = 0 ; i < getChildCount (); i ++) {
77
77
View child = getChildAt (i );
78
78
child .measure (widthMeasureSpec , MeasureSpec .makeMeasureSpec (0 , MeasureSpec .UNSPECIFIED ));
79
79
int h = child .getMeasuredHeight ();
80
- if (h > height ) height = h ;
80
+ if (h > height ) height = h ;
81
81
}
82
82
83
83
heightMeasureSpec = MeasureSpec .makeMeasureSpec (height , MeasureSpec .EXACTLY );
@@ -132,8 +132,8 @@ public Object instantiateItem(ViewGroup container, int position) {
132
132
iv .setVisibility (GONE );
133
133
tv .setVisibility (VISIBLE );
134
134
tv .setText (pickerItem .getText ());
135
- int textSize = ((TextItem )pickerItem ).getTextSize ();
136
- if (textSize != 0 ) {
135
+ int textSize = ((TextItem ) pickerItem ).getTextSize ();
136
+ if (textSize != 0 ) {
137
137
tv .setTextSize (dpToPx (((TextItem ) pickerItem ).getTextSize ()));
138
138
}
139
139
}
@@ -153,11 +153,10 @@ public boolean isViewFromObject(View view, Object object) {
153
153
return (view == object );
154
154
}
155
155
156
- private int dpToPx (int dp ) {
156
+ private int dpToPx (int dp ) {
157
157
DisplayMetrics displayMetrics = context .getResources ().getDisplayMetrics ();
158
158
return Math .round (dp * (displayMetrics .xdpi / DisplayMetrics .DENSITY_DEFAULT ));
159
159
}
160
-
161
160
}
162
161
163
162
/**
@@ -179,6 +178,7 @@ public interface PickerItem {
179
178
public static class TextItem implements PickerItem {
180
179
private String text ;
181
180
private int textSize ;
181
+
182
182
public TextItem (String text , int textSize ) {
183
183
this .text = text ;
184
184
this .textSize = textSize ;
0 commit comments