From 101ade575883ff51a7742d030a863b6fde980408 Mon Sep 17 00:00:00 2001 From: merlinpaypal <124289716+merlinpaypal@users.noreply.github.com> Date: Mon, 18 Mar 2024 08:00:40 -0400 Subject: [PATCH] feat: modal updates (#28) --- library/build.gradle | 10 ++++------ .../src/main/java/com/paypal/messages/ModalFragment.kt | 2 +- .../res/layout/paypal_message_modal_sheet_layout.xml | 4 ++-- scripts/pre-commit | 4 ++++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/library/build.gradle b/library/build.gradle index f0bf537b..e7b545b5 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -67,13 +67,11 @@ android { tasks.register('addPreCommitGitHookOnBuild') { group 'git' - if (! project.file('../.git/hooks/pre-commit').exists()) { - println("⚈ ⚈ ⚈ Running Add Pre Commit Git Hook Script on Build ⚈ ⚈ ⚈") - exec { - commandLine("cp", "../scripts/pre-commit", "../.git/hooks") - } - println("✅ Added Pre Commit Git Hook Script.") + println("⚈ ⚈ ⚈ Running Add Pre Commit Git Hook Script on Build ⚈ ⚈ ⚈") + exec { + commandLine("cp", "../scripts/pre-commit", "../.git/hooks") } + println("✅ Added Pre Commit Git Hook Script.") } preBuild.doFirst { addPreCommitGitHookOnBuild } diff --git a/library/src/main/java/com/paypal/messages/ModalFragment.kt b/library/src/main/java/com/paypal/messages/ModalFragment.kt index 5e41829f..f922aa7c 100644 --- a/library/src/main/java/com/paypal/messages/ModalFragment.kt +++ b/library/src/main/java/com/paypal/messages/ModalFragment.kt @@ -234,7 +234,7 @@ internal class ModalFragment( behavior.isFitToContents = false behavior.expandedOffset = offsetTop behavior.isHideable = true - behavior.isDraggable = true + behavior.isDraggable = false behavior.state = BottomSheetBehavior.STATE_EXPANDED } diff --git a/library/src/main/res/layout/paypal_message_modal_sheet_layout.xml b/library/src/main/res/layout/paypal_message_modal_sheet_layout.xml index 1f69fc45..3f836aa0 100644 --- a/library/src/main/res/layout/paypal_message_modal_sheet_layout.xml +++ b/library/src/main/res/layout/paypal_message_modal_sheet_layout.xml @@ -44,9 +44,9 @@ android:layout_width="64dip" android:layout_height="64dip" android:layout_alignParentTop="true" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:layout_marginTop="12dip" - android:layout_marginRight="12dip" + android:layout_marginEnd="12dip" android:background="@drawable/ic_close" android:scaleType="center" android:contentDescription="Close modal" /> diff --git a/scripts/pre-commit b/scripts/pre-commit index c8e37713..45f892cf 100755 --- a/scripts/pre-commit +++ b/scripts/pre-commit @@ -16,11 +16,15 @@ echo git diff --staged --name-only | grep -E '(library|demo)' echo "" echo "Running ktFormat to fix any auto-fixable issues" +git stash --quiet --keep-index + ./gradlew ktFormat git add library/ git add demo/ +git stash pop --quiet + echo "***********************************************" echo "Added changed files to commit" echo ""