mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-30 06:13:54 +01:00
Convert bookmarks package to kotlin (#6387)
* Convert BookmarkItemsController to kotlin * Split BookmarkItemsDao apart and converted to Kotlin * Convert and cleanup content providers * Convert BookmarkItemsFragment to kotlin * Convert BookmarkPicturesFragment to kotlin * Convert BookmarkPicturesDao to kotlin and share some useful DB methods * Convert BookmarkPicturesController to kotlin * Convert BookmarkFragment to kotlin * Convert BookmarksPagerAdapter to kotlin * Convert BookmarkListRootFragment to kotlin
This commit is contained in:
parent
869371b485
commit
8de57304bf
44 changed files with 1738 additions and 1988 deletions
|
|
@ -1,14 +1,25 @@
|
|||
package fr.free.nrw.commons.di
|
||||
|
||||
import android.content.ContentProvider
|
||||
import android.database.sqlite.SQLiteDatabase
|
||||
import fr.free.nrw.commons.data.DBOpenHelper
|
||||
import fr.free.nrw.commons.di.ApplicationlessInjection.Companion.getInstance
|
||||
import javax.inject.Inject
|
||||
|
||||
abstract class CommonsDaggerContentProvider : ContentProvider() {
|
||||
@JvmField
|
||||
@Inject
|
||||
var dbOpenHelper: DBOpenHelper? = null
|
||||
|
||||
override fun onCreate(): Boolean {
|
||||
inject()
|
||||
return true
|
||||
}
|
||||
|
||||
fun requireDbOpenHelper(): DBOpenHelper = dbOpenHelper!!
|
||||
|
||||
fun requireDb(): SQLiteDatabase = requireDbOpenHelper().writableDatabase!!
|
||||
|
||||
private fun inject() {
|
||||
val injection = getInstance(context!!)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue