From 30e9a19f36914c49106837e0451a06344314591b Mon Sep 17 00:00:00 2001 From: AhlaamK-tap Date: Wed, 24 May 2023 10:07:07 +0300 Subject: [PATCH] Enhancement Feature The merchant can now configure the scanner to be shown or hide --- CHANGELOG.md | 7 +++++++ README.md | 6 +++++- .../tap/sample/activity/MainActivity.java | 4 +++- .../viewholders/CardCredentialsViewHolder.java | 5 +++++ .../gosellapi/open/controllers/ThemeObject.java | 17 ++++++++++++++++- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd2dac7b..d72135fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ # CHANGELOG +[3.17.0] - 2023-05-24 +### Enhancement Feature: +- The merchant can now configure the scanner to be shown or hide +### Impact on existing integrations: +- The update does not impact existing integrations. +### Recommended changes for existing integrations before updating: +- None. [3.16.4] - 2023-05-22 ### Hot Fix: - bug fix for text diff --git a/README.md b/README.md index 346f5881..d09522ed 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,8 @@ import company.tap.gosellapi.GoSellSDK // change scan icon .setScanIconDrawable(getResources().getDrawable(R.drawable.btn_card_scanner_normal)) // **Optional** + //Show or hide the scanner + .setCardScannerIconVisible(true) // **Optional** // setup pay button selector [ background - round corner ] .setPayButtonResourceId(R.drawable.btn_pay_selector) @@ -434,7 +436,9 @@ import company.tap.gosellapi.GoSellSDK // change scan icon .setScanIconDrawable(getResources().getDrawable(R.drawable.btn_card_scanner_normal)) // **Optional** - + + //Show or hide the scanner + .setCardScannerIconVisible(true) // **Optional** // setup pay button selector [ background - round corner ] .setPayButtonResourceId(R.drawable.btn_pay_selector) diff --git a/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java b/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java index 3a74b45b..69be063f 100644 --- a/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java +++ b/goSellSDKSample/src/main/java/company/tap/sample/activity/MainActivity.java @@ -184,6 +184,7 @@ private void configureSDKThemeObject() { .setSaveCardSwitchOnTrackTint(getResources().getColor(R.color.vibrant_green_pressed)) .setScanIconDrawable(getResources().getDrawable(R.drawable.btn_card_scanner_normal)) + .setCardScannerIconVisible(true) // **Optional** .setPayButtonResourceId(R.drawable.btn_pay_selector) //btn_pay_merchant_selector .setPayButtonFont(Typeface.createFromAsset(getAssets(), "fonts/roboto_light.ttf")) @@ -193,7 +194,8 @@ private void configureSDKThemeObject() { .setPayButtonTextSize(14) .setPayButtonLoaderVisible(true) .setPayButtonSecurityIconVisible(true) - .setPayButtonText("Tokenize Text value") // **Optional** + // .setPayButtonText("Tokenize Text value") // **Optional** + // setup dialog textcolor and textsize diff --git a/library/src/main/java/company/tap/gosellapi/internal/viewholders/CardCredentialsViewHolder.java b/library/src/main/java/company/tap/gosellapi/internal/viewholders/CardCredentialsViewHolder.java index 926228ed..6155dbd1 100644 --- a/library/src/main/java/company/tap/gosellapi/internal/viewholders/CardCredentialsViewHolder.java +++ b/library/src/main/java/company/tap/gosellapi/internal/viewholders/CardCredentialsViewHolder.java @@ -270,6 +270,11 @@ public void afterTextChanged(Editable s) { cardScannerButton = itemView.findViewById(R.id.cardScannerButton); + if(ThemeObject.getInstance().isSetCardScannerIconVisible()) cardScannerButton.setVisibility(View.VISIBLE); + else cardScannerButton.setVisibility(View.GONE); + + + /////////////////////////////////////////////////// CARD EXPIRATION_DATE START /////////////////////////////////////////////////////// expirationDateField = itemView.findViewById(R.id.expirationDateField); // enable Expiration date dialog diff --git a/library/src/main/java/company/tap/gosellapi/open/controllers/ThemeObject.java b/library/src/main/java/company/tap/gosellapi/open/controllers/ThemeObject.java index 7c2faeca..2ca8cd4c 100644 --- a/library/src/main/java/company/tap/gosellapi/open/controllers/ThemeObject.java +++ b/library/src/main/java/company/tap/gosellapi/open/controllers/ThemeObject.java @@ -48,7 +48,7 @@ public class ThemeObject { private int saveCardSwitchOffTrackTint; private int saveCardSwitchOnTrackTint; private Drawable scanIconDrawable; - + private boolean cardScannerIconVisible=true; /** * Tap Button @@ -346,6 +346,14 @@ public ThemeObject setPayButtonSecurityIconVisible(boolean payButtSecurityIconVi return this; } + /** + * pay button view or hide scanner + * @param cardScannerIconVisible + */ + public ThemeObject setCardScannerIconVisible(boolean cardScannerIconVisible) { + this.cardScannerIconVisible = cardScannerIconVisible; + return this; + } /** * * @param payButtLoaderVisible @@ -573,6 +581,13 @@ public boolean isPayButtSecurityIconVisible() { return this.payButtSecurityIconVisible; } + /** + * @return pay button security icon visible + */ + public boolean isSetCardScannerIconVisible() { + return this.cardScannerIconVisible; + } + /** * * @return