Skip to content
Group avatar image
Kotlin
Branch: master
Clone or download
mariohany and MarioHany update readme
Latest commit ea0454a Feb 6, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
IKGroupAvatar fix default value issue Feb 6, 2020
example fix 0 limit issue Feb 6, 2020
gradle/wrapper Initial commit Feb 5, 2020
.gitignore Initial commit Feb 5, 2020
LICENSE Initial commit Feb 5, 2020
README.md update readme Feb 9, 2020
build.gradle Initial commit Feb 5, 2020
full_list.png fix 0 limit issue Feb 6, 2020
gradle.properties Initial commit Feb 5, 2020
gradlew Initial commit Feb 5, 2020
gradlew.bat Initial commit Feb 5, 2020
limited_list.png fix 0 limit issue Feb 6, 2020
settings.gradle Initial commit Feb 5, 2020

README.md

IKGroupAvatar

License: MIT MinSdk: 19 write: Kotlin Release

limited_list full_list

How to integrate the library in your app?

Step 1: Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
    implementation 'com.github.iken.tech:IKGroupAvatarView:0.1'
    implementation "androidx.recyclerview:recyclerview:1.1.0"
}

Step 3. Add IKGroupAvatarView to your layout file

 <iken.tech.ikgroupAvatar.IKGroupAvatarView
        android:id="@+id/avatars_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:item_limit="3"
        app:display_remaining_items="true"
        app:avatar_border_size="2dp"
        app:avatar_size="50dp"
        app:avatar_margin="-16"
        app:avatar_border_color="@color/colorAccent"
        app:remain_color="@color/colorPrimary"
        app:remain_count_text_color="@android:color/black"
        app:remain_count_text_size="24"
        app:avatar_placeholder="@drawable/ic_launcher_background"/>

Step 4. Pass your data source to IKGroupAvatarView

 val mIKGroupAvatarView = findViewById<IKGroupAvatarView>(R.id.avatars_list)

 val list = mutableListOf<Any>()                  // you can pass URI, URL, Drawable
 list.add(R.drawable.ic_launcher_background)
 list.add("https://avatarfiles.alphacoders.com/668/66833.jpg")
 list.add("https://avatarfiles.alphacoders.com/668/66833.jpg")
 list.add("https://avatarfiles.alphacoders.com/668/66833.jpg")
 list.add("https://avatarfiles.alphacoders.com/668/66833.jpg")
 list.add("https://avatarfiles.alphacoders.com/668/66833.jpg")
 list.add("https://avatarfiles.alphacoders.com/668/66833.jpg")

 mIKGroupAvatarView.dataSource = list

Xml view Attributes

Attribute Functionality defult Value
item_limit disblay limited items 0
display_remaining_items dispaly remaining items view false
avatar_border_size avatar border size 0
avatar_size avatar circle size 38dp
avatar_margin space between each avatar -16
avatar_border_color avatar border color #0000000
remain_color remaining items circle color #d3d3d3
remain_count_text_color remaining items count text color #0000000
remain_count_text_size remaining items count text size 18
avatar_placeholder avatar place holder while avatar's loading finish R.drawable.avatar_placeholder

License

IKGroupAvatar is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.