i am developing an app where i have to create an xml item in my activity dynamically like circle image view. shown below.
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/p_image"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="@mipmap/ic_launcher"
app:border_width="2dp"
app:border_color="@android:color/white"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp" />
now in my java code i am creating a new instance of it and i want to change the
app:border_width="2dp"
app:border_color="@android:color/white"
how to do that?
CircleImageView imageView = new CircleImageView(mContext);
imageView.border_width="2dp"; //these lines are giving error.
imageView.border_color="@android:color/white"; //these lines are giving error.
imageView.setImageResource(mThumbIds[position]);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
any help will be appriciated thanks :)