Commit e8230282 authored by Tassilo Busche's avatar Tassilo Busche

initial commit

parents
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
<?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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<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" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</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="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8 (1)" 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
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/tickaroo-sdk-android-demo.iml" filepath="$PROJECT_DIR$/tickaroo-sdk-android-demo.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.tickaroo.sdksample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionName '2.8.0'
multiDexEnabled true
}
signingConfigs {
release {
}
}
buildTypes {
release {
debuggable false
minifyEnabled false
signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false // No proguard for faster dev builds
applicationIdSuffix ".debug"
debuggable true
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
}
kapt {
generateStubs = true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.tickaroo:sdk:1.1.1-develop-26"
}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/tassilo/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tickaroo.sdkandroiddemo"
>
<application
android:name=".SampleApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.tickaroo.sdkandroiddemo.SampleActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
package com.tickaroo.sdkandroiddemo
import android.app.Activity
import android.os.Bundle
import android.view.View.GONE
import android.view.View.VISIBLE
import android.widget.Toast
import com.tickaroo.apimodel.android.TickerRef
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
/**
* 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(), "staging.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(), "staging.tickaroo.com")
pre_init.visibility = GONE
post_init.visibility = VISIBLE
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "58d0d5c3af5f1e8cb50aa1cd"
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef))
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
sample2.setOnClickListener {
try {
val tickerRef = TickerRef()
tickerRef.tickerId = "58aff3cdaf5f1e8cb50a9c50"
tickerRef.showScoreboard = false
startActivity(TickarooEmbedManager.tickerIntentForRef(this, tickerRef))
} 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(), "staging.tickaroo.com")
} catch (e: IllegalStateException) {
exceptionHandler(e)
}
}
}
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)
}
}
\ No newline at end of file
package com.tickaroo.sdkandroiddemo
import android.app.Application
/**
* Created by tassi on 27.03.17.
*/
class SampleApplication : Application(){
}
\ No newline at end of file
package com.tickaroo.sdkandroiddemo
import android.util.Log
import com.tickaroo.apimodel.IAbstractRef
import com.tickaroo.apimodel.analytics.IEvent
import com.tickaroo.sdk.LoadingType
import com.tickaroo.sdk.TickarooEmbedManagerDelegate
/**
* Created by tassi on 27.03.17.
*/
class SampleDelegate : TickarooEmbedManagerDelegate(){
val TAG = "SDK SAMPLE"
override fun trackView(view: String, type: LoadingType,
userInfos: MutableMap<String, Any>?) {
Log.d(TAG, "View Tracked: $view, $type, $userInfos")
}
override fun trackEvent(category: String, action: String) {
Log.d(TAG, "Event Tracked: $category, $action")
}
override fun didTrackEvent(event: IEvent) {
Log.d(TAG, "Did track Event: $event")
}
override fun navigateToRef(ref: IAbstractRef): Boolean {
Log.d(TAG, "navigated to ref ${ref._type}")
return false
}
}
\ No newline at end of file
This diff is collapsed.
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/tickaroo_corporate_green"
android:padding="20dp"
android:text="Tickaroo SDK Sample App"
android:textAlignment="center"
android:textColor="@android:color/white"
android:textSize="20sp"
android:textStyle="bold"
/>
<LinearLayout
android:id="@+id/pre_init"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/init_owner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Initialisierung mit Profilbild"
/>
<TextView
android:id="@+id/init_empty"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Initialisierung ohne Profilbild"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingEnd="20dp"
android:paddingStart="20dp"
android:paddingTop="20dp"
android:text="Aufruf eines Tickers ohne vorherige Initialisierung wirft eine Exception"
android:textSize="10sp"
/>
</LinearLayout>
<TextView
android:id="@+id/sample"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Beispielticker"
/>
<TextView
android:id="@+id/sample2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Weiterer Beispielticker (ohne Scoreboard)"
/>
<TextView
android:id="@+id/illegal_ref"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Ungültiger Ref"
/>
<LinearLayout
android:id="@+id/post_init"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible"
>
<TextView
android:id="@+id/init_again"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Erneute Initialisierung (wirft Exception)"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Fonts -->
<string name="font_family_medium" translatable="false">sans-serif-light</string>
<string name="font_family_light" translatable="false">sans-serif-light</string>
<string name="font_family_black" translatable="false">sans-serif-light</string>
<string name="font_family_regular" translatable="false">sans-serif-light</string>
<string name="font_file_comic" translatable="false">Mono Test Font.ttf</string>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">@color/tickaroo_corporate_green</color>
<color name="colorPrimaryDark">@color/tickaroo_corporate_green_dark</color>
<color name="colorAccent">@color/tickaroo_corporate_orange</color>
<color name="tickaroo_primary_color">@color/tickaroo_corporate_green</color>
<color name="tickaroo_primary_color_dark">@color/tickaroo_corporate_green_dark</color>
<color name="tickaroo_accent_color">@color/tickaroo_corporate_orange</color>
<color name="tickaroo_accent_color_dark">@color/tickaroo_corporate_orange_dark</color>
</resources>
<resources>
<string name="app_name">SDK Sample App</string>
<string name="client_id">57d6a6bbe4b0cc1b8e5871b0</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
// Top-level build file where you can add configuration options common to all sub-projects/modules.
ext {
compileSdkVersion = 25
buildToolsVersion = '25.0.2'
versionCode = System.getenv("BUILD_NUMBER") != null ? System.getenv("BUILD_NUMBER").toInteger() : 1
minSdkVersion = 15
targetSdkVersion = 25
fragmentargsVersion = "2.0.+"
}
buildscript {
ext {
kotlinVersion = "1.1.1"
}
repositories {
jcenter()
maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
maven { url "https://mvn.tickaroo.com" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.1" }
maven { url "https://mvn.tickaroo.com" }
maven { url "https://clojars.org/repo/" }
maven { url "http://dl.bintray.com/tbruyelle/tbruyelle" }
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Tue Apr 04 16:19:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0<