Remove InterestItem state

Change-Id: I5d4fddb9fb36a40ae9864edfa6eb4850d8f8d306
pull/145/head
Tomáš Mlynarič 3 years ago
parent 1ac3b4d90c
commit 24a876d4d8

@ -16,16 +16,11 @@
package com.google.samples.apps.nowinandroid.core.ui
import android.view.View
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalView
import androidx.metrics.performance.PerformanceMetricsState
fun View.addPerformanceMetricsState(stateName: String, state: String) {
PerformanceMetricsState.getForHierarchy(this).state?.addState(stateName, state)
}
/**
* Retrieves [PerformanceMetricsState.MetricsStateHolder] from current [LocalView] and
* remembers it until the View changes.

@ -33,14 +33,12 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import com.google.samples.apps.nowinandroid.core.ui.FollowButton
import com.google.samples.apps.nowinandroid.core.ui.addPerformanceMetricsState
import com.google.samples.apps.nowinandroid.core.ui.theme.NiaTheme
import com.google.samples.apps.nowinandroid.feature.interests.R.string
@ -56,7 +54,6 @@ fun InterestsItem(
description: String = "",
itemSeparation: Dp = 16.dp
) {
LocalView.current.addPerformanceMetricsState("InterestItem", name)
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier

Loading…
Cancel
Save