katalog
katalog copied to clipboard
Please consider ditching the material dependency from the manifest!
What happened?
The library declares android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar"
in its manifest.
Unfortunately this breaks things for projects like mine that dont depend on material at all. Please consider ditching it, if thats viable for you too! :)
Thanks for your report!
What specific problems do you encounter? Android Theme in Preview can be replaced with an extension.
dependencies {
implementation("jp.co.cyberagent.katalog:katalog:`LATEST_VERSION`")
implementation("jp.co.cyberagent.katalog:katalog-androidview:`LATEST_VERSION`")
implementation("jp.co.cyberagent.katalog:katalog-ext-androidtheme:`LATEST_VERSION`")
}
registerKatalog(
title = "Android Sample",
extensions = listOf(
AndroidThemeExt(R.style.MyTheme) // add this line
)
) {
view("Text View") {
TextView(context).apply {
text = "Hello, World"
}
}
}
Actually, there's a PR for this specific issue; #110
@Mori-Atsushi Thank you, that works :)
While on the topic, I saw that appcompat would replace material - is it possible to make both optional? My application is entirely written in compose and Im able to trim the aab/apk size quite massively by removing these libraries. My activity just extends ComponentActivity
.
This is a debug tool, so if you care about app size, it's best not to include it in your production code. You can use it only in debug build or an independent application.