diff --git a/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationActivity.kt b/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationActivity.kt index 6b5898ad0ec..b84943f12b3 100755 --- a/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationActivity.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationActivity.kt @@ -17,6 +17,7 @@ import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.lifecycle.lifecycleScope import dagger.hilt.android.AndroidEntryPoint import io.homeassistant.companion.android.conversation.views.LoadAssistView +import io.homeassistant.companion.android.home.HomeActivity import kotlinx.coroutines.launch @AndroidEntryPoint @@ -53,6 +54,9 @@ class ConversationActivity : ComponentActivity() { val launchIntent = conversationViewModel.onCreate(hasRecordingPermission()) if (launchIntent) { launchVoiceInputIntent() + } else if (!conversationViewModel.isRegistered()) { + startActivity(HomeActivity.newInstance(this@ConversationActivity)) + finish() } } diff --git a/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationViewModel.kt b/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationViewModel.kt index 46e6812c222..ba3dc57b497 100755 --- a/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationViewModel.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/conversation/ConversationViewModel.kt @@ -129,6 +129,8 @@ class ConversationViewModel @Inject constructor( return false } + fun isRegistered(): Boolean = serverManager.isRegistered() + override fun getInput(): AssistInputMode = inputMode override fun setInput(inputMode: AssistInputMode) { diff --git a/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt b/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt index 82123693199..fc1e83c6a30 100755 --- a/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt +++ b/wear/src/main/java/io/homeassistant/companion/android/conversation/views/ConversationView.kt @@ -121,7 +121,7 @@ fun ConversationResultView( val scrollState = rememberScalingLazyListState() LaunchedEffect(conversation.size) { scrollState.scrollToItem( - if (inputMode != AssistViewModelBase.AssistInputMode.BLOCKED) conversation.size else (conversation.size - 1) + if (inputMode != AssistViewModelBase.AssistInputMode.BLOCKED) (conversation.size + 1) else conversation.size ) } if (hapticFeedback) { @@ -135,6 +135,9 @@ fun ConversationResultView( } ThemeLazyColumn(state = scrollState) { + item { + Spacer(Modifier.size(1.dp)) // This exists to allow the next item to be centered + } item { if (currentPipeline != null) { val textColor = LocalContentColor.current.copy(alpha = 0.38f) // disabled/hint alpha