ICInAppModalNotificationViewBinder
This class implements the ICInAppNotificationViewBinder and will represent the Modal InApp Notification
Styling
The style of the Modal can be set by configuring the appropriate style attributes within your apps styles.xml.
Internally ICInAppModalNotificationViewBinder leverages the lower level components which utilizes the style attributes. Therefore, the style is applied to that individual components.
First, define styles which inherit from the defaults provided by the SDK and set the appropriate attributes:
<style name="ICInAppModalNotificationViewChild" parent="@style/ ICInAppModalNotificationView ">
<item name="titleTextColor">@color/title_text_light</item>
<item name="titleTextSize">@dimen/default_title_text_size</item>
<item name="titleTextTypeface">bold</item>
<item name="textColor">@color/sonic_silver</item>
<item name="textSize">@dimen/default_text_size</item>
<item name="textTypeface">normal</item>
<item name="backgroundColor">@android:color/white</item>
<item name="buttonTextColor">@color/btn_text_light</item>
<item name="buttonTextSize">@dimen/default_text_size</item>
<item name="buttonTextTypeface">normal</item>
<item name="buttonBackgroundColor">@android:color/white</item>
</style>
Finally, apply the style within the app theme:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name=" ICInAppModalNotificationView ">@style/ICInAppModalNotificationViewChild</item>
…..
</style>
SDK supports Light and Dark themes for Modal InAppNotification. By default Light theme will be applied for Modal.
Please find below sample code for applying Dark Theme to Modal InAppNotification.
Sample code for Applying Dark theme to Modal:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="ICInAppModalNotificationView">@style/ICInAppModalNotificationView.Dark</item>
…..
</style>
Style attributes
ICInAppModalNotificationView
Name | Description | Example | Supported Values |
---|---|---|---|
titleTextColor | text color for the InAppNotification Title | Ex: @color/default_title_text_color | A color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". |
titleTextSize | text size for the InAppNotification Title | Ex : @dimen/default_title_text_size | A dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). |
titleTextTypeface | Typeface for the InAppNotification title | Ex: normal | Must be one of the following constant values monospace(3),normal(0),sans(1),serif (2) |
textColor | Text color for InAppNotification body | Ex: @color/befault_text_color | A color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". |
textSize | Text size for InAppNotification Body | Ex: @dimen/default_text_size | A dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). |
backgroundColor | Background colour for InAppNotification | Ex: @color/default_bg_color | May be a reference to another resource, in the form "@[+][package:]type/name" or a theme attribute in the form "?[package:]type/name". May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". |
buttonTextColor | Text color for InAppNotification button | Ex: @color/button_text_color | May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". |
buttonTextSize | Text size for InAppNotification button | Ex: @dimen/default_text_size | May be a dimension value, which is a floating point number appended with a unit such as "14.5sp". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), and mm (millimeters). |
buttonTextTypeface | Typeface for InAppNotification button | Ex: normal | Must be one of the following constant values monospace(3),normal(0),sans(1),serif (2) |
buttonBackgroundColor | Background color for InAppNotification button | Ex: @color/button_text_color | May be a color value, in the form of "#rgb", "#argb", "#rrggbb", or "#aarrggbb". |
Updated 12 months ago