TP-63574 | OverScroll Issue Fix (#10729)
This commit is contained in:
@@ -29,6 +29,8 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.animation.slideInVertically
|
||||
import androidx.compose.animation.slideOutVertically
|
||||
import androidx.compose.animation.with
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.LocalOverscrollConfiguration
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
@@ -55,7 +57,7 @@ sealed class ScreenSelected {
|
||||
}
|
||||
|
||||
|
||||
@OptIn(ExperimentalAnimationApi::class)
|
||||
@OptIn(ExperimentalAnimationApi::class, ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
fun DigitalClaimScreenComposable(data: DigitalClaimScreenResponse, widgetCallback: WidgetCallback) {
|
||||
var selectedScreen by remember { mutableStateOf<ScreenSelected>(ScreenSelected.Cashless) }
|
||||
@@ -69,170 +71,174 @@ fun DigitalClaimScreenComposable(data: DigitalClaimScreenResponse, widgetCallbac
|
||||
}
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(color = colorResource(id = R.color.white))
|
||||
.verticalScroll(rememberScrollState())
|
||||
CompositionLocalProvider(
|
||||
LocalOverscrollConfiguration provides null
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.getBackground(
|
||||
data.header?.headerBackground ?: BackgroundDrawableData()
|
||||
)
|
||||
.padding(15.dp, 30.dp, 12.dp, 8.dp)
|
||||
.fillMaxSize()
|
||||
.background(color = colorResource(id = R.color.white))
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(0.6f)
|
||||
) {
|
||||
NaviImage(
|
||||
imageFieldData = data.header?.topLeftIcon,
|
||||
modifier = Modifier
|
||||
.size(24.dp),
|
||||
widgetCallback = widgetCallback
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.getBackground(
|
||||
data.header?.headerBackground ?: BackgroundDrawableData()
|
||||
)
|
||||
Row(
|
||||
modifier = Modifier.padding(top = 20.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
.padding(15.dp, 30.dp, 12.dp, 8.dp)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(0.6f)
|
||||
) {
|
||||
NaviImage(
|
||||
imageFieldData = data.header?.titleIcon,
|
||||
imageFieldData = data.header?.topLeftIcon,
|
||||
modifier = Modifier
|
||||
.widthIn(max = (0.25* getScreenWidthInDp()).dp)
|
||||
.size(24.dp),
|
||||
widgetCallback = widgetCallback
|
||||
)
|
||||
Row(
|
||||
modifier = Modifier.padding(top = 20.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
NaviImage(
|
||||
imageFieldData = data.header?.titleIcon,
|
||||
modifier = Modifier
|
||||
.widthIn(max = (0.25* getScreenWidthInDp()).dp)
|
||||
)
|
||||
NaviTextWidgetized(
|
||||
textFieldData = data.header?.titleText,
|
||||
modifier = Modifier.padding(start = 4.dp)
|
||||
)
|
||||
}
|
||||
NaviTextWidgetized(
|
||||
textFieldData = data.header?.titleText,
|
||||
modifier = Modifier.padding(start = 4.dp)
|
||||
textFieldData = data.header?.subTitle,
|
||||
modifier = Modifier.padding(top = 8.dp)
|
||||
)
|
||||
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(0.4f)
|
||||
) {
|
||||
NaviImage(imageFieldData = data.header?.rightIcon)
|
||||
}
|
||||
NaviTextWidgetized(
|
||||
textFieldData = data.header?.subTitle,
|
||||
modifier = Modifier.padding(top = 8.dp)
|
||||
)
|
||||
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.weight(0.4f)
|
||||
) {
|
||||
NaviImage(imageFieldData = data.header?.rightIcon)
|
||||
}
|
||||
}
|
||||
}
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(42.dp)
|
||||
.getBackground(
|
||||
data.rolodexData?.rolodexBackground ?: BackgroundDrawableData()
|
||||
)
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp)
|
||||
) {
|
||||
NaviImage(
|
||||
imageFieldData = data.rolodexData?.rolodexIcon,
|
||||
modifier = Modifier
|
||||
.padding(end = 6.dp)
|
||||
)
|
||||
AnimatedContent(targetState = currentIndex, label = "DigitalClaimAnimatedContent", transitionSpec = {
|
||||
slideInVertically { it } with slideOutVertically { -it }
|
||||
}) { targetState ->
|
||||
NaviTextWidgetized(
|
||||
textFieldData = adTexts?.getOrNull(targetState)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp, 24.dp, 16.dp, 68.dp)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.border(
|
||||
width = 1.dp,
|
||||
color = colorResource(id = R.color.card_stroke),
|
||||
shape = RoundedCornerShape(4.dp)
|
||||
.height(42.dp)
|
||||
.getBackground(
|
||||
data.rolodexData?.rolodexBackground ?: BackgroundDrawableData()
|
||||
)
|
||||
.background(color = colorResource(id = R.color.white))
|
||||
.padding(4.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
.padding(horizontal = 16.dp, vertical = 12.dp)
|
||||
) {
|
||||
Box(modifier = Modifier
|
||||
.weight(1f)
|
||||
.fillMaxWidth()
|
||||
.clickable(indication = null,
|
||||
interactionSource = remember { MutableInteractionSource() }) {
|
||||
selectedScreen = ScreenSelected.Cashless
|
||||
}
|
||||
.background(
|
||||
shape = RoundedCornerShape(4.dp),
|
||||
color = if (selectedScreen == ScreenSelected.Cashless) Color(
|
||||
android.graphics.Color.parseColor(
|
||||
data.selectedTabColor ?: "#1F002A"
|
||||
)
|
||||
) else colorResource(
|
||||
id = R.color.white
|
||||
)
|
||||
)
|
||||
.padding(horizontal = 16.dp, vertical = 9.dp),
|
||||
contentAlignment = Alignment.Center) {
|
||||
NaviTextWidgetized(textFieldData = if (selectedScreen == ScreenSelected.Cashless) data.firstTabContent?.selectedTabTitle else data.firstTabContent?.unselectedTabTitle)
|
||||
}
|
||||
|
||||
Box(modifier = Modifier
|
||||
.weight(1f)
|
||||
.fillMaxWidth()
|
||||
.clickable(indication = null,
|
||||
interactionSource = remember { MutableInteractionSource() }) {
|
||||
selectedScreen = ScreenSelected.Refund
|
||||
}
|
||||
.background(
|
||||
shape = RoundedCornerShape(4.dp),
|
||||
color = if (selectedScreen == ScreenSelected.Refund) Color(
|
||||
android.graphics.Color.parseColor(
|
||||
data.selectedTabColor ?: "#1F002A"
|
||||
)
|
||||
) else colorResource(
|
||||
id = R.color.white
|
||||
)
|
||||
)
|
||||
.padding(horizontal = 16.dp, vertical = 9.dp),
|
||||
contentAlignment = Alignment.Center) {
|
||||
NaviTextWidgetized(textFieldData = if (selectedScreen == ScreenSelected.Refund) data.secondTabContent?.selectedTabTitle else data.secondTabContent?.unselectedTabTitle)
|
||||
}
|
||||
}
|
||||
when (selectedScreen) {
|
||||
ScreenSelected.Cashless -> Column {
|
||||
Content(
|
||||
data.firstTabContent ?: TabContent(),
|
||||
data.tabDescriptionTipIcon ?: ImageFieldData(),
|
||||
data.bulletIcon ?: ImageFieldData(),
|
||||
data.tabDescriptionBackground ?: BackgroundDrawableData(),
|
||||
widgetCallback = widgetCallback
|
||||
NaviImage(
|
||||
imageFieldData = data.rolodexData?.rolodexIcon,
|
||||
modifier = Modifier
|
||||
.padding(end = 6.dp)
|
||||
)
|
||||
AnimatedContent(targetState = currentIndex, label = "DigitalClaimAnimatedContent", transitionSpec = {
|
||||
slideInVertically { it } with slideOutVertically { -it }
|
||||
}) { targetState ->
|
||||
NaviTextWidgetized(
|
||||
textFieldData = adTexts?.getOrNull(targetState)
|
||||
)
|
||||
}
|
||||
|
||||
ScreenSelected.Refund -> Column {
|
||||
Content(
|
||||
data.secondTabContent ?: TabContent(),
|
||||
data.tabDescriptionTipIcon ?: ImageFieldData(),
|
||||
data.bulletIcon ?: ImageFieldData(),
|
||||
data.tabDescriptionBackground ?: BackgroundDrawableData(),
|
||||
widgetCallback = widgetCallback
|
||||
)
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(16.dp, 24.dp, 16.dp, 68.dp)
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.border(
|
||||
width = 1.dp,
|
||||
color = colorResource(id = R.color.card_stroke),
|
||||
shape = RoundedCornerShape(4.dp)
|
||||
)
|
||||
.background(color = colorResource(id = R.color.white))
|
||||
.padding(4.dp),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
) {
|
||||
Box(modifier = Modifier
|
||||
.weight(1f)
|
||||
.fillMaxWidth()
|
||||
.clickable(indication = null,
|
||||
interactionSource = remember { MutableInteractionSource() }) {
|
||||
selectedScreen = ScreenSelected.Cashless
|
||||
}
|
||||
.background(
|
||||
shape = RoundedCornerShape(4.dp),
|
||||
color = if (selectedScreen == ScreenSelected.Cashless) Color(
|
||||
android.graphics.Color.parseColor(
|
||||
data.selectedTabColor ?: "#1F002A"
|
||||
)
|
||||
) else colorResource(
|
||||
id = R.color.white
|
||||
)
|
||||
)
|
||||
.padding(horizontal = 16.dp, vertical = 9.dp),
|
||||
contentAlignment = Alignment.Center) {
|
||||
NaviTextWidgetized(textFieldData = if (selectedScreen == ScreenSelected.Cashless) data.firstTabContent?.selectedTabTitle else data.firstTabContent?.unselectedTabTitle)
|
||||
}
|
||||
|
||||
Box(modifier = Modifier
|
||||
.weight(1f)
|
||||
.fillMaxWidth()
|
||||
.clickable(indication = null,
|
||||
interactionSource = remember { MutableInteractionSource() }) {
|
||||
selectedScreen = ScreenSelected.Refund
|
||||
}
|
||||
.background(
|
||||
shape = RoundedCornerShape(4.dp),
|
||||
color = if (selectedScreen == ScreenSelected.Refund) Color(
|
||||
android.graphics.Color.parseColor(
|
||||
data.selectedTabColor ?: "#1F002A"
|
||||
)
|
||||
) else colorResource(
|
||||
id = R.color.white
|
||||
)
|
||||
)
|
||||
.padding(horizontal = 16.dp, vertical = 9.dp),
|
||||
contentAlignment = Alignment.Center) {
|
||||
NaviTextWidgetized(textFieldData = if (selectedScreen == ScreenSelected.Refund) data.secondTabContent?.selectedTabTitle else data.secondTabContent?.unselectedTabTitle)
|
||||
}
|
||||
}
|
||||
when (selectedScreen) {
|
||||
ScreenSelected.Cashless -> Column {
|
||||
Content(
|
||||
data.firstTabContent ?: TabContent(),
|
||||
data.tabDescriptionTipIcon ?: ImageFieldData(),
|
||||
data.bulletIcon ?: ImageFieldData(),
|
||||
data.tabDescriptionBackground ?: BackgroundDrawableData(),
|
||||
widgetCallback = widgetCallback
|
||||
)
|
||||
}
|
||||
|
||||
ScreenSelected.Refund -> Column {
|
||||
Content(
|
||||
data.secondTabContent ?: TabContent(),
|
||||
data.tabDescriptionTipIcon ?: ImageFieldData(),
|
||||
data.bulletIcon ?: ImageFieldData(),
|
||||
data.tabDescriptionBackground ?: BackgroundDrawableData(),
|
||||
widgetCallback = widgetCallback
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user