This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OrderView @JvmOverloads constructor( | |
context: Context, | |
attrs: AttributeSet? = null | |
) : ConstraintLayout(context, attrs) { | |
private val binding = ViewOrderBinding.inflate(LayoutInflater.from(context), this) | |
init { | |
setPadding(context.dpToPx(16)) | |
background = context.drawable(R.drawable.background_info_view) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<merge xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="@drawable/background_info_view" | |
android:padding="16dp" | |
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Preview | |
@Composable | |
fun CustomViewPreview( | |
@PreviewParameter(ViewStateProvider::class) params: PreviewParams, | |
) { | |
AndroidView( | |
modifier = Modifier | |
.fillMaxWidth() | |
.background(Color.White) | |
.padding(8.dp), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val previewItems = listOf( | |
mapOf( | |
"Dimension" to "34x12x8", | |
), | |
mapOf( | |
"Display" to "6.4 inches", | |
"Resolution" to "1080x2340" | |
), | |
mapOf( | |
"OS" to "Android 10", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun SearchBox( | |
onBackClick: () -> Unit, | |
) { | |
var searchText by remember { mutableStateOf("") } | |
Row( | |
horizontalArrangement = Arrangement.spaced(16.dp), | |
) { | |
Icon( |
OlderNewer