mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
renaming GalleryDataBase to GalleryDatabase
This commit is contained in:
parent
c08d6a8b13
commit
49e376e2ec
4 changed files with 9 additions and 22 deletions
|
@ -26,7 +26,7 @@ import com.simplemobiletools.commons.views.MyRecyclerView
|
|||
import com.simplemobiletools.gallery.BuildConfig
|
||||
import com.simplemobiletools.gallery.R
|
||||
import com.simplemobiletools.gallery.adapters.DirectoryAdapter
|
||||
import com.simplemobiletools.gallery.databases.GalleryDataBase
|
||||
import com.simplemobiletools.gallery.databases.GalleryDatabase
|
||||
import com.simplemobiletools.gallery.dialogs.ChangeSortingDialog
|
||||
import com.simplemobiletools.gallery.dialogs.FilterMediaDialog
|
||||
import com.simplemobiletools.gallery.extensions.*
|
||||
|
@ -191,7 +191,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
mTempShowHiddenHandler.removeCallbacksAndMessages(null)
|
||||
removeTempFolder()
|
||||
if (!isChangingConfigurations) {
|
||||
GalleryDataBase.destroyInstance()
|
||||
GalleryDatabase.destroyInstance()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,20 +10,20 @@ import com.simplemobiletools.gallery.models.Directory
|
|||
import com.simplemobiletools.gallery.models.Medium
|
||||
|
||||
@Database(entities = [(Directory::class), (Medium::class)], version = 2)
|
||||
abstract class GalleryDataBase : RoomDatabase() {
|
||||
abstract class GalleryDatabase : RoomDatabase() {
|
||||
|
||||
abstract fun DirectoryDao(): DirectoryDao
|
||||
|
||||
abstract fun MediumDao(): MediumDao
|
||||
|
||||
companion object {
|
||||
private var db: GalleryDataBase? = null
|
||||
private var db: GalleryDatabase? = null
|
||||
|
||||
fun getInstance(context: Context): GalleryDataBase {
|
||||
fun getInstance(context: Context): GalleryDatabase {
|
||||
if (db == null) {
|
||||
synchronized(GalleryDataBase::class) {
|
||||
synchronized(GalleryDatabase::class) {
|
||||
if (db == null) {
|
||||
db = Room.databaseBuilder(context.applicationContext, GalleryDataBase::class.java, "gallery.db")
|
||||
db = Room.databaseBuilder(context.applicationContext, GalleryDatabase::class.java, "gallery.db")
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
|
@ -20,7 +20,7 @@ import com.simplemobiletools.commons.helpers.OTG_PATH
|
|||
import com.simplemobiletools.gallery.R
|
||||
import com.simplemobiletools.gallery.activities.SettingsActivity
|
||||
import com.simplemobiletools.gallery.asynctasks.GetMediaAsynctask
|
||||
import com.simplemobiletools.gallery.databases.GalleryDataBase
|
||||
import com.simplemobiletools.gallery.databases.GalleryDatabase
|
||||
import com.simplemobiletools.gallery.helpers.*
|
||||
import com.simplemobiletools.gallery.interfaces.DirectoryDao
|
||||
import com.simplemobiletools.gallery.models.Directory
|
||||
|
@ -70,7 +70,7 @@ fun Context.launchSettings() {
|
|||
|
||||
val Context.config: Config get() = Config.newInstance(applicationContext)
|
||||
|
||||
val Context.galleryDB: GalleryDataBase get() = GalleryDataBase.getInstance(applicationContext)
|
||||
val Context.galleryDB: GalleryDatabase get() = GalleryDatabase.getInstance(applicationContext)
|
||||
|
||||
fun Context.movePinnedDirectoriesToFront(dirs: ArrayList<Directory>): ArrayList<Directory> {
|
||||
val foundFolders = ArrayList<Directory>()
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M63.58,40.16m-5.73,0a5.73,5.73 0,1 1,11.47 0a5.73,5.73 0,1 1,-11.47 0"/>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M47.37,46.64l-17.45,25.43l45.46,0l-9.89,-16.21l-5.9,8.39z"/>
|
||||
</vector>
|
Loading…
Reference in a new issue