Breens-Mbaka / Jetpack-Compose-Tables

🐝 A Compose UI data table library which allows developers to seamless integrate visually appealing and customizable tables to their Android apps or IOS apps.
169 stars 14 forks source link

isMinifyEnabled #17

Closed persian1910 closed 1 month ago

persian1910 commented 1 month ago

hi and thanks for it. when i use isMinifyEnabled tables not working please add documants for how use it when isMinifyEnabled is true thanks..

Breens-Mbaka commented 1 month ago

Hey @persian1910 we are looking into this issue, we will get back to you as soon as possible.

Breens-Mbaka commented 1 month ago

Hey @persian1910 so the issue is that when minification is enabled it removes the table data class at build time that's why the table is empty.

To prevent this, annotate your data class with @Keep to prevent minification marking the class as unused and removing it.

For example, if you are displaying a list of users in a table and you have a class that holds the name, age and city for example.

@Keep data class MyData( val name: String, val age: Int, val city: String )

This will fix the issue of the table not appearing if you have minification enabled. Please let me know immediately if this helps.

etonotieno commented 1 month ago

You could also add a proguard rule to keep the class in your proguard-rules.pro file. It's convenient if you have all your models in one package.

-keep class com.example.modelpackage.*

Breens-Mbaka commented 1 month ago

Closing this since option to solve this has been suggested