Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd495110 authored by Qinmei Du's avatar Qinmei Du Committed by Android (Google) Code Review
Browse files

Merge "Change the more options row into text button"

parents 3eb77a8d a83646ce
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4,7 +4,8 @@
  <string name="string_cancel">Cancel</string>
  <string name="string_continue">Continue</string>
  <string name="string_more_options">More options</string>
  <string name="string_create_at_another_place">Create at another place</string>
  <string name="string_create_in_another_place">Create in another place</string>
  <string name="string_save_to_another_place">Save to another place</string>
  <string name="string_no_thanks">No thanks</string>
  <string name="passkey_creation_intro_title">A simple way to sign in safely</string>
  <string name="passkey_creation_intro_body">Use your fingerprint, face or screen lock to sign in with a unique passkey that can’t be forgotten or stolen. Learn more</string>
+18 −26
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
@@ -23,6 +22,7 @@ import androidx.compose.material.IconButton
import androidx.compose.material.ModalBottomSheetLayout
import androidx.compose.material.ModalBottomSheetValue
import androidx.compose.material.Text
import androidx.compose.material.TextButton
import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
@@ -458,11 +458,22 @@ fun CreationSelectionCard(
              PrimaryCreateOptionRow(requestDisplayInfo = requestDisplayInfo,
                onOptionSelected = onOptionSelected)
            }
          if (multiProvider) {
            item {
              MoreOptionsRow(onSelect = onMoreOptionsSelected)
        }
      }
      if (multiProvider) {
        TextButton(
          onClick = onMoreOptionsSelected,
          modifier = Modifier
          .padding(horizontal = 24.dp)
          .align(alignment = Alignment.CenterHorizontally)){
          Text(
              text =
                when (requestDisplayInfo.type) {
                  TYPE_PUBLIC_KEY_CREDENTIAL ->
                    stringResource(R.string.string_create_in_another_place)
                  else -> stringResource(R.string.string_save_to_another_place)},
            textAlign = TextAlign.Center,
          )
        }
      }
      Divider(
@@ -564,22 +575,3 @@ fun MoreOptionsInfoRow(
        }
    }
}
 No newline at end of file

@ExperimentalMaterialApi
@Composable
fun MoreOptionsRow(onSelect: () -> Unit) {
  Chip(
    modifier = Modifier.fillMaxWidth().height(52.dp),
    onClick = onSelect,
    colors = ChipDefaults.chipColors(
      backgroundColor = Grey100,
      leadingIconContentColor = Grey100
    ),
    shape = Shapes.large
  ) {
      Text(
        text = stringResource(R.string.string_create_at_another_place),
        style = Typography.h6,
      )
  }
}