mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-22 15:09:17 +01:00
Simplify placeholder for empty items
This commit is contained in:
parent
b82452f8f8
commit
0b453ca4ed
@ -294,14 +294,9 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
private fun populateAdapter() {
|
||||
binding.textTitle.text = null
|
||||
binding.textTitle.visibility = View.GONE
|
||||
val items = getDataItems()
|
||||
binding.emptyPlaceholder.isVisible = items.isEmpty()
|
||||
adapter.setItems(items)
|
||||
if (items.isEmpty()) {
|
||||
binding.textTitle.visibility = View.VISIBLE
|
||||
binding.textTitle.text = getString(R.string.no_rom)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
@ -109,18 +109,19 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="72dp"
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginVertical="8dp"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintTop_toBottomOf="@id/sub_text"
|
||||
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.ExtraLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_title"
|
||||
android:id="@+id/empty_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:textAlignment="viewStart"
|
||||
app:layout_constraintTop_toBottomOf="@id/search_bar"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Loading…
Reference in New Issue
Block a user