imagecard
README.md
Image Card
The image card contains multiple card variants that all include a large image element in addition to texts and icons. Image cards work as buttons. The whole card is clickable. Overall Accessibility: Image cards have one focus point. The image is always ignored by screen readers.
Typed of Image Card
- OVS Appointment Card: This image card contain title, doctor speciality both get truncated after 2 lines. Also there is a image on the left side which s disabled for screen readers. The image card has information about the appointment date and time and also photo upload.
- Feed Card: This image card contain image, category, title and description. User can provide image resource id or any composable to load image. Truncation of text is as follows: Category - After 1 line, title - After 2 lines, description - After 4 lines.
- Course Card Yuble: This image card contain image, star ratings, title, description and addresses. User can provide image resource id or any composable to load image. Truncation of text is as follows: start ratings - After 1 line, title - After 2 lines, description - After 4 lines - Addresses.
- Course Card Queo: This image card contain image, title, rounder button, addresses, date and time . User can provide image resource id or any composable to load image. Truncation of text is as follows: title - After 1 line, rounder button - After 1 line, addresses - After 2 lines - date - After 1 line - time.
- Course Card: This image card contain image, title and description . User can provide image resource id or any composable to load image. Truncation of text is as follows: title - After 2 line, description.
- GoalsOverView Card: This image card contain image, bubble image, title and union button. User can provide image resource id or any composable to load image. Truncation of text is as follows: title - After 1 line, button.
- Magazine Card: This image card contain image, title and description. The component user can provide image resource id or any composable to load image. Truncation of text is as follows: title - After 1 line, description after 4 lines of description.
- Event Card: This image card contain image, title, description, location and date. User can provide image resource id or any composable to load image. Truncation of text is as follows: title - After 2 lines, description - After 4 lines.
Features:
- Able to pass different types of image card.
- Dynamic styling the text content
- Able to pass image composable so image from url can also be displayed in card along with drawables.
How to use Image Card
-
Add the necessary imports:
import your.package.name.OCImageCard
-
Create Image Card composable of your choice by choosing your desired image Card Type and pass the required model
OCOVSAppointmentImageCard
OCImageCard(
modifier = Modifier.wrapContentHeight(),
imageCardType = OCOVSAppointmentImageCard,
oCImageCardModel = OCOVSAppointmentModel(
title = "Dr. med. Wolfgang Gast",
doctorsSpeciality = "Hals-Nasen-Ohrenheilkunde",
appointmentTime = "09:10 Uhr",
appointmentDate = "Mittwoch, 12.12.2023",
photoUpload = "Bitte Fotos hochladen",
image = R.drawable.image_card_placeholder_image
),
onClick = {
println("Hello I am Image Card")
}
)
OCFeedImageCard
OCImageCard(
modifier = Modifier.wrapContentHeight(),
imageCardType = OCFeedImageCard,
oCImageCardModel = OCFeedModel(
title = "Title",
category = "Category",
description = "Teasertext goes here in maximum of four lines. Cut off (after number of characters/words, when line ends?) with three dots.",
imageResId = R.drawable.image_card_placeholder,
),
onClick = {
println("Hello I am Image Card With Multi Line")
},
)
OCCourseImageCardYuble
OCImageCard(
modifier = Modifier.wrapContentHeight(),
imageCardType = OCCourseImageCard,
oCImageCardModel = OCCourseModel(
courseModel = OCCourseYubleModelItemData(
imageResId = R.drawable.image_card_placeholder,
title = "Very long Title Lorem ipsum dolor sit amet at, sed diam voluptua.",
description = "Very long Teaser Text. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat",
ratings = 3.5f,
address = arrayListOf("Address 1", "Address 2")
)
),
onClick = {
println("Hello I am Image Card With Multi Line")
},
)
OCCourseImageCardQueo
OCImageCard(
modifier = Modifier.wrapContentHeight(),
imageCardType = OCCourseImageCard,
oCImageCardModel = OCCourseModel(
courseModel = OCCourseQueoModelItemData(
imageResId = R.drawable.image_card_placeholder,
title = "Very long Title Lorem ipsum dolor sit amet at, sed diam voluptua.",
description = "Label",
address = arrayListOf("Address 1", "Address 2"),
date = "Date 1",
time = "Time"
)
),
onClick = {
println("Hello I am Image Card With Multi Line")
},
)