TP-71029 | Saksham Mahajan | Added color in modifier (#11467)
Co-authored-by: saksham <saksham>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
package com.naviapp.home.compose.home.navigation
|
||||
|
||||
import InvestmentsScreen
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.statusBarsPadding
|
||||
@@ -15,6 +16,7 @@ import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.foundation.lazy.rememberLazyListState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.navi.common.ui.fragment.BaseFragment
|
||||
import com.naviapp.analytics.utils.NaviAnalytics
|
||||
@@ -75,7 +77,11 @@ fun NavGraphNavigationItem(
|
||||
InvestmentsScreen(
|
||||
activity = activity,
|
||||
listState = { investmentListState() },
|
||||
modifier = Modifier.fillMaxSize().padding(bottom = 56.dp).statusBarsPadding(),
|
||||
modifier =
|
||||
Modifier.fillMaxSize()
|
||||
.padding(bottom = 56.dp)
|
||||
.statusBarsPadding()
|
||||
.background(Color.White),
|
||||
sharedVM = sharedVM
|
||||
)
|
||||
NavigationItem.Loan.tabId ->
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
import android.app.Activity
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
@@ -16,7 +17,7 @@ import com.navi.common.ui.errorview.FullScreenErrorComposeView
|
||||
import com.navi.common.utils.setStatusBarColorInt
|
||||
import com.navi.design.utils.parseColorSafe
|
||||
import com.naviapp.home.compose.activity.HomePageActivity
|
||||
import com.naviapp.home.compose.home.ui.content.HomePageContentShimmer
|
||||
import com.naviapp.home.dashboard.ui.compose.investmentTab.InvestmentsTabShimmer
|
||||
import com.naviapp.home.dashboard.viewmodels.InvestmentsVm
|
||||
import com.naviapp.home.viewmodel.SharedVM
|
||||
|
||||
@@ -38,23 +39,24 @@ fun InvestmentsScreen(
|
||||
sharedVM = sharedVM
|
||||
)
|
||||
|
||||
when (investmentsScreenData) {
|
||||
is InvestmentsVm.InvestmentsTabUiTronScreenState.Loading -> {
|
||||
HomePageContentShimmer()
|
||||
}
|
||||
is InvestmentsVm.InvestmentsTabUiTronScreenState.Success -> {
|
||||
InvestmentsTab(
|
||||
investmentsTabVm = investmentsTabVm,
|
||||
toggleStatusBarColor = { toggleStatusBarColor(activity, it) },
|
||||
lazyListState = listState,
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
is InvestmentsVm.InvestmentsTabUiTronScreenState.Error -> {
|
||||
FullScreenErrorComposeView(
|
||||
error = investmentsScreenData.error,
|
||||
onRetryClick = { investmentsTabVm.fetchInvestmentTabUiTronConfigs() }
|
||||
)
|
||||
Box(modifier = modifier) {
|
||||
when (investmentsScreenData) {
|
||||
is InvestmentsVm.InvestmentsTabUiTronScreenState.Loading -> {
|
||||
InvestmentsTabShimmer()
|
||||
}
|
||||
is InvestmentsVm.InvestmentsTabUiTronScreenState.Success -> {
|
||||
InvestmentsTab(
|
||||
investmentsTabVm = investmentsTabVm,
|
||||
toggleStatusBarColor = { toggleStatusBarColor(activity, it) },
|
||||
lazyListState = listState
|
||||
)
|
||||
}
|
||||
is InvestmentsVm.InvestmentsTabUiTronScreenState.Error -> {
|
||||
FullScreenErrorComposeView(
|
||||
error = investmentsScreenData.error,
|
||||
onRetryClick = { investmentsTabVm.fetchInvestmentTabUiTronConfigs() }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,7 @@ import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
fun InvestmentsTab(
|
||||
investmentsTabVm: InvestmentsVm = hiltViewModel(),
|
||||
toggleStatusBarColor: (String) -> Unit,
|
||||
lazyListState: () -> LazyListState?,
|
||||
modifier: Modifier = Modifier
|
||||
lazyListState: () -> LazyListState?
|
||||
) {
|
||||
|
||||
val investmentsTabUiTronConfig =
|
||||
@@ -68,8 +67,7 @@ fun InvestmentsTab(
|
||||
investmentsTabVm = investmentsTabVm,
|
||||
data = state.data,
|
||||
toggleStatusBarColor = toggleStatusBarColor,
|
||||
lazyListState = lazyListState,
|
||||
modifier = modifier
|
||||
lazyListState = lazyListState
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -83,8 +81,7 @@ fun RenderWidgets(
|
||||
investmentsTabVm: InvestmentsVm = hiltViewModel(),
|
||||
data: ScreenDefinition,
|
||||
toggleStatusBarColor: (String) -> Unit,
|
||||
lazyListState: () -> LazyListState? = { null },
|
||||
modifier: Modifier = Modifier
|
||||
lazyListState: () -> LazyListState? = { null }
|
||||
) {
|
||||
val scrollState = lazyListState() ?: rememberLazyListState()
|
||||
|
||||
@@ -102,7 +99,7 @@ fun RenderWidgets(
|
||||
}
|
||||
}
|
||||
Scaffold(
|
||||
modifier = modifier.fillMaxSize(),
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
content = {
|
||||
CompositionLocalProvider(LocalOverscrollConfiguration provides null) {
|
||||
LazyColumn(
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
|
||||
package com.naviapp.home.dashboard.ui.compose.investmentTab
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.naviapp.home.utils.shimmerEffect
|
||||
|
||||
@Composable
|
||||
fun InvestmentsTabShimmer() {
|
||||
Column(modifier = Modifier.fillMaxWidth().padding(start = 16.dp, end = 16.dp)) {
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Row(horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth()) {
|
||||
Box(modifier = Modifier.height(34.dp).width(94.dp).shimmerEffect())
|
||||
Box(modifier = Modifier.height(34.dp).width(148.dp).shimmerEffect())
|
||||
}
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Box(modifier = Modifier.height(108.dp).fillMaxWidth().shimmerEffect())
|
||||
Spacer(modifier = Modifier.height(32.dp))
|
||||
Box(modifier = Modifier.height(24.dp).width(176.dp).shimmerEffect())
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Box(modifier = Modifier.height(132.dp).fillMaxWidth().shimmerEffect())
|
||||
|
||||
Spacer(modifier = Modifier.height(32.dp))
|
||||
Box(modifier = Modifier.height(24.dp).width(120.dp).shimmerEffect())
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Box(modifier = Modifier.height(104.dp).fillMaxWidth().shimmerEffect())
|
||||
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Box(modifier = Modifier.height(78.dp).fillMaxWidth().shimmerEffect())
|
||||
Spacer(modifier = Modifier.height(32.dp))
|
||||
Box(modifier = Modifier.height(24.dp).width(176.dp).shimmerEffect())
|
||||
Spacer(modifier = Modifier.height(24.dp))
|
||||
Box(modifier = Modifier.height(132.dp).fillMaxWidth().shimmerEffect())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user