toolboxPremium Android SDK

  • Version: 1.5.0

  • Min Android SDK: 30

  • Theme: light, dark

  • Orientations: portrait, landscape

  • Languages: en, ru, kk

Configure dependency

To get the dependency, you first need to configure access to our repository.

  1. Install AWS CLI using this guidearrow-up-right.

  2. Configure AWS CLI using the credentials provided by us. To do this, run the following command in your terminal.

  1. Add this configuration into the repositories block in your project's build.gradle|settings.gradle file.

  1. Add the dependency on the SDK to the project's build.gradle file in the dependencies block.

  1. The SDK uses some Java 8 APIs that are not available in Android SDK 24, so to enable devices with lower Android versions to u SDKse the, desugaring must be enabled. More detaist can be found here https://developer.android.com/studio/write/java8-support#library-desugaringarrow-up-right

Auth

The SDK is available only to authenticated users.

To start the authorization process, you need to implement the functional interface com.visa.concierge.auth.CredentialsProvider. The output of the implementation method of this interface should be a class implementing the interface com.visa.concierge.auth.Credentials. Currently, only one authentication method is available - using the client token. To obtain this token, your backend must have the appropriate API. In the implementation of the functional interface, you need to implement the logic for retrieving this token from your backend and passing it to the SDK in the appropriate format. To provide this token, you need to use the class com.visa.concierge.auth.ClientCredentials.

com.visa.concierge.auth.ClientCredentials has 2 parameters in the constructor:

  1. token - user token

  2. needRequestUserPhone - a flag indicating the necessity to request the user's phone number on the first SDK launch. If the flag is true - on first launch SDK will open an activation flow to request and activate the user's phone number, iffalse - it won't (by default, in the constructor with one parameter, this flag is false).

circle-info

