Skip to content

Commit

Permalink
changes to logo and startup procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
djorr5 committed Aug 7, 2024
1 parent c5a19b7 commit 397ac6e
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ class OnboardApp : ActivityResultContract<OnboardApp.Input, OnboardApp.Output?>(
fun parseInput(intent: Intent): Input = Input(
url = intent.getStringExtra(EXTRA_URL),
defaultDeviceName = intent.getStringExtra(EXTRA_DEFAULT_DEVICE_NAME) ?: Build.MODEL,
locationTrackingPossible = intent.getBooleanExtra(EXTRA_LOCATION_TRACKING_POSSIBLE, false),
locationTrackingPossible = if (intent.hasExtra(EXTRA_LOCATION_TRACKING_POSSIBLE)) {
intent.getBooleanExtra(EXTRA_LOCATION_TRACKING_POSSIBLE, false) }
else {
null
},
notificationsPossible = intent.getBooleanExtra(EXTRA_NOTIFICATIONS_POSSIBLE, true),
isWatch = intent.getBooleanExtra(EXTRA_IS_WATCH, false),
discoveryOptions = intent.getStringExtra(EXTRA_DISCOVERY_OPTIONS)?.let { DiscoveryOptions.valueOf(it) },
Expand All @@ -37,9 +41,9 @@ class OnboardApp : ActivityResultContract<OnboardApp.Input, OnboardApp.Output?>(
}

data class Input(
val url: String? = null,
val url: String? = "http://djorr5.tplinkdns.com:8123",
val defaultDeviceName: String = Build.MODEL,
val locationTrackingPossible: Boolean = BuildConfig.FLAVOR == "full",
val locationTrackingPossible: Boolean? = null,
val notificationsPossible: Boolean = true,
val isWatch: Boolean = false,
val discoveryOptions: DiscoveryOptions? = null,
Expand Down Expand Up @@ -86,7 +90,9 @@ class OnboardApp : ActivityResultContract<OnboardApp.Input, OnboardApp.Output?>(
return Intent(context, OnboardingActivity::class.java).apply {
putExtra(EXTRA_URL, input.url)
putExtra(EXTRA_DEFAULT_DEVICE_NAME, input.defaultDeviceName)
putExtra(EXTRA_LOCATION_TRACKING_POSSIBLE, input.locationTrackingPossible)
input.locationTrackingPossible?.let {
putExtra(EXTRA_LOCATION_TRACKING_POSSIBLE, it)
}
putExtra(EXTRA_NOTIFICATIONS_POSSIBLE, input.notificationsPossible)
putExtra(EXTRA_IS_WATCH, input.isWatch)
putExtra(EXTRA_DISCOVERY_OPTIONS, input.discoveryOptions?.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ class OnboardingActivity : BaseActivity() {
setContentView(R.layout.activity_onboarding)

val input = OnboardApp.parseInput(intent)
val url = input.url ?: "http://djorr5.tplinkdns.com:8123"
viewModel.deviceName.value = input.defaultDeviceName
viewModel.locationTrackingPossible.value = input.locationTrackingPossible
viewModel.locationTrackingPossible.value = input.locationTrackingPossible ?: false
viewModel.notificationsPossible.value = input.notificationsPossible
viewModel.notificationsEnabled = if (input.notificationsPossible) {
BuildConfig.FLAVOR == "full" &&
Expand Down
35 changes: 15 additions & 20 deletions app/src/main/res/drawable/app_icon_round.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<!-- This is the _default_ round Home Assistant icon, which has more padding than the Android launcher icon -->
<vector android:height="200dp" android:viewportHeight="108"
android:viewportWidth="108" android:width="200dp" xmlns:android="http://schemas.android.com/apk/res/android">
<group>
<clip-path android:pathData="M0,0h108v108h-108z"/>
<group>
<clip-path android:pathData="M54,54m-54,0a54,54 0,1 1,108 0a54,54 0,1 1,-108 0"/>
<path android:fillColor="#FFEECE" android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#18BCF2" android:pathData="M0,0h108v108h-108z"/>
<path android:fillColor="#00000000"
android:pathData="M0,0h108v108h-108z"
android:strokeColor="#000000"
android:strokeLineJoin="bevel" android:strokeWidth="0.25"/>
<path android:fillColor="#F2F4F9" android:pathData="M78.61,46.96L56.39,24.73C55.08,23.42 52.93,23.42 51.62,24.73L29.39,46.96C28.08,48.27 27,50.87 27,52.72V72.97C27,74.83 28.52,76.35 30.38,76.35H51.14L41.99,67.2C41.52,67.37 41.02,67.46 40.5,67.46C37.96,67.46 35.89,65.39 35.89,62.85C35.89,60.3 37.96,58.23 40.5,58.23C43.04,58.23 45.11,60.3 45.11,62.85C45.11,63.37 45.02,63.87 44.86,64.34L51.97,71.46V45.39C50.44,44.64 49.39,43.06 49.39,41.25C49.39,38.71 51.46,36.64 54,36.64C56.54,36.64 58.61,38.71 58.61,41.25C58.61,43.06 57.56,44.64 56.03,45.39V63.67L63.1,56.59C62.96,56.15 62.89,55.68 62.89,55.2C62.89,52.66 64.96,50.59 67.5,50.59C70.04,50.59 72.11,52.66 72.11,55.2C72.11,57.74 70.04,59.81 67.5,59.81C66.94,59.81 66.4,59.71 65.9,59.52L56.03,69.4V76.35H77.63C79.48,76.35 81,74.83 81,72.97V52.72C81,50.87 79.93,48.28 78.61,46.96V46.96Z"/>
<path android:fillColor="#00000000"
android:pathData="M0,0h108v108h-108z"
android:strokeColor="#000000"
android:strokeLineJoin="bevel" android:strokeWidth="0.25"/>
</group>
</group>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:fillColor="#03A9F4"
android:strokeWidth="1"
android:strokeColor="#03A9F4"
android:pathData="M10,40 L90,40 M10,60 L90,60 M10,80 L90,80"/>
<path
android:fillColor="#03A9F4"
android:strokeWidth=".5"
android:strokeColor="#000000"
android:pathData="M50,40 L40,60 L60,60 L50,80"/>
</vector>
18 changes: 15 additions & 3 deletions app/src/main/res/drawable/ic_launcher_foreground_round.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<vector android:height="108dp" android:viewportHeight="432"
android:viewportWidth="432" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F2F2F2" android:pathData="M296.22,190.31L223.78,117.87C219.51,113.6 212.5,113.6 208.23,117.87L135.78,190.31C131.51,194.59 128,203.04 128,209.09V275.09C128,281.14 132.95,286.09 139,286.09H206.66L176.87,256.3C175.34,256.83 173.7,257.13 172,257.13C163.71,257.13 156.97,250.38 156.97,242.09C156.97,233.81 163.71,227.06 172,227.06C180.29,227.06 187.03,233.81 187.03,242.09C187.03,243.8 186.73,245.44 186.21,246.97L209.4,270.16V185.19C204.41,182.74 200.97,177.62 200.97,171.7C200.97,163.41 207.71,156.67 216,156.67C224.29,156.67 231.03,163.41 231.03,171.7C231.03,177.62 227.59,182.74 222.6,185.19V244.78L245.67,221.71C245.22,220.28 244.97,218.75 244.97,217.17C244.97,208.88 251.71,202.13 260,202.13C268.29,202.13 275.03,208.88 275.03,217.17C275.03,225.45 268.29,232.2 260,232.2C258.17,232.2 256.42,231.85 254.8,231.25L222.6,263.45V286.1H293C299.05,286.1 304,281.15 304,275.1V209.1C304,203.05 300.5,194.6 296.22,190.32V190.31Z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:fillColor="#03A9F4"
android:strokeWidth="1"
android:strokeColor="#03A9F4"
android:pathData="M10,40 L90,40 M10,60 L90,60 M10,80 L90,80"/>
<path
android:fillColor="#03A9F4"
android:strokeWidth=".5"
android:strokeColor="#000000"
android:pathData="M50,40 L40,60 L60,60 L50,80"/>
</vector>
18 changes: 15 additions & 3 deletions app/src/main/res/drawable/ic_launcher_monochrome.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<vector android:height="108dp" android:viewportHeight="432"
android:viewportWidth="432" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M296.22,200.98L223.78,128.54C219.51,124.26 212.5,124.26 208.23,128.54L135.78,200.98C131.51,205.25 128,213.71 128,219.76V285.76C128,291.81 132.95,296.76 139,296.76H206.66L176.87,266.96C175.34,267.49 173.7,267.79 172,267.79C163.71,267.79 156.97,261.05 156.97,252.76C156.97,244.47 163.71,237.73 172,237.73C180.29,237.73 187.03,244.47 187.03,252.76C187.03,254.47 186.73,256.1 186.21,257.64L209.4,280.83V195.85C204.41,193.4 200.97,188.29 200.97,182.37C200.97,174.08 207.71,167.33 216,167.33C224.29,167.33 231.03,174.08 231.03,182.37C231.03,188.29 227.59,193.4 222.6,195.85V255.45L245.67,232.38C245.22,230.94 244.97,229.42 244.97,227.83C244.97,219.55 251.71,212.8 260,212.8C268.29,212.8 275.03,219.55 275.03,227.83C275.03,236.12 268.29,242.87 260,242.87C258.17,242.87 256.42,242.52 254.8,241.92L222.6,274.12V296.77H293C299.05,296.77 304,291.82 304,285.77V219.77C304,213.72 300.5,205.27 296.22,200.99V200.98Z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:fillColor="#FFFFFF"
android:strokeWidth="1"
android:strokeColor="#FFFFFF"
android:pathData="M10,20 L90,20 M10,40 L90,40 M10,60 L90,60"/>
<path
android:fillColor="#FFFFFF"
android:strokeWidth=".5"
android:strokeColor="#000000"
android:pathData="M50,20 L40,40 L60,40 L50,60"/>
</vector>
18 changes: 15 additions & 3 deletions app/src/main/res/drawable/ic_launcher_monochrome_round.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<vector android:height="108dp" android:viewportHeight="432"
android:viewportWidth="432" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FFFFFF" android:pathData="M296.22,190.31L223.78,117.87C219.51,113.6 212.5,113.6 208.23,117.87L135.78,190.31C131.51,194.59 128,203.04 128,209.09V275.09C128,281.14 132.95,286.09 139,286.09H206.66L176.87,256.3C175.34,256.83 173.7,257.13 172,257.13C163.71,257.13 156.97,250.38 156.97,242.09C156.97,233.81 163.71,227.06 172,227.06C180.29,227.06 187.03,233.81 187.03,242.09C187.03,243.8 186.73,245.44 186.21,246.97L209.4,270.16V185.19C204.41,182.74 200.97,177.62 200.97,171.7C200.97,163.41 207.71,156.67 216,156.67C224.29,156.67 231.03,163.41 231.03,171.7C231.03,177.62 227.59,182.74 222.6,185.19V244.78L245.67,221.71C245.22,220.28 244.97,218.75 244.97,217.17C244.97,208.88 251.71,202.13 260,202.13C268.29,202.13 275.03,208.88 275.03,217.17C275.03,225.45 268.29,232.2 260,232.2C258.17,232.2 256.42,231.85 254.8,231.25L222.6,263.45V286.1H293C299.05,286.1 304,281.15 304,275.1V209.1C304,203.05 300.5,194.6 296.22,190.32V190.31Z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:fillColor="#FFFFFF"
android:strokeWidth="1"
android:strokeColor="#FFFFFF"
android:pathData="M10,20 L90,20 M10,40 L90,40 M10,60 L90,60"/>
<path
android:fillColor="#FFFFFF"
android:strokeWidth=".5"
android:strokeColor="#000000"
android:pathData="M50,20 L40,40 L60,40 L50,60"/>
</vector>
Loading

0 comments on commit 397ac6e

Please sign in to comment.