mirror of
https://github.com/home-assistant/android
synced 2024-09-06 17:23:32 +00:00
Hide native mode UI from automotive play store builds (#3612)
* Hide native mode UI from automotive play store builds * Remove launch transition * Simply automotive check
This commit is contained in:
parent
edf6ba5b9f
commit
c75b315d81
|
@ -1,5 +1,7 @@
|
|||
package io.homeassistant.companion.android.launch
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.activity.compose.setContent
|
||||
|
@ -81,7 +83,15 @@ class LaunchActivity : AppCompatActivity(), LaunchView {
|
|||
override fun displayWebview() {
|
||||
presenter.setSessionExpireMillis(0)
|
||||
|
||||
startActivity(WebViewActivity.newInstance(this, intent.data?.path))
|
||||
if (packageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE) && BuildConfig.FLAVOR == "full") {
|
||||
val carIntent = Intent(
|
||||
this,
|
||||
Class.forName("androidx.car.app.activity.CarAppActivity")
|
||||
).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
startActivity(carIntent)
|
||||
} else {
|
||||
startActivity(WebViewActivity.newInstance(this, intent.data?.path))
|
||||
}
|
||||
finish()
|
||||
overridePendingTransition(0, 0) // Disable activity start/stop animation
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.mikepenz.iconics.IconicsDrawable
|
|||
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
|
||||
import com.mikepenz.iconics.utils.sizeDp
|
||||
import com.mikepenz.iconics.utils.toAndroidIconCompat
|
||||
import io.homeassistant.companion.android.BuildConfig
|
||||
import io.homeassistant.companion.android.common.data.authentication.SessionState
|
||||
import io.homeassistant.companion.android.common.data.integration.Entity
|
||||
import io.homeassistant.companion.android.common.data.integration.domain
|
||||
|
@ -242,7 +243,7 @@ class MainVehicleScreen(
|
|||
return ListTemplate.Builder().apply {
|
||||
setTitle(carContext.getString(commonR.string.app_name))
|
||||
setHeaderAction(Action.APP_ICON)
|
||||
if (isAutomotive && !iDrivingOptimized) {
|
||||
if (isAutomotive && !iDrivingOptimized && BuildConfig.FLAVOR != "full") {
|
||||
setActionStrip(
|
||||
ActionStrip.Builder().addAction(
|
||||
Action.Builder()
|
||||
|
|
Loading…
Reference in a new issue