android / wear-os-samples

Multiple samples showing best practices in app and watch face development on Wear OS.
https://developer.android.com/wear
Apache License 2.0
1.12k stars 572 forks source link

Adds splashscreen for Wear 3 #1028

Closed kul3r4 closed 7 months ago

kul3r4 commented 7 months ago

Add splashscreen for Wear 3 by following guidance from https://developer.android.com/reference/androidx/core/splashscreen/SplashScreen. It adds a theme file and a splashscreen.xml so that we can define sizes (otherwise the icon is too big.) Also adds adaptive icons both for launcher and splashscreen.

kul3r4 commented 7 months ago

@ithinkihaveacat take a look for the addition of the adaptive icons if it looks good. @garanj FYI

kul3r4 commented 7 months ago

@yschimke The issue when not specifying

 android:width="@dimen/splash_screen_icon_size"
        android:height="@dimen/splash_screen_icon_size"

even if you use parent="Theme.SplashScreen.IconBackground", it's that you will get a different icon from the launcher in size. Attaching video. Screen_recording_20240310_210018.webm

Was the suggestion to remove dimens.xml?

yschimke commented 7 months ago

I think we should fix the library to use the correct defaults!

But for now, this is correct.

yschimke commented 7 months ago

Going to land, to play around with. Any further comments in a follow up?

Hope this is ok @kul3r4

yschimke commented 7 months ago

@kul3r4 from https://issuetracker.google.com/issues/256678037 - it seems like the values 72/90 in https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:core/core-splashscreen/src/main/res/values-watch/dimens.xml;l=26 are deliberate.

Should we reopen this issue?