https://kotlinlang.org logo
#glance
Title
# glance
t

Tolriq

08/11/2022, 3:16 PM
m

Marcel Pinto

08/22/2022, 9:29 AM
That should be fixed in the latest snapshot. If not let me know
t

Tolriq

08/22/2022, 9:32 AM
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

Marcel Pinto

08/22/2022, 9:36 AM
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

Tolriq

08/22/2022, 9:41 AM
No it does not even with the precise one, the proguard rules are broad due to reflection.
m

Marcel Pinto

08/22/2022, 9:41 AM
ok thanks for confirming
t

Tolriq

08/22/2022, 9:42 AM
I'm maintaining a fork of MediaRouter to vastly reduce APK size, but maintaining a fork of full compose / glance is another story 🙂
m

Marcel Pinto

08/22/2022, 9:43 AM
we will try to provide a solution for next alpha. Thanks for your feedback
t

Tolriq

08/22/2022, 9:49 AM
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

Marcel Pinto

08/22/2022, 9:55 AM
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

Tolriq

08/22/2022, 9:57 AM
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

Marcel Pinto

08/22/2022, 9:59 AM
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

Tolriq

08/22/2022, 10:18 AM
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

Marcel Pinto

08/22/2022, 10:24 AM
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

Tolriq

08/22/2022, 10:41 AM
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

Marcel Pinto

08/22/2022, 11:05 AM
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

Tolriq

08/22/2022, 11:09 AM
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

Marcel Pinto

09/13/2022, 9:31 AM
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

Tolriq

09/13/2022, 9:33 AM
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

Marcel Pinto

09/22/2022, 8:07 AM
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

Tolriq

09/22/2022, 8:12 AM
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

Marcel Pinto

10/11/2022, 9:09 AM
I asked. Not sure why it was added again
t

Tolriq

10/11/2022, 9:10 AM
It was not from blame just a left over from the removal.
6 Views