23 lines
619 B
Kotlin
23 lines
619 B
Kotlin
package org.schabi.newpipe
|
|
|
|
import android.content.Context
|
|
import android.content.SharedPreferences
|
|
import androidx.preference.PreferenceManager
|
|
import dagger.Module
|
|
import dagger.Provides
|
|
import dagger.hilt.InstallIn
|
|
import dagger.hilt.android.qualifiers.ApplicationContext
|
|
import dagger.hilt.components.SingletonComponent
|
|
import javax.inject.Singleton
|
|
|
|
@Module
|
|
@InstallIn(SingletonComponent::class)
|
|
class AppModule {
|
|
|
|
@Provides
|
|
@Singleton
|
|
fun providesSharedPreference(@ApplicationContext context: Context): SharedPreferences {
|
|
return PreferenceManager.getDefaultSharedPreferences(context)
|
|
}
|
|
}
|