Skip to content

Commit 569c9ed

Browse files
✨ minor code cleanup
1 parent c1d0bef commit 569c9ed

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

carouselpicker/src/main/java/in/goodiebag/carouselpicker/CarouselPicker.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ private void init() {
7373
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
7474

7575
int height = 0;
76-
for(int i = 0; i < getChildCount(); i++) {
76+
for (int i = 0; i < getChildCount(); i++) {
7777
View child = getChildAt(i);
7878
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
7979
int h = child.getMeasuredHeight();
80-
if(h > height) height = h;
80+
if (h > height) height = h;
8181
}
8282

8383
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
@@ -132,8 +132,8 @@ public Object instantiateItem(ViewGroup container, int position) {
132132
iv.setVisibility(GONE);
133133
tv.setVisibility(VISIBLE);
134134
tv.setText(pickerItem.getText());
135-
int textSize = ((TextItem)pickerItem).getTextSize();
136-
if(textSize != 0) {
135+
int textSize = ((TextItem) pickerItem).getTextSize();
136+
if (textSize != 0) {
137137
tv.setTextSize(dpToPx(((TextItem) pickerItem).getTextSize()));
138138
}
139139
}
@@ -153,11 +153,10 @@ public boolean isViewFromObject(View view, Object object) {
153153
return (view == object);
154154
}
155155

156-
private int dpToPx(int dp) {
156+
private int dpToPx(int dp) {
157157
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
158158
return Math.round(dp * (displayMetrics.xdpi / DisplayMetrics.DENSITY_DEFAULT));
159159
}
160-
161160
}
162161

163162
/**
@@ -179,6 +178,7 @@ public interface PickerItem {
179178
public static class TextItem implements PickerItem {
180179
private String text;
181180
private int textSize;
181+
182182
public TextItem(String text, int textSize) {
183183
this.text = text;
184184
this.textSize = textSize;

0 commit comments

Comments
 (0)