Commit 91480572 authored by Emanuel Wontorra's avatar Emanuel Wontorra

updated sdk, added SampleAdProvider, additional settings in config.xml

parent ec75f12c
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
/.idea/*
.DS_Store
/build
/captures
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="FallthruInSwitchStatement" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="UnnecessarySemicolon" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KotlinCommonCompilerArguments">
<option name="languageVersion" value="1.1" />
<option name="apiVersion" value="1.1" />
</component>
</project>
\ No newline at end of file
......@@ -5,11 +5,12 @@
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<list size="5">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
......@@ -24,46 +25,10 @@
</value>
</option>
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Android Lint</id>
</State>
<State>
<id>Gradle</id>
</State>
<State>
<id>Probable bugsGradle</id>
</State>
</expanded-state>
</profile-state>
</entry>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.7</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
......@@ -6,7 +6,7 @@ Add Maven repository
to your project and
com.tickaroo:sdk:3.0.3
com.tickaroo:sdk:3.0.4
to the dependencies of your app.
......@@ -36,4 +36,6 @@ The following four fonts can be changed to any standard android font family by o
- font\_family\_black
- font\_family\_regular
By default these are set to the corresponding sans-serif font families, normally Roboto. The comic font can be replaced by a custom font file in assets/fonts. The file name is specified by the string font\_file\_comic
\ No newline at end of file
By default these are set to the corresponding sans-serif font families, normally Roboto. The comic font can be replaced by a custom font file in assets/fonts. The file name is specified by the string font\_file\_comic
Additional settings can be found in res/values/config.xml
\ No newline at end of file
......@@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation("com.tickaroo:sdk:3.0.3")
implementation("com.tickaroo:sdk:3.0.4")
}
......@@ -6,93 +6,131 @@ import android.view.View.GONE
import android.view.View.VISIBLE
import android.widget.Toast
import com.tickaroo.apimodel.android.TickerRef
import com.tickaroo.common.config.track.TikUserTrackingInfo
import com.tickaroo.sdk.RefreshBehaviour.RefreshAuto
import com.tickaroo.sdk.ScoreboardImageMode.ScoreboardImageModeNone
import com.tickaroo.sdk.ScoreboardImageMode.ScoreboardImageModeOwner
import com.tickaroo.sdk.TickarooEmbedManager
import kotlinx.android.synthetic.main.activity_sample.illegal_ref
import kotlinx.android.synthetic.main.activity_sample.init_again
import kotlinx.android.synthetic.main.activity_sample.init_empty
import kotlinx.android.synthetic.main.activity_sample.init_owner
import kotlinx.android.synthetic.main.activity_sample.post_init
import kotlinx.android.synthetic.main.activity_sample.pre_init
import kotlinx.android.synthetic.main.activity_sample.sample
import kotlinx.android.synthetic.main.activity_sample.sample2
import kotlinx.android.synthetic.main.activity_sample.*
import java.util.ArrayList
/**
* Created by tassi on 27.03.17.
*/
class SampleActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sample)
init_owner.setOnClickListener {
try {
TickarooEmbedManager(this, "Tickaroo Sample", resources.getString(R.string.client_id),
RefreshAuto, ScoreboardImageModeOwner, SampleDelegate(), "www.tickaroo.com")
pre_init.visibility = GONE
post_init.visibility = VISIBLE
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_sample)
init_owner.setOnClickListener {
try {
TickarooEmbedManager(this, "Tickaroo Sample", resources.getString(R.string.client_id),
RefreshAuto, ScoreboardImageModeOwner, SampleDelegate(), tikAdProvider = SampleAdProvider(), apiHost = "www.tickaroo.com")
pre_init.visibility = GONE
post_init.visibility = VISIBLE
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
init_empty.setOnClickListener {
try {
TickarooEmbedManager(this, "Tickaroo Sample", resources.getString(R.string.client_id),
RefreshAuto, ScoreboardImageModeNone, SampleDelegate(), "www.tickaroo.com")
pre_init.visibility = GONE
post_init.visibility = VISIBLE
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
init_empty.setOnClickListener {
try {
TickarooEmbedManager(this, "Tickaroo Sample", resources.getString(R.string.client_id),
RefreshAuto, ScoreboardImageModeNone, SampleDelegate(), tikAdProvider = SampleAdProvider(), apiHost = "www.tickaroo.com")
pre_init.visibility = GONE
post_init.visibility = VISIBLE
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "58e3b1ebf7596cf6cfae69c1"
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample2.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "58e3b1ebf7596cf6cfae69c1"
tickerRef.showScoreboard = false
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample_news.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "5afd1e1209bfcbd85c1da6b6"
illegal_ref.setOnClickListener {
try {
startActivity(TickarooEmbedManager.tickerIntentForId(this, "foobar"))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
val userTrackInfos = arrayListOf<TikUserTrackingInfo>()
userTrackInfos.add(TikUserTrackingInfo("userTrackInfo1", "value ${tickerRef.tickerId}"))
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef, userTrackInfos = userTrackInfos))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample_news_without_scoreboard.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "5afd1e1209bfcbd85c1da6b6"
tickerRef.showScoreboard = false
tickerRef.eventLocalId
val userTrackInfos = arrayListOf<TikUserTrackingInfo>()
userTrackInfos.add(TikUserTrackingInfo("userTrackInfo", "value ${tickerRef.tickerId}"))
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef, title = "News without scoreboard", userTrackInfos = userTrackInfos))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample_soccer.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "5afd22ab09bfcbd85c1da6e4"
val userTrackInfos = arrayListOf<TikUserTrackingInfo>()
userTrackInfos.add(TikUserTrackingInfo("userTrackInfo1", "value ${tickerRef.tickerId}"))
init_again.setOnClickListener {
try {
TickarooEmbedManager(this, "Tickaroo Sample", resources.getString(R.string.client_id),
RefreshAuto, ScoreboardImageModeOwner, SampleDelegate(), "www.tickaroo.com")
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef, userTrackInfos = userTrackInfos))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample2.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "58e3b1ebf7596cf6cfae69c1"
val userTrackInfos = arrayListOf<TikUserTrackingInfo>()
userTrackInfos.add(TikUserTrackingInfo("userTrackInfo1", "value ${tickerRef.tickerId}"))
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef, userTrackInfos = userTrackInfos))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
illegal_ref.setOnClickListener {
try {
startActivity(TickarooEmbedManager.tickerIntentForId(this, "foobar"))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
init_again.setOnClickListener {
try {
TickarooEmbedManager(this, "Tickaroo Sample", resources.getString(R.string.client_id),
RefreshAuto, ScoreboardImageModeOwner, SampleDelegate(), tikAdProvider = SampleAdProvider(), apiHost = "www.tickaroo.com")
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
}
}
fun exceptionHandler(e: Exception) {
Toast.makeText(applicationContext, "${e::class.java.canonicalName}: ${e.localizedMessage}", Toast.LENGTH_SHORT).show()
}
fun exceptionHandler(e: Exception) {
Toast.makeText(applicationContext, "${e::class.java.canonicalName}: ${e.localizedMessage}", Toast.LENGTH_SHORT).show()
}
override fun onBackPressed() {
super.onBackPressed()
System.exit(0)
}
override fun onBackPressed() {
super.onBackPressed()
System.exit(0)
}
}
\ No newline at end of file
package com.tickaroo.sdkandroiddemo
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import com.tickaroo.apimodel.IAdRow
import com.tickaroo.common.config.ad.TikAdProvider
import kotlinx.android.synthetic.main.ad_row_sample.view.tickaroo_ad_row_example_text1
import kotlinx.android.synthetic.main.ad_row_sample.view.tickaroo_ad_row_example_text2
class SampleAdProvider : TikAdProvider {
override fun provideAdRow(parent: ViewGroup, row: IAdRow, position: Int): View {
val view = LayoutInflater.from(parent.context).inflate(R.layout.ad_row_sample, parent, false)
view.tickaroo_ad_row_example_text1.text = "AdRow position - ${position}"
view.tickaroo_ad_row_example_text2.text = "${row.placementId}"
parent.setOnClickListener {
Toast.makeText(parent.context, "Clicked", Toast.LENGTH_LONG).show()
}
return view
}
}
\ No newline at end of file
package com.tickaroo.sdkandroiddemo
import android.content.Context
import android.util.Log
import com.tickaroo.apimodel.IAbstractRef
import com.tickaroo.apimodel.analytics.IEvent
......@@ -24,10 +25,10 @@ class SampleDelegate : TickarooEmbedManagerDelegate(){
Log.d(TAG, "Did track Event: $event")
}
/*
override fun navigateToRef(ref: IAbstractRef): Boolean {
override fun navigateToRef(ref: IAbstractRef, context: Context?): Boolean {
Log.d(TAG, "navigated to ref ${ref._type}")
return false
}
*/
}
\ No newline at end of file
......@@ -39,7 +39,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Initialisierung mit Profilbild"
android:text="Initialize with scoreboard image"
/>
<TextView
......@@ -47,7 +47,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Initialisierung ohne Profilbild"
android:text="Initialize without scoreboard image"
/>
<TextView
......@@ -56,18 +56,34 @@
android:paddingEnd="20dp"
android:paddingStart="20dp"
android:paddingTop="20dp"
android:text="Aufruf eines Tickers ohne vorherige Initialisierung wirft eine Exception"
android:text="Livecast without prior initialization throws exception"
android:textSize="10sp"
/>
</LinearLayout>
<TextView
android:id="@+id/sample"
android:id="@+id/sample_news"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Beispielticker"
android:text="News livecast"
/>
<TextView
android:id="@+id/sample_news_without_scoreboard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="News livecast (without Scoreboard)"
/>
<TextView
android:id="@+id/sample_soccer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Soccer livecast"
/>
<TextView
......@@ -75,7 +91,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Weiterer Beispielticker (ohne Scoreboard)"
android:text="Other livecast"
/>
<TextView
......@@ -83,7 +99,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Ungültiger Ref"
android:text="Invalid Ref"
/>
<LinearLayout
......@@ -100,7 +116,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Erneute Initialisierung (wirft Exception)"
android:text="Reinitialization(throws exception)"
/>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tickaroo_ad_row_example_text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/black"
tools:text="test" />
<TextView
android:id="@+id/tickaroo_ad_row_example_text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/tickaroo_accent_color"
tools:text="test2" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- colors -->
<color name="tickaroo_window_background">#f3f4f9</color>
<color name="tickaroo_primary_color">#234567</color>
<color name="tickaroo_primary_color_dark">#456789</color>
<color name="tickaroo_accent_color">#765432</color>
<color name="tickaroo_accent_color_dark">#98765432</color>
<!-- toolbar -->
<color name="tickaroo_gradient_start">#000000</color>
<color name="tickaroo_gradient_end">#FFFFFF</color>
<!-- scoreboard -->
<dimen name="tickaroo_scoreboard_margin_left">12dp</dimen>
<dimen name="tickaroo_scoreboard_toolbar_height">30dp</dimen>
<color name="tickaroo_scoreboard_background">#D3D3D3</color>
<!-- rows -->
<color name="tickaroo_card_background">#FFFFFF</color>
<dimen name="tickaroo_row_margin_left">14dp</dimen>
<dimen name="tickaroo_round_corners_radius">0dp</dimen>
<dimen name="tickaroo_round_corners_background_radius">0dp</dimen>
<color name="tickaroo_event_highlight_color">#123456</color>
<!-- milestone -->
<dimen name="tickaroo_text_size_milestone">18sp</dimen>
<bool name="tickaroo_milestone_arrow_visible">true</bool>
<!-- spacer -->
<dimen name="tickaroo_spacer_padding_top">50dp</dimen>
<dimen name="tickaroo_spacer_padding_bottom">80dp</dimen>
<color name="tickaroo_spacer_color">#FF0000</color>
<bool name="tickaroo_spacer_after_milestone_row">false</bool>
<bool name="tickaroo_spacer_after_event_row">true</bool>
<bool name="tickaroo_spacer_after_ad_row">false</bool>
<bool name="tickaroo_spacer_after_section_headline_row">false</bool>
<bool name="tickaroo_spacer_after_button_row">false</bool>
<bool name="tickaroo_spacer_after_load_prev_row">false</bool>
<bool name="tickaroo_spacer_after_load_next_row">false</bool>
<bool name="tickaroo_spacer_after_team_game_highlight_row">false</bool>
<bool name="tickaroo_spacer_after_lineup_row">false</bool>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment