Newer Version Available
Customize the Android SDK
After you build the Loyalty Management Mobile SDK for Android, you can customize the
colors, fonts, and strings.
-
Customize the colors.
- With your Sample Apps project open in Android Studio, open the file.
-
To add a color to the Android UI theme or as another app color, edit the
Color.kt file.
For example, to add blue as one of the app colors, open the Color.kt file, and under //App Colors, add the val Blue = Color(0x0000FF33) code.
- Save the Color.kt file.
-
To add the new color in any of the component definitions, add an entry or replace an
entry with the new color.
For example, to replace the vibrant purple 40 color with blue, in any of the files, replace color = VibrantPurple40 with color = Blue.
- Clean and rebuild your project in Android Studio.
-
Add a font to the Android UI theme.
- With your Sample Apps project open in Android Studio, go to the folder.
- In the font folder, paste a .ttf file with the font script that you want to add.
- Open the file.
-
Edit the Type.kt file, and add the file that you
added in the font folder.
For example, to add Arial as one of the fonts, edit the Type.kt file to add the sample code:
- Save the Type.kt file.
-
Add this font in any of the component definitions.
For example, to replace the sf_pro font on the My Transactions page with Arial, replace fontFamily = font_sf_pro with fontFamily = font_arial.
- Clean and rebuild your project in Android Studio.
-
Customize the UI labels or strings used in your Sample App.
- Open the file.
-
Edit any text included in the <string> tag.
For example, to change the text Membership Number to Membership ID, replace all the strings that contain Membership Number with Membership ID.
- Save the strings.xml file.
- Clean and rebuild your project in Android Studio.
- To replace an image, go to , and replace the image.