YesGraph Android SDK is fully customizable which includes the entire look and feel of the contact book and sharing screens. This document describes how to style the YesGraph SDK’s share screen to best fit your app style guidelines. The appearance of the integrated YesGraph UI is defined by a proxy Theme object named CustomTheme.

How to style?

To set your own properties, you have to create your own CustomTheme object instance. Modify the default properties on your CustomTheme instance then set the instance into YesGraph SDK using our convenience API.

CustomTheme customTheme=new CustomTheme();

CustomTheme

CustomTheme class represents a styling proxy object and is the main point of interaction between your view and the styling of the app. There are several properties you can influence in order to adapt the YesGraph SDK to your aesthetic needs.

You can customise almost every colour on the Share sheet and in the Contacts sheet. If you do not change it, the colours will be taken from your app’s default style.

int mainForegroundColor=Color.parseColor("#0078BD");
int mainBackgroundColor=Color.parseColor("#F5F5F5");
int darkFontColor=Color.parseColor("#212121");
int lightFontColor=Color.parseColor("#FFFFFF");
int rowSelectedColor=Color.parseColor("#AAAAAA");
int rowUnselectedColor=Color.parseColor("#F5F5F5");
int rowBackgroundColor=Color.parseColor("#F5F5F5");
int backArrowColor=Color.parseColor("#FFFFFF");
int copyButtonColor=Color.parseColor("#F5F5F5");
int referralBannerBackgroundColor=Color.parseColor("#F5F5F5");

customTheme.setThemeColor(
                mainForegroundColor,
                mainBackgroundColor,
                darkFontColor,
                lightFontColor,
                rowSelectedColor,
                rowUnselectedColor,
                rowBackgroundColor,
                backArrowColor,
                copyButtonColor,
                referralBannerBackgroundColor);

The font family is also customizable. You just need to put your font into assets folder and call:

customTheme.setFonts("Pacifico.ttf");

The Share service buttons shape is set to the default ‘circle’ value, but you can customise it via:

customTheme.setShareButtonsShape("square");

At the end you just need to set this custom theme to the SDK:

yesGraphApplication.setCustomTheme(customTheme);