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 MyNTORewards | src | main | java | com | salesforce | loyalty | mobile | myntorewards | ui | theme | Color.kt file.
-
To add a color to the Android UI theme or as another app color, edit the
Color.ktfile.For example, to add blue as one of the app colors, open the
Color.ktfile, and under//App Colors, add theval Blue = Color(0x0000FF33)code. -
Save the
Color.ktfile. -
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 = VibrantPurple40withcolor = 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 MyNTORewards | src | main | res | font folder.
-
In the font folder, paste a .ttf file with the font script that you want to add.
-
Open the MyNTORewards | src | main | java | com | salesforce | loyalty | mobile | myntorewards | ui | theme | Type.kt file.
-
Edit the
Type.ktfile, and add the file that you added in the font folder.For example, to add Arial as one of the fonts, edit the
Type.ktfile to add the sample code: -
Save the
Type.ktfile. -
Add this font in any of the component definitions.
For example, to replace the
sf_profont on the My Transactions page with Arial, replacefontFamily = font_sf_prowithfontFamily = font_arial. -
Clean and rebuild your project in Android Studio.
-
-
Customize the UI labels or strings used in your Sample App.
-
Open the MyNTORewards | src | main | res | values | strings.xml 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.xmlfile. -
Clean and rebuild your project in Android Studio.
-
-
To replace an image, go to MyNTORewards | src | main | res | drawable, and replace the image.