Initial work on custom dialogs

This commit is contained in:
2020-06-14 09:36:34 -05:00
parent dc33342586
commit f27706e3be
14 changed files with 244 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/dialogBackground" />
<corners
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
</shape>

View File

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/dialogContainer"
android:orientation="vertical"
android:weightSum="100"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/titlebar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/dialogNotice"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/dialogTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24dp"
android:textColor="@color/dialogTitle"
android:textFontWeight="800"
android:text="[Title Not Set]"
android:layout_marginLeft="10dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/dialogCloseButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/dialog_close"
android:src="@drawable/cross"
android:backgroundTint="@color/colorDanger"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:id="@+id/dialogContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dialogBackground"
android:orientation="vertical">
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/variable_name" />
<EditText
android:id="@+id/variableName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/variable_name"
android:inputType="textPersonName" />
<TextView
android:id="@+id/textView6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/variable_type" />
<EditText
android:id="@+id/editTextTextPersonName3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/variable_type"
android:inputType="textPersonName" />
<TextView
android:id="@+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/variable_value" />
<EditText
android:id="@+id/editTextTextPersonName4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/variable_value"
android:inputType="textPersonName" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_cancel" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_add" />
</LinearLayout>
</LinearLayout>

View File

@@ -1,22 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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"
android:orientation="vertical"
tools:context=".ui.settings.SettingsFragment">
<TextView
android:id="@+id/text_settings"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:background="@color/list_even"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_manage_presets" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/list_odd"
android:orientation="vertical"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<Button
android:id="@+id/button5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_manage_configurations" />
</LinearLayout>
</LinearLayout>

View File

@@ -6,10 +6,22 @@
<color name="colorSecondary">#006000</color>
<color name="colorTertiary">#00d000</color>
<color name="colorDanger">#800</color>
<color name="buttonContent">#ffffff</color>
<color name="buttonDisabled">#765</color>
<color name="navigationButtonSelected">#00a000</color>
<color name="navigationButtonHover">#00d000</color>
<color name="navigationButtonActive">#00d000</color>
<color name="navigationButton">#006000</color>
<color name="list_even">#555</color>
<color name="list_odd">#999</color>
<color name="dialogBackground">#eee</color>
<color name="dialogTitle">#fff</color>
<color name="dialogCloseColor">#222</color>
<color name="dialogAlert">#f80</color>
<color name="dialogError">@color/colorDanger</color>
<color name="dialogNotice">#080</color>
</resources>

View File

@@ -16,4 +16,17 @@
<string name="navbar_editor_description">Edit configuration</string>
<string name="navbar_settings_description">Manage presets and configuration files</string>
<string name="navbar_search_description">Search for groups and actions</string>
<string name="settings_manage_presets">Manage Presets</string>
<string name="settings_manage_configurations">Manage Configurations</string>
<string name="dialog_close">Close</string>
<string name="dialog_cancel">Cancel</string>
<string name="dialog_okay">Okay</string>
<string name="dialog_add">Add</string>
<string name="dialog_update">Update</string>
<string name="variable_name">Name</string>
<string name="variable_type">Type</string>
<string name="variable_value">Value</string>
</resources>