DSAvataImageView
Subclass of ImageView to create a circle avatar image view with user name initial image view.
Usage
###XML (Use Circle avatar image view)
<com.xperi.avataimageview.DSAvatarImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:src="@drawable/image"
app:border_color="#EEEEEE"
app:border_width="5dp"
/>
###XML (Use user name initial view) output 'SJ'
<com.xperi.avataimageview.DSAvatarImageView
android:layout_width="250dp"
android:layout_height="250dp"
app:border_color="#EEEEEE"
app:border_width="5dp"
app:name="steve jobs"
app:background_color="@android:color/white"
app:text_color="@android:color/black"
/>
You may use the following properties in your XML to customize your DSAvataImageView.
#####Properties:
app:border
(boolean) -> default trueapp:border_color
(color) -> default GRAYapp:border_width
(dimension) -> default 2dpapp:name
(String) -> defaultapp:background_color
(color) -> default WHITEapp:text_color
(color) -> default GRAY ###JAVA (Use Circle avatar image view)
DSAvatarImageView avataImageView=getView(convertView, R.id.circularIv);
avataImageView.setBorderColor(getResources().getColor(R.color.GrayLight));
avataImageView.setBorderWidth(10);
avataImageView.setImageResource(R.id.sample);
###JAVA (Use user name initial view) output 'SJ'
DSAvatarImageView avataImageView=getView(convertView, R.id.circularIv);
avataImageView.setBorderColor(getResources().getColor(R.color.GrayLight));
avataImageView.setName("steve jobs")