All Downloads are FREE. Search and download functionalities are using the official Maven repository.

androidMain.com.algolia.instantsearch.insights.internal.extension.Platform.kt Maven / Gradle / Ivy

Go to download

InstantSearch Android is a library providing widgets and helpers to help you build the best instant-search experience on Android with Algolia. It is built on top of Algolia's Kotlin API Client to provide you a high-level solution to quickly build various search interfaces.

There is a newer version: 3.3.1
Show newest version
package com.algolia.instantsearch.insights.internal.extension

import android.content.Context
import android.content.SharedPreferences
import com.algolia.search.model.IndexName

internal var SharedPreferences.events: Set by SharedPreferencesDelegate.StringSet(setOf())

internal fun Context.sharedPreferences(name: String, mode: Int = Context.MODE_PRIVATE): SharedPreferences {
    return getSharedPreferences(name, mode)
}

internal fun Context.insightsSharedPreferences(indexName: IndexName) = sharedPreferences("Algolia Insights-$indexName")

/**
 * Get Insights Settings Shared Preferences.
 */
internal fun Context.insightsSettingsPreferences(): SharedPreferences {
    return getSharedPreferences("InsightsEvents", Context.MODE_PRIVATE)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy