Refactored Config inner classes into their own classes, added a dialogs for Groups, Actions, Server, and confirmations

This commit is contained in:
2020-08-21 12:12:19 -05:00
parent 8fd48d4d8d
commit ee6372a4f5
42 changed files with 1020 additions and 284 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/configurations"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -30,9 +30,10 @@
<ImageButton
android:id="@+id/dialogCloseButton"
android:layout_width="wrap_content"
style="Da"
android:layout_width="56dp"
android:layout_height="match_parent"
android:backgroundTint="@color/colorDanger"
android:background="@drawable/dangerous_button"
android:contentDescription="@string/dialog_close"
android:src="@drawable/cross"
app:layout_constraintEnd_toEndOf="parent"

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/button_margin_left"
android:layout_marginTop="@dimen/button_margin_top"
android:layout_marginRight="@dimen/button_margin_right"
android:gravity="center"
android:text="TextView"
android:textColor="@color/dialogLabel"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dialog_button_margin"
android:orientation="horizontal">
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_cancel" />
<Button
android:id="@+id/confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_okay"
android:background="@drawable/dangerous_button" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
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:gravity="center|center_horizontal|center_vertical"
android:text="@string/variable_name"
android:textColor="@color/dialogLabel" />
<EditText
android:id="@+id/name"
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:gravity="center|center_horizontal|center_vertical"
android:text="@string/comment"
android:textColor="@color/dialogLabel" />
<EditText
android:id="@+id/comment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/comment"
android:inputType="textPersonName" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dialog_button_margin"
android:orientation="horizontal">
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_cancel" />
<Button
android:id="@+id/mutate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_add" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
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:gravity="center|center_horizontal|center_vertical"
android:text="@string/variable_name"
android:textColor="@color/dialogLabel" />
<EditText
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/variable_name"
android:inputType="textPersonName" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dialog_button_margin"
android:orientation="horizontal">
<Button
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_cancel" />
<Button
android:id="@+id/mutate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/dialog_add" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/button_margin_left"
android:layout_marginRight="@dimen/button_margin_right"
android:orientation="horizontal">
<!-- labels -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Client Status"
android:textColor="@color/dialogLabel"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Total Packets In"
android:textColor="@color/dialogLabel"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Total Packets Out"
android:textColor="@color/dialogLabel"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Total Data In"
android:textColor="@color/dialogLabel"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Total Data Out"
android:textColor="@color/dialogLabel"
android:textStyle="bold" />
</LinearLayout>
<!-- values -->
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/button_margin_left"
android:orientation="vertical">
<TextView
android:id="@+id/total_data_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="0"
android:textColor="@color/dialogLabel"/>
<TextView
android:id="@+id/total_packets_in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="0"
android:textColor="@color/dialogLabel"/>
<TextView
android:id="@+id/total_data_in"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="0"
android:textColor="@color/dialogLabel"/>
<TextView
android:id="@+id/client_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="0"
android:textColor="@color/dialogLabel"/>
<TextView
android:id="@+id/total_packets_out"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="0"
android:textColor="@color/dialogLabel"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dialog_button_margin"
android:orientation="horizontal">
<Button
android:id="@+id/stop_server"
style="@style/DangerousButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/tacnet_stop_server" />
</LinearLayout>
</LinearLayout>

View File

@@ -5,16 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.editor.EditorFragment">
tools:context=".ui.editor.GroupsFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</ScrollView>
<include layout="@layout/partial_editor"/>
</LinearLayout>

View File

@@ -3,19 +3,9 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"/>
<LinearLayout
android:id="@+id/configuration"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"></LinearLayout>
<include layout="@layout/partial_editor"/>
</LinearLayout>

View File

@@ -5,25 +5,18 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.editor.EditorFragment">
tools:context=".ui.editor.GroupsFragment">
<TextView
android:id="@+id/configuration_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/list_even"
android:text="No configuration active"
android:text="@string/warning_no_config_active"
android:textAlignment="center"
android:layout_gravity="center_horizontal"
android:textSize="18sp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/partial_editor"/>
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</ScrollView>
</LinearLayout>

View File

@@ -5,16 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.editor.EditorFragment">
tools:context=".ui.editor.GroupsFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</ScrollView>
<include layout="@layout/partial_editor"/>
</LinearLayout>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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">
<ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</ScrollView>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/actionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/activity_vertical_margin"
android:clickable="true"
android:src="@drawable/plus"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -13,9 +13,9 @@
<fragment
android:id="@+id/navigation_editor"
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.editor.EditorFragment"
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.editor.GroupsFragment"
android:label="@string/title_editor"
tools:layout="@layout/fragment_editor" >
tools:layout="@layout/fragment_groups" >
<action
android:id="@+id/action_navigation_editor_to_actionsFragment"
app:destination="@id/actionsFragment" />

View File

@@ -32,4 +32,8 @@
<string name="variable_name">Name</string>
<string name="variable_type">Type</string>
<string name="variable_value">Value</string>
<string name="comment">Comment</string>
<string name="warning_no_config_active">No active configuration set</string>
<string name="tacnet_stop_server">Stop Server</string>
<string name="tacnet_server_status">Server Status</string>
</resources>