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

Update Kotlin to 1.6 and Compose to 1.1 #2372

Merged
merged 3 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 10 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.0.4"
kotlinCompilerExtensionVersion = "1.1.1"
}

kotlinOptions {
Expand Down Expand Up @@ -181,15 +181,15 @@ dependencies {
}
"minimalImplementation"("org.chromium.net:cronet-embedded:95.4638.50")

implementation("androidx.compose.animation:animation:1.0.5")
implementation("androidx.compose.compiler:compiler:1.0.5")
implementation("androidx.compose.foundation:foundation:1.0.5")
implementation("androidx.compose.material:material:1.0.5")
implementation("androidx.compose.material:material-icons-core:1.0.5")
implementation("androidx.compose.material:material-icons-extended:1.0.5")
implementation("androidx.compose.runtime:runtime:1.0.5")
implementation("androidx.compose.ui:ui:1.0.5")
implementation("androidx.compose.ui:ui-tooling:1.0.5")
implementation("androidx.compose.animation:animation:1.1.1")
implementation("androidx.compose.compiler:compiler:1.1.1")
implementation("androidx.compose.foundation:foundation:1.1.1")
implementation("androidx.compose.material:material:1.1.1")
implementation("androidx.compose.material:material-icons-core:1.1.1")
implementation("androidx.compose.material:material-icons-extended:1.1.1")
implementation("androidx.compose.runtime:runtime:1.1.1")
implementation("androidx.compose.ui:ui:1.1.1")
implementation("androidx.compose.ui:ui-tooling:1.1.1")
implementation("androidx.activity:activity-compose:1.4.0")
implementation("androidx.navigation:navigation-compose:2.4.0-rc01")
implementation("com.google.android.material:compose-theme-adapter:1.1.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.platform.ComposeView
import androidx.core.content.getSystemService
import androidx.fragment.app.Fragment
Expand All @@ -41,7 +40,6 @@ class MobileAppIntegrationFragment : Fragment() {
private var dialog: AlertDialog? = null
private val viewModel by activityViewModels<OnboardingViewModel>()

@ExperimentalComposeUiApi
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import androidx.compose.ui.unit.dp
import io.homeassistant.companion.android.onboarding.OnboardingViewModel
import io.homeassistant.companion.android.common.R as commonR

@ExperimentalComposeUiApi
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun MobileAppIntegrationView(
onboardingViewModel: OnboardingViewModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.platform.ComposeView
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
Expand All @@ -19,7 +18,6 @@ class ManualSetupFragment : Fragment() {

private val viewModel by activityViewModels<OnboardingViewModel>()

@ExperimentalComposeUiApi
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.compose.ui.unit.dp
import io.homeassistant.companion.android.onboarding.OnboardingViewModel
import io.homeassistant.companion.android.common.R as commonR

@ExperimentalComposeUiApi
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun ManualSetupView(
onboardingViewModel: OnboardingViewModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ import io.homeassistant.companion.android.notifications.MessagingManager
import io.homeassistant.companion.android.settings.SettingsActivity
import io.homeassistant.companion.android.webview.WebViewActivity
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import java.util.concurrent.TimeUnit

@ExperimentalCoroutinesApi
class WebsocketManager(
appContext: Context,
workerParams: WorkerParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ import io.homeassistant.companion.android.util.isStarted
import io.homeassistant.companion.android.websocket.WebsocketManager
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
Expand Down Expand Up @@ -643,7 +642,6 @@ class WebViewActivity : BaseActivity(), io.homeassistant.companion.android.webvi
}
}

@ExperimentalCoroutinesApi
override fun onResume() {
super.onResume()
if ((currentLang != languagesManager.getCurrentLang()) || currentAutoplay != presenter.isAutoPlayVideoEnabled())
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10")
classpath("com.google.gms:google-services:4.3.10")
classpath("com.google.firebase:firebase-appdistribution-gradle:3.0.1")
classpath("de.mannodermaus.gradle.plugins:android-junit5:1.8.2.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import io.homeassistant.companion.android.common.data.websocket.impl.entities.En
import io.homeassistant.companion.android.common.data.websocket.impl.entities.EntityRegistryUpdatedEvent
import io.homeassistant.companion.android.common.data.websocket.impl.entities.GetConfigResponse
import io.homeassistant.companion.android.common.data.websocket.impl.entities.StateChangedEvent
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow

@ExperimentalCoroutinesApi
interface WebSocketRepository {
fun getConnectionState(): WebSocketState?
suspend fun sendPing(): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import kotlinx.coroutines.CancellableContinuation
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.ProducerScope
import kotlinx.coroutines.channels.awaitClose
Expand All @@ -55,7 +54,6 @@ import okio.ByteString
import java.util.concurrent.atomic.AtomicLong
import javax.inject.Inject

@ExperimentalCoroutinesApi
class WebSocketRepositoryImpl @Inject constructor(
private val okHttpClient: OkHttpClient,
private val urlRepository: UrlRepository,
Expand Down
8 changes: 4 additions & 4 deletions wear/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = "1.0.4"
kotlinCompilerExtensionVersion = "1.1.1"
}

compileOptions {
Expand Down Expand Up @@ -111,9 +111,9 @@ dependencies {

implementation("androidx.activity:activity-ktx:1.4.0")
implementation("androidx.activity:activity-compose:1.4.0")
implementation("androidx.compose.compiler:compiler:1.0.5")
implementation("androidx.compose.foundation:foundation:1.0.5")
implementation("androidx.compose.ui:ui-tooling:1.0.5")
implementation("androidx.compose.compiler:compiler:1.1.1")
implementation("androidx.compose.foundation:foundation:1.1.1")
implementation("androidx.compose.ui:ui-tooling:1.1.1")
implementation("androidx.wear.compose:compose-foundation:1.0.0-alpha14")
implementation("androidx.wear.compose:compose-material:1.0.0-alpha14")
implementation("androidx.wear.compose:compose-navigation:1.0.0-alpha14")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import dagger.hilt.android.AndroidEntryPoint
import io.homeassistant.companion.android.home.views.LoadHomePage
import io.homeassistant.companion.android.onboarding.OnboardingActivity
Expand All @@ -33,9 +30,6 @@ class HomeActivity : ComponentActivity(), HomeView {
}
}

@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalWearMaterialApi
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Get rid of me!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package io.homeassistant.companion.android.home.views
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
Expand All @@ -24,7 +23,6 @@ import io.homeassistant.companion.android.theme.WearAppTheme
import io.homeassistant.companion.android.util.getIcon
import io.homeassistant.companion.android.common.R as commonR

@ExperimentalComposeUiApi
@Composable
fun ChooseEntityView(
mainViewModel: MainViewModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
Expand All @@ -33,7 +32,6 @@ import io.homeassistant.companion.android.theme.WearAppTheme
import io.homeassistant.companion.android.util.getColorTemperature
import java.text.DateFormat

@ExperimentalComposeUiApi
@Composable
fun DetailsPanelView(
entity: Entity<*>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@ package io.homeassistant.companion.android.home.views

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.Text
import io.homeassistant.companion.android.common.data.integration.Entity
import io.homeassistant.companion.android.theme.WearAppTheme
import io.homeassistant.companion.android.util.previewEntity1
import io.homeassistant.companion.android.util.previewEntity2
import io.homeassistant.companion.android.common.R as commonR

@ExperimentalComposeUiApi
@Composable
fun EntityViewList(
entityLists: Map<String, List<Entity<*>>>,
Expand Down Expand Up @@ -80,8 +77,6 @@ fun EntityViewList(
}
}

@ExperimentalComposeUiApi
@ExperimentalWearMaterialApi
@Preview
@Composable
private fun PreviewEntityListView() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package io.homeassistant.companion.android.home.views

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -46,9 +44,7 @@ private const val SCREEN_SELECT_TILE_SHORTCUT = "select_tile_shortcut"
private const val SCREEN_SET_TILE_TEMPLATE = "set_tile_template"
private const val SCREEN_SET_TILE_TEMPLATE_REFRESH_INTERVAL = "set_tile_template_refresh_interval"

@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalWearMaterialApi
@OptIn(ExperimentalWearMaterialApi::class)
@Composable
fun LoadHomePage(
mainViewModel: MainViewModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.homeassistant.companion.android.home.views

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
Expand All @@ -11,7 +10,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
Expand All @@ -23,7 +21,6 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.PositionIndicator
import androidx.wear.compose.material.Scaffold
Expand All @@ -40,9 +37,6 @@ import io.homeassistant.companion.android.util.getIcon
import io.homeassistant.companion.android.util.onEntityClickedFeedback
import io.homeassistant.companion.android.common.R as commonR

@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalWearMaterialApi
@Composable
fun MainView(
mainViewModel: MainViewModel,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package io.homeassistant.companion.android.home.views

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.platform.LocalContext
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.PositionIndicator
import androidx.wear.compose.material.Scaffold
import androidx.wear.compose.material.ScalingLazyListState
Expand All @@ -13,10 +10,7 @@ import io.homeassistant.companion.android.common.sensors.SensorManager
import io.homeassistant.companion.android.database.sensor.Sensor
import io.homeassistant.companion.android.theme.WearAppTheme

@ExperimentalAnimationApi
@ExperimentalWearMaterialApi
@Composable
@ExperimentalComposeUiApi
fun SensorManagerUi(
allSensors: List<Sensor>?,
sensorManager: SensorManager,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package io.homeassistant.companion.android.home.views

import androidx.compose.animation.ExperimentalAnimationApi
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.wear.compose.material.Chip
import androidx.wear.compose.material.ChipDefaults
import androidx.wear.compose.material.ExperimentalWearMaterialApi
import androidx.wear.compose.material.PositionIndicator
import androidx.wear.compose.material.Scaffold
import androidx.wear.compose.material.ScalingLazyListState
Expand All @@ -23,9 +20,6 @@ import io.homeassistant.companion.android.sensors.SensorReceiver
import io.homeassistant.companion.android.theme.WearAppTheme
import io.homeassistant.companion.android.common.R as commonR

@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalWearMaterialApi
@Composable
fun SensorsView(
onClickSensorManager: (SensorManager) -> Unit
Expand Down Expand Up @@ -74,9 +68,6 @@ fun getSensorManagers(): List<SensorManager> {
return SensorReceiver.MANAGERS.sortedBy { stringResource(it.name) }.filter { it.hasSensor(LocalContext.current) }
}

@ExperimentalComposeUiApi
@ExperimentalAnimationApi
@ExperimentalWearMaterialApi
@Preview
@Composable
private fun PreviewSensorsView() {
Expand Down
Loading