mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-22 08:49:18 +01:00
Use the searching text to specify load state
This commit is contained in:
parent
30aee55122
commit
178dbea801
@ -263,13 +263,20 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
private fun loadRoms(loadFromFile : Boolean) {
|
||||
if (!loadFromFile) {
|
||||
binding.romPlaceholder.isVisible = true
|
||||
binding.romPlaceholder.text = getString(R.string.searching_roms)
|
||||
}
|
||||
viewModel.loadRoms(this, loadFromFile, Uri.parse(appSettings.searchLocation), EmulationSettings.global.systemLanguage)
|
||||
appSettings.refreshRequired = false
|
||||
}
|
||||
|
||||
private fun populateAdapter() {
|
||||
val items = getAppItems()
|
||||
binding.emptyPlaceholder.isVisible = items.isEmpty()
|
||||
if (items.isEmpty())
|
||||
binding.romPlaceholder.text = getString(R.string.no_rom)
|
||||
else
|
||||
binding.romPlaceholder.isVisible = false
|
||||
adapter.setItems(items)
|
||||
}
|
||||
|
||||
|
@ -115,13 +115,12 @@
|
||||
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.ExtraLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/empty_placeholder"
|
||||
android:id="@+id/rom_placeholder"
|
||||
style="?attr/textAppearanceTitleLarge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:text="@string/no_rom"
|
||||
android:text="@string/searching_roms"
|
||||
android:textAlignment="viewStart"
|
||||
app:layout_constraintTop_toBottomOf="@id/search_bar"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@ -132,7 +131,6 @@
|
||||
android:id="@+id/swipe_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="-8dp"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
Loading…
Reference in New Issue
Block a user