@@ -38,10 +38,10 @@ import androidx.compose.foundation.rememberScrollState
3838import androidx.compose.foundation.shape.CornerSize
3939import androidx.compose.foundation.shape.RoundedCornerShape
4040import androidx.compose.foundation.verticalScroll
41+ import androidx.compose.material.ButtonDefaults
4142import androidx.compose.material.Icon
4243import androidx.compose.material.MaterialTheme
4344import androidx.compose.material.Text
44- import androidx.compose.material.TextButton
4545import androidx.compose.material.icons.Icons
4646import androidx.compose.material.icons.filled.ArrowRight
4747import androidx.compose.runtime.Composable
@@ -57,6 +57,8 @@ import com.dimension.maskbook.common.bigDecimal.BigDecimal
5757import com.dimension.maskbook.common.ext.humanizeDollar
5858import com.dimension.maskbook.common.ext.humanizeToken
5959import com.dimension.maskbook.common.ext.ifNullOrEmpty
60+ import com.dimension.maskbook.common.ui.theme.moreColor
61+ import com.dimension.maskbook.common.ui.widget.MaskCard
6062import com.dimension.maskbook.common.ui.widget.MaskDecimalInputField
6163import com.dimension.maskbook.common.ui.widget.MaskPasswordInputField
6264import com.dimension.maskbook.common.ui.widget.MaskScaffold
@@ -65,9 +67,9 @@ import com.dimension.maskbook.common.ui.widget.MaskSingleLineTopAppBar
6567import com.dimension.maskbook.common.ui.widget.ScaffoldPadding
6668import com.dimension.maskbook.common.ui.widget.button.MaskBackButton
6769import com.dimension.maskbook.common.ui.widget.button.MaskIconButton
70+ import com.dimension.maskbook.common.ui.widget.button.MaskTextButton
6871import com.dimension.maskbook.common.ui.widget.button.MaskTransparentButton
6972import com.dimension.maskbook.common.ui.widget.button.PrimaryButton
70- import com.dimension.maskbook.common.ui.widget.button.SecondaryButton
7173import com.dimension.maskbook.wallet.R
7274import com.dimension.maskbook.wallet.export.model.TradableData
7375import com.dimension.maskbook.wallet.export.model.WalletCollectibleData
@@ -205,22 +207,24 @@ private fun AddressContent(
205207 isContact : Boolean ,
206208 onAddContact : () -> Unit ,
207209) {
208- Row (
209- modifier = Modifier .fillMaxWidth(),
210- verticalAlignment = Alignment .CenterVertically
211- ) {
212- Text (
213- text = name,
214- style = MaterialTheme .typography.body1.copy(fontWeight = FontWeight .Bold ),
215- modifier = Modifier .weight(1f )
216- )
217- if (! isContact) {
218- MaskIconButton (onClick = onAddContact) {
219- Image (
220- painter = painterResource(id = R .drawable.ic_add_user),
221- contentDescription = null ,
222- modifier = Modifier .size(32 .dp)
223- )
210+ MaskCard (elevation = 0 .dp) {
211+ Row (
212+ modifier = Modifier .fillMaxWidth().padding(vertical = 14 .dp, horizontal = 12 .dp),
213+ verticalAlignment = Alignment .CenterVertically ,
214+ ) {
215+ Text (
216+ text = name,
217+ style = MaterialTheme .typography.body1.copy(fontWeight = FontWeight .Bold ),
218+ modifier = Modifier .weight(1f )
219+ )
220+ if (! isContact) {
221+ MaskIconButton (onClick = onAddContact) {
222+ Image (
223+ painter = painterResource(id = R .drawable.ic_add_user),
224+ contentDescription = null ,
225+ modifier = Modifier .size(32 .dp)
226+ )
227+ }
224228 }
225229 }
226230 }
@@ -233,21 +237,29 @@ private fun TokenContent(
233237 balance : String = "",
234238 onClick : () -> Unit
235239) {
236- MaskTransparentButton (onClick = onClick) {
237- Image (
238- painter = rememberImagePainter(logoUri),
239- contentDescription = null ,
240- modifier = Modifier .size(38 .dp)
241- )
242- Spacer (modifier = Modifier .width(8 .dp))
243- Column (modifier = Modifier .weight(1f )) {
244- Text (
245- text = tokenName,
246- style = MaterialTheme .typography.body1.copy(fontWeight = FontWeight .Bold )
240+ MaskCard (
241+ onClick = onClick,
242+ elevation = 0 .dp
243+ ) {
244+ Row (
245+ modifier = Modifier .padding(vertical = 14 .dp, horizontal = 12 .dp).fillMaxWidth(),
246+ verticalAlignment = Alignment .CenterVertically
247+ ) {
248+ Image (
249+ painter = rememberImagePainter(logoUri),
250+ contentDescription = null ,
251+ modifier = Modifier .size(38 .dp)
247252 )
248- Text (text = balance)
253+ Spacer (modifier = Modifier .width(8 .dp))
254+ Column (modifier = Modifier .weight(1f )) {
255+ Text (
256+ text = tokenName,
257+ style = MaterialTheme .typography.h5.copy(fontWeight = FontWeight .Bold ),
258+ )
259+ Text (text = balance, style = MaterialTheme .typography.body2)
260+ }
261+ Icon (imageVector = Icons .Default .ArrowRight , contentDescription = null )
249262 }
250- Icon (imageVector = Icons .Default .ArrowRight , contentDescription = null )
251263 }
252264}
253265
@@ -294,24 +306,30 @@ private fun AmountContent(
294306 error : String ,
295307) {
296308 Column (modifier = Modifier .fillMaxWidth()) {
297- Text (text = stringResource(R .string.scene_sendTransaction_send_label_Amount))
309+ Text (
310+ text = stringResource(R .string.scene_sendTransaction_send_label_Amount),
311+ style = MaterialTheme .typography.h5.copy(color = MaterialTheme .colors.onSurface)
312+ )
298313 Spacer (modifier = Modifier .height(8 .dp))
299314 MaskDecimalInputField (
300315 modifier = Modifier .fillMaxWidth(),
301316 decimalValue = amount.toBigDecimal(),
302317 onValueChange = { onValueChanged(it.toString()) },
303318 trailingIcon = {
304319 Row {
305- TextButton (
320+ MaskTextButton (
306321 onClick = onMax,
307322 modifier = Modifier .background(
308323 color = MaterialTheme .colors.onSurface.copy(alpha = 0.1f ),
309324 shape = MaterialTheme .shapes.small
310- )
325+ ),
326+ minWidth = 42 .dp,
327+ minHeight = 24 .dp
311328 ) {
312329 Text (
313330 text = stringResource(R .string.scene_sendTransaction_send_btn_max),
314- color = MaterialTheme .colors.primary
331+ color = MaterialTheme .colors.primary,
332+ style = MaterialTheme .typography.body2
315333 )
316334 }
317335 Spacer (modifier = Modifier .padding(end = 12 .dp))
@@ -334,7 +352,10 @@ private fun PaymentPasswordContent(
334352 onValueChanged : (String ) -> Unit ,
335353) {
336354 Column (modifier = Modifier .fillMaxWidth()) {
337- Text (text = stringResource(R .string.scene_setting_general_setup_payment_password))
355+ Text (
356+ text = stringResource(R .string.scene_setting_general_setup_payment_password),
357+ style = MaterialTheme .typography.h5.copy(color = MaterialTheme .colors.onSurface)
358+ )
338359 Spacer (modifier = Modifier .height(8 .dp))
339360 MaskPasswordInputField (
340361 value = pwd,
@@ -422,28 +443,32 @@ private fun RoundButton(
422443 iconStart : Boolean = true,
423444 iconEnd : Boolean = false
424445) {
425- SecondaryButton (
446+ MaskTextButton (
426447 onClick = onClick,
427- shape = MaterialTheme .shapes.small.copy(CornerSize (50 )),
428- modifier = Modifier .clip(MaterialTheme .shapes.small.copy(CornerSize (50 )))
448+ shape = MaterialTheme .shapes.small.copy(CornerSize (13 .dp)),
449+ modifier = Modifier .clip(MaterialTheme .shapes.small.copy(CornerSize (13 .dp))),
450+ minHeight = 28 .dp,
451+ colors = ButtonDefaults .buttonColors(
452+ backgroundColor = MaterialTheme .moreColor.caption,
453+ )
429454 ) {
430455 if (iconStart) {
431456 Icon (
432457 painter = painterResource(id = icon),
433458 contentDescription = null ,
434- tint = MaterialTheme .colors.primary ,
459+ tint = MaterialTheme .typography.h6.color ,
435460 modifier = Modifier
436461 .size(13 .dp)
437462 )
438463 Spacer (modifier = Modifier .width(5 .dp))
439464 }
440- Text (text = title, color = MaterialTheme .colors.primary )
465+ Text (text = title, style = MaterialTheme .typography.h6 )
441466 if (iconEnd) {
442467 Spacer (modifier = Modifier .width(10 .dp))
443468 Icon (
444469 painter = painterResource(id = icon),
445470 contentDescription = null ,
446- tint = MaterialTheme .colors.primary ,
471+ tint = MaterialTheme .typography.h6.color ,
447472 modifier = Modifier .size(13 .dp)
448473 )
449474 }
0 commit comments