mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Add new credit card and bank transfer glyphs.
This commit is contained in:
committed by
Cody Henthorne
parent
8425bb4f59
commit
5f7099184d
@@ -58,7 +58,7 @@ class BecomeASustainerFragment : DSLSettingsBottomSheetFragment() {
|
||||
|
||||
space(DimensionUnit.DP.toPixels(32f).toInt())
|
||||
|
||||
tonalButton(
|
||||
tonalWrappedButton(
|
||||
text = DSLSettingsText.from(
|
||||
R.string.BecomeASustainerMegaphone__become_a_sustainer
|
||||
),
|
||||
|
||||
@@ -16,7 +16,6 @@ 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
|
||||
@@ -106,7 +105,7 @@ class GatewaySelectorBottomSheet : DSLSettingsBottomSheetFragment() {
|
||||
|
||||
primaryButton(
|
||||
text = DSLSettingsText.from(R.string.GatewaySelectorBottomSheet__credit_or_debit_card),
|
||||
icon = DSLSettingsIcon.from(R.drawable.credit_card, NO_TINT),
|
||||
icon = DSLSettingsIcon.from(R.drawable.credit_card, R.color.signal_colorOnPrimary),
|
||||
onClick = {
|
||||
findNavController().popBackStack()
|
||||
val response = GatewayResponse(GatewayResponse.Gateway.CREDIT_CARD, args.request)
|
||||
@@ -118,9 +117,9 @@ class GatewaySelectorBottomSheet : DSLSettingsBottomSheetFragment() {
|
||||
if (state.isSEPADebitAvailable) {
|
||||
space(8.dp)
|
||||
|
||||
primaryButton(
|
||||
tonalButton(
|
||||
text = DSLSettingsText.from(R.string.GatewaySelectorBottomSheet__bank_transfer),
|
||||
icon = DSLSettingsIcon.from(R.drawable.credit_card, NO_TINT), // TODO [sepa] -- Final icon
|
||||
icon = DSLSettingsIcon.from(R.drawable.bank_transfer),
|
||||
onClick = {
|
||||
findNavController().popBackStack()
|
||||
val response = GatewayResponse(GatewayResponse.Gateway.SEPA_DEBIT, args.request)
|
||||
|
||||
@@ -177,10 +177,21 @@ class DSLConfiguration {
|
||||
|
||||
fun tonalButton(
|
||||
text: DSLSettingsText,
|
||||
icon: DSLSettingsIcon? = null,
|
||||
isEnabled: Boolean = true,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
val preference = Button.Model.Tonal(text, null, isEnabled, onClick)
|
||||
val preference = Button.Model.Tonal(text, icon, isEnabled, onClick)
|
||||
children.add(preference)
|
||||
}
|
||||
|
||||
fun tonalWrappedButton(
|
||||
text: DSLSettingsText,
|
||||
icon: DSLSettingsIcon? = null,
|
||||
isEnabled: Boolean = true,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
val preference = Button.Model.TonalWrapped(text, icon, isEnabled, onClick)
|
||||
children.add(preference)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ object Button {
|
||||
mappingAdapter.registerFactory(Model.Primary::class.java, LayoutFactory({ ViewHolder(it) }, R.layout.dsl_button_primary))
|
||||
mappingAdapter.registerFactory(Model.PrimaryWrapped::class.java, LayoutFactory({ ViewHolder(it) }, R.layout.dsl_button_primary_wrapped))
|
||||
mappingAdapter.registerFactory(Model.Tonal::class.java, LayoutFactory({ ViewHolder(it) }, R.layout.dsl_button_tonal))
|
||||
mappingAdapter.registerFactory(Model.TonalWrapped::class.java, LayoutFactory({ ViewHolder(it) }, R.layout.dsl_button_tonal_wrapped))
|
||||
mappingAdapter.registerFactory(Model.SecondaryNoOutline::class.java, LayoutFactory({ ViewHolder(it) }, R.layout.dsl_button_secondary))
|
||||
}
|
||||
|
||||
@@ -56,6 +57,13 @@ object Button {
|
||||
onClick: () -> Unit
|
||||
) : Model<Tonal>(title, icon, isEnabled, onClick)
|
||||
|
||||
class TonalWrapped(
|
||||
title: DSLSettingsText?,
|
||||
icon: DSLSettingsIcon?,
|
||||
isEnabled: Boolean,
|
||||
onClick: () -> Unit
|
||||
) : Model<TonalWrapped>(title, icon, isEnabled, onClick)
|
||||
|
||||
class SecondaryNoOutline(
|
||||
title: DSLSettingsText?,
|
||||
icon: DSLSettingsIcon?,
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
<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="M4.158,6L27.842,6A3.158,3.158 0,0 1,31 9.158L31,22.842A3.158,3.158 0,0 1,27.842 26L4.158,26A3.158,3.158 0,0 1,1 22.842L1,9.158A3.158,3.158 0,0 1,4.158 6z"
|
||||
android:fillColor="#ffffff"/>
|
||||
<path
|
||||
android:pathData="M22.316,8.963L27.053,8.963A0.789,0.789 0,0 1,27.842 9.752L27.842,14.099A0.789,0.789 0,0 1,27.053 14.889L22.316,14.889A0.789,0.789 0,0 1,21.527 14.099L21.527,9.752A0.789,0.789 0,0 1,22.316 8.963z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M4.899,20.074L8.154,20.074A0.741,0.741 0,0 1,8.895 20.815L8.895,20.815A0.741,0.741 0,0 1,8.154 21.556L4.899,21.556A0.741,0.741 0,0 1,4.158 20.815L4.158,20.815A0.741,0.741 0,0 1,4.899 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M11.214,20.074L14.47,20.074A0.741,0.741 0,0 1,15.21 20.815L15.21,20.815A0.741,0.741 0,0 1,14.47 21.556L11.214,21.556A0.741,0.741 0,0 1,10.474 20.815L10.474,20.815A0.741,0.741 0,0 1,11.214 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M17.53,20.074L20.785,20.074A0.741,0.741 0,0 1,21.526 20.815L21.526,20.815A0.741,0.741 0,0 1,20.785 21.556L17.53,21.556A0.741,0.741 0,0 1,16.789 20.815L16.789,20.815A0.741,0.741 0,0 1,17.53 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M23.846,20.074L27.102,20.074A0.741,0.741 0,0 1,27.842 20.815L27.842,20.815A0.741,0.741 0,0 1,27.102 21.556L23.846,21.556A0.741,0.741 0,0 1,23.105 20.815L23.105,20.815A0.741,0.741 0,0 1,23.846 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
</vector>
|
||||
51
app/src/main/res/drawable/bank_transfer.xml
Normal file
51
app/src/main/res/drawable/bank_transfer.xml
Normal file
@@ -0,0 +1,51 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14.07 2.27l7.9 4.99-0.94 1.48-7.9-4.99c-0.69-0.44-1.57-0.44-2.26 0l-7.9 4.99-0.94-1.48 7.9-4.99c1.26-0.8 2.88-0.8 4.14 0Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M1.63 8c0-0.48 0.39-0.87 0.87-0.87h19c0.48 0 0.88 0.39 0.88 0.87s-0.4 0.88-0.88 0.88h-19c-0.48 0-0.88-0.4-0.88-0.88Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M2.13 20.5c0-0.48 0.39-0.88 0.87-0.88h18c0.48 0 0.88 0.4 0.88 0.88s-0.4 0.88-0.88 0.88H3c-0.48 0-0.88-0.4-0.88-0.88Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M5.25 18.25c-0.41 0-0.75-0.34-0.75-0.75V11c0-0.41 0.34-0.75 0.75-0.75S6 10.59 6 11v6.5c0 0.41-0.34 0.75-0.75 0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M9.75 18.25C9.34 18.25 9 17.91 9 17.5V11c0-0.41 0.34-0.75 0.75-0.75S10.5 10.59 10.5 11v6.5c0 0.41-0.34 0.75-0.75 0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M14.25 18.25c-0.41 0-0.75-0.34-0.75-0.75V11c0-0.41 0.34-0.75 0.75-0.75S15 10.59 15 11v6.5c0 0.41-0.34 0.75-0.75 0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M18.75 18.25c-0.41 0-0.75-0.34-0.75-0.75V11c0-0.41 0.34-0.75 0.75-0.75S19.5 10.59 19.5 11v6.5c0 0.41-0.34 0.75-0.75 0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M3.5 10.5c0-0.41 0.34-0.75 0.75-0.75h2C6.66 9.75 7 10.09 7 10.5s-0.34 0.75-0.75 0.75h-2c-0.41 0-0.75-0.34-0.75-0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M8 10.5c0-0.41 0.34-0.75 0.75-0.75h2c0.41 0 0.75 0.34 0.75 0.75s-0.34 0.75-0.75 0.75h-2C8.34 11.25 8 10.91 8 10.5Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12.5 10.5c0-0.41 0.34-0.75 0.75-0.75h2c0.41 0 0.75 0.34 0.75 0.75s-0.34 0.75-0.75 0.75h-2c-0.41 0-0.75-0.34-0.75-0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M17 10.5c0-0.41 0.34-0.75 0.75-0.75h2c0.41 0 0.75 0.34 0.75 0.75s-0.34 0.75-0.75 0.75h-2c-0.41 0-0.75-0.34-0.75-0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M3.5 18c0-0.41 0.34-0.75 0.75-0.75h2C6.66 17.25 7 17.59 7 18s-0.34 0.75-0.75 0.75h-2c-0.41 0-0.75-0.34-0.75-0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M8 18c0-0.41 0.34-0.75 0.75-0.75h2c0.41 0 0.75 0.34 0.75 0.75s-0.34 0.75-0.75 0.75h-2C8.34 18.75 8 18.41 8 18Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M12.5 18c0-0.41 0.34-0.75 0.75-0.75h2c0.41 0 0.75 0.34 0.75 0.75s-0.34 0.75-0.75 0.75h-2c-0.41 0-0.75-0.34-0.75-0.75Z"/>
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M17 18c0-0.41 0.34-0.75 0.75-0.75h2c0.41 0 0.75 0.34 0.75 0.75s-0.34 0.75-0.75 0.75h-2C17.34 18.75 17 18.41 17 18Z"/>
|
||||
</vector>
|
||||
@@ -1,30 +1,9 @@
|
||||
<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="M4.158,6L27.842,6A3.158,3.158 0,0 1,31 9.158L31,22.842A3.158,3.158 0,0 1,27.842 26L4.158,26A3.158,3.158 0,0 1,1 22.842L1,9.158A3.158,3.158 0,0 1,4.158 6z"
|
||||
android:fillColor="#FBFCFE"/>
|
||||
<path
|
||||
android:pathData="M4.158,6L27.842,6A3.158,3.158 0,0 1,31 9.158L31,22.842A3.158,3.158 0,0 1,27.842 26L4.158,26A3.158,3.158 0,0 1,1 22.842L1,9.158A3.158,3.158 0,0 1,4.158 6z"
|
||||
android:fillColor="#50679F"
|
||||
android:fillAlpha="0.11"/>
|
||||
<path
|
||||
android:pathData="M22.316,8.963L27.053,8.963A0.789,0.789 0,0 1,27.842 9.752L27.842,14.099A0.789,0.789 0,0 1,27.053 14.889L22.316,14.889A0.789,0.789 0,0 1,21.527 14.099L21.527,9.752A0.789,0.789 0,0 1,22.316 8.963z"
|
||||
android:strokeAlpha="0.4"
|
||||
android:fillColor="#586071"
|
||||
android:fillAlpha="0.4"/>
|
||||
<path
|
||||
android:pathData="M4.899,20.074L8.154,20.074A0.741,0.741 0,0 1,8.895 20.815L8.895,20.815A0.741,0.741 0,0 1,8.154 21.556L4.899,21.556A0.741,0.741 0,0 1,4.158 20.815L4.158,20.815A0.741,0.741 0,0 1,4.899 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M11.214,20.074L14.47,20.074A0.741,0.741 0,0 1,15.21 20.815L15.21,20.815A0.741,0.741 0,0 1,14.47 21.556L11.214,21.556A0.741,0.741 0,0 1,10.474 20.815L10.474,20.815A0.741,0.741 0,0 1,11.214 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M17.53,20.074L20.785,20.074A0.741,0.741 0,0 1,21.526 20.815L21.526,20.815A0.741,0.741 0,0 1,20.785 21.556L17.53,21.556A0.741,0.741 0,0 1,16.789 20.815L16.789,20.815A0.741,0.741 0,0 1,17.53 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
<path
|
||||
android:pathData="M23.846,20.074L27.102,20.074A0.741,0.741 0,0 1,27.842 20.815L27.842,20.815A0.741,0.741 0,0 1,27.102 21.556L23.846,21.556A0.741,0.741 0,0 1,23.105 20.815L23.105,20.815A0.741,0.741 0,0 1,23.846 20.074z"
|
||||
android:fillColor="#A1ACC4"/>
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M22.88 8.96c0-0.67 0-1.22-0.04-1.67-0.04-0.47-0.12-0.91-0.33-1.32-0.33-0.64-0.84-1.15-1.48-1.48-0.4-0.2-0.85-0.29-1.32-0.33-0.45-0.04-1-0.04-1.67-0.04H5.96c-0.67 0-1.22 0-1.67 0.04C3.82 4.2 3.38 4.28 2.97 4.5 2.33 4.82 1.82 5.33 1.49 5.97 1.3 6.37 1.2 6.82 1.16 7.29c-0.04 0.45-0.04 1-0.03 1.67v6.08c0 0.67 0 1.22 0.03 1.67 0.04 0.47 0.12 0.91 0.33 1.32 0.33 0.64 0.84 1.15 1.48 1.48 0.4 0.2 0.85 0.29 1.32 0.33 0.45 0.04 1 0.04 1.67 0.04h12.08c0.67 0 1.22 0 1.67-0.04 0.47-0.04 0.91-0.12 1.32-0.33 0.64-0.33 1.15-0.84 1.48-1.48 0.2-0.4 0.29-0.85 0.33-1.32 0.04-0.45 0.04-1 0.04-1.67V8.96Zm-1.93-2.2c0.06 0.13 0.11 0.3 0.14 0.67 0.02 0.25 0.03 0.55 0.03 0.95H2.88c0-0.4 0-0.7 0.03-0.95 0.03-0.36 0.08-0.54 0.14-0.67 0.16-0.3 0.4-0.55 0.71-0.7 0.13-0.07 0.3-0.12 0.67-0.15C4.8 5.88 5.29 5.87 6 5.87h12c0.71 0 1.2 0 1.57 0.04 0.36 0.03 0.54 0.08 0.67 0.14 0.3 0.16 0.55 0.4 0.7 0.71ZM2.88 15v-4.38h18.25V15c0 0.71 0 1.2-0.04 1.57-0.03 0.36-0.08 0.54-0.14 0.67-0.16 0.3-0.4 0.55-0.71 0.7-0.13 0.07-0.3 0.12-0.67 0.15-0.37 0.03-0.86 0.04-1.57 0.04H6c-0.71 0-1.2 0-1.57-0.04-0.36-0.03-0.54-0.08-0.67-0.14-0.3-0.16-0.55-0.4-0.7-0.71-0.07-0.13-0.12-0.3-0.15-0.67C2.88 16.2 2.87 15.71 2.87 15Z"/>
|
||||
</vector>
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<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.Tonal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button"
|
||||
style="@style/Signal.Widget.Button.Large.Tonal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
tools:text="Tonal button" />
|
||||
</FrameLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||
android:layout_marginEnd="@dimen/dsl_settings_gutter"
|
||||
android:insetTop="2dp"
|
||||
android:insetBottom="2dp"
|
||||
app:iconGravity="textStart"
|
||||
app:iconSize="32dp"
|
||||
app:iconTint="@null"
|
||||
tools:icon="@drawable/bank_transfer"
|
||||
tools:text="Tonal button"
|
||||
tools:viewBindingIgnore="true" />
|
||||
15
app/src/main/res/layout/dsl_button_tonal_wrapped.xml
Normal file
15
app/src/main/res/layout/dsl_button_tonal_wrapped.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:viewBindingIgnore="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button"
|
||||
style="@style/Signal.Widget.Button.Large.Tonal"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
tools:text="Tonal button" />
|
||||
</FrameLayout>
|
||||
@@ -65,6 +65,9 @@
|
||||
<action
|
||||
android:id="@+id/action_giftFlowConfirmationFragment_to_bankTransferMandateFragment"
|
||||
app:destination="@id/bankTransferMandateFragment" />
|
||||
<action
|
||||
android:id="@+id/action_giftFlowConfirmationFragment_to_donationPendingBottomSheet"
|
||||
app:destination="@id/donationPendingBottomSheet" />
|
||||
</fragment>
|
||||
|
||||
<dialog
|
||||
@@ -228,4 +231,16 @@
|
||||
android:id="@+id/action_bankTransferDetailsFragment_to_yourInformationIsPrivateBottomSheet"
|
||||
app:destination="@id/yourInformationIsPrivateBottomSheet" />
|
||||
</fragment>
|
||||
|
||||
<dialog
|
||||
android:id="@+id/donationPendingBottomSheet"
|
||||
android:name="org.thoughtcrime.securesms.components.settings.app.subscription.DonationPendingBottomSheet"
|
||||
android:label="donation_pending_bottom_sheet"
|
||||
tools:layout="@layout/dsl_settings_bottom_sheet">
|
||||
|
||||
<argument
|
||||
android:name="request"
|
||||
app:argType="org.thoughtcrime.securesms.components.settings.app.subscription.donate.gateway.GatewayRequest"
|
||||
app:nullable="false" />
|
||||
</dialog>
|
||||
</navigation>
|
||||
Reference in New Issue
Block a user