From 2b4414ce21cef8aca55b840708d97dd1f4bff3d8 Mon Sep 17 00:00:00 2001 From: marazmarci Date: Sun, 23 Jul 2023 07:41:32 +0200 Subject: [PATCH] Fix more ktlint errors --- .../homeassistant/companion/android/home/views/HomeView.kt | 6 +++--- .../companion/android/home/views/SelectShortcutsTileView.kt | 2 +- .../companion/android/home/views/SetShortcutsTileView.kt | 6 +----- .../integration/MobileAppIntegrationPresenterImpl.kt | 2 +- .../companion/android/phone/PhoneSettingsListener.kt | 2 +- .../companion/android/tiles/BaseShortcutsTile.kt | 2 +- 6 files changed, 8 insertions(+), 12 deletions(-) diff --git a/wear/src/main/java/io/homeassistant/companion/android/home/views/HomeView.kt b/wear/src/main/java/io/homeassistant/companion/android/home/views/HomeView.kt index 8bce040e4ce..bcaee7dba91 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/home/views/HomeView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/home/views/HomeView.kt @@ -181,7 +181,7 @@ fun LoadHomePage( navArgument(name = ARG_SCREEN_SHORTCUTS_TILE_ID) { type = NavType.StringType } - ), + ) ) { backStackEntry -> val shortcutsTileId = backStackEntry.arguments!!.getString(ARG_SCREEN_SHORTCUTS_TILE_ID)!!.let { @@ -202,8 +202,8 @@ fun LoadHomePage( }, navArgument(name = ARG_SCREEN_SHORTCUTS_TILE_ENTITY_INDEX) { type = NavType.IntType - }, - ), + } + ) ) { backStackEntry -> val entityIndex = backStackEntry.arguments!!.getInt(ARG_SCREEN_SHORTCUTS_TILE_ENTITY_INDEX) val shortcutsTileId = diff --git a/wear/src/main/java/io/homeassistant/companion/android/home/views/SelectShortcutsTileView.kt b/wear/src/main/java/io/homeassistant/companion/android/home/views/SelectShortcutsTileView.kt index 8150b3ec501..5eefaefaf1e 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/home/views/SelectShortcutsTileView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/home/views/SelectShortcutsTileView.kt @@ -118,7 +118,7 @@ private fun PreviewSelectShortcutsTileView() { shortcutTileEntitiesCountById = mapOf( ShortcutsTileId.SHORTCUTS_TILE_1 to 7, ShortcutsTileId.SHORTCUTS_TILE_2 to 1, - ShortcutsTileId.SHORTCUTS_TILE_3 to 0, + ShortcutsTileId.SHORTCUTS_TILE_3 to 0 ), onSelectShortcutsTile = {}, isShowShortcutTextEnabled = true, diff --git a/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt b/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt index 426c7dc0a89..373dba0f44b 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/home/views/SetShortcutsTileView.kt @@ -16,18 +16,14 @@ import androidx.wear.compose.material.Button import androidx.wear.compose.material.ButtonDefaults import androidx.wear.compose.material.Chip import androidx.wear.compose.material.ChipDefaults -import androidx.wear.compose.material.Icon import androidx.wear.compose.material.PositionIndicator import androidx.wear.compose.material.Scaffold import androidx.wear.compose.material.Text -import androidx.wear.compose.material.ToggleChip -import androidx.wear.compose.material.ToggleChipDefaults import androidx.wear.compose.material.rememberScalingLazyListState import com.mikepenz.iconics.compose.Image import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial import io.homeassistant.companion.android.data.SimplifiedEntity import io.homeassistant.companion.android.theme.WearAppTheme -import io.homeassistant.companion.android.theme.wearColorPalette import io.homeassistant.companion.android.util.getIcon import io.homeassistant.companion.android.util.simplifiedEntity import io.homeassistant.companion.android.views.ListHeader @@ -37,7 +33,7 @@ import io.homeassistant.companion.android.common.R as commonR @Composable fun SetShortcutsTileView( shortcutEntities: List, - onShortcutEntitySelectionChange: (Int) -> Unit, + onShortcutEntitySelectionChange: (Int) -> Unit ) { val scalingLazyListState = rememberScalingLazyListState() WearAppTheme { diff --git a/wear/src/main/java/io/homeassistant/companion/android/onboarding/integration/MobileAppIntegrationPresenterImpl.kt b/wear/src/main/java/io/homeassistant/companion/android/onboarding/integration/MobileAppIntegrationPresenterImpl.kt index 1a4ce4826ca..2496c2105ee 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/onboarding/integration/MobileAppIntegrationPresenterImpl.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/onboarding/integration/MobileAppIntegrationPresenterImpl.kt @@ -8,8 +8,8 @@ import io.homeassistant.companion.android.BuildConfig import io.homeassistant.companion.android.common.data.integration.DeviceRegistration import io.homeassistant.companion.android.common.data.servers.ServerManager import io.homeassistant.companion.android.onboarding.getMessagingToken -import io.homeassistant.companion.android.tiles.ConversationTile import io.homeassistant.companion.android.tiles.BaseShortcutsTile +import io.homeassistant.companion.android.tiles.ConversationTile import io.homeassistant.companion.android.tiles.TemplateTile import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers diff --git a/wear/src/main/java/io/homeassistant/companion/android/phone/PhoneSettingsListener.kt b/wear/src/main/java/io/homeassistant/companion/android/phone/PhoneSettingsListener.kt index 4740451c116..76a26211d9b 100755 --- a/wear/src/main/java/io/homeassistant/companion/android/phone/PhoneSettingsListener.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/phone/PhoneSettingsListener.kt @@ -32,8 +32,8 @@ import io.homeassistant.companion.android.database.wear.replaceAll import io.homeassistant.companion.android.home.HomeActivity import io.homeassistant.companion.android.home.HomePresenterImpl import io.homeassistant.companion.android.onboarding.getMessagingToken -import io.homeassistant.companion.android.tiles.ConversationTile import io.homeassistant.companion.android.tiles.BaseShortcutsTile +import io.homeassistant.companion.android.tiles.ConversationTile import io.homeassistant.companion.android.tiles.TemplateTile import io.homeassistant.companion.android.util.UrlUtil import kotlinx.coroutines.CoroutineScope diff --git a/wear/src/main/java/io/homeassistant/companion/android/tiles/BaseShortcutsTile.kt b/wear/src/main/java/io/homeassistant/companion/android/tiles/BaseShortcutsTile.kt index 1bbee4d701d..0ade716a1c5 100644 --- a/wear/src/main/java/io/homeassistant/companion/android/tiles/BaseShortcutsTile.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/tiles/BaseShortcutsTile.kt @@ -261,7 +261,7 @@ abstract class BaseShortcutsTile( .build() companion object { - private fun ShortcutsTileId.getTileServiceClass() = when(this) { + private fun ShortcutsTileId.getTileServiceClass() = when (this) { ShortcutsTileId.SHORTCUTS_TILE_1 -> ShortcutsTile::class ShortcutsTileId.SHORTCUTS_TILE_2 -> ShortcutsTile2::class ShortcutsTileId.SHORTCUTS_TILE_3 -> ShortcutsTile3::class