Use this Library to show Profile Picture using url or show initial letter of user's name. This Library is Written in Kotlin.
Add Jitpack in Profile level build.gradle file if you don't have.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add Profile Picture View Dependency.
implementation 'com.github.JoshTalks:profile-picture-view:1.0.0'
Action | Code |
---|---|
Pass Image Url using data binding | app:dynamicImageUrl="@{handler.imageUrl}" |
Pass User Name using data binding | app:dynamicUsername="@{handler.username}" |
Change Shape (Rounded is Default) | app:shape |
Change Corner Radius if using Rounded Shape | app:cornerRadius |
Change Name Letters) | app:nameLetters |
Change text color | app:textColor |
Change text size | app:textSize |
Change background color | android:background |
Change scale type | android:scaleType |
Pass User Name without data binding | app:userName="User Name" |
Pass User Name without data binding | app:imageUrl="https://upload.wikimedia.org/wikipedia/commons/b/b7/Josh_Talk_Logo.png" |
Note: All these Attributes can be set or changed programmatically as well.