Skip to content

Commit f20b4a6

Browse files
committed
February 2022 cleanup
1 parent 61b0feb commit f20b4a6

File tree

17 files changed

+344
-143
lines changed

17 files changed

+344
-143
lines changed

build.gradle

Lines changed: 0 additions & 19 deletions
This file was deleted.

build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
plugins {
2+
id("com.android.application").version(Version.androidPlugin).apply(false)
3+
id("org.jetbrains.kotlin.jvm").version(Version.kotlin).apply(false)
4+
id("org.jetbrains.kotlin.android").version(Version.kotlin).apply(false)
5+
id("org.jetbrains.kotlin.android.extensions").version(Version.kotlin).apply(false)
6+
}
7+
8+
allprojects {
9+
repositories {
10+
mavenCentral()
11+
google()
12+
}
13+
}
14+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
object Version {
2+
val targetSdkVersion = 31
3+
val minSdkVersion = 21
4+
val compileSdkVersion = 31
5+
6+
val androidPlugin = "7.1.0"
7+
val kotlin = "1.6.10"
8+
}
9+
10+
object Libs {
11+
const val kxCoroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:_"
12+
const val kxCoroutinesAndroid = "org.jetbrains.kotlinx:kotlinx-coroutines-android:_"
13+
14+
const val kotlin = "org.jetbrains.kotlin:kotlin-stdlib:_"
15+
const val xAppCompat = "androidx.appcompat:appcompat:_"
16+
const val xCore = "androidx.core:core-ktx:_"
17+
const val xConstraintLayout = "androidx.constraintlayout:constraintlayout:_"
18+
19+
const val timber = "com.jakewharton.timber:timber:_"
20+
const val gson = "com.google.code.gson:gson:_"
21+
const val playServicesAds = "com.google.android.gms:play-services-ads-identifier:_"
22+
23+
const val xTestRunner = "androidx.test:runner:_"
24+
const val xTestRules = "androidx.test:rules:_"
25+
const val xEspresso = "androidx.test.espresso:espresso-core:_"
26+
const val xTestUnit = "androidx.test.ext:junit:_"
27+
28+
const val junit = "junit:junit:_"
29+
}

buildSrc/src/main/java/Version.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Tue Jan 22 16:56:03 CET 2019
1+
#Thu Feb 03 12:22:36 CET 2022
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
34
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
6+
zipStoreBase=GRADLE_USER_HOME

sampleapp/build.gradle

Lines changed: 0 additions & 34 deletions
This file was deleted.

sampleapp/build.gradle.kts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
plugins {
2+
id("com.android.application")
3+
id("org.jetbrains.kotlin.android")
4+
id("org.jetbrains.kotlin.android.extensions")
5+
}
6+
7+
dependencies {
8+
api(project(":sdk"))
9+
10+
implementation(Libs.kotlin)
11+
implementation(Libs.xAppCompat)
12+
implementation(Libs.timber)
13+
implementation(Libs.xConstraintLayout)
14+
15+
androidTestImplementation(Libs.xEspresso)
16+
androidTestImplementation(Libs.xTestRunner)
17+
androidTestImplementation(Libs.xTestRules)
18+
androidTestImplementation(Libs.xTestUnit)
19+
}
20+
21+
android {
22+
compileSdk = Version.compileSdkVersion
23+
24+
defaultConfig {
25+
26+
buildConfigField("String", "PLAYER_SDK_VERSION", "\"${LibraryProject.libraryVersionName}\"")
27+
28+
minSdk = Version.minSdkVersion
29+
targetSdk = Version.targetSdkVersion
30+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
31+
}
32+
}
33+
34+
repositories {
35+
mavenCentral()
36+
}

sampleapp/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
android:configChanges="orientation|screenSize"
2323
android:windowSoftInputMode="adjustPan"
2424
android:label="@string/app_name"
25-
android:exported="false">
25+
android:exported="true">
2626
<intent-filter>
2727
<action android:name="android.intent.action.MAIN"/>
2828
<category android:name="android.intent.category.LAUNCHER"/>

