Skip to content

Commit

Permalink
Merge branch 'main' into IPC-250-Update-Payment-Component-UI
Browse files Browse the repository at this point in the history
  • Loading branch information
danicretu committed May 15, 2024
2 parents cd372b9 + fb48d4a commit f1b9bd1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package net.gini.android.health.sdk.bankselection
import android.app.Dialog
import android.content.Intent
import android.content.res.ColorStateList
import android.graphics.Paint
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.net.Uri
Expand Down Expand Up @@ -69,6 +70,13 @@ class BankSelectionBottomSheet private constructor(private val paymentComponent:
dismiss()
}

binding.ghsMoreInformationLabel.apply {
paintFlags = binding.ghsMoreInformationLabel.paintFlags or Paint.UNDERLINE_TEXT_FLAG
setOnClickListener {
paymentComponent?.listener?.onMoreInformationClicked()
dismiss()
}
}
return binding.root
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ internal fun Context.generateBitmapDrawableIcon(icon: ByteArray, iconSize: Int):
iconSizePx,
true
)
bitmap.recycle()
// Bitmap.createScaledBitmap returns original bitmap when width and height is the same as bitmap.width and bitmap.height. In one case (Pixel 7 Pro) iconSizePx was being resolved to exactly the same value as some of the bitmap's widths
// Recycling this bitmap in this case leads to the app crashing when attempting to load the drawable into an ImageView
// Only recycle if width is different than bitmap.width (can only check for width, as it's the same dimension for both with and height)
if (bitmap.width != iconSizePx) bitmap.recycle()
BitmapDrawable(this.resources, scaledBitmap)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,32 @@
tools:itemCount="13"
tools:listitem="@layout/ghs_item_payment_provider_app" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ghs_more_information_label"
style="@style/GiniHealthTheme.Typography.Caption2"
android:layout_marginStart="@dimen/ghs_large"
android:drawableStart="@drawable/ghs_info_circle_icon"
android:drawableTint="@color/ghs_more_information_color"
android:drawablePadding="@dimen/ghs_medium"
android:text="@string/ghs_more_information_underlined_part"
android:textColor="@color/ghs_payment_component_caption"
android:gravity="center_vertical"
app:layout_constraintTop_toTopOf="@id/ghs_powered_by_gini_layout"
app:layout_constraintBottom_toBottomOf="@id/ghs_powered_by_gini_layout"
app:layout_constraintStart_toStartOf="parent"
/>

<include layout="@layout/ghs_powered_by_gini"
android:id="@+id/ghs_powered_by_gini_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ghs_payment_provider_apps_list"
android:layout_marginVertical="@dimen/ghs_large"
/>
android:layout_marginEnd="@dimen/ghs_large"
/>

</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 1 addition & 0 deletions health-sdk/sdk/src/main/res/values-night/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<color name="ghs_install_app_details_color">@color/ghs_light_03</color>
<color name="ghs_select_bank_and_pay_color">@color/ghs_light_01</color>
<color name="ghs_info_button_tint">@color/ghs_light_02</color>
<color name="ghs_more_information_color">@color/ghs_light_02</color>

<!-- Open With -->
<color name="ghs_open_with_title">@color/ghs_light_02</color>
Expand Down
1 change: 1 addition & 0 deletions health-sdk/sdk/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<color name="ghs_install_app_details_color">@color/ghs_dark_03</color>
<color name="ghs_select_bank_and_pay_color">@color/ghs_dark_01</color>
<color name="ghs_info_button_tint">@color/ghs_dark_02</color>
<color name="ghs_more_information_color">@color/ghs_dark_02</color>

<!-- Open With -->
<color name="ghs_open_with_title">@color/ghs_dark_02</color>
Expand Down

0 comments on commit f1b9bd1

Please sign in to comment.