Story Thumbnail is a library designed to assist Android developers in generating a thumbnail for a story. This thumbnail displays an image with stroke/dashes corresponding to the number of stories.
Add the JitPack repository to your project-level build.gradle / settings.gradle file
dependencyResolutionManagement {
repositories {
...
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}Add the dependency to your app-level build.gradle file
dependencies {
...
implementation 'com.github.MohammedShaat:story-thumbnail:1.0.0'
}Just import StoryThumbnail composable function and set it up.
Example
StoryThumbnail(
count = 5,
seen = 3,
content = {
Image(
painter = painterResource(id = R.drawable.profile),
contentDescription = null,
)
},
modifier = Modifier.size(150.dp),
onClick = { },
seenColor = Color.Green,
unSeenColor = Color.Gray,
width = 3.dp,
spacing = 2.dp,
)
| Argument | Description |
|---|---|
| count | Total number of stories |
| seen | Number of seen stories |
| content | Content to display, usually an image |
| modifier | The Modifier to be applied to this element |
| onClick | Will be called when user clicks on the element |
| seenColor | Dash color of seen stories |
| unSeenColor | Dash color of unseen stories |
| width | Width of dashes |
| spacing | Space between dashes |