For the record <https://issuetracker.google.com/is...
# glance
t
m
That should be fixed in the latest snapshot. If not let me know
t
Thanks yes it's fixed but https://issuetracker.google.com/issues/242214896 is a blocking for me. I hope this can be addressed as the new features with glance widget visible in configuration ui and everything sounds really nice.
m
We are looking into this, unfortunetly Material-components is a single big project but we might look into porting only the colors.
Does
shrinkResources
help reducing the unused resources?
t
No it does not even with the precise one, the proguard rules are broad due to reflection.
m
ok thanks for confirming
t
I'm maintaining a fork of MediaRouter to vastly reduce APK size, but maintaining a fork of full compose / glance is another story 🙂
m
we will try to provide a solution for next alpha. Thanks for your feedback
t
BTW I did not opened an issue, but do you think it's possible via the precise Shrinker to have some rules to reduce the number of layout embedded via Glance?
m
The problem is that would be really error-prone, because you would need to know which layouts your widget is exactly using. I don’t see a way we could do this from the library itself
t
Yes from the library it's hard, but some doc or a way to log something so that we can tweak things. There's hundreds of files and I have no idea what is used where so can't do anything. This is not vital but it would be a nice doc addition.
m
I see. It would be hard to mantain and error-prone, nothing we would recommend. The API is changing rapidly also. Most of these files are needed to generate the different options for attributes that cannot be access via RemoteViews
t
Yes I know but that's really a tons of files and APK size when using 1 simple widget. Anyway I'll look again into that if the transitive issue is possible to solve and when it reach beta status then.
Thanks for answering.
m
Unfortunately, at least for now, that's a price we need to pay due to platform limitations. That being said last time I checked it was just few kb increase
Although it can be more depending on the amount of layout configurations the app uses. Since every new layout configuration will add a new column in the resources.arsc table
t
It's 100-150K of xml + size in the arsc. The widget is single size column/row/image/text very basic for now as I wait a little to see how it evolve before investing more in it.
m
the last time I checked it was several months ago, there was a limitation that required a lot of XML files to solve it, that might have increase it much
t
Well this is not as large as the Mbs from Material transitive so on larger apps it's acceptable trade off.
@Marcel Pinto Thanks for the fix, seeing linked PR https://android-review.googlesource.com/c/platform/frameworks/support/+/2205841/1 this is kinda the same, an app will never have a reason to include both M2 and M3. This is usually handled as different submodules that each have the necessary transitive deps. Like what accompanist do.
m
This one is still a draft. It will probably use compileOnly dependencies since those methods will only be used if the project already has M3
an app will never have a reason to include both M2 and M3
Actually, yes. Currently you probably need both since they are not 1:1
t
Yes I've seen it's a draft, just anticipating as I do not use M2. I'm in prod in a large app with only M3, there's now nearly nothing missing and the few part are easy to copy paste to get.
@Marcel Pinto I know this is a bad question but do you have any idea of when the next Glance release will be out? Playing with all the new cool experimental stuff will be fun but time consuming so I need to plan time for it.
m
I can't really say sorry. We don't have a release train schedule setup for now, but let me ask to the team. With the m3 remove and the proguard fix we should do a release soon.
t
Thanks will pre lock some time in October so.
Thanks for the release. Just in case the team have filters on closed issue the M3 dep is still transitive via https://github.com/androidx/androidx/blob/androidx-main/glance/glance-appwidget/build.gradle#L55 (but can be excluded now)
m
I asked. Not sure why it was added again
t
It was not from blame just a left over from the removal.