Skip to content

Commit

Permalink
feat(internal-payment-sdk): Added landscape mode for `BankSelectionBo…
Browse files Browse the repository at this point in the history
…ttomSheet`

IPC-459
  • Loading branch information
danicretu committed Nov 28, 2024
1 parent 6fe7929 commit c352ea8
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 45 deletions.
2 changes: 0 additions & 2 deletions health-sdk/example-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@
android:exported="false" />
<activity
android:name=".invoices.ui.InvoicesActivity"
android:screenOrientation="portrait"
android:label="@string/title_activity_invoices"
android:exported="false" />
<activity
android:name=".invoices.ui.AppCompatThemeInvoicesActivity"
android:screenOrientation="portrait"
android:label="@string/title_activity_invoices"
android:exported="false"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class BankSelectionBottomSheet private constructor(private val paymentComponent:
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
binding = GpsBottomSheetBankSelectionBinding.inflate(inflater, container, false)

binding.gpsPaymentProviderAppsList.setHasFixedSize(false)
binding.gpsPaymentProviderAppsList.layoutManager = LinearLayoutManager(requireContext())
binding.gpsPaymentProviderAppsList.adapter =
PaymentProviderAppsAdapter(emptyList(),
Expand All @@ -76,11 +77,6 @@ class BankSelectionBottomSheet private constructor(private val paymentComponent:
}
})

binding.gpsCloseButton.setOnClickListener {
viewModel.backListener?.backCalled()
dismiss()
}

binding.gpsMoreInformationLabel.apply {
paintFlags = binding.gpsMoreInformationLabel.paintFlags or Paint.UNDERLINE_TEXT_FLAG
setOnClickListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="match_parent"
android:paddingBottom="@dimen/gps_medium_12"
android:paddingHorizontal="@dimen/gps_large_72">

<com.google.android.material.bottomsheet.BottomSheetDragHandleView
style="@style/GiniPaymentTheme.Widget.BottomSheet.DragHandle"
android:id="@+id/drag_handle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/gps_medium"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />

<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/scroll_view"
android:layout_below="@id/drag_handle"
android:layout_above="@id/gps_more_information_label"
android:fillViewport="true"
android:layout_marginBottom="@dimen/gps_medium_12">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/gps_title_label"
style="@style/GiniPaymentTheme.Typography.Subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gps_select_bank"
android:textColor="@color/gps_bank_selection_bottom_sheet_title"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/gps_subtitle_label"
/>

<TextView
android:id="@+id/gps_subtitle_label"
style="@style/GiniPaymentTheme.Typography.Caption1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/gps_large"
android:text="@string/gps_payment_provider_apps_list_description"
android:textColor="@color/gps_bank_selection_bottom_sheet_caption"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_title_label"/>

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/gps_payment_provider_apps_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/gps_large"
android:nestedScrollingEnabled="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_subtitle_label"
tools:itemCount="13"
tools:listitem="@layout/gps_item_payment_provider_app" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gps_more_information_label"
style="@style/GiniPaymentTheme.Typography.Caption2"
android:drawableStart="@drawable/gps_info_circle_icon"
android:drawableTint="@color/gps_more_information_color"
android:drawablePadding="@dimen/gps_medium"
android:text="@string/gps_more_information_underlined_part"
android:textColor="@color/gps_payment_component_caption"
android:gravity="center_vertical"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
/>

<include layout="@layout/gps_powered_by_gini"
android:id="@+id/gps_powered_by_gini_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -15,58 +15,30 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/gps_header_container"
android:layout_width="match_parent"
<TextView
android:id="@+id/gps_title_label"
style="@style/GiniPaymentTheme.Typography.Subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/gps_subtitle_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0"
app:layout_constraintVertical_chainStyle="packed">

<ImageView
android:id="@+id/gps_close_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/gps_small"
android:layout_marginTop="@dimen/gps_large_32"
android:paddingVertical="@dimen/gps_medium_12"
android:paddingHorizontal="@dimen/gps_medium_12"
android:contentDescription="@string/gps_close_content_description"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/gps_close_icon"
app:tint="?attr/colorOnBackground" />

<TextView
android:id="@+id/gps_title_label"
style="@style/GiniPaymentTheme.Typography.Subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/gps_large_24"
android:text="@string/gps_select_bank"
android:textColor="@color/gps_bank_selection_bottom_sheet_title"
app:layout_constraintBottom_toBottomOf="@+id/gps_close_button"
app:layout_constraintStart_toEndOf="@+id/gps_close_button"
app:layout_constraintTop_toTopOf="@+id/gps_close_button" />

</androidx.constraintlayout.widget.ConstraintLayout>
android:text="@string/gps_select_bank"
android:textColor="@color/gps_bank_selection_bottom_sheet_title"
app:layout_constraintTop_toBottomOf="@id/drag_handle"
app:layout_constraintStart_toStartOf="@id/gps_subtitle_label"/>

<TextView
android:id="@+id/gps_subtitle_label"
style="@style/GiniPaymentTheme.Typography.Caption1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/gps_small"
android:layout_marginStart="@dimen/gps_large"
android:layout_marginEnd="@dimen/gps_large"
android:text="@string/gps_payment_provider_apps_list_description"
android:textColor="@color/gps_bank_selection_bottom_sheet_caption"
app:layout_constraintBottom_toTopOf="@id/gps_payment_provider_apps_list"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_header_container" />
app:layout_constraintTop_toBottomOf="@id/gps_title_label" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/gps_payment_provider_apps_list"
Expand Down
1 change: 1 addition & 0 deletions internal-payment-sdk/sdk/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<dimen name="gps_large_56">56dp</dimen>
<dimen name="gps_large_60">60dp</dimen>
<dimen name="gps_large_64">64dp</dimen>
<dimen name="gps_large_72">72dp</dimen>
<dimen name="gps_large_80">80dp</dimen>
<dimen name="gps_large_96">96dp</dimen>
<dimen name="gps_large_100">100dp</dimen>
Expand Down

0 comments on commit c352ea8

Please sign in to comment.