Skip to content

Subclass of ImageView to create a circle avatar image view with user name initial image view

License

Notifications You must be signed in to change notification settings

xperi/DSAvataImageView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DSAvataImageView

Android Arsenal

Subclass of ImageView to create a circle avatar image view with user name initial image view.

screenshot

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 true
  • app:border_color (color) -> default GRAY
  • app:border_width (dimension) -> default 2dp
  • app:name (String) -> default
  • app:background_color (color) -> default WHITE
  • app: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")

About

Subclass of ImageView to create a circle avatar image view with user name initial image view

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages