Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor update to Auto(motive) login screen #3647

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.pm.PackageManager
import androidx.car.app.CarContext
import androidx.car.app.Screen
import androidx.car.app.model.Action
import androidx.car.app.model.CarIcon
import androidx.car.app.model.MessageTemplate
import androidx.car.app.model.ParkedOnlyOnClickListener
import androidx.car.app.model.Template
Expand Down Expand Up @@ -42,17 +43,17 @@ class LoginScreen(context: CarContext, val serverManager: ServerManager) : Scree
}

override fun onGetTemplate(): Template {
return MessageTemplate.Builder(carContext.getString(R.string.aa_app_not_logged_in))
.setTitle(carContext.getString(R.string.app_name))
.setHeaderAction(Action.APP_ICON)
return MessageTemplate.Builder(carContext.getString(R.string.welcome_hass))
.setIcon(CarIcon.APP_ICON)
.addAction(
Action.Builder()
.setTitle(carContext.getString(R.string.login))
.setTitle(carContext.getString(if (isAutomotive) R.string.login else R.string.login_on_phone))
.setOnClickListener(
ParkedOnlyOnClickListener.create {
startNativeActivity()
}
)
.setFlags(Action.FLAG_PRIMARY)
.build()
)
.build()
Expand Down
1 change: 1 addition & 0 deletions common/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
<string name="logbook">Logbook</string>
<string name="logged_in">Logged in</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="logout">Logout</string>
<string name="lovelace_view_dashboard">Dashboard View or Dashboard</string>
Expand Down