mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Added an empty list message to the Passes screen
This commit is contained in:
1 parent
65941a8304
commit
acc308379c
5 files changed
+45
-10
No files matched your search
@@ -141,12 +141,12 @@ class PassesFragment : Fragment(R.layout.fragment_passes), PassesAdapter.PassesC
|
||||
tickMainTimer(state.data)
|
||||
if (state.data.isNotEmpty()) { // show new passes list
|
||||
passesRecycler.visibility = View.VISIBLE
|
||||
passesErrorMsg.visibility = View.INVISIBLE
|
||||
passesEmpty.visibility = View.INVISIBLE
|
||||
passesRefreshBtn.isEnabled = true
|
||||
refreshAnimator?.cancel()
|
||||
} else { // show no passes message
|
||||
passesRecycler.visibility = View.INVISIBLE
|
||||
passesErrorMsg.visibility = View.VISIBLE
|
||||
passesEmpty.visibility = View.VISIBLE
|
||||
passesRefreshBtn.isEnabled = true
|
||||
refreshAnimator?.cancel()
|
||||
}
|
||||
@@ -155,7 +155,6 @@ class PassesFragment : Fragment(R.layout.fragment_passes), PassesAdapter.PassesC
|
||||
refreshAnimator?.start()
|
||||
passesRefreshBtn.isEnabled = false
|
||||
passesTimer.text = 0L.toTimerString()
|
||||
passesErrorMsg.visibility = View.INVISIBLE
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M2,21h19v-3H2v3zM20,8H3c-0.55,0 -1,0.45 -1,1v6c0,0.55 0.45,1 1,1h17c0.55,0 1,-0.45 1,-1V9c0,-0.55 -0.45,-1 -1,-1zM2,3v3h19V3H2z" />
|
||||
</vector>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -44,13 +45,37 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/passes_error_msg"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/passes_empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/passes_error"
|
||||
android:textSize="@dimen/text_size_large" />
|
||||
android:layout_marginStart="48dp"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:layout_marginBottom="32dp"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/passes_empty_img"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="180dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:contentDescription="@string/passes_error"
|
||||
android:src="@drawable/ic_list"
|
||||
app:tint="@color/textDisabled" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/passes_empty_msg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
android:text="@string/passes_error"
|
||||
android:textSize="@dimen/text_size_large" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<string name="entries_search_hint">Поиск по Имени / Id</string>
|
||||
<string name="entries_update_error">Ошибка обновления спутников</string>
|
||||
|
||||
<string name="passes_error">Нет предстоящих пролётов</string>
|
||||
<string name="passes_error">Нет предстоящих пролётов спутников</string>
|
||||
<string name="passes_empty_db">Пожалуйста, обновите базу данных спутников через меню Настроек</string>
|
||||
|
||||
<string name="pass_aosAz">НПС - %.1f°</string>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
<string name="timer_zero" translatable="false">00:00:00</string>
|
||||
|
||||
<string name="passes_error">No upcoming passes</string>
|
||||
<string name="passes_error">There are no upcoming satellite passes to display</string>
|
||||
<string name="passes_empty_db">No data to show. Please update the database via Settings menu.</string>
|
||||
|
||||
<string name="pass_satName" translatable="false">%s</string>
|
||||
|
||||
Reference in new issue
Block a user