Skip to content

Commit

Permalink
put circluar image returns
Browse files Browse the repository at this point in the history
  • Loading branch information
innoflash committed Jun 19, 2019
1 parent d4fe105 commit b997a78
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ private void init() {
}

public ImageView getImageView() {
if (circularImage)
return getCircleImageView();
return imageView;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
import net.innoflash.iosview.Constants;
import net.innoflash.iosview.R;

import de.hdodenhof.circleimageview.CircleImageView;

public class ListItemView2 extends RelativeLayout {
private ImageView imageView;
private CircleImageView circleImageView;
private TextView headerTextView;
private TextView contentTextView;
private View line;
Expand Down Expand Up @@ -59,9 +62,12 @@ private void init() {
contentTextView = findViewById(R.id.item_content);
line = findViewById(R.id.line);
imageView = findViewById(R.id.item_icon);
circleImageView = findViewById(R.id.circular_image);
}

public ImageView getImageView() {
if (circularImage)
return getCircleImageView();
return imageView;
}

Expand Down Expand Up @@ -154,5 +160,16 @@ public boolean isCircularImage() {

public void setCircularImage(boolean circularImage) {
this.circularImage = circularImage;
if (circularImage) {
getCircleImageView().setVisibility(VISIBLE);
imageView.setVisibility(GONE);
} else {
getCircleImageView().setVisibility(GONE);
imageView.setVisibility(VISIBLE);
}
}

public CircleImageView getCircleImageView() {
return circleImageView;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ private void init() {
}

public ImageView getImageView() {
if (circularImage)
return getCircleImageView();
return imageView;
}

Expand Down
2 changes: 1 addition & 1 deletion iosview/src/main/res/layout/ios_list_item_1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
android:layout_marginRight="@dimen/margin10"
android:adjustViewBounds="true"
android:padding="@dimen/dimen3"
android:scaleType="fitCenter"
android:scaleType="centerCrop"
android:src="@drawable/square" />

<de.hdodenhof.circleimageview.CircleImageView
Expand Down

0 comments on commit b997a78

Please sign in to comment.