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

feat(internal-payment-sdk): Added landscape mode for `InstallAppBotto… #633

Open
wants to merge 1 commit into
base: feat(internal-payment-sdk)-Landscape-mode
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import net.gini.android.internal.payment.utils.GpsBottomSheetDialogFragment
import net.gini.android.internal.payment.utils.autoCleared
import net.gini.android.internal.payment.utils.extensions.getLayoutInflaterWithGiniPaymentThemeAndLocale
import net.gini.android.internal.payment.utils.extensions.getLocaleStringResource
import net.gini.android.internal.payment.utils.extensions.isLandscapeOrientation
import net.gini.android.internal.payment.utils.extensions.setBackListener
import net.gini.android.internal.payment.utils.setBackgroundTint
import org.slf4j.LoggerFactory
Expand Down Expand Up @@ -74,7 +75,9 @@ class InstallAppBottomSheet private constructor(
savedInstanceState: Bundle?
): View {
binding = GpsBottomSheetInstallAppBinding.inflate(inflater, container, false)
binding.root.minHeight = minHeight ?: resources.getDimension(R.dimen.gps_install_app_min_height).toInt()
if (!resources.isLandscapeOrientation()) {
binding.root.minHeight = minHeight ?: resources.getDimension(R.dimen.gps_install_app_min_height).toInt()
}
return binding.root
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="@dimen/gps_large"
android:paddingHorizontal="@dimen/gps_large_72"
xmlns:app="http://schemas.android.com/apk/res-auto">

<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"
app:layout_constraintTop_toTopOf="parent"
/>

<TextView
android:id="@+id/gps_install_app_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/gps_install_app_title"
style="@style/GiniPaymentTheme.Typography.Subtitle1"
android:textColor="@color/gps_install_app_title_color"
android:gravity="center_horizontal"
app:layout_constraintTop_toBottomOf="@id/drag_handle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>

<include layout="@layout/gps_payment_provider_icon_holder"
android:id="@+id/gps_payment_provider_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/gps_medium_12"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_install_app_title"/>

<TextView
android:id="@+id/gps_install_app_details"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/gps_install_app_detail"
android:drawableLeft="@drawable/gps_info_circle_icon"
android:drawablePadding="@dimen/gps_large"
android:drawableTint="@color/gps_install_app_details_color"
android:textColor="@color/gps_install_app_details_color"
android:gravity="center_vertical"
style="@style/GiniPaymentTheme.Typography.Caption1"
android:layout_marginTop="@dimen/gps_large"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_payment_provider_icon"
/>

<Button
android:id="@+id/gps_forward_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/GiniPaymentTheme.Widget.Button.OutlinedButton"
android:text="@string/gps_forward"
android:visibility="gone"
android:layout_marginBottom="@dimen/gps_medium_12"
android:layout_marginTop="@dimen/gps_large_36"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_install_app_details"
app:layout_constraintBottom_toTopOf="@id/gps_powered_by_gini_layout"/>

<ImageButton
android:id="@+id/gps_play_store_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gps_play_store_logo"
android:background="@null"
android:visibility="visible"
android:contentDescription="@string/gps_play_store_content_description"
android:layout_marginTop="@dimen/gps_large_36"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_install_app_details"
app:layout_constraintBottom_toTopOf="@id/gps_powered_by_gini_layout"
/>

<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"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/gps_play_store_logo"
android:layout_marginTop="@dimen/gps_medium_12"
/>

</androidx.constraintlayout.widget.ConstraintLayout>