/* * Copyright 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * */ package com.android.healthconnect.controller.onboarding import android.os.Bundle import androidx.activity.enableEdgeToEdge import androidx.activity.viewModels import androidx.fragment.app.FragmentActivity import androidx.navigation.findNavController import com.android.healthconnect.controller.R import com.android.settingslib.widget.SettingsThemeHelper import dagger.hilt.android.AndroidEntryPoint /** * Activity that handles the onboarding flow for connecting apps to Health Connect. It displays a * [ConnectAppsOnboardingFragment] to guide the user through the process. */ @AndroidEntryPoint(FragmentActivity::class) class ConnectAppsOnboardingActivity : Hilt_ConnectAppsOnboardingActivity() { private val viewModel: OnboardingViewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { enableEdgeToEdge() if (SettingsThemeHelper.isExpressiveTheme(this)) { setTheme(R.style.Theme_HealthConnect_Expressive) } super.onCreate(savedInstanceState) setContentView(R.layout.activity_onboarding) } override fun onBackPressed() { val navController = findNavController(R.id.nav_host_fragment) if (!navController.popBackStack()) { finish() } } override fun onNavigateUp(): Boolean { val navController = findNavController(R.id.nav_host_fragment) if (!navController.popBackStack()) { finish() } return true } }