Skip to content

TalbotGooday/AvatarView

Repository files navigation

AvatarView

License

A simple AvatarView based on the AppCompatImageView.

Getting started

Add to your root build.gradle:

allprojects {
	repositories {
	    ...
	    maven { url "https://jitpack.io" }
	}
}

Add the dependency:

dependencies {
      implementation 'com.github.TalbotGooday:AvatarView:x.x.x'
}

Code example

Settle the AvatarView somewhere in your XML like this:

<com.goodayapps.widget.AvatarView
	android:id="@+id/avatarView"
	android:layout_width="@dimen/avatar_size"
	android:layout_height="@dimen/avatar_size"
	android:src="drawable"
	app:avBackgroundColor="color|reference"
	app:avBorderColor="color|reference"
	app:avBorderColorSecondary="color|reference"
	app:avBorderWidth="dimension"
	app:avVolumetricType="none|all|drawable|placeholder"
	app:avAvatarMargin="dimension"
	app:avTextSizePercentage="float"
	app:iconDrawableScale="float"
	app:placeholderText="string" />

TODO

  • Animated border
  • Border progress
  • Online indicator
  • Border arches better logic

License

This project is licensed under the MIT License - see the LICENSE file for details