Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Sample code for use without kotlin #38

Closed
bmbariah opened this issue Jun 22, 2018 · 5 comments
Closed

Sample code for use without kotlin #38

bmbariah opened this issue Jun 22, 2018 · 5 comments

Comments

@bmbariah
Copy link

Is is possible to use this without having to use kotlin? just Java
Kindly share some sample code on the README.
I tried some Kotlin decompiling but it didn't work

@garretyoder
Copy link
Owner

This will compile work and function in a java project perfectly fine, infact the API will be the same, you just won't have access to optional arguments is all. If you're having issue with a specific api endpoint in Java, then I'd be happy to help.

@bmbariah
Copy link
Author

For starters, I'm using this on my root Application class for initialization
Defaults defaults = new Defaults( ThemeColor.BLUE, ThemeColor.YELLOW, true, true, 0); initColorful(this, defaults);

but can't figure out what code to use to actually change color in my Activity color. Kindly assist

@garretyoder
Copy link
Owner

Read up on the wiki, it goes over how to do this. The api in Java is almost identical. Kotlin is a JVM language. you need to call initColorful.

Setting colors at runtime is also covered in the wiki.

Colorful().edit()
        .setPrimaryColor(ThemeColor.RED)
        .setAccentColor(ThemeColor.BLUE)
        .setDarkTheme(true)
        .setTranslucent(true)
        .apply(context:Context)

The only difference in java will be the ending ;.

@bmbariah
Copy link
Author

Thanks. The callback was giving me errors so i set it to null.

@Naguchennai
Copy link

how you fixed that callback problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants