mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-27 01:15:29 +03: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() {
|
private fun populateAdapter() {
|
||||||
binding.textTitle.text = null
|
|
||||||
binding.textTitle.visibility = View.GONE
|
|
||||||
val items = getDataItems()
|
val items = getDataItems()
|
||||||
|
binding.emptyPlaceholder.isVisible = items.isEmpty()
|
||||||
adapter.setItems(items)
|
adapter.setItems(items)
|
||||||
if (items.isEmpty()) {
|
|
||||||
binding.textTitle.visibility = View.VISIBLE
|
|
||||||
binding.textTitle.text = getString(R.string.no_rom)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
|
@ -109,18 +109,19 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
android:layout_marginHorizontal="8dp"
|
android:layout_marginHorizontal="8dp"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginVertical="8dp"
|
||||||
app:cardUseCompatPadding="true"
|
app:cardUseCompatPadding="true"
|
||||||
app:layout_constraintTop_toBottomOf="@id/sub_text"
|
app:layout_constraintTop_toBottomOf="@id/sub_text"
|
||||||
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.ExtraLarge" />
|
app:shapeAppearance="@style/ShapeAppearance.Material3.Corner.ExtraLarge" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_title"
|
android:id="@+id/empty_placeholder"
|
||||||
style="?attr/textAppearanceTitleLarge"
|
style="?attr/textAppearanceTitleLarge"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="16dp"
|
android:layout_marginHorizontal="16dp"
|
||||||
android:layout_marginVertical="8dp"
|
android:layout_marginVertical="8dp"
|
||||||
|
android:text="@string/no_rom"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
app:layout_constraintTop_toBottomOf="@id/search_bar"/>
|
app:layout_constraintTop_toBottomOf="@id/search_bar"/>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
Loading…
Reference in New Issue
Block a user