Dashboard

UI Customization

With the version 0.4.0, you will be able to customize the UI of the SDK and use your own brand colors, font types, and header banner. So, you can increase your users' experience.

AppsPrizeStyleConfig:

  • primaryColor: The primary color used for UI customization.
// Example: Set primary color to red
.setPrimaryColor(Color.RED)
  • secondaryColor: The secondary color used for UI customization.
// Example: Set secondary color to blue
.setSecondaryColor(Color.BLUE)
  • setHighlightColor: This function allows to set highlight color for UI customization. If set null or not set will use default value.
fun setHighlightColor(@ColorInt highlightColor: Int?): AppsPrizeStyleConfig.Builder
  • typeface: The typeface used for UI customization.
// Example: Set typeface to bold
.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD))
  • bannerDrawable: The drawable used for the header banner.
// Example: Set banner drawable to a specific drawable resource  
.setBannerDrawable(context.getDrawable(R.drawable.header_banner))
  • offersTitleText: Text for the offers page title and navigation.
/ Example: Set offers title text  
.setOffersTitleText("Offers")
  • appsTitleText: Text for the apps page title and navigation.
// Example: Set apps title text  
.setAppsTitleText("Apps")
  • item: Styling for items and item detail popup.
// Example: Set item styling using a nested builder  
.setItemStyling(AppsPrizeItemStyling.Builder().build())
  • currencyIconDrawable: This function allows to set item currency icon in CTA. If set null or not set will use default value.
// Example: Set currency icon drawable  
fun setCurrencyIcon(currencyIcon: Drawable?): AppsPrizeStyleConfig.Builder

Sample Usage

val styleConfig = AppsPrizeStyleConfig.Builder()
            .setPrimaryColor(Color.parseColor("#265073"))
            .setSecondaryColor(Color.parseColor("#F1FADA"))
            .setHighlightColor(Color.parseColor("#00F593"))
            .setTypeface(ResourcesCompat.getFont(this, R.font.kodemono))
            .setBannerDrawable(ResourcesCompat.getDrawable(resources, R.drawable.custom_banner, theme))
            .setOffersTitleText("Offer")
            .setAppsTitleText("Active")
            .setCurrencyIcon(ResourcesCompat.getDrawable(resources, R.drawable.coins_icon, theme))
            .build()