Class EasyLaunchCardView

All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, ViewManager, ViewParent

public class EasyLaunchCardView extends ConstraintLayout
UI widget for retrieving, displaying and managing card data from the processing platform.

Widget wraps MCD SDK functionality. There are no additional calls to MCD SDK necessary if widget is the only entry point. MCD SDK initialization is done by widget itself. Widget also takes care of disposing card data in 60 seconds after retrieving from the processing platform.

  • Constructor Details

  • Method Details

    • setCardBackground

      public void setCardBackground(Drawable background)
      Sets card background.
      Parameters:
      background - Card background as instance of Drawable
    • setTextColor

      public void setTextColor(@ColorInt Integer color)
      Sets color of all texts printed on card.
      Parameters:
      color - Color int
    • setLayout

      public void setLayout(@LayoutRes int layoutId)
      Sets custom card layout.
      Parameters:
      layoutId - Layout resource id
    • setFont

      public void setFont(@FontRes int fontId)
      Sets custom card font.
      Parameters:
      fontId - Font resource id
    • setFont

      public void setFont(@NonNull Typeface font)
      Sets custom card font.
      Parameters:
      font - Typeface instance
    • setFontSize

      public void setFontSize(float fontSize)
      Sets font size.
      Parameters:
      fontSize - font size
    • setPanCopyInfoText

      public void setPanCopyInfoText(String infoMsg)
      Sets text to display in info toast when PAN is copied to clipboard.
      Parameters:
      infoMsg - Text to display in info toast.
    • setHolderNameCopyInfoText

      public void setHolderNameCopyInfoText(String infoMsg)
      Sets text to display in info toast when holder name is copied to clipboard.
      Parameters:
      infoMsg - Text to display in info toast.
    • setValidThruCopyInfoText

      public void setValidThruCopyInfoText(String infoMsg)
      Sets text to display in info toast when valid thru information is copied to clipboard.
      Parameters:
      infoMsg - Text to display in info toast.
    • setCvvCopyInfoText

      public void setCvvCopyInfoText(String infoMsg)
      Sets text to display in info toast when CVV is copied to clipboard.
      Parameters:
      infoMsg - Text to display in info toast.
    • setPanCopyMenuTitle

      public void setPanCopyMenuTitle(String menuTitle)
      Sets menu entry text for copy PAN action.
      Parameters:
      menuTitle - Text to display in default menu.
    • setHolderNameCopyMenuTitle

      public void setHolderNameCopyMenuTitle(String menuTitle)
      Sets menu entry text for copy holder name action.
      Parameters:
      menuTitle - Text to display in default menu.
    • setValidThruCopyMenuTitle

      public void setValidThruCopyMenuTitle(String menuTitle)
      Sets menu entry text for copy valid thru action.
      Parameters:
      menuTitle - Text to display in default menu.
    • setCvvCopyMenuTitle

      public void setCvvCopyMenuTitle(String menuTitle)
      Sets menu entry text for copy CVV action.
      Parameters:
      menuTitle - Text to display in default menu.
    • setShowCardMenuTitle

      public void setShowCardMenuTitle(String menuTitle)
      Sets menu entry text for show card action.
      Parameters:
      menuTitle - Text to display in default menu.
    • setHideCardMenuTitle

      public void setHideCardMenuTitle(String menuTitle)
      Sets menu entry text for hide card action.
      Parameters:
      menuTitle - Text to display in default menu.
    • setLoadingIndicatorEnabled

      public void setLoadingIndicatorEnabled(boolean isEnabled)
      Enables / Disables default card data loading indicator. Indicator is shown while retrieving card data over internet.
      Parameters:
      isEnabled - True to enable default loading indicator. False otherwise.
    • setInfoToastsEnabled

      public void setInfoToastsEnabled(boolean isEnabled)
      Enables / Disables default widget toasts. Affects all widget messages informing about card data copy status - PAN copied, Valid thru copied, Holder name copied.
      Parameters:
      isEnabled - True to enable default toast messages. False otherwise.
    • setDefaultMenuEnabled

      public void setDefaultMenuEnabled(boolean isEnabled)
      Shows or hides the default menu button. Default button is the only way of displaying the default menu.
      Parameters:
      isEnabled - True if default menu enabled. False otherwise.
    • setDefaultListenersEnabled

      public void setDefaultListenersEnabled(boolean isEnabled)
      Set default listener enablement. When disabled (set to false), default listeners are disabled. Both - onClick and onLongClick. This method doesn't impact user set listeners.
      Parameters:
      isEnabled - Boolean value of default listener enablement.
    • setOnCardClickListener

      public void setOnCardClickListener(View.OnClickListener listener)
      Set listener for card onClick events. This listener overrides default behaviour even if the default onClick listener is not disabled.
      Parameters:
      listener - The onClick listener as View.OnClickListener interface.
    • setOnCardLongClickListener

      public void setOnCardLongClickListener(View.OnLongClickListener listener)
      Set listener for card onLongClick events. This listener overrides default behaviour even if default the onLongClick listener is not disabled.
      Parameters:
      listener - The onLongClick listener as View.OnLongClickListener interface.
    • setOnCardDataLoadingStartedListener

      public void setOnCardDataLoadingStartedListener(@Nullable McdEasyLaunchListener listener)
      Set listener for card data loading start.
      Parameters:
      listener - Instance of McdEasyLaunchListener interface.
    • setOnCardDataLoadingCompletedListener

      public void setOnCardDataLoadingCompletedListener(@Nullable McdEasyLaunchListener listener)
      Set listener for card data loading events.
      Parameters:
      listener - Instance of McdEasyLaunchListener interface.
    • setOnCardDataClearedListener

      public void setOnCardDataClearedListener(@Nullable McdEasyLaunchListener listener)
      Set listener for card data wipe event.
      Parameters:
      listener - Instance of McdEasyLaunchListener interface.
    • setLoadingIndicatorColor

      public void setLoadingIndicatorColor(@ColorInt Integer color)
      Sets color of data loading indicator.
      Parameters:
      color - Color int
    • copyAcquiredPanToClipboard

      public boolean copyAcquiredPanToClipboard()
      Copies PAN if card data is acquired.
      Returns:
      True if card data acquired and is copied to clipboard. False otherwise.
    • copyAcquiredHolderNameToClipboard

      public boolean copyAcquiredHolderNameToClipboard()
      Copies holder name if card data is acquired.
      Returns:
      True if card data acquired and is copied to clipboard. False otherwise.
    • copyAcquiredValidThruToClipboard

      public boolean copyAcquiredValidThruToClipboard()
      Copies valid thru information if card data is acquired.
      Returns:
      True if card data acquired and is copied to clipboard. False otherwise.
    • copyAcquiredCvvToClipboard

      public boolean copyAcquiredCvvToClipboard()
      Copies CVV if card data is acquired.
      Returns:
      True if card data acquired and is copied to clipboard. False otherwise.
    • revealAndCopyPanToClipboard

      public void revealAndCopyPanToClipboard(McdEasyLaunchListener easyLaunchListener)
      Reveals card data and copies PAN to clipboard. If card data is not acquired, performs acquisition at first.
      Parameters:
      easyLaunchListener - Listener McdEasyLaunchListener for receiving operation result status.
    • revealAndCopyHolderNameToClipboard

      public void revealAndCopyHolderNameToClipboard(McdEasyLaunchListener easyLaunchListener)
      Reveals card data and copies holder name to clipboard. If card data is not acquired, performs acquisition at first.
      Parameters:
      easyLaunchListener - Listener McdEasyLaunchListener for receiving operation result status.
    • revealAndCopyValidThruToClipboard

      public void revealAndCopyValidThruToClipboard(McdEasyLaunchListener easyLaunchListener)
      Reveals card data and copies valid thru information in format of dd/yy to clipboard. If card data is not acquired, performs acquisition at first.
      Parameters:
      easyLaunchListener - Listener McdEasyLaunchListener for receiving operation result status.
    • revealAndCopyCvvToClipboard

      public void revealAndCopyCvvToClipboard(McdEasyLaunchListener easyLaunchListener)
      Reveals card data and copies CVV to clipboard. If card data is not acquired, performs acquisition at first.
      Parameters:
      easyLaunchListener - Listener McdEasyLaunchListener for receiving operation result status.
    • setCardIdentityProvider

      public void setCardIdentityProvider(@NonNull McdCardIdentityProvider cardIdentityProvider)
      Sets card identity provider. Disposes card data if previously acquired.

      Widget invokes card identity provider methods to acquire cardId and secret for card data acquisition.

      Parameters:
      cardIdentityProvider - Callback class implementing McdCardIdentityProvider for providing cardId and secret.
    • acquireCardData

      public void acquireCardData(McdEasyLaunchListener easyLaunchListener)
      Requests and caches card data. Doesn't reveal card. Method also checks if underlying MCD SDK is initialized and tries to initialize it if it is not.
      Parameters:
      easyLaunchListener - Listener McdEasyLaunchListener for receiving operation result status.
    • showAcquiredCardData

      public boolean showAcquiredCardData()
      Reveals card data if acquired and returns true. In case card data is not acquired, return false. Card data acquisition is not invoked.
      Returns:
      True if card data is acquired and displayed. False if not acquired and can't be displayed.
    • showCardData

      public void showCardData(McdEasyLaunchListener easyLaunchListener)
      Reveals card data. Method acquires card data, if not already acquired.
      Parameters:
      easyLaunchListener - Listener McdEasyLaunchListener for receiving operation result status.
    • hideCardData

      public void hideCardData()
      Hides card data on widget. Acquired data is not disposed.
    • disposeCardData

      public void disposeCardData()
      Disposes card data. Clears acquired card data and tries to clear clipboard.
    • isCardDataAcquired

      public boolean isCardDataAcquired()
      Returns true if card data is acquired. False otherwise.
      Returns:
      True if card data is acquired. False otherwise.
    • isCardDataRevealed

      public boolean isCardDataRevealed()
      Returns true if card data is revealed - printed on widget. False otherwise.
      Returns:
      True if card data is revealed. False otherwise.
    • isCardIdentityProviderSet

      public boolean isCardIdentityProviderSet()
      Returns true if card identity provider (of type McdCardIdentityProvider) is set. False otherwise.
      Returns:
      True if identity provider set. False otherwise.
    • isDefaultMenuEnabled

      public boolean isDefaultMenuEnabled()
      Returns true if default menu button is enabled. False otherwise.
      Returns:
      True if default menu button is enabled. False otherwise.
    • isDefaultListenersEnabled

      public boolean isDefaultListenersEnabled()
      Returns true if default listeners enabled. False otherwise. This setting affects both - onClick and onLongClick listeners.
      Returns:
      True if default listeners enabled. False otherwise.