mirror of
https://github.com/home-assistant/android
synced 2024-09-06 17:23:32 +00:00
Minor update to Auto(motive) login screen (#3647)
This commit is contained in:
parent
482414f62a
commit
8bf32b30e9
|
@ -5,6 +5,7 @@ import android.content.pm.PackageManager
|
||||||
import androidx.car.app.CarContext
|
import androidx.car.app.CarContext
|
||||||
import androidx.car.app.Screen
|
import androidx.car.app.Screen
|
||||||
import androidx.car.app.model.Action
|
import androidx.car.app.model.Action
|
||||||
|
import androidx.car.app.model.CarIcon
|
||||||
import androidx.car.app.model.MessageTemplate
|
import androidx.car.app.model.MessageTemplate
|
||||||
import androidx.car.app.model.ParkedOnlyOnClickListener
|
import androidx.car.app.model.ParkedOnlyOnClickListener
|
||||||
import androidx.car.app.model.Template
|
import androidx.car.app.model.Template
|
||||||
|
@ -42,17 +43,17 @@ class LoginScreen(context: CarContext, val serverManager: ServerManager) : Scree
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onGetTemplate(): Template {
|
override fun onGetTemplate(): Template {
|
||||||
return MessageTemplate.Builder(carContext.getString(R.string.aa_app_not_logged_in))
|
return MessageTemplate.Builder(carContext.getString(R.string.welcome_hass))
|
||||||
.setTitle(carContext.getString(R.string.app_name))
|
.setIcon(CarIcon.APP_ICON)
|
||||||
.setHeaderAction(Action.APP_ICON)
|
|
||||||
.addAction(
|
.addAction(
|
||||||
Action.Builder()
|
Action.Builder()
|
||||||
.setTitle(carContext.getString(R.string.login))
|
.setTitle(carContext.getString(if (isAutomotive) R.string.login else R.string.login_on_phone))
|
||||||
.setOnClickListener(
|
.setOnClickListener(
|
||||||
ParkedOnlyOnClickListener.create {
|
ParkedOnlyOnClickListener.create {
|
||||||
startNativeActivity()
|
startNativeActivity()
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
.setFlags(Action.FLAG_PRIMARY)
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
.build()
|
.build()
|
||||||
|
|
|
@ -342,6 +342,7 @@
|
||||||
<string name="logbook">Logbook</string>
|
<string name="logbook">Logbook</string>
|
||||||
<string name="logged_in">Logged in</string>
|
<string name="logged_in">Logged in</string>
|
||||||
<string name="login">Login</string>
|
<string name="login">Login</string>
|
||||||
|
<string name="login_on_phone">Login on your phone</string>
|
||||||
<string name="login_wear_os_device">Login Wear OS Device</string>
|
<string name="login_wear_os_device">Login Wear OS Device</string>
|
||||||
<string name="logout">Logout</string>
|
<string name="logout">Logout</string>
|
||||||
<string name="lovelace_view_dashboard">Dashboard View or Dashboard</string>
|
<string name="lovelace_view_dashboard">Dashboard View or Dashboard</string>
|
||||||
|
|
Loading…
Reference in a new issue