Stories
CleverPush Story Widget
You can also implement CleverPush Stories into your application. For this, please set up a Story Widget in your CleverPush account. You can access stories via generated Widget Id and by following usage guide.
Story View
Story Player
How to use
Add xml to your layout
<com.cleverpush.stories.StoryView
android:id="@+id/storyView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:background_color="#000"
app:border_color="#cA4000"
app:fontFamily="CabinSketch-Bold"
app:story_view_height="500dp"
app:story_view_width="700dp"
app:text_color="#fff"
app:title_visibility="gone"
app:title_text_size="12sp"
app:story_icon_height="100dp"
app:story_icon_width="100dp"
app:widget_id="o76hjaysdgohltyil" />
- Stories will be load edusing
widget_id
. Story Widget ID can be set using widget_id attribute in xml or it can be set through instance ofStoryView
like:
StoryView storyView = findViewById(R.id.storyView);
storyView.setWidgetId("o76hjaysdgohltyil");
StoryView storyView = findViewById(R.id.storyView);
storyView.setWidgetId("o76hjaysdgohltyil");
Handle opened URLs in stories:
storyView.setOpenedListener((url) -> {
// do something with the opened URL
});
storyView.setOpenedListener { url ->
// do something with the opened URL
}
Customizations
You can customize the experience of StoryView
using these attributes:
story_view_height
story view height in dpstory_view_width
story view width in dpborder_color
border colorbackground_color
story view background colortext_color
text colorfont_family
text font familytitle_visibility
title visibilitytitle_text_size
title text sizestory_icon_height
story icon height in dpstory_icon_width
story icon width in dp