Note that different client tokens are used for the two different flows (with or without requesting the user's phone number).

  • Without requesting the phone number, the token obtained from /sdk/v1/user/getToken is used.

  • With requesting the phone number, the token obtained from /sdk/v1/user/getTokenById is used.

circle-info

To reduce requests to your backend, the SDK caches the client token in the application memory(RAM), and in EncryptedSharedPreferences, relying on its expiration time.

EncryptedSharedPreferences are encrypted with a unique device-bound key, so they need to be excluded from automatic backups. To do this, you need to:

  1. In your AndroidManifest.xml file add attributes.

  2. Create an XML file called backup_rules.xml in the res/xml/ directory with following content.

  3. Create an XML file called data_extraction_rules.xml in the res/xml/ directory with following content.

Setup and Init SDK

Sdk must be initialized before the first usage of UI components. This could be done in the Application class of your app.

Example of initialization

Configuration and Theming

All configuration and theme settings of the SDK are done using com.visa.concierge.ConciergeConfig.Builder. All themes are divided into two parts - dark and light. Switching between them occurs automatically following the dark-light mode of the operating system.

The tint of elements with dynamic colors is set using com.visa.concierge.ui.theme.TintStateList. This class has static methods that allow you to set the color for a specific state. Currently, there are 3 states:

  • normal - color in the normal state

  • disabled - color in the disabled state

  • checked - color in the selected state

Each screen, element, or group of elements can have individually customized fonts. The following parameters are available for font customization:

  • fontFamily - class that holds a list of font families

  • fontSize - font size

  • fontWeight - font weight from the specified family

  • lineHeight - paragraph height

  • letterSpacing - spacing between characters

circle-info

Tip. Since typically one font family with different weights is used throughout the application, you can create a constant with com.visa.concierge.ui.theme.FontFamily and pass it to all design elements. The appropriate font from the family will be selected based on the fontWeight from the theme.

circle-exclamation

Theme elements

element
description

isDebugEnabled

enable/disable console logging

backgroundTheme

global screen background theme

topBarTheme

toolbar theme

navBarTheme

navigation bar theme

inputTheme

global input theme

progressIndicatorTheme

global progress indicator theme

ratingBarTheme

global rating bar theme

textTheme

global text theme

rippleTheme

global ripple theme

cardTheme

global card component theme

filledTextButtonTheme

global filled text button theme

outlinedTextButtonTheme

global outlined text button theme

filledIconButtonTheme

global filled icon button theme

infoDialogTheme

global info dialog theme

chatScreenTheme

chat screen theme

requestListScreenTheme

requests list screen theme

brandColors

brand colors theme (primary, secondary, tertiary, etc.)

benefitsTheme

benefits screen theme

stepIndicatorTheme

step indicator theme

statusBadgeTheme

status badge theme

floatingButtonTheme

floating button theme

infoDoubleActionDialogTheme

double action dialog theme

appButtonTheme

global app button theme

Background theme

element
description

color

background color

TopBar theme

element
description

backgroundColor

background color

buttonTint

button tint color

element
description

backgroundColor

background color

buttonTint

button tint color

indicatorColor

accent background color of selected icon

Input theme

element
description

cursorColor

cursor color

textHighlight

selected text highlight color

ProgressIndicator theme

element
description

color

indicator background color

trackColor

indicator track color

StepIndicator theme

element
description

stepTint

step color tint

doneIconColor

color of done icon for last step

RatingBar theme

element
description

selectedColor

color that represents the selected or "filled" part of the rating

unselectedColor

color that represents the unselected or "empty" part of the rating

Text theme

element
description

color

text color

Ripple theme

element
description

color

ripple color

alpha

ripple alpha

Card theme

element
description

backgroundColor

background color

contentColor

content color

Button theme

element
description

backgroundTint

background color

contentTint

content color

SingleActionDialog theme

element
description

backgroundColor

background color

confirmButtonTheme

confirm button theme

ChatScreen theme

element
description

infoScreenTheme

info screen theme

clientMessageTheme

client message theme

managerMessageTheme

manager message theme

dateSeparatorTheme

date separator theme

inputTheme

chat input theme

InfoScreen theme

element
description

logoBackground

logog background color

logoTint

logo tint color

vendorLogo

vendor logo icon resource

vendorLogoTintEnabled

enable/disable tint of vendor logo

Message theme

element
description

backgroundTint

background color

fileTheme

message file theme

textColor

text color

dateColor

date text color

avatarBackgroundTint

avatar background color

avatarContentTint

avatar content color

MessageFile theme

element
description

backgroundTint

background color

contentTint

tint of file icon/name

DateSeparator theme

element
description

backgroundTint

background color

textColor

text color

ChatInput theme

element
description

backgroundTint

background color

textTint

text color

emojiButtonTheme

emoji popup theme

sendButtonTheme

send button theme

attachButtonTheme

attach button theme

emojiPopupTheme

emoji button theme

attachDialogTheme

attach dialog theme

attachedItemTheme

attached item theme

EmojiPopup theme

element
description

backgroundTint

background color

buttonTint

button tint color

dividerTint

divider color

AttachDialog theme

element
description

backgroundTint

background color

buttonTint

button tint color

dividerTint

divider color

AttachedItem theme

element
description

backgroundTint

background color

contentTint

tint color of icon/text

cancelButtonTheme

cancell button theme

RequestListScreen theme

element
description

requestViewTheme

request card view theme

RequestView theme

element
description

backgroundColor

background color

unseenBadgeColor

unseen progress badge background color

unseenBadgeTextColor

unseen progress badge text color

titleTint

title color

dateTint

request creation date color

requestProgressTheme

request step indicator theme

BrandColors theme

primary

primary brand color

secondary

secondary brand color

tertiary

tertiary brand color

quaternary

quaternary brand color

quinary

quinary brand color

senary

senary brand color

septenary

septenary brand color

octonary

octonary brand color

nonary

nonary brand color

denary

denary brand color

eleventh

eleventh brand color

twelfth

twelfth brand color

BenefitsTheme theme

element

description

textPrimary

primary text color

textSecondary

secondary text color

foregroundTertiary

tertiary foreground color

borderPrimary

primary border color

backgroundPrimary

primary background color

backgroundSecondary

secondary background color

buttonSecondaryBackground

secondary button background color

buttonSecondaryForeground

secondary button foreground color

TopBarTheme theme

element

description

backgroundColor

toolbar background color

buttonTint

toolbar button tint color

actionBackgroundTint

action button background tint

textStyle

toolbar text style

element

description

backgroundColor

navigation bar background color

buttonTint

navigation bar button tint color

indicatorColor

navigation bar indicator color

textStyle

navigation bar text style

ActivationScreenTheme theme

element

description

bodyTextStyle

activation screen body text style

ChatScreenTheme theme

element

description

title

chat screen title

isMessageListReversed

reverse message list order

infoScreenTheme

info screen theme

clientMessageTheme

client message theme

managerMessageTheme

manager message theme

dateSeparatorTheme

date separator theme

inputTheme

chat input theme

InfoScreenTheme theme (nested in ChatScreenTheme)

element

description

logoBackground

logo background color

logoTint

logo tint color

vendorLogo

vendor logo drawable resource

vendorLogoTintEnabled

enable vendor logo tint

visaLogoEnabled

enable visa logo

vendorAdditionalText

vendor additional text resource

bodyTextStyle

body text style

ChatMessageTheme theme (nested in ChatScreenTheme)

element

description

backgroundTint

message background color

fileTheme

message file theme

textColor

message text color

linkColor

message link color

dateColor

message date color

avatarIcon

avatar icon drawable resource

avatarIconSize

avatar icon size

avatarBackgroundTint

avatar background color

avatarContentTint

avatar content color

textStyle

message text style

dateTextStyle

date text style

MessageFileTheme theme (nested in ChatMessageTheme)

element

description

backgroundTint

file background color

contentTint

file content color

textStyle

file text style

ChatDateSeparatorTheme theme (nested in ChatScreenTheme)

element

description

backgroundTint

date separator background color

borderColor

date separator border color

textColor

date separator text color

textStyle

date separator text style

ChatInputTheme theme (nested in ChatScreenTheme)

element

description

backgroundTint

input background color

textTint

input text tint color

emojiButtonTheme

emoji button theme

sendButtonTheme

send button theme

attachButtonTheme

attach button theme

emojiPopupTheme

emoji popup theme

attachDialogTheme

attach dialog theme

attachedItemTheme

attached item theme

textStyle

input text style

AttachedItemTheme theme (nested in ChatInputTheme)

element

description

backgroundTint

attached item background color

contentTint

attached item content color

cancelButtonTheme

cancel button theme

textStyle

attached item text style

RequestListScreenTheme theme

element

description

requestStateTheme

request state theme

requestViewTheme

request view theme

RequestStateTheme theme (nested in RequestListScreenTheme)

element

description

waitingState

waiting state theme

processingState

processing state theme

completedState

completed state theme

emptyState

empty state theme

searchEmptyState

search empty state theme

RequestStateItemTheme theme (nested in RequestStateTheme)

element

description

iconBackgroundColor

state icon background color

iconTintColor

state icon tint color

titleColor

state title color

descriptionColor

state description color

RequestViewTheme theme (nested in RequestListScreenTheme)

element

description

backgroundColor

request card background color

borderColor

request card border color

unseenBadgeColor

unseen badge background color

unseenBadgeTextColor

unseen badge text color

titleTint

request title color

dateTint

request date color

unseenBadgeTextStyle

unseen badge text style

titleTextStyle

title text style

dateTextStyle

date text style

statusBadgeTheme

status badge theme

InputTheme theme

element

description

cursorColor

input cursor color

textHighlight

input text highlight color

hintColor

input hint color

errorColor

input error color

backgroundColor

input background color

textStyle

input text style

errorTextStyle

input error text style

StepIndicatorTheme theme

element

description

stepTint

step indicator tint color

doneIconColor

done icon color

StatusBadgeTheme theme

element

description

newStatusColors

new status colors (background, border, text)

inProgressStatusColors

in progress status colors (background, border, text)

completedStatusColors

completed status colors (background, border, text)

ProgressIndicatorTheme theme

element

description

color

progress indicator color

trackColor

progress indicator track color

RatingBarTheme theme

element

description

ratingColor

active rating color

backgroundColor

inactive rating color

TextTheme theme

element

description

color

global text color

RippleTheme theme

element

description

color

ripple effect color

CardTheme theme

element

description

backgroundColor

card background color

contentColor

card content color

FilledTextButtonTheme theme

element

description

backgroundTint

filled button background tint

contentTint

filled button content tint

textStyle

filled button text style

OutlinedTextButtonTheme theme

element

description

backgroundTint

outlined button background tint

contentTint

outlined button content tint

textStyle

outlined button text style

FilledIconButtonTheme theme

element

description

backgroundTint

filled icon button background tint

contentTint

filled icon button content tint

FloatingButtonTheme theme

element

description

backgroundTint

floating button background tint

contentTint

floating button content tint

InfoDialogTheme theme

element

description

backgroundColor

dialog background color

textStyle

dialog text style

confirmButtonTheme

confirm button theme

InfoDoubleActionDialogTheme theme

element

description

backgroundColor

dialog background color

textStyle

dialog text style

confirmButtonTheme

confirm button theme

declineButtonTheme

decline button theme

AppButtonTheme theme

element

description

backgroundColor

app button background color

textColor

app button text color

cornerRadius

app button corner radius

height

app button height

textStyle

app button text style

fontWeight

app button font weight

Usage

Concierge Integration

There are 3 ways to integrate the SDK into your application:

  • Activity - using com.visa.concierge.ui.ConciergeActivity. This activity needs to be registered in your application's manifest.

  • Fragment - using com.visa.concierge.ui.ConciergeFragment.

  • Compose - using com.visa.concierge.ui.ConciergeEntryPoint().

Benefits Integration

The SDK also provides separate entry points for Benefits functionality:

Benefits Only Entry Points

  • Fragment: com.visa.concierge.ui.BenefitsOnlyFragment

  • Compose: com.visa.concierge.ui.BenefitsOnlyEntryPoint()

BenefitsOnlyEntryPoint does not handle phone activation workflow automatically. Phone activation should be handled by the parent application or use ConciergeEntryPoint instead.

For any of these methods, you will only need to define the navigation from your application to the SDK's entry point, and that's it.

Last updated