Skip to content

Commit

Permalink
fix some usage
Browse files Browse the repository at this point in the history
  • Loading branch information
crossle committed Jan 23, 2025
1 parent 5491cec commit 4b339bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import android.os.CancellationSignal
import android.os.Parcelable
import android.view.View
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.fragment.app.viewModels
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
Expand Down Expand Up @@ -80,6 +81,7 @@ class SearchExploreFragment : BaseFragment(R.layout.fragment_search_explore) {

private val binding by viewBinding(FragmentSearchExploreBinding::bind)

@ExperimentalLayoutApi
override fun onViewCreated(
view: View,
savedInstanceState: Bundle?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -46,7 +45,6 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import kotlinx.coroutines.launch
import one.mixin.android.Constants
import one.mixin.android.R
import one.mixin.android.compose.CoilImage
Expand All @@ -59,7 +57,7 @@ import one.mixin.android.vo.RecentSearch
import one.mixin.android.vo.RecentSearchType
import java.math.BigDecimal

@OptIn(ExperimentalLayoutApi::class)
@ExperimentalLayoutApi
@Composable
fun RecentSearchPage(dappClick: (Dapp) -> Unit, searchClick: (RecentSearch) -> Unit) {
val context = LocalContext.current
Expand Down Expand Up @@ -147,15 +145,14 @@ fun RecentSearchPage(dappClick: (Dapp) -> Unit, searchClick: (RecentSearch) -> U
fun RecentSearchComponent(search: RecentSearch, searchClick: (RecentSearch) -> Unit) {
val context = LocalContext.current
val viewModel = hiltViewModel<SearchViewModel>()
val coroutineScope = rememberCoroutineScope()
val quoteColorPref = context.defaultSharedPreferences
.getBoolean(Constants.Account.PREF_QUOTE_COLOR, false)
var priceChangePercentage24H by remember { mutableStateOf<String?>(null) }
val configuration = LocalConfiguration.current
val screenWidthDp = configuration.screenWidthDp
val itemWidth = ((screenWidthDp - 48) / 2).dp
if (search.type == RecentSearchType.MARKET) {
coroutineScope.launch {
LaunchedEffect(priceChangePercentage24H) {
val marketItem = search.primaryKey?.let { viewModel.findMarketItemByCoinId(coinId = it) }
priceChangePercentage24H = marketItem?.priceChangePercentage24H
}
Expand Down

0 comments on commit 4b339bc

Please sign in to comment.