Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipc 211 small UI issues #398

Merged
merged 8 commits into from
Mar 20, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class PaymentComponentView(context: Context, attrs: AttributeSet?) : ConstraintL
private fun restoreBankPickerDefaultState() {
LOG.debug("Restoring bank picker default state")
context?.wrappedWithGiniHealthTheme()?.let { context ->
binding.ghsSelectBankPicker.ghsPaymentProviderAppIconHolder.root.visibility = View.INVISIBLE
binding.ghsSelectBankPicker.ghsPaymentProviderAppIconHolder.root.visibility = View.GONE
binding.ghsSelectBankPicker.ghsSelectBankButton.text = context.getString(R.string.ghs_select_bank)
binding.ghsSelectBankPicker.ghsSelectBankButton.setCompoundDrawablesWithIntrinsicBounds(
null,
Expand Down
2 changes: 1 addition & 1 deletion health-sdk/sdk/src/main/res/layout/ghs_fragment_review.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
android:id="@+id/payment"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/GiniHealthTheme.Widget.Button.OutlinedButton.Picker"
style="@style/GiniHealthTheme.Widget.Button.OutlinedButton"
android:enabled="false"
android:text="@string/ghs_pay_button"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
android:background="@drawable/ghs_selectable_payment_provider_background"
>

<include layout="@layout/ghs_payment_provider_selector_button"
<include layout="@layout/ghs_payment_provider_picker_button"
android:id="@+id/ghs_selector_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:layout_marginBottom="@dimen/ghs_medium"
/>

</FrameLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<Button
android:id="@+id/ghs_select_bank_button"
style="@style/GiniHealthTheme.Widget.Button.PaymentProviderPicker"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ghs_chevron_down_icon"
android:gravity="start|center_vertical"
android:text="@string/ghs_select_bank"
android:layout_marginStart="-8dp"
android:clickable="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ghs_payment_provider_app_icon_holder"
app:layout_constraintTop_toTopOf="parent"
/>
<include android:id="@+id/ghs_payment_provider_app_icon_holder"
layout="@layout/ghs_payment_provider_icon_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/ghs_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
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:paddingStart="@dimen/ghs_large">
android:layout_height="wrap_content">
<Button
android:id="@+id/ghs_select_bank_button"
style="@style/GiniHealthTheme.Widget.Button.TransparentBackground"
style="@style/GiniHealthTheme.Widget.Button.PaymentProviderSelector"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ghs_chevron_down_icon"
Expand All @@ -23,6 +22,8 @@
layout="@layout/ghs_payment_provider_icon_holder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/ghs_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
Expand Down
18 changes: 11 additions & 7 deletions health-sdk/sdk/src/main/res/layout/ghs_view_payment_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@
android:layout_marginBottom="@dimen/ghs_small"
android:text="@string/ghs_select_bank_label"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@id/ghs_select_bank_picker"
app:layout_constraintBottom_toTopOf="@id/ghs_select_bank_picker_layout"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ghs_more_information_label"
tools:visibility="visible" />

<include layout="@layout/ghs_payment_provider_selector_button"
android:id="@+id/ghs_select_bank_picker"
<!-- Including the layout in a FrameLayout because background cannot be set on an `include` widget -->
<FrameLayout
android:id="@+id/ghs_select_bank_picker_layout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/ghs_large"
Expand All @@ -63,12 +64,15 @@
app:layout_constraintBottom_toTopOf="@id/ghs_pay_invoice_button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ghs_select_bank_label"
tools:visibility="visible"/>
app:layout_constraintTop_toBottomOf="@id/ghs_select_bank_label">
<include layout="@layout/ghs_payment_provider_selector_button"
android:id="@+id/ghs_select_bank_picker"
tools:visibility="visible"/>
</FrameLayout>

<Button
android:id="@+id/ghs_pay_invoice_button"
style="@style/GiniHealthTheme.Widget.Button.OutlinedButton.Picker"
style="@style/GiniHealthTheme.Widget.Button.OutlinedButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/ghs_large"
Expand All @@ -78,7 +82,7 @@
app:layout_constraintBottom_toTopOf="@id/ghs_powered_by_gini_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ghs_select_bank_picker"
app:layout_constraintTop_toBottomOf="@id/ghs_select_bank_picker_layout"
tools:visibility="visible" />

<TextView
Expand Down
4 changes: 2 additions & 2 deletions health-sdk/sdk/src/main/res/values-en/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<string name="ghs_pay_button">To banking app</string>
<string name="ghs_bank_placeholder">Loading...</string>
<string name="ghs_error_failed_to_load_image">Failed to load image</string>
<string name="ghs_error_input_invalid_iban">IBAN is not valid</string>
<string name="ghs_error_input_invalid_iban">IBAN is not valid.</string>
<string name="ghs_error_input_amount_format">Invalid format</string>
<string name="ghs_error_input_recipient_empty">Recipient is required.</string>
<string name="ghs_error_input_iban_empty">IBAN is required.</string>
<string name="ghs_error_input_amount_empty">Invalid</string>
<string name="ghs_error_input_amount_empty">Invalid.</string>
<string name="ghs_error_input_purpose_empty">Purpose is required.</string>
<string name="ghs_error_document">Failed to load document</string>
<string name="ghs_error_payment_details">Failed to get payment details</string>
Expand Down
6 changes: 1 addition & 5 deletions health-sdk/sdk/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@

<!-- region Widgets -->

<style name="GiniHealthTheme.Widget.Button.OutlinedButton.Picker" parent="Root.GiniHealthTheme.Widget.Button.OutlinedButton.Picker">
<style name="GiniHealthTheme.Widget.Button.OutlinedButton" parent="Root.GiniHealthTheme.Widget.Button.OutlinedButton">
<item name="strokeColor">@color/ghs_light_05</item>
</style>

<style name="GiniHealthTheme.Widget.Button.IconButton" parent="Root.GiniHealthTheme.Widget.Button.IconButton">
<item name="iconTint">@color/ghs_light_02</item>
</style>

<style name="GiniHealthTheme.Widget.Button.OutlinedButton.ListItem" parent="Root.GiniHealthTheme.Widget.Button.OutlinedButton.ListItem">
<item name="strokeColor">@color/ghs_light_05</item>
</style>

<style name="GiniHealthTheme.ThemeOverlay.BottomSheetDialog" parent="Root.GiniHealthTheme.ThemeOverlay.BottomSheetDialog">
<item name="colorPrimary">@color/ghs_light_07</item>
<item name="bottomSheetStyle">@style/GiniHealthTheme.Widget.BottomSheet</item>
Expand Down
2 changes: 1 addition & 1 deletion health-sdk/sdk/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<color name="ghs_dark_04">#8A8A8E</color>
<color name="ghs_dark_05">#E8E9EB</color>
<color name="ghs_dark_06">#F3F3F3</color>
<color name="ghs_dark_07">#FFFFFF</color>
<color name="ghs_dark_07">#FAFAFA</color>

<color name="ghs_light_01">#F2F2F2</color>
<color name="ghs_light_02">#E8E9EB</color>
Expand Down
10 changes: 5 additions & 5 deletions health-sdk/sdk/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<string name="ghs_pay_button">Zur Banking App</string>
<string name="ghs_bank_placeholder">Wird geladen...</string>
<string name="ghs_error_failed_to_load_image">Bild konnte nicht geladen werden</string>
<string name="ghs_error_input_invalid_iban">Bitte gib eine gültige IBAN an</string>
<string name="ghs_error_input_invalid_iban">IBAN ist ungültig.</string>
<string name="ghs_error_input_amount_format">Ungültiges Format für Bezahlbetrag</string>
<string name="ghs_error_input_recipient_empty">Bitte gib einen Empfänger an</string>
<string name="ghs_error_input_iban_empty">Bitte gib eine IBAN an</string>
<string name="ghs_error_input_amount_empty">Ungültig</string>
<string name="ghs_error_input_purpose_empty">Bitte gib einen Verwendungszweck an</string>
<string name="ghs_error_input_recipient_empty">Empfänger ist notwendig.</string>
<string name="ghs_error_input_iban_empty">IBAN ist notwendig.</string>
<string name="ghs_error_input_amount_empty">Ungültig.</string>
<string name="ghs_error_input_purpose_empty">Verwendungszweck ist notwendig.</string>
<string name="ghs_error_document">Dokument konnte nicht geladen werden</string>
<string name="ghs_error_payment_details">Bezahlinformationen konnten nicht geladen werden</string>
<string name="ghs_error_bank_not_found">Banking App konnte nicht gestartet werden</string>
Expand Down
35 changes: 11 additions & 24 deletions health-sdk/sdk/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</style>
<style name="GiniHealthTheme.Widget.Button.IconButton" parent="Root.GiniHealthTheme.Widget.Button.IconButton"/>

<style name="Root.GiniHealthTheme.Widget.Button.OutlinedButton.Picker" parent="Widget.Material3.Button.OutlinedButton">
<style name="Root.GiniHealthTheme.Widget.Button.OutlinedButton" parent="Widget.Material3.Button.OutlinedButton">
<item name="cornerRadius">@dimen/ghs_small</item>
<item name="android:textAllCaps">false</item>
<item name="android:autoSizeTextType">uniform</item>
Expand All @@ -89,35 +89,13 @@
<item name="android:textColor">@color/ghs_outlined_button_text</item>
<item name="android:textAppearance">@style/GiniHealthTheme.Typography.Button.Picker</item>
</style>
<style name="GiniHealthTheme.Widget.Button.OutlinedButton.Picker" parent="Root.GiniHealthTheme.Widget.Button.OutlinedButton.Picker"/>
<style name="GiniHealthTheme.Widget.Button.OutlinedButton" parent="Root.GiniHealthTheme.Widget.Button.OutlinedButton"/>

<style name="Root.GiniHealthTheme.ThemeOverlay.Button.OutlinedButton.Picker" parent="ThemeOverlay.Material3.Button">
<item name="colorPrimary">@color/ghs_outlined_button_background</item>
</style>
<style name="GiniHealthTheme.ThemeOverlay.Button.OutlinedButton.Picker" parent="Root.GiniHealthTheme.ThemeOverlay.Button.OutlinedButton.Picker" />

<style name="Root.GiniHealthTheme.Widget.Button.OutlinedButton.ListItem" parent="Widget.Material3.Button.OutlinedButton">
<item name="cornerRadius">@dimen/ghs_small</item>
<item name="android:textAllCaps">false</item>
<item name="android:autoSizeTextType">uniform</item>
<item name="android:autoSizeMaxTextSize">16sp</item>
<item name="android:minHeight">@dimen/ghs_large_56</item>
<item name="strokeColor">@color/ghs_dark_05</item>
<item name="strokeWidth">@dimen/ghs_small_2</item>
<item name="android:insetTop">@dimen/ghs_zero</item>
<item name="android:insetBottom">@dimen/ghs_zero</item>
<item name="iconPadding">@dimen/ghs_large</item>
<item name="materialThemeOverlay">@style/GiniHealthTheme.ThemeOverlay.Button.OutlinedButton.ListItem</item>
<item name="android:textColor">@color/ghs_outlined_button_text</item>
<item name="android:textAppearance">@style/GiniHealthTheme.Typography.Button.ListItem</item>
</style>
<style name="GiniHealthTheme.Widget.Button.OutlinedButton.ListItem" parent="Root.GiniHealthTheme.Widget.Button.OutlinedButton.ListItem"/>

<style name="Root.GiniHealthTheme.ThemeOverlay.Button.OutlinedButton.ListItem" parent="ThemeOverlay.Material3.Button">
<item name="colorPrimary">@color/ghs_outlined_button_list_item_background</item>
</style>
<style name="GiniHealthTheme.ThemeOverlay.Button.OutlinedButton.ListItem" parent="Root.GiniHealthTheme.ThemeOverlay.Button.OutlinedButton.ListItem" />

<style name="Root.GiniHealthTheme.ThemeOverlay.BottomSheetDialog" parent="ThemeOverlay.Material3.BottomSheetDialog">
<item name="colorPrimary">@color/ghs_dark_07</item>
<item name="bottomSheetStyle">@style/GiniHealthTheme.Widget.BottomSheet</item>
Expand Down Expand Up @@ -220,4 +198,13 @@
</style>
<style name="GiniHealthTheme.PaymentDetails.InfoBar.TextAppearance" parent="Root.GiniHealthTheme.PaymentDetails.InfoBar.TextAppearance" />

<style name="Root.GiniHealthTheme.Widget.Button.PaymentProviderSelector" parent="GiniHealthTheme.Widget.Button.TransparentBackground">
<item name="android:textAppearance">@style/GiniHealthTheme.Typography.Input</item>
</style>
<style name="GiniHealthTheme.Widget.Button.PaymentProviderSelector" parent="Root.GiniHealthTheme.Widget.Button.PaymentProviderSelector"/>

<style name="Root.GiniHealthTheme.Widget.Button.PaymentProviderPicker" parent="GiniHealthTheme.Widget.Button.TransparentBackground">
<item name="android:textAppearance">@style/GiniHealthTheme.Typography.Body1</item>
</style>
<style name="GiniHealthTheme.Widget.Button.PaymentProviderPicker" parent="Root.GiniHealthTheme.Widget.Button.PaymentProviderPicker"/>
</resources>
11 changes: 11 additions & 0 deletions health-sdk/sdk/src/main/res/values/typography.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<style name="Root.GiniHealthTheme.Typography.Body1" parent="TextAppearance.MaterialComponents.Body1">
<item name="android:textSize">16sp</item>
<item name="android:textColor">?attr/colorOnBackground</item>
<!-- See "weight" here for details: https://developer.android.com/training/wearables/wff/group/part/text/font -->
<item name="android:textFontWeight">400</item>
<item name="android:lineHeight">@dimen/ghs_large_22</item>
</style>

Expand Down Expand Up @@ -84,6 +86,14 @@
<item name="android:lineHeight">@dimen/ghs_large_22</item>
</style>

<style name="Root.GiniHealthTheme.Typography.Input" parent="TextAppearance.MaterialComponents.Button">
<item name="android:textColor">?attr/colorOnBackground</item>
<item name="android:textSize">14sp</item>
<!-- See "weight" here for details: https://developer.android.com/training/wearables/wff/group/part/text/font -->
<item name="android:textFontWeight">500</item>
<item name="android:lineHeight">@dimen/ghs_large_22</item>
</style>

<style name="GiniHealthTheme.Typography.Headline1" parent="Root.GiniHealthTheme.Typography.Headline1"/>
<style name="GiniHealthTheme.Typography.Headline2" parent="Root.GiniHealthTheme.Typography.Headline2"/>
<style name="GiniHealthTheme.Typography.Headline3" parent="Root.GiniHealthTheme.Typography.Headline3"/>
Expand All @@ -97,4 +107,5 @@
<style name="GiniHealthTheme.Typography.Caption1" parent="Root.GiniHealthTheme.Typography.Caption1"/>
<style name="GiniHealthTheme.Typography.Caption2" parent="Root.GiniHealthTheme.Typography.Caption2"/>
<style name="GiniHealthTheme.Typography.Link" parent="Root.GiniHealthTheme.Typography.Link"/>
<style name="GiniHealthTheme.Typography.Input" parent="Root.GiniHealthTheme.Typography.Input"/>
</resources>
Loading