Skip to content

Commit

Permalink
Update splash screen icon to match style/size of frontend (#4937)
Browse files Browse the repository at this point in the history
- Use the same style and size of icon on the splash screen as the frontend to make the transition smoother
 - Also update onboarding screen with the same icon
 - Don't set splash screen icon as placeholder in camera/media player widgets as they are not visible anyway
  • Loading branch information
jpelgrom authored Dec 27, 2024
1 parent cef0ff7 commit 622a0b5
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ fun WelcomeView(
) {
OnboardingScreen(Modifier.verticalScroll(rememberScrollState())) {
Image(
painter = painterResource(id = R.drawable.app_icon_round),
painter = painterResource(id = R.drawable.app_icon_launch),
contentDescription = stringResource(
id = commonR.string.app_name
),
modifier = Modifier
.size(width = 274.dp, height = 202.dp)
.padding(bottom = 16.dp)
.size(width = 112.dp, height = 148.dp)
.padding(bottom = 32.dp)
)
Text(
fontSize = 19.sp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ class CameraWidget : AppWidgetProvider() {
if (widget != null) {
setViewVisibility(R.id.widgetCameraError, if (widgetCameraError) View.VISIBLE else View.GONE)
if (url == null) {
setImageViewResource(
R.id.widgetCameraImage,
R.drawable.app_icon_round
)
setViewVisibility(
R.id.widgetCameraPlaceholder,
View.VISIBLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,6 @@ class MediaPlayerControlsWidget : BaseWidgetProvider() {
val baseUrl = serverManager.getServer(widget.serverId)?.connection?.getUrl().toString().removeSuffix("/")
val url = if (entityPictureUrl?.startsWith("http") == true) entityPictureUrl else "$baseUrl$entityPictureUrl"
if (entityPictureUrl == null) {
setImageViewResource(
R.id.widgetMediaImage,
R.drawable.app_icon_round
)
setViewVisibility(
R.id.widgetMediaPlaceholder,
View.VISIBLE
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/drawable-v26/launch_screen_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorLaunchScreenBackground" />

<item android:width="170dp"
android:height="170dp"
<item android:width="112dp"
android:height="112dp"
android:gravity="center"
android:drawable="@drawable/app_icon_round">
android:drawable="@drawable/app_icon_launch">
</item>
</layer-list>
13 changes: 13 additions & 0 deletions app/src/main/res/drawable-v31/app_icon_launch_screen.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- 112 dp icon on a 288dp canvas -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="288dp"
android:height="288dp"
android:viewportWidth="288"
android:viewportHeight="288">
<path
android:pathData="M200,192.89C200,194.75 199.26,196.53 197.95,197.84C196.64,199.15 194.86,199.89 193,199.89H95C93.14,199.89 91.36,199.15 90.05,197.84C88.74,196.53 88,194.75 88,192.89V150.89C88,147.04 90.23,141.66 92.95,138.94L139.05,92.84C141.77,90.12 146.23,90.12 148.95,92.84L195.05,138.94C197.77,141.66 200,147.04 200,150.89V192.89L200,192.89Z"
android:fillColor="#18BCF2"/>
<path
android:pathData="M138.06,199.89L119.1,180.93C118.1,181.27 117.06,181.45 116,181.46C110.73,181.46 106.43,177.16 106.43,171.89C106.43,166.61 110.73,162.32 116,162.32C121.27,162.32 125.57,166.61 125.57,171.89C125.57,172.94 125.39,173.99 125.04,174.99L139.8,189.75V135.68C136.63,134.12 134.43,130.86 134.43,127.09C134.43,121.82 138.73,117.53 144,117.53C149.27,117.53 153.57,121.82 153.57,127.09C153.57,130.86 151.37,134.12 148.2,135.68V173.6L162.88,158.92C162.59,157.99 162.43,157.01 162.43,156.03C162.43,150.76 166.73,146.46 172,146.46C177.27,146.46 181.57,150.75 181.57,156.03C181.57,161.3 177.27,165.6 172,165.6C170.87,165.59 169.75,165.39 168.69,164.99L148.2,185.48V199.89L138.06,199.89Z"
android:fillColor="#F2F4F9"/>
</vector>
12 changes: 12 additions & 0 deletions app/src/main/res/drawable/app_icon_launch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="120dp"
android:height="120dp"
android:viewportWidth="120"
android:viewportHeight="120">
<path
android:pathData="M120,112.38a7.5,7.5 0,0 1,-7.5 7.5H7.5a7.5,7.5 0,0 1,-7.5 -7.5v-45c0,-4.13 2.38,-9.88 5.3,-12.81l49.39,-49.39c2.91,-2.91 7.69,-2.91 10.6,0l49.4,49.4c2.91,2.91 5.3,8.68 5.3,12.81v45z"
android:fillColor="#18BCF2"/>
<path
android:pathData="M53.63,119.88 L33.32,99.57c-1.04,0.36 -2.16,0.56 -3.32,0.56 -5.65,0 -10.25,-4.6 -10.25,-10.25s4.6,-10.25 10.25,-10.25 10.25,4.6 10.25,10.25c0,1.16 -0.2,2.28 -0.56,3.33L55.5,109.02v-57.94c-3.4,-1.67 -5.75,-5.16 -5.75,-9.19 0,-5.65 4.6,-10.25 10.25,-10.25s10.25,4.6 10.25,10.25c0,4.03 -2.35,7.53 -5.75,9.19v40.63l15.73,-15.73c-0.31,-0.98 -0.48,-2.02 -0.48,-3.1 0,-5.65 4.6,-10.25 10.25,-10.25s10.25,4.6 10.25,10.25 -4.6,10.25 -10.25,10.25c-1.25,0 -2.44,-0.23 -3.55,-0.64L64.5,104.45v15.44z"
android:fillColor="#F2F4F9"/>
</vector>
21 changes: 0 additions & 21 deletions app/src/main/res/drawable/app_icon_round.xml

This file was deleted.

3 changes: 2 additions & 1 deletion app/src/main/res/values-v31/styles.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- We don't inherit Theme.LaunchScreen.Base anymore, because on API 31+ (Anrdoid 12) the system draws the launch screen background -->
<!-- We don't inherit Theme.LaunchScreen.Base anymore, because on API 31+ (Android 12) the system draws the launch screen background -->
<!-- It is only allowed to change the color and a few other things -->
<style name="Theme.LaunchScreen" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:colorBackground">@color/colorLaunchScreenBackground</item>
<item name="android:statusBarColor">@color/colorLaunchScreenBackground</item>
<item name="android:navigationBarColor">@color/colorLaunchScreenBackground</item>
<item name="alertDialogTheme">@style/Theme.HomeAssistant.Dialog.Alert.Launch</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/app_icon_launch_screen</item>
</style>

<style name="Theme.HomeAssistant.DynamicColorWidget">
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
app:enableCopying="true" />
<Preference
android:key="version"
android:icon="@drawable/app_icon_round"
android:icon="@drawable/ic_stat_ic_notification_blue"
android:title="@string/application_version"
android:summary="1.0.0 (1)"/>
<Preference
Expand Down

0 comments on commit 622a0b5

Please sign in to comment.