tv: add text when there are no tunnels
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
10bb413187
commit
03189e7b20
@ -84,6 +84,8 @@ class TvMainActivity : AppCompatActivity() {
|
|||||||
if (isDeleting.get()) {
|
if (isDeleting.get()) {
|
||||||
try {
|
try {
|
||||||
item.deleteAsync()
|
item.deleteAsync()
|
||||||
|
if (this@TvMainActivity.binding.tunnels?.isEmpty() != false)
|
||||||
|
isDeleting.set(false)
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
val error = ErrorMessages[e]
|
val error = ErrorMessages[e]
|
||||||
val message = getString(R.string.config_delete_error, error)
|
val message = getString(R.string.config_delete_error, error)
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
app:cardElevation="2dp"
|
app:cardElevation="2dp"
|
||||||
app:contentPadding="0dp"
|
app:contentPadding="0dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -54,6 +54,7 @@
|
|||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:visibility="@{tunnels.isEmpty() ? View.GONE : View.VISIBLE}"
|
||||||
app:configurationHandler="@{rowConfigurationHandler}"
|
app:configurationHandler="@{rowConfigurationHandler}"
|
||||||
app:items="@{tunnels}"
|
app:items="@{tunnels}"
|
||||||
app:layout="@{@layout/tv_tunnel_list_item}"
|
app:layout="@{@layout/tv_tunnel_list_item}"
|
||||||
@ -65,6 +66,19 @@
|
|||||||
tools:itemCount="10"
|
tools:itemCount="10"
|
||||||
tools:listitem="@layout/tv_tunnel_list_item" />
|
tools:listitem="@layout/tv_tunnel_list_item" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
style="@style/TextAppearance.MaterialComponents.Headline4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:text="@string/tv_add_tunnel_get_started"
|
||||||
|
android:visibility="@{tunnels.isEmpty() ? View.VISIBLE : View.GONE}"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/delete_button"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/banner_logo"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/import_button"
|
android:id="@+id/import_button"
|
||||||
style="@style/Widget.MaterialComponents.Button"
|
style="@style/Widget.MaterialComponents.Button"
|
||||||
|
@ -103,6 +103,7 @@
|
|||||||
<string name="delete">Delete</string>
|
<string name="delete">Delete</string>
|
||||||
<string name="tv_delete">Select tunnel to delete</string>
|
<string name="tv_delete">Select tunnel to delete</string>
|
||||||
<string name="tv_error">Your TV does not have a file picker</string>
|
<string name="tv_error">Your TV does not have a file picker</string>
|
||||||
|
<string name="tv_add_tunnel_get_started">Add a tunnel to get started</string>
|
||||||
<string name="disable_config_export_title">Disable config exporting</string>
|
<string name="disable_config_export_title">Disable config exporting</string>
|
||||||
<string name="disable_config_export_description">Disabling config exporting makes private keys less accessible</string>
|
<string name="disable_config_export_description">Disabling config exporting makes private keys less accessible</string>
|
||||||
<string name="dns_servers">DNS servers</string>
|
<string name="dns_servers">DNS servers</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user