Skip to content

Commit 0b45876

Browse files
authored
Merge pull request #6 from Breens-Mbaka/develop
Add ability to enable or disable table headers
2 parents 2fd386b + 60b7cc6 commit 0b45876

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

BeeTablesCompose/build.gradle.kts

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ android {
4040
}
4141
}
4242
compileOptions {
43-
sourceCompatibility = JavaVersion.VERSION_17
44-
targetCompatibility = JavaVersion.VERSION_17
43+
sourceCompatibility = JavaVersion.VERSION_1_8
44+
targetCompatibility = JavaVersion.VERSION_1_8
4545
}
4646
kotlinOptions {
47-
jvmTarget = "17"
47+
jvmTarget = "1.8"
4848
}
4949
buildFeatures {
5050
compose = true

BeeTablesCompose/src/main/java/com/breens/beetablescompose/BeeTablesCompose.kt

+11-7
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import com.breens.beetablescompose.utils.extractMembers
3535
* 🐝 A Compose UI data table library.
3636
*
3737
* @param data The list of data items to display in the table.
38+
* @param enableTableHeaderTitles show or hide the table header titles. If not set, by default the table header titles will be shown.
3839
* @param headerTableTitles The list of header titles to display at the top of the table.
3940
* @param headerTitlesBorderColor The color of the border for the header titles, by default it will be [Color.LightGray].
4041
* @param headerTitlesBorderWidth The width of the border for the header titles in DP, by default it will be "0.4.dp".
@@ -50,6 +51,7 @@ import com.breens.beetablescompose.utils.extractMembers
5051
@Composable
5152
inline fun <reified T : Any> BeeTablesCompose(
5253
data: List<T>,
54+
enableTableHeaderTitles: Boolean = true,
5355
headerTableTitles: List<String>,
5456
headerTitlesBorderColor: Color = Color.LightGray,
5557
headerTitlesBorderWidth: Dp = 0.4.dp,
@@ -64,13 +66,15 @@ inline fun <reified T : Any> BeeTablesCompose(
6466
) {
6567
Card(elevation = CardDefaults.cardElevation(defaultElevation = tableElevation)) {
6668
Column(modifier = Modifier.clip(shape = shape)) {
67-
TableHeaderComponent(
68-
headerTableTitles = headerTableTitles,
69-
headerTitlesBorderColor = headerTitlesBorderColor,
70-
headerTitlesBorderWidth = headerTitlesBorderWidth,
71-
headerTitlesTextStyle = headerTitlesTextStyle,
72-
headerTitlesBackGroundColor = headerTitlesBackGroundColor,
73-
)
69+
if (enableTableHeaderTitles) {
70+
TableHeaderComponent(
71+
headerTableTitles = headerTableTitles,
72+
headerTitlesBorderColor = headerTitlesBorderColor,
73+
headerTitlesBorderWidth = headerTitlesBorderWidth,
74+
headerTitlesTextStyle = headerTitlesTextStyle,
75+
headerTitlesBackGroundColor = headerTitlesBackGroundColor,
76+
)
77+
}
7478

7579
data.forEachIndexed { index, data ->
7680
val rowData = extractMembers(data).map {

README.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,20 @@
3838

3939
To use the BeeTablesCompose library, follow these steps:
4040

41+
- Add this to either your **project build.gradle** file or **setting.gradle**, depending with what version of Android Studio you are using;
42+
43+
```gradle
44+
repositories {
45+
...
46+
maven(url = "https://jitpack.io")
47+
}
48+
```
49+
4150
- Add the dependency: Include the library in your project's dependencies;
4251

4352
```gradle
4453
dependencies {
45-
implementation("com.github.Breens-Mbaka:BeeTablesCompose:1.0.2")
54+
implementation("com.github.Breens-Mbaka:BeeTablesCompose:1.0.3")
4655
}
4756
```
4857

@@ -57,7 +66,7 @@ dependencies {
5766
titles as parameters to generate the data table.
5867

5968
<p align="center">
60-
<img src="https://github.com/Breens-Mbaka/AnimeFollowKMM/assets/72180010/42f7fab4-cfe4-4236-968c-4a6eda006b0f" />
69+
<img src="https://github.com/Breens-Mbaka/BeeTablesCompose/assets/72180010/f5ea94a1-df41-472c-91e2-03d6cb7dc82f" />
6170

6271
# Want a new shiny feature 🪩✨
6372
- If you want to request a new feature please first read this [short guide](https://github.com/Breens-Mbaka/BeeTablesCompose/blob/master/.github/ISSUE_TEMPLATE/feature_request.md)

jitpack.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
jdk:
2-
- openjdk17
2+
- openjdk11
33
before_install:
44
- ./scripts/prepareJitpackEnvironment.sh

0 commit comments

Comments
 (0)