Disallow push message if no applications exist

Fixes #179
This commit is contained in:
Sternagfonkel
2021-07-27 20:20:19 +02:00
committed by GitHub
parent 0a7a04885f
commit b35d5af258
5 changed files with 164 additions and 84 deletions

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@color/icons"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
</vector>

View File

@@ -1,92 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
layout="@layout/app_bar_drawer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp">
<EditText
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/push_title_hint"
android:inputType="text"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/push_content_hint"
android:inputType="textCapSentences|textMultiLine"
android:maxLength="2000"
android:maxLines="10" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtTxtPriority"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789"
android:hint="@string/push_priority_hint"
android:imeOptions="actionDone"
android:inputType="numberSigned"
android:maxLength="3"
android:text="0" />
</com.google.android.material.textfield.TextInputLayout>
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp">
android:orientation="vertical">
<TextView
android:id="@+id/txtAppListDesc"
android:layout_width="wrap_content"
<include
layout="@layout/app_bar_drawer"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/appListDescription" />
android:layout_margin="20dp">
<EditText
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/push_title_hint"
android:inputType="text"
android:singleLine="true" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/push_content_hint"
android:inputType="textCapSentences|textMultiLine"
android:maxLength="2000"
android:maxLines="10" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtTxtPriority"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:digits="0123456789"
android:hint="@string/push_priority_hint"
android:imeOptions="actionDone"
android:inputType="numberSigned"
android:maxLength="3"
android:text="0" />
</com.google.android.material.textfield.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/txtAppListDesc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/appListDescription" />
<Spinner
android:id="@+id/appSpinner"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:spinnerMode="dropdown"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/missingAppsContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:visibility="gone">
<ImageView
android:id="@+id/missingAppsIcon"
android:layout_width="40dp"
android:layout_height="match_parent"
android:layout_weight="0"
app:srcCompat="@drawable/ic_info" />
<Space
android:layout_width="10dp"
android:layout_height="match_parent"
android:layout_weight="0" />
<TextView
android:id="@+id/missingAppsText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0"
android:text="@string/push_missing_app_info"
android:textAlignment="center"
android:visibility="visible" />
</LinearLayout>
<Button
android:id="@+id/push_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginHorizontal="20dp"
android:layout_marginBottom="20dp"
android:text="@string/push_button" />
<Spinner
android:id="@+id/appSpinner"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:spinnerMode="dropdown"
android:textSize="18sp" />
</LinearLayout>
<Button
android:id="@+id/push_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginBottom="20dp"
android:layout_marginHorizontal="20dp"
android:text="@string/push_button" />
</LinearLayout>
</ScrollView>

View File

@@ -81,5 +81,6 @@
<string name="push_title_hint">Title</string>
<string name="push_content_hint">Content</string>
<string name="push_priority_hint">Priority</string>
<string name="push_missing_app_info">There are no applications available on the server to push a message to.</string>
<string name="message_copied_to_clipboard">Content copied to clipboard</string>
</resources>