kieronquinn / monetcompat Goto Github PK
View Code? Open in Web Editor NEWApp-level wallpaper color palette generation for Android 5.0+
License: MIT License
App-level wallpaper color palette generation for Android 5.0+
License: MIT License
MonetCompat
is a singleton that stores its own instance in the INSTANCE
field. The problem is that MonetCompatActivity
creates it by passing itself as context. As a result, when the activity is destroyed, it remains bound to MonetCompat
and cannot be released by the garbage collector.
The MonetCompat
registers the BroadcastReceiver
in the setup
method if running on Android 12 or older versions of Android. The MonetCompatActivity
calls setup
on creation by passing itself to it as context. However, when the activity is destroyed, this BroadcastReceiver
is not unregistered, which leads to activity leakage.
For me, the only way to avoid these leaks is to stop using MonetCompatActivity
and initialize MonetCompat
myself using the application context.
I've manage to get MonetCompat to recreate (almost) 1:1 official Jetpack compose color scheme generation
Both are with the same wallpaper
MaterialTheme3.dynamicLightColorScheme() | MonetCompat |
---|---|
Android 12L | Android 10 |
Here is the implementation https://github.com/rozPierog/Cofi/blob/f8676add8d072d04ecafc082f98a6015cb25c3cc/app/src/main/java/com/omelan/cofi/ui/Theme.kt#L31
I would like to contribute this code to this repo so that everyone can use it easily. Is it okay? Or should I create separate repo and publish it separately.
Took me some time to understand what it's all about, because it's written in an unclear way:
"MonetCompat is an app-level implementation of kdrag0n's custom Monet implementation, used in his android12-extensions module"
It should say that it takes the colors out of wallpapers and be able to apply them inside the app on various Views, no?
I followed the setup guide (enable PaletteCompat in Application, implement custom MonetCompatActivity based on ComponentActivity, using MonetCompatDynamicTheme) but I'm getting this error when trying to run my application
java.lang.NoSuchMethodError: No static method MonetCompatDynamicTheme(Lcom/kieronquinn/monetcompat/core/MonetCompat;Lkotlin/jvm/functions/Function2;Landroidx/compose/runtime/Composer;I)V in class Lcom/kieronquinn/monetcompat/compose/MonetCompatThemeKt; or its super classes (declaration of 'com.kieronquinn.monetcompat.compose.MonetCompatThemeKt' appears in /data/app/~~W4-GVauu1KbA2jmEvOaszg==/com.owenlejeune.tvtime-GXupWNu-YmGy4Ey1Pr3eLw==/base.apk!classes13.dex)
I tried enabling Multidex but that didn't solve the issue either.
I noticed that these 2 like to show conflict and not sync. Is there a way for MonetCompat to play nice with Repainter or is it just a conflict issue.
I'm currently using a wallpaper change listener I forked from pixel launcher in my launcher app project, is this basically the same thing but... works?
How to use in Java?
Some inconvenience to download lib
This error may be reported if the project is used by default. I also read your setup, you seem to forget to say to want to put the com. Google. Android. The above material upgrade for 1.5.0. The default now seems to be 1.4.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.