mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-22 20:39:20 +01:00
Remove the DataItem wrapper on AppItem
This commit is contained in:
parent
c8e0f71bb7
commit
56fd79ff46
@ -32,7 +32,6 @@ import emu.skyline.data.AppItemTag
|
|||||||
import emu.skyline.databinding.MainActivityBinding
|
import emu.skyline.databinding.MainActivityBinding
|
||||||
import emu.skyline.loader.AppEntry
|
import emu.skyline.loader.AppEntry
|
||||||
import emu.skyline.loader.LoaderResult
|
import emu.skyline.loader.LoaderResult
|
||||||
import emu.skyline.loader.RomFormat
|
|
||||||
import emu.skyline.provider.DocumentsProvider
|
import emu.skyline.provider.DocumentsProvider
|
||||||
import emu.skyline.settings.AppSettings
|
import emu.skyline.settings.AppSettings
|
||||||
import emu.skyline.settings.EmulationSettings
|
import emu.skyline.settings.EmulationSettings
|
||||||
@ -210,7 +209,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
if (appSettings.searchLocation.isEmpty()) documentPicker.launch(null)
|
if (appSettings.searchLocation.isEmpty()) documentPicker.launch(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDataItems() = mutableListOf<AppViewItem>().apply {
|
private fun getAppItems() = mutableListOf<AppViewItem>().apply {
|
||||||
appEntries?.let { entries ->
|
appEntries?.let { entries ->
|
||||||
sortGameList(entries.toList()).forEach { entry ->
|
sortGameList(entries.toList()).forEach { entry ->
|
||||||
add(AppItem(entry).toViewItem())
|
add(AppItem(entry).toViewItem())
|
||||||
@ -269,7 +268,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun populateAdapter() {
|
private fun populateAdapter() {
|
||||||
val items = getDataItems()
|
val items = getAppItems()
|
||||||
binding.emptyPlaceholder.isVisible = items.isEmpty()
|
binding.emptyPlaceholder.isVisible = items.isEmpty()
|
||||||
adapter.setItems(items)
|
adapter.setItems(items)
|
||||||
}
|
}
|
||||||
|
@ -23,12 +23,10 @@ const val AppItemTag = BuildConfig.APPLICATION_ID + ".APP_ITEM"
|
|||||||
|
|
||||||
private val missingIcon by lazy { ContextCompat.getDrawable(SkylineApplication.instance, R.drawable.default_icon)!!.toBitmap(256, 256) }
|
private val missingIcon by lazy { ContextCompat.getDrawable(SkylineApplication.instance, R.drawable.default_icon)!!.toBitmap(256, 256) }
|
||||||
|
|
||||||
sealed class DataItem : Serializable
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is a wrapper around [AppEntry], it is used for passing around game metadata
|
* This class is a wrapper around [AppEntry], it is used for passing around game metadata
|
||||||
*/
|
*/
|
||||||
data class AppItem(private val meta : AppEntry) : DataItem() {
|
data class AppItem(private val meta : AppEntry) : Serializable {
|
||||||
/**
|
/**
|
||||||
* The icon of the application
|
* The icon of the application
|
||||||
*/
|
*/
|
Loading…
Reference in New Issue
Block a user