Revert "TP-48309 | Added Alfred masking functionality in uitron" (#282)
This commit is contained in:
committed by
GitHub
parent
19b505fc78
commit
5f6aa6ee2a
@@ -68,7 +68,6 @@ dependencies {
|
||||
implementation project(':navi-uitron')
|
||||
|
||||
implementation platform(libs.androidx.compose.bom)
|
||||
implementation platform(libs.firebase.bom)
|
||||
implementation platform(libs.okhttp.bom)
|
||||
|
||||
implementation libs.android.material
|
||||
@@ -93,8 +92,6 @@ dependencies {
|
||||
|
||||
implementation libs.dagger.hiltAndroid
|
||||
|
||||
implementation libs.firebase.analytics
|
||||
|
||||
implementation libs.gson
|
||||
|
||||
implementation libs.okhttp.loggingIntercepter
|
||||
@@ -110,8 +107,6 @@ dependencies {
|
||||
|
||||
ksp libs.androidx.room.compiler
|
||||
|
||||
implementation libs.navi.alfred
|
||||
|
||||
androidTestImplementation libs.androidx.test.espresso.core
|
||||
androidTestImplementation libs.androidx.test.junit
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.uitron.demo
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import com.navi.alfred.AlfredManager
|
||||
import com.navi.uitron.IUiTronDependencyProvider
|
||||
import com.navi.uitron.utils.EMPTY
|
||||
import com.navi.uitron.utils.SPACE
|
||||
@@ -187,32 +185,6 @@ class UiTronDependencyProvider : IUiTronDependencyProvider {
|
||||
|
||||
override fun logException(e: Exception) {}
|
||||
|
||||
override fun maskSensitiveUiTronComposable(
|
||||
id: String,
|
||||
left: Float?,
|
||||
top: Float?,
|
||||
right: Float?,
|
||||
bottom: Float?,
|
||||
rootView: View?
|
||||
) {
|
||||
AlfredManager.sensitiveComposeRepository.maskSensitiveUiTronComposable(
|
||||
id,
|
||||
left,
|
||||
top,
|
||||
right,
|
||||
bottom,
|
||||
rootView
|
||||
)
|
||||
}
|
||||
|
||||
override fun removeSensitiveComposable(id: String) {
|
||||
AlfredManager.sensitiveComposeRepository.removeSensitiveComposable(id)
|
||||
}
|
||||
|
||||
override fun blurSensitiveScreen(blur: Boolean) {
|
||||
AlfredManager.sensitiveComposeRepository.blurSensitiveScreen(blur)
|
||||
}
|
||||
|
||||
companion object{
|
||||
private const val TT_FONT_FAMILY = "ttComposeFontFamily"
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ moengage-inapp = "6.5.0"
|
||||
moengage-push-amp-plus = "6.2.1"
|
||||
moengage-rich-notification = "4.3.2"
|
||||
mvel2 = "2.4.15.Final"
|
||||
navi-alfred = "1.0.19"
|
||||
navi-alfred = "1.0.16"
|
||||
navi-uitron = "1.0.36-20231218.103220-27"
|
||||
navi-guarddog = "1.0.2"
|
||||
navigation = "2.5.3"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.navi.uitron
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
@@ -25,10 +24,4 @@ interface IUiTronDependencyProvider {
|
||||
|
||||
fun logException(e : Exception)
|
||||
|
||||
fun maskSensitiveUiTronComposable(id: String, left: Float?, top: Float?, right:Float?, bottom: Float?, rootView: View?)
|
||||
|
||||
fun removeSensitiveComposable(id: String)
|
||||
|
||||
fun blurSensitiveScreen(blur: Boolean)
|
||||
|
||||
}
|
||||
@@ -53,7 +53,6 @@ open class BaseProperty(
|
||||
var widthRange: SizeRange? = null,
|
||||
var heightRange: SizeRange? = null,
|
||||
var offset: Offset? = null,
|
||||
var isSensitive: Boolean? = null
|
||||
) : Parcelable {
|
||||
open fun copyNonNullFrom(property: BaseProperty?) {
|
||||
property?.width?.let { width = it }
|
||||
@@ -78,7 +77,6 @@ open class BaseProperty(
|
||||
property?.offset?.let { offset = it }
|
||||
property?.widthRange?.let { widthRange = it }
|
||||
property?.heightRange?.let { heightRange = it }
|
||||
property?.isSensitive?.let { isSensitive = it }
|
||||
}
|
||||
|
||||
fun getPropertyId() = layoutId + PROPERTY_SUFFIX
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.core.*
|
||||
import androidx.compose.animation.expandIn
|
||||
@@ -19,7 +18,6 @@ import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
@@ -120,7 +118,6 @@ class AnimationRenderer(
|
||||
Pair(KEY_MVEL_ACTION, extrasState.value?.get(MvelAction.KEY_MVEL) as? MvelAction)
|
||||
))
|
||||
|
||||
val rootView = LocalView.current.rootView
|
||||
Box(modifier = Modifier
|
||||
.graphicsLayer {
|
||||
translationX = property.translationX?.let {
|
||||
@@ -139,11 +136,6 @@ class AnimationRenderer(
|
||||
scaleX = property.scaleX ?: 1f
|
||||
scaleY = property.scaleY ?: 1f
|
||||
}
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
.scale(scaleX = scaleXAnimation, scaleY = scaleYAnimation)) {
|
||||
AnimatedVisibility(
|
||||
visible = property.visible.orTrue(),
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.animation.AnimatedContent
|
||||
import androidx.compose.animation.AnimatedContentTransitionScope
|
||||
import androidx.compose.animation.ContentTransform
|
||||
@@ -20,7 +19,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import clip
|
||||
import com.navi.uitron.model.data.EmptyData
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
@@ -88,7 +86,6 @@ class AutoScrollViewRenderer(
|
||||
}
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
val animatedContentModifier = (modifier ?: Modifier)
|
||||
.setTag(property)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
@@ -115,11 +112,6 @@ class AutoScrollViewRenderer(
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
|
||||
|
||||
if (childrenComposeViews.size > 1) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
@@ -16,7 +15,6 @@ import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import clip
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
@@ -88,7 +86,6 @@ class BoxRenderer(
|
||||
))
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Box(
|
||||
contentAlignment = getContentAlignment(contentAlignment = property.contentAlignment),
|
||||
propagateMinConstraints = property.propagateMinConstraints.orFalse(),
|
||||
@@ -129,11 +126,6 @@ class BoxRenderer(
|
||||
spotColor = property.spotColor?.hexToComposeColor ?: Color.Transparent,
|
||||
ambientColor = property.ambientColor?.hexToComposeColor ?: Color.Transparent
|
||||
)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
childrenComposeViews.forEach {
|
||||
if (it.data.isNullOrEmpty()) {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.material.Button
|
||||
import androidx.compose.material.ButtonDefaults
|
||||
@@ -20,7 +19,6 @@ import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.compositeOver
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.navi.uitron.model.data.EmptyData
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
@@ -73,7 +71,6 @@ class ButtonRenderer(
|
||||
}
|
||||
var lastClickEvent: Long by remember { mutableStateOf(0) }
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Button(
|
||||
shape = ShapeUtil.getShape(shape = property.shape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
@@ -103,12 +100,7 @@ class ButtonRenderer(
|
||||
.setPadding(property.margin)
|
||||
.setPadding(property.padding)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
onClick = {
|
||||
if (property.debounceTime != null && property.debounceTime.orZero() > 0) {
|
||||
val now = System.currentTimeMillis()
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.material.Card
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -18,7 +17,6 @@ import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.DefaultShadowColor
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import clip
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
@@ -85,7 +83,6 @@ class CardRenderer(
|
||||
))
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Card(
|
||||
modifier = (modifier ?: Modifier)
|
||||
.setTag(property)
|
||||
@@ -113,12 +110,7 @@ class CardRenderer(
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
shape = ShapeUtil.getShape(shape = property.shape),
|
||||
elevation = 0.dp,
|
||||
backgroundColor = property.backgroundColor?.hexToComposeColor ?: Color.White,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.material.Checkbox
|
||||
import androidx.compose.material.CheckboxDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -19,7 +18,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import clip
|
||||
import com.navi.uitron.model.data.CheckBoxData
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
@@ -76,7 +74,6 @@ class CheckBoxRenderer :
|
||||
}
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Checkbox(
|
||||
checked = isChecked.value,
|
||||
onCheckedChange = {
|
||||
@@ -119,11 +116,6 @@ class CheckBoxRenderer :
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.padding
|
||||
@@ -16,7 +15,6 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import clip
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
@@ -88,7 +86,6 @@ class ColumnRenderer(
|
||||
))
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Column(
|
||||
verticalArrangement = Arrangement.setVerticalArrangement(arrangementData = property.arrangementData),
|
||||
horizontalAlignment = getHorizontalAlignment(horizontalAlignment = property.horizontalAlignment),
|
||||
@@ -133,11 +130,6 @@ class ColumnRenderer(
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.setBlur(property.blurData)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
if (property.repeat == null || (property.repeat ?: 0) <= 1) {
|
||||
childrenComposeViews.forEach {childrenView ->
|
||||
|
||||
@@ -8,13 +8,11 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import RenderUtility
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.constraintlayout.compose.ConstraintLayout
|
||||
import androidx.constraintlayout.compose.layoutId
|
||||
@@ -84,7 +82,6 @@ class ConstraintLayoutRenderer(
|
||||
))
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
ConstraintLayout(
|
||||
constraintSet = RenderUtility.decoupledConstraints(childrenViews),
|
||||
modifier = (modifier ?: Modifier)
|
||||
@@ -127,11 +124,6 @@ class ConstraintLayoutRenderer(
|
||||
}
|
||||
.setBorderStroke(property.borderStrokeData)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
uiTronRenderer.Render(childrenViews)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import KeyboardUtil
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.*
|
||||
@@ -144,7 +143,6 @@ class CustomTextFieldRenderer(
|
||||
val localTextToolBar = LocalTextToolbar.current
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
@@ -160,12 +158,7 @@ class CustomTextFieldRenderer(
|
||||
property.backGroundBrushData
|
||||
)
|
||||
.clip(property.clipShape)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
verticalArrangement = Arrangement.setVerticalArrangement(
|
||||
property.arrangementData ?: ArrangementData(
|
||||
arrangementType = VerticalArrangementType.SpacedBy.name,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.Canvas
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.Divider
|
||||
@@ -19,7 +18,6 @@ import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.PathEffect
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
import com.navi.uitron.model.ui.DividerProperty
|
||||
@@ -52,7 +50,6 @@ class DividerRenderer : Renderer<DividerProperty> {
|
||||
property.copyNonNullFrom(property.statesMap?.get(state.value))
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
if (property.separation == null || property.separation == 0) {
|
||||
Divider(
|
||||
modifier = (modifier ?: Modifier)
|
||||
@@ -65,12 +62,7 @@ class DividerRenderer : Renderer<DividerProperty> {
|
||||
.setTag(property)
|
||||
.setPadding(property.margin)
|
||||
.setPadding(property.padding)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
color = property.color?.hexToComposeColor ?: Color.Black,
|
||||
thickness = property.thickness?.dp ?: 1.dp
|
||||
)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.padding
|
||||
@@ -20,7 +19,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.DpOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.PopupProperties
|
||||
@@ -59,7 +57,6 @@ class DropdownRenderer(
|
||||
property.copyNonNullFrom(property.statesMap?.get(state.value))
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
val isExpanded = remember {
|
||||
mutableStateOf(property.isExpanded ?: false)
|
||||
}
|
||||
@@ -68,11 +65,6 @@ class DropdownRenderer(
|
||||
.clickable {
|
||||
isExpanded.value = !isExpanded.value
|
||||
}
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
DropdownMenu(
|
||||
expanded = isExpanded.value,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
@@ -10,7 +9,6 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.constraintlayout.compose.layoutId
|
||||
import clip
|
||||
@@ -61,7 +59,6 @@ class GridRenderer(
|
||||
updatedData = updatedDataState.value ?: updatedData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
val columnModifier = (modifier ?: Modifier)
|
||||
.setTag(property)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
@@ -86,11 +83,6 @@ class GridRenderer(
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
|
||||
Column(modifier = columnModifier) {
|
||||
val itemCount = childrenComposeViews.size
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
@@ -15,7 +14,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import clip
|
||||
import coil.compose.AsyncImage
|
||||
@@ -83,7 +81,6 @@ class ImageRenderer : Renderer<ImageProperty> {
|
||||
)
|
||||
)
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
UiTronSdkManager.getDependencyProvider().getIconResourceId(uiTronImageData?.iconUrl)?.let { iconCode ->
|
||||
Image(
|
||||
painter = painterResource(id = iconCode),
|
||||
@@ -117,11 +114,6 @@ class ImageRenderer : Renderer<ImageProperty> {
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.setBlur(property.blurData)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
)
|
||||
} ?: kotlin.run {
|
||||
val placeHolderIcon = UiTronSdkManager.getDependencyProvider()
|
||||
@@ -166,11 +158,6 @@ class ImageRenderer : Renderer<ImageProperty> {
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.setBlur(property.blurData)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.animation.AnimatedContent
|
||||
import androidx.compose.animation.AnimatedContentTransitionScope
|
||||
import androidx.compose.animation.ContentTransform
|
||||
@@ -30,7 +29,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -86,7 +84,6 @@ class JackpotTextRendererV2 : Renderer<JackpotTextProperty> {
|
||||
}
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Row(
|
||||
(modifier ?: Modifier)
|
||||
.setPadding(property.margin)
|
||||
@@ -96,11 +93,6 @@ class JackpotTextRendererV2 : Renderer<JackpotTextProperty> {
|
||||
.clip(property.clipShape)
|
||||
.setPadding(property.padding)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
val startCount = updatedData?.startCount.orZero()
|
||||
val endCount = updatedData?.endCount.orZero()
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.animation.*
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.material.Text
|
||||
@@ -16,7 +15,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.sp
|
||||
import clip
|
||||
import com.navi.uitron.UiTronSdkManager
|
||||
@@ -65,7 +63,6 @@ class JackpotTextRenderer : Renderer<TextProperty> {
|
||||
uiTronTextData?.text?.getText(uiTronTextData.textFormatter)
|
||||
?: uiTronTextData?.text.orEmpty()
|
||||
}
|
||||
val rootView = LocalView.current.rootView
|
||||
Row(
|
||||
(modifier ?: Modifier)
|
||||
.setPadding(property.margin)
|
||||
@@ -77,11 +74,6 @@ class JackpotTextRenderer : Renderer<TextProperty> {
|
||||
.clip(property.clipShape)
|
||||
.setPadding(property.padding)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
val countString =
|
||||
uiTronTextData?.text?.getText(uiTronTextData.textFormatter)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
@@ -17,7 +16,6 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import clip
|
||||
import com.navi.uitron.helpers.ScrollEventHandler
|
||||
import com.navi.uitron.model.data.LazyColumnData
|
||||
@@ -73,7 +71,6 @@ class LazyColumnRenderer(
|
||||
lazyColumnData = updatedDataState.value ?: lazyColumnData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
LazyColumn(
|
||||
state = lazyListState,
|
||||
verticalArrangement = Arrangement.setVerticalArrangement(arrangementData = property.arrangementData),
|
||||
@@ -104,12 +101,7 @@ class LazyColumnRenderer(
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
) {
|
||||
items(childrenComposeViews) { childrenView ->
|
||||
if (childrenView.data.isNullOrEmpty()) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.lazy.grid.GridCells
|
||||
import androidx.compose.foundation.lazy.grid.GridItemSpan
|
||||
@@ -12,7 +11,6 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.constraintlayout.compose.layoutId
|
||||
import clip
|
||||
@@ -68,7 +66,6 @@ class LazyGridRenderer(
|
||||
}
|
||||
val gridState = uiTronViewModel.stateHolder.getOrUpdateGridState(key = property.gridStateKey)
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
val modifier = (modifier ?: Modifier)
|
||||
.setTag(property)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
@@ -93,11 +90,6 @@ class LazyGridRenderer(
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
if (property.orientation == LazyGridProperty.ORIENTATION_HORIZONTAL) {
|
||||
LazyHorizontalGrid(
|
||||
modifier = modifier,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.lazy.LazyRow
|
||||
import androidx.compose.foundation.lazy.items
|
||||
@@ -17,7 +16,6 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import clip
|
||||
import com.navi.uitron.helpers.ScrollEventHandler
|
||||
import com.navi.uitron.model.data.LazyRowData
|
||||
@@ -75,7 +73,6 @@ class LazyRowRenderer(
|
||||
lazyRowData = updatedDataState.value ?: lazyRowData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
LazyRow(
|
||||
state = lazyListState,
|
||||
horizontalArrangement = Arrangement.setHorizontalArrangement(arrangementData = property.arrangementData),
|
||||
@@ -108,11 +105,6 @@ class LazyRowRenderer(
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
items(childrenComposeViews) { childrenView ->
|
||||
if (childrenView.data.isNullOrEmpty()) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.LinearProgressIndicator
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -16,7 +15,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import clipContent
|
||||
import com.navi.uitron.model.data.LinearProgressIndicatorData
|
||||
@@ -59,7 +57,6 @@ class LinearProgressIndicatorRenderer :
|
||||
linearProgressIndicatorData = updatedDataState.value ?: linearProgressIndicatorData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
LinearProgressIndicator(
|
||||
progress = linearProgressIndicatorData?.progress ?: 0f,
|
||||
modifier = (modifier ?: Modifier)
|
||||
@@ -77,12 +74,7 @@ class LinearProgressIndicatorRenderer :
|
||||
top = property.padding?.top?.dp ?: 0.dp,
|
||||
bottom = property.padding?.bottom?.dp ?: 0.dp
|
||||
)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
color = property.color?.hexToComposeColor ?: Color.Green,
|
||||
backgroundColor = property.backgroundColor?.hexToComposeColor ?: Color.White
|
||||
)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
@@ -16,7 +15,6 @@ import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.airbnb.lottie.LottieComposition
|
||||
import com.airbnb.lottie.compose.LottieAnimation
|
||||
@@ -88,7 +86,6 @@ class LottieRenderer : Renderer<LottieProperty> {
|
||||
ObserveProgress(composition, uiTronLottieData, uiTronViewModel)
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
val modifier = (modifier ?: Modifier)
|
||||
.setTag(property)
|
||||
.customOffset(property.offset)
|
||||
@@ -114,11 +111,6 @@ class LottieRenderer : Renderer<LottieProperty> {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
uiTronLottieData?.progress?.let {
|
||||
LottieAnimation(
|
||||
composition = composition,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
@@ -133,7 +132,6 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
}
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Column(
|
||||
modifier = (modifier ?: Modifier)
|
||||
.setTag(property)
|
||||
@@ -143,12 +141,7 @@ class MultiSectionTextFieldRenderer() : Renderer<MultiSectionTextFieldProperty>
|
||||
.setHeight(property.height)
|
||||
.setHeightRange(property.heightRange)
|
||||
.setWidthRange(property.widthRange)
|
||||
.setPadding(property.padding)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.setPadding(property.padding),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
Row(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
@@ -104,7 +103,6 @@ class OtpBoxRenderer : Renderer<OtpBoxProperty> {
|
||||
uiTronViewModel.handle[property.layoutId.getInputId()] = otpBoxData?.inputText
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.setTag(property)
|
||||
@@ -121,12 +119,7 @@ class OtpBoxRenderer : Renderer<OtpBoxProperty> {
|
||||
property.backGroundBrushData
|
||||
)
|
||||
.clip(property.clipShape)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
verticalArrangement = Arrangement.setVerticalArrangement(property.containerProperty?.arrangementData),
|
||||
horizontalAlignment = getHorizontalAlignment(horizontalAlignment = property.containerProperty?.horizontalAlignment),
|
||||
) {
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import KeyboardUtil
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
@@ -90,7 +89,6 @@ class OutlinedTextFieldRenderer(
|
||||
}
|
||||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Column(
|
||||
modifier = (modifier ?: Modifier)
|
||||
.setTag(property)
|
||||
@@ -116,12 +114,7 @@ class OutlinedTextFieldRenderer(
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp)
|
||||
) {
|
||||
OutlinedTextField(
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.LocalContentAlpha
|
||||
@@ -17,7 +16,6 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.constraintlayout.compose.layoutId
|
||||
import clip
|
||||
@@ -76,7 +74,6 @@ class PagerIndicatorRenderer : Renderer<PagerIndicatorProperty> {
|
||||
val pagerState = uiTronViewModel.stateHolder.getOrUpdatePagerState(property.pagerStateKey)
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
if (property.orientation == PagerIndicatorProperty.ORIENTATION_VERTICAL) {
|
||||
VerticalPagerIndicator(
|
||||
pagerState = pagerState ?: rememberPagerState(),
|
||||
@@ -111,11 +108,6 @@ class PagerIndicatorRenderer : Renderer<PagerIndicatorProperty> {
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
,
|
||||
activeColor = property.activeColor?.hexToComposeColor
|
||||
?: LocalContentColor.current.copy(alpha = LocalContentAlpha.current),
|
||||
@@ -155,11 +147,6 @@ class PagerIndicatorRenderer : Renderer<PagerIndicatorProperty> {
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
,
|
||||
activeColor = property.activeColor?.hexToComposeColor
|
||||
?: LocalContentColor.current.copy(alpha = LocalContentAlpha.current),
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.gestures.FlingBehavior
|
||||
import androidx.compose.foundation.interaction.collectIsDraggedAsState
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
@@ -18,7 +17,6 @@ import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.snapshotFlow
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.constraintlayout.compose.layoutId
|
||||
import clip
|
||||
@@ -86,7 +84,6 @@ class PagerRenderer(
|
||||
pagerData = updatedDataState.value ?: pagerData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
val pagerState =
|
||||
uiTronViewModel.stateHolder.getOrUpdatePagerState(property.pagerStateKey)
|
||||
?: rememberPagerState()
|
||||
@@ -121,12 +118,7 @@ class PagerRenderer(
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
state = pagerState,
|
||||
reverseLayout = property.reverseLayout.orFalse(),
|
||||
itemSpacing = (property.itemSpacing ?: 0).dp,
|
||||
@@ -179,12 +171,7 @@ class PagerRenderer(
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
state = pagerState,
|
||||
reverseLayout = property.reverseLayout.orFalse(),
|
||||
itemSpacing = (property.itemSpacing ?: 0).dp,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.material.RadioButton
|
||||
import androidx.compose.material.RadioButtonDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -16,7 +15,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import clip
|
||||
import com.navi.uitron.model.data.EmptyData
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
@@ -63,7 +61,6 @@ class RadioButtonRenderer :
|
||||
updatedData = updatedDataState.value ?: updatedData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
RadioButton(
|
||||
selected = property.isSelected ?: false,
|
||||
enabled = property.enabled ?: true,
|
||||
@@ -95,12 +92,7 @@ class RadioButtonRenderer :
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
onClick = null
|
||||
)
|
||||
}
|
||||
|
||||
@@ -9,12 +9,8 @@ package com.navi.uitron.render
|
||||
|
||||
import androidx.annotation.CallSuper
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.LocalLifecycleOwner
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import com.navi.uitron.UiTronSdkManager
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
import com.navi.uitron.model.data.UiTronAction
|
||||
@@ -43,25 +39,6 @@ interface Renderer<T : BaseProperty> {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
})
|
||||
|
||||
if (property.isSensitive == true) {
|
||||
val lifecycleOwner = LocalLifecycleOwner.current
|
||||
DisposableEffect(key1 = lifecycleOwner) {
|
||||
val observer = LifecycleEventObserver { _, event ->
|
||||
if (event == Lifecycle.Event.ON_START || event == Lifecycle.Event.ON_PAUSE) {
|
||||
UiTronSdkManager.getDependencyProvider().blurSensitiveScreen(true)
|
||||
}
|
||||
if (event == Lifecycle.Event.ON_RESUME || event == Lifecycle.Event.ON_STOP) {
|
||||
UiTronSdkManager.getDependencyProvider().blurSensitiveScreen(false)
|
||||
}
|
||||
}
|
||||
lifecycleOwner.lifecycle.addObserver(observer)
|
||||
onDispose {
|
||||
lifecycleOwner.lifecycle.removeObserver(observer)
|
||||
UiTronSdkManager.getDependencyProvider().removeSensitiveComposable(property.layoutId.orEmpty())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun updateMvelValuesInActions(actions: List<UiTronAction?>?, map: Map<String, Any?>) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.padding
|
||||
@@ -16,7 +15,6 @@ import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import clip
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
@@ -84,7 +82,6 @@ class RowRenderer(
|
||||
))
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.setHorizontalArrangement(arrangementData = property.arrangementData),
|
||||
verticalAlignment = getVerticalAlignment(verticalAlignment = property.verticalAlignment),
|
||||
@@ -128,11 +125,6 @@ class RowRenderer(
|
||||
.customCombinedClick(property, uiTronData) {
|
||||
uiTronViewModel.handleActions(it)
|
||||
}
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
if (property.repeat == null || (property.repeat ?: 0) <= 1) {
|
||||
childrenComposeViews.forEach { childrenView ->
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.animateColorAsState
|
||||
import androidx.compose.animation.core.LinearEasing
|
||||
@@ -46,7 +45,6 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.IntSize
|
||||
@@ -138,18 +136,12 @@ class SlideToActButtonRenderer(
|
||||
Pair(UI_TRON_VM, uiTronViewModel)
|
||||
))
|
||||
|
||||
val rootView = LocalView.current.rootView
|
||||
SwipeButton(
|
||||
modifier= Modifier
|
||||
.fillMaxWidth()
|
||||
.setHeight(property.height)
|
||||
.setPadding(property.margin)
|
||||
.clipContent(property.clipData)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
,
|
||||
onSwipe = {
|
||||
uiTronViewModel.handleActions(uiTronSlideToActButtonData?.onSlideComplete)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Slider
|
||||
@@ -18,7 +17,6 @@ import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.draw.rotate
|
||||
import androidx.compose.ui.graphics.compositeOver
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
import com.navi.uitron.model.data.SliderDependentValue
|
||||
import com.navi.uitron.model.data.StepValue
|
||||
@@ -148,7 +146,6 @@ class SliderRenderer :
|
||||
}
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Slider(
|
||||
value = sliderPosition.value,
|
||||
onValueChange = {
|
||||
@@ -223,12 +220,7 @@ class SliderRenderer :
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
.setPadding(property.padding)
|
||||
.rotate(property.rotation ?: 0f)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
colors = SliderDefaults.colors(
|
||||
thumbColor = property.sliderColors.thumbColor?.hexToComposeColor
|
||||
?: MaterialTheme.colors.primary,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.Canvas
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.offset
|
||||
@@ -28,7 +27,6 @@ import androidx.compose.ui.graphics.compositeOver
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.layout.positionInParent
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.IntOffset
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.zIndex
|
||||
@@ -164,7 +162,6 @@ class SliderRendererV2(
|
||||
)
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Column(
|
||||
modifier = (modifier ?: Modifier)
|
||||
.customOffset(property.offset)
|
||||
@@ -175,11 +172,6 @@ class SliderRendererV2(
|
||||
.setTag(property)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
.setPadding(property.padding)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
Tooltip(
|
||||
thumbX = thumbX,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.MaterialTheme
|
||||
@@ -23,7 +22,6 @@ import androidx.compose.ui.graphics.compositeOver
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.layout.positionInParent
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.navi.uitron.model.action.MvelAction
|
||||
import com.navi.uitron.model.data.SliderDataV3
|
||||
@@ -154,7 +152,6 @@ class SliderRendererV3(
|
||||
)
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Column(
|
||||
modifier = (modifier ?: Modifier)
|
||||
.customOffset(property.offset)
|
||||
@@ -165,11 +162,6 @@ class SliderRendererV3(
|
||||
.setTag(property)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
.setPadding(property.padding)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
) {
|
||||
Slider(
|
||||
value = sliderPosition.value,
|
||||
|
||||
@@ -7,14 +7,12 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import clip
|
||||
import com.navi.uitron.model.data.EmptyData
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
@@ -58,7 +56,6 @@ class SpacerRenderer : Renderer<SpacerProperty> {
|
||||
updatedData = updatedDataState.value ?: updatedData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Spacer(
|
||||
modifier = (modifier ?: Modifier)
|
||||
.customOffset(property.offset)
|
||||
@@ -87,11 +84,6 @@ class SpacerRenderer : Renderer<SpacerProperty> {
|
||||
.setPadding(property.padding)
|
||||
.setTag(property)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.text.BasicText
|
||||
import androidx.compose.foundation.text.ClickableText
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -9,7 +8,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
@@ -61,7 +59,6 @@ class SpannableTextRenderer : Renderer<SpannableProperty> {
|
||||
spannableData = updatedDataState.value ?: spannableData
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
val spanProperties = property.spanProperty
|
||||
val text = java.lang.StringBuilder()
|
||||
val annotatedString = buildAnnotatedString {
|
||||
@@ -155,12 +152,7 @@ class SpannableTextRenderer : Renderer<SpannableProperty> {
|
||||
)
|
||||
.clip(property.clipShape)
|
||||
.setPadding(property.padding)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
style = TextStyle(
|
||||
textAlign = getTextAlignment(property.textAlign)
|
||||
)
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.MaterialTheme
|
||||
@@ -22,7 +21,6 @@ import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.graphics.compositeOver
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import com.navi.uitron.model.data.SwitchData
|
||||
import com.navi.uitron.model.data.UiTronData
|
||||
import com.navi.uitron.model.ui.SwitchProperty
|
||||
@@ -63,7 +61,6 @@ class SwitchRenderer :
|
||||
mutableStateOf(property.isChecked ?: false)
|
||||
}
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Switch(
|
||||
checked = isChecked.value,
|
||||
onCheckedChange = {
|
||||
@@ -79,12 +76,7 @@ class SwitchRenderer :
|
||||
.scale(property.scaleData?.x ?: 1.0f, property.scaleData?.y ?: 1.0f)
|
||||
.layoutId(property.layoutId.orEmpty())
|
||||
.setTag(property)
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
),
|
||||
.alpha(property.alpha ?: 1.0f),
|
||||
enabled = property.enabled ?: true,
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
colors = SwitchDefaults.colors(
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
package com.navi.uitron.render
|
||||
|
||||
import alfredMaskSensitiveComposable
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
@@ -17,7 +16,6 @@ import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shadow
|
||||
import androidx.compose.ui.layout.layoutId
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontStyle
|
||||
import androidx.compose.ui.unit.TextUnit
|
||||
@@ -96,7 +94,6 @@ class TextRenderer : Renderer<TextProperty> {
|
||||
}
|
||||
|
||||
if (property.visible.orTrue()) {
|
||||
val rootView = LocalView.current.rootView
|
||||
Text(
|
||||
text = (getTransformedText(property.valueTransformation, uiTronTextData?.text.orEmpty())?:uiTronTextData?.text)?.getText(uiTronTextData?.textFormatter).orEmpty(),
|
||||
fontFamily = UiTronSdkManager.getDependencyProvider()
|
||||
@@ -152,11 +149,6 @@ class TextRenderer : Renderer<TextProperty> {
|
||||
}
|
||||
.alpha(property.alpha ?: 1.0f)
|
||||
.setBlur(property.blurData)
|
||||
.alfredMaskSensitiveComposable(
|
||||
isSensitive = property.isSensitive.orFalse(),
|
||||
rootView = rootView,
|
||||
id = property.layoutId.orEmpty()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import android.content.res.Resources
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import androidx.compose.animation.core.LinearEasing
|
||||
import androidx.compose.animation.core.animateFloat
|
||||
import androidx.compose.animation.core.infiniteRepeatable
|
||||
@@ -34,7 +33,6 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.SolidColor
|
||||
import androidx.compose.ui.graphics.TileMode
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.layout.boundsInWindow
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.platform.testTag
|
||||
@@ -927,21 +925,4 @@ fun getAnimationBoundSize(fullSize: IntSize, widthPercentage: Float?, heightPerc
|
||||
val calculatedWidth = (fullSize.width * widthPercentage.orValue(0f))
|
||||
val calculatedHeight = (fullSize.height * heightPercentage.orValue(0f))
|
||||
return IntSize(calculatedWidth.toNearestInt(), calculatedHeight.toNearestInt())
|
||||
}
|
||||
|
||||
|
||||
fun Modifier.alfredMaskSensitiveComposable(isSensitive: Boolean, rootView: View, id: String): Modifier {
|
||||
return conditional(isSensitive) {
|
||||
onGloballyPositioned { coordinates ->
|
||||
val maskingBounds = coordinates.boundsInWindow()
|
||||
UiTronSdkManager.getDependencyProvider().maskSensitiveUiTronComposable(
|
||||
id,
|
||||
maskingBounds.left,
|
||||
maskingBounds.top,
|
||||
maskingBounds.right,
|
||||
maskingBounds.bottom,
|
||||
rootView = rootView
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user