-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Migrate Internal CoreCallback class to kotlin (#517)
- Loading branch information
1 parent
a8efd13
commit b6ab438
Showing
3 changed files
with
74 additions
and
90 deletions.
There are no files selected for viewing
79 changes: 0 additions & 79 deletions
79
android-core/src/main/java/com/mparticle/internal/CoreCallbacks.java
This file was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
android-core/src/main/kotlin/com/mparticle/internal/CoreCallbacks.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.mparticle.internal | ||
|
||
import android.app.Activity | ||
import android.net.Uri | ||
import androidx.annotation.WorkerThread | ||
import com.mparticle.MParticleOptions.DataplanOptions | ||
import org.json.JSONArray | ||
import java.lang.ref.WeakReference | ||
|
||
interface CoreCallbacks { | ||
fun isBackgrounded(): Boolean | ||
|
||
fun getUserBucket(): Int | ||
|
||
fun isEnabled(): Boolean | ||
|
||
fun setIntegrationAttributes(kitId: Int, integrationAttributes: Map<String, String>) | ||
|
||
fun getIntegrationAttributes(kitId: Int): Map<String, String>? | ||
|
||
fun getCurrentActivity(): WeakReference<Activity>? | ||
|
||
@WorkerThread | ||
fun getLatestKitConfiguration(): JSONArray? | ||
|
||
fun getDataplanOptions(): DataplanOptions? | ||
|
||
fun isPushEnabled(): Boolean | ||
|
||
fun getPushSenderId(): String? | ||
|
||
fun getPushInstanceId(): String? | ||
|
||
fun getLaunchUri(): Uri? | ||
|
||
fun getLaunchAction(): String? | ||
|
||
fun getKitListener(): KitListener? | ||
|
||
interface KitListener { | ||
fun kitFound(kitId: Int) | ||
|
||
fun kitConfigReceived(kitId: Int, configuration: String?) | ||
|
||
fun kitExcluded(kitId: Int, reason: String?) | ||
|
||
fun kitStarted(kitId: Int) | ||
fun onKitApiCalled(kitId: Int, used: Boolean?, vararg objects: Any?) | ||
fun onKitApiCalled(methodName: String?, kitId: Int, used: Boolean?, vararg objects: Any?) | ||
|
||
companion object { | ||
@JvmField | ||
val EMPTY: KitListener = object : KitListener { | ||
override fun kitFound(kitId: Int) {} | ||
override fun kitConfigReceived(kitId: Int, configuration: String?) {} | ||
override fun kitExcluded(kitId: Int, reason: String?) {} | ||
override fun kitStarted(kitId: Int) {} | ||
override fun onKitApiCalled(kitId: Int, used: Boolean?, vararg objects: Any?) {} | ||
override fun onKitApiCalled(methodName: String?, kitId: Int, used: Boolean?, vararg objects: Any?) {} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters