Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'org.jetbrains.kotlin.plugin.compose'
}

def blazeSDK = '1.11.6'
def blazeSDK = '1.13.2'

android {
namespace 'com.wscsports.android.blaze.sampleapp'
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/Theme.BlazeSDKAndroidSampleApp"
tools:targetApi="31">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Application : Application() {

BlazeSDK.init(
// Please provide valid API-KEY here
apiKey = "[API_KEY]",
apiKey = "739741c1465c4d0681b39e4b3e633730",
cachingLevel = BlazeCachingLevel.DEFAULT,
cachingSize = 512,
sdkDelegate = Delegates.globalDelegate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MainActivity : AppCompatActivity() {
private fun prepareMomentsContainer() {
BlazeMomentsPlayerContainer.prepareMoments(
containerId = "blaze-moments-container-unique-id",
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel("moments"))
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel("all-access"))
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.wscsports.android.blaze.sampleapp.core.Delegates
import com.wscsports.android.blaze.sampleapp.databinding.FragmentMomentsBinding

class MomentsFragment : Fragment(R.layout.fragment_moments) {
val MOMENT_ID = "all-access"

private var binding: FragmentMomentsBinding? = null

Expand Down Expand Up @@ -55,13 +56,13 @@ class MomentsFragment : Fragment(R.layout.fragment_moments) {

momentsRowWidget.updateDataSource(
dataSourceType = BlazeDataSourceType.Labels(
BlazeWidgetLabel.singleLabel("moments")
BlazeWidgetLabel.singleLabel(MOMENT_ID)
)
)

momentsGridWidget.updateDataSource(
dataSourceType = BlazeDataSourceType.Labels(
BlazeWidgetLabel.singleLabel("moments")
BlazeWidgetLabel.singleLabel(MOMENT_ID)
)
)

Expand All @@ -73,7 +74,22 @@ class MomentsFragment : Fragment(R.layout.fragment_moments) {

private fun initRowWidget() {
// Using rectangles Preset
val momentsWidgetRowPreset = BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalRectangles
val momentsWidgetRowPreset = BlazeWidgetLayout.Presets.MomentsWidget.Row.verticalRectangles.apply{
widgetItemStyle.statusIndicator.let{
it.unreadState.apply{
textStyle.textColor = android.graphics.Color.GREEN
backgroundColor = android.graphics.Color.RED
isVisible = true
}
it.readState.apply{
textStyle.textColor = android.graphics.Color.CYAN;
backgroundColor = android.graphics.Color.BLUE;
isVisible = true
}
}
}



// Using default player Preset
val momentsPlayerPreset = BlazeMomentsPlayerStyle.base()
Expand All @@ -87,7 +103,7 @@ class MomentsFragment : Fragment(R.layout.fragment_moments) {
binding?.momentsRowWidget?.initWidget(
widgetLayout = momentsWidgetRowPreset,
playerStyle = momentsPlayerPreset,
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel("moments")),
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel(MOMENT_ID)),
widgetId = "moments-row",
widgetDelegate = Delegates.widgetDelegate,
shouldOrderWidgetByReadStatus = true
Expand All @@ -96,7 +112,20 @@ class MomentsFragment : Fragment(R.layout.fragment_moments) {

private fun initGridWidget() {
// Using 2 columns Preset
val momentsWidgetGridPreset = BlazeWidgetLayout.Presets.MomentsWidget.Grid.twoColumnsVerticalRectangles
val momentsWidgetGridPreset = BlazeWidgetLayout.Presets.MomentsWidget.Grid.twoColumnsVerticalRectangles.apply{
widgetItemStyle.statusIndicator.let{
it.unreadState.apply{
textStyle.textColor = android.graphics.Color.GREEN
backgroundColor = android.graphics.Color.RED
isVisible = true
}
it.readState.apply{
textStyle.textColor = android.graphics.Color.CYAN;
backgroundColor = android.graphics.Color.BLUE;
isVisible = true
}
}
}

// Using default player Preset
val momentsPlayerPreset = BlazeMomentsPlayerStyle.base()
Expand All @@ -117,7 +146,7 @@ class MomentsFragment : Fragment(R.layout.fragment_moments) {
binding?.momentsGridWidget?.initWidget(
widgetLayout = momentsWidgetGridPreset,
playerStyle = momentsPlayerPreset,
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel("moments")),
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel(MOMENT_ID)),
widgetId = "moments-grid",
widgetDelegate = Delegates.widgetDelegate,
shouldOrderWidgetByReadStatus = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.wscsports.android.blaze.sampleapp.core.Delegates
import com.wscsports.android.blaze.sampleapp.databinding.FragmentStoriesBinding

class StoriesFragment : Fragment(R.layout.fragment_stories) {
private val STORY_ID = "game-stories"

private var binding: FragmentStoriesBinding? = null

Expand Down Expand Up @@ -55,13 +56,13 @@ class StoriesFragment : Fragment(R.layout.fragment_stories) {

storyRowWidget.updateDataSource(
dataSourceType = BlazeDataSourceType.Labels(
BlazeWidgetLabel.singleLabel("live-stories")
BlazeWidgetLabel.singleLabel(STORY_ID)
)
)

storyGridWidget.updateDataSource(
dataSourceType = BlazeDataSourceType.Labels(
BlazeWidgetLabel.singleLabel("top-stories")
BlazeWidgetLabel.singleLabel(STORY_ID)
)
)

Expand All @@ -73,8 +74,20 @@ class StoriesFragment : Fragment(R.layout.fragment_stories) {

private fun initRowWidget() {
// Using default Preset
val storiesWidgetRowPreset = BlazeWidgetLayout.Presets.StoriesWidget.Row.circles

val storiesWidgetRowPreset = BlazeWidgetLayout.Presets.StoriesWidget.Row.circles.apply{
widgetItemStyle.statusIndicator.let{
it.unreadState.apply{
textStyle.textColor = android.graphics.Color.GREEN
backgroundColor = android.graphics.Color.RED
isVisible = true
}
it.readState.apply{
textStyle.textColor = android.graphics.Color.CYAN;
backgroundColor = android.graphics.Color.BLUE;
isVisible = true
}
}
}
// Using default player Preset
val storiesPlayerPreset = BlazeStoryPlayerStyle.base()

Expand All @@ -95,7 +108,7 @@ class StoriesFragment : Fragment(R.layout.fragment_stories) {
binding?.storyRowWidget?.initWidget(
widgetLayout = storiesWidgetRowPreset,
playerStyle = storiesPlayerPreset,
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel("live-stories")),
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel(STORY_ID)),
widgetId = "live-stories-row",
widgetDelegate = Delegates.widgetDelegate,
shouldOrderWidgetByReadStatus = true
Expand All @@ -104,7 +117,20 @@ class StoriesFragment : Fragment(R.layout.fragment_stories) {

private fun initGridWidget() {
// Using default Preset
val storiesWidgetGridPreset = BlazeWidgetLayout.Presets.StoriesWidget.Grid.twoColumnsVerticalRectangles
val storiesWidgetGridPreset = BlazeWidgetLayout.Presets.StoriesWidget.Grid.twoColumnsVerticalRectangles.apply{
widgetItemStyle.statusIndicator.let{
it.unreadState.apply{
textStyle.textColor = android.graphics.Color.GREEN
backgroundColor = android.graphics.Color.RED
isVisible = true
}
it.readState.apply{
textStyle.textColor = android.graphics.Color.CYAN;
backgroundColor = android.graphics.Color.BLUE;
isVisible = true
}
}
}

// Using default player Preset
val storiesPlayerPreset = BlazeStoryPlayerStyle.base()
Expand All @@ -127,7 +153,7 @@ class StoriesFragment : Fragment(R.layout.fragment_stories) {
binding?.storyGridWidget?.initWidget(
widgetLayout = storiesWidgetGridPreset,
playerStyle = storiesPlayerPreset,
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel("top-stories")),
dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel(STORY_ID)),
widgetId = "top-stories-grid",
widgetDelegate = Delegates.widgetDelegate,
shouldOrderWidgetByReadStatus = true
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:android="http://schemas.android.com/apk/res/android">

<debug-overrides>
<trust-anchors>
<!-- Trust user added CAs while debuggable only -->
<certificates src="user" />
</trust-anchors>
</debug-overrides>

<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>

<domain-config cleartextTrafficPermitted="false">
<domain includeSubdomains="true">yinzcam.com</domain>
<domain includeSubdomains="true">yi.nzc.am</domain>
<domain includeSubdomains="true">amazonaws.com</domain>
<trust-anchors>
<certificates src="user"/>
<certificates src="system"/>
</trust-anchors>
</domain-config>

</network-security-config>