sdk/build.gradle.kts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,29 @@ apply(plugin = "maven-publish")
1313
apply(plugin = "signing")
1414

1515
android {
16-
compileSdkVersion(Version.compileSdkVersion)
16+
compileSdk = Version.compileSdkVersion
1717

1818
defaultConfig {
19-
minSdkVersion(Version.minSdkVersion)
20-
targetSdkVersion(Version.targetSdkVersion)
19+
minSdk = Version.minSdkVersion
20+
targetSdk = Version.targetSdkVersion
2121
buildConfigField("String", "SDK_VERSION", "\"${LibraryProject.libraryVersionName}\"")
2222
}
2323
}
2424

2525
dependencies {
26-
implementation("com.google.code.gson:gson:2.8.6")
27-
implementation("com.jakewharton.timber:timber:4.7.1")
28-
implementation("com.google.android.gms:play-services-ads-identifier:17.0.1")
26+
implementation(Libs.gson)
27+
implementation(Libs.timber)
2928

30-
implementation("androidx.core:core-ktx:1.5.0")
31-
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.5.10")
29+
implementation(Libs.kxCoroutines)
30+
implementation(Libs.kxCoroutinesAndroid)
31+
32+
implementation(Libs.playServicesAds)
33+
34+
implementation(Libs.xCore)
35+
implementation(Libs.kotlin)
3236
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
3337

34-
testImplementation("junit:junit:4.13.2")
38+
testImplementation(Libs.junit)
3539
}
3640

3741
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask> {

sdk/src/main/AndroidManifest.xml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.dailymotion.android"
4-
android:versionCode="1"
5-
android:versionName="1.0" >
3+
package="com.dailymotion.android"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
7+
<application>
8+
<provider
9+
android:name=".player.sdk.PlayerSdkInitProvider"
10+
android:authorities="${applicationId}.player.sdk.PlayerSdkInitProvider"
11+
android:exported="false" />
12+
</application>
613

714
</manifest>

sdk/src/main/java/com/dailymotion/android/player/sdk/AdIdTask.kt

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package com.dailymotion.android.player.sdk
2+
3+
import android.content.ContentProvider
4+
import android.content.ContentValues
5+
import android.content.Context
6+
import android.database.Cursor
7+
import android.net.Uri
8+
import kotlinx.coroutines.CoroutineScope
9+
import kotlinx.coroutines.Dispatchers
10+
import kotlinx.coroutines.launch
11+
12+
class PlayerSdkInitProvider : ContentProvider() {
13+
14+
companion object {
15+
internal lateinit var appContext: Context
16+
private set
17+
18+
internal val visitorInfoManager = VisitorInfoManager()
19+
}
20+
21+
override fun onCreate(): Boolean {
22+
context?.let {
23+
appContext = it
24+
CoroutineScope(Dispatchers.Main).launch {
25+
visitorInfoManager.getAdvertisingInfo(appContext)
26+
}
27+
}
28+
return true
29+
}
30+
31+
override fun insert(uri: Uri, values: ContentValues?): Uri {
32+
throw Exception("unimplemented")
33+
}
34+
35+
override fun query(
36+
uri: Uri,
37+
projection: Array<out String>?,
38+
selection: String?,
39+
selectionArgs: Array<out String>?,
40+
sortOrder: String?
41+
): Cursor {
42+
throw Exception("unimplemented")
43+
}
44+
45+
override fun update(
46+
uri: Uri,
47+
values: ContentValues?,
48+
selection: String?,
49+
selectionArgs: Array<out String>?
50+
): Int {
51+
throw Exception("unimplemented")
52+
}
53+
54+
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Int {
55+
throw Exception("unimplemented")
56+
}
57+
58+
override fun getType(uri: Uri): String {
59+
throw Exception("unimplemented")
60+
}
61+
62+
}

0 commit comments

Comments
 (0)