Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider ditching the material dependency from the manifest! #111

Open
zoltish opened this issue Jul 6, 2022 · 4 comments
Open
Labels
bug Something isn't working

Comments

@zoltish
Copy link

zoltish commented Jul 6, 2022

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! :)

@zoltish zoltish added the bug Something isn't working label Jul 6, 2022
@mori-atsushi
Copy link
Owner

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"
        }
    }
}

Details

@yshrsmz
Copy link

yshrsmz commented Jul 7, 2022

Actually, there's a PR for this specific issue; #110

@zoltish
Copy link
Author

zoltish commented Jul 7, 2022

@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.

@mori-atsushi
Copy link
Owner

mori-atsushi commented Jul 13, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants