Add credit card icon.
This commit is contained in:
parent
4077dc829a
commit
5b8a729afc
4 changed files with 41 additions and 3 deletions
|
@ -12,7 +12,9 @@ import org.thoughtcrime.securesms.badges.models.BadgeDisplay112
|
|||
import org.thoughtcrime.securesms.components.settings.DSLConfiguration
|
||||
import org.thoughtcrime.securesms.components.settings.DSLSettingsAdapter
|
||||
import org.thoughtcrime.securesms.components.settings.DSLSettingsBottomSheetFragment
|
||||
import org.thoughtcrime.securesms.components.settings.DSLSettingsIcon
|
||||
import org.thoughtcrime.securesms.components.settings.DSLSettingsText
|
||||
import org.thoughtcrime.securesms.components.settings.NO_TINT
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.DonationPaymentComponent
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.donate.DonateToSignalType
|
||||
import org.thoughtcrime.securesms.components.settings.app.subscription.models.GooglePayButton
|
||||
|
@ -84,6 +86,7 @@ class GatewaySelectorBottomSheet : DSLSettingsBottomSheetFragment() {
|
|||
|
||||
primaryButton(
|
||||
text = DSLSettingsText.from(R.string.GatewaySelectorBottomSheet__credit_or_debit_card),
|
||||
icon = DSLSettingsIcon.from(R.drawable.credit_card, NO_TINT),
|
||||
onClick = {
|
||||
findNavController().popBackStack()
|
||||
val response = GatewayResponse(GatewayResponse.Gateway.CREDIT_CARD, args.request)
|
||||
|
|
|
@ -151,10 +151,11 @@ class DSLConfiguration {
|
|||
|
||||
fun primaryButton(
|
||||
text: DSLSettingsText,
|
||||
icon: DSLSettingsIcon? = null,
|
||||
isEnabled: Boolean = true,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
val preference = Button.Model.Primary(text, null, isEnabled, onClick)
|
||||
val preference = Button.Model.Primary(text, icon, isEnabled, onClick)
|
||||
children.add(preference)
|
||||
}
|
||||
|
||||
|
|
30
app/src/main/res/drawable/credit_card.xml
Normal file
30
app/src/main/res/drawable/credit_card.xml
Normal file
|
@ -0,0 +1,30 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:pathData="M3.368,5L28.632,5A3.368,3.368 0,0 1,32 8.368L32,23.632A3.368,3.368 0,0 1,28.632 27L3.368,27A3.368,3.368 0,0 1,0 23.632L0,8.368A3.368,3.368 0,0 1,3.368 5z"
|
||||
android:fillColor="#FBFCFE"/>
|
||||
<path
|
||||
android:pathData="M3.368,5L28.632,5A3.368,3.368 0,0 1,32 8.368L32,23.632A3.368,3.368 0,0 1,28.632 27L3.368,27A3.368,3.368 0,0 1,0 23.632L0,8.368A3.368,3.368 0,0 1,3.368 5z"
|
||||
android:fillColor="#50679F"
|
||||
android:fillAlpha="0.11"/>
|
||||
<path
|
||||
android:pathData="M22.737,8.259L27.79,8.259A0.842,0.842 0,0 1,28.632 9.101L28.632,13.936A0.842,0.842 0,0 1,27.79 14.778L22.737,14.778A0.842,0.842 0,0 1,21.895 13.936L21.895,9.101A0.842,0.842 0,0 1,22.737 8.259z"
|
||||
android:strokeAlpha="0.4"
|
||||
android:fillColor="#586071"
|
||||
android:fillAlpha="0.4"/>
|
||||
<path
|
||||
android:pathData="M4.183,20.482L7.606,20.482A0.815,0.815 0,0 1,8.421 21.296L8.421,21.296A0.815,0.815 0,0 1,7.606 22.111L4.183,22.111A0.815,0.815 0,0 1,3.369 21.296L3.369,21.296A0.815,0.815 0,0 1,4.183 20.482z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M10.92,20.482L14.343,20.482A0.815,0.815 0,0 1,15.158 21.296L15.158,21.296A0.815,0.815 0,0 1,14.343 22.111L10.92,22.111A0.815,0.815 0,0 1,10.105 21.296L10.105,21.296A0.815,0.815 0,0 1,10.92 20.482z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M17.657,20.482L21.08,20.482A0.815,0.815 0,0 1,21.894 21.296L21.894,21.296A0.815,0.815 0,0 1,21.08 22.111L17.657,22.111A0.815,0.815 0,0 1,16.842 21.296L16.842,21.296A0.815,0.815 0,0 1,17.657 20.482z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M24.394,20.482L27.817,20.482A0.815,0.815 0,0 1,28.632 21.296L28.632,21.296A0.815,0.815 0,0 1,27.817 22.111L24.394,22.111A0.815,0.815 0,0 1,23.579 21.296L23.579,21.296A0.815,0.815 0,0 1,24.394 20.482z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
</vector>
|
|
@ -1,11 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.button.MaterialButton 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"
|
||||
tools:viewBindingIgnore="true"
|
||||
android:id="@+id/button"
|
||||
style="@style/Signal.Widget.Button.Large.Primary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
android:layout_marginEnd="@dimen/dsl_settings_gutter"
|
||||
tools:text="Primary button" />
|
||||
app:iconGravity="textStart"
|
||||
app:iconTint="@null"
|
||||
tools:icon="@drawable/credit_card"
|
||||
tools:text="Primary button"
|
||||
tools:viewBindingIgnore="true" />
|
Loading…
Add table
Reference in a new issue