From 2bdf011e61db6899a3a44a5357a0100b045767f9 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Wed, 12 Jan 2022 23:11:46 -0600 Subject: Improved design of commands --- .../details/commands/UnitCommandsFragment.kt | 3 ++- .../src/main/res/drawable/icon_radio_checked.xml | 10 ++++++++ .../src/main/res/drawable/icon_radio_unchecked.xml | 10 ++++++++ .../res/drawable/indicator_check_mark_light.xml | 28 +++++++++++++++++++++ .../main/res/layout/simple_list_item_checked.xml | 29 ++++++++++++++++++++++ .../src/main/res/layout/unit_details_commands.xml | 22 +++++++++++----- androidApp/src/main/res/values/strings.xml | 2 +- 7 files changed, 96 insertions(+), 8 deletions(-) create mode 100644 androidApp/src/main/res/drawable/icon_radio_checked.xml create mode 100644 androidApp/src/main/res/drawable/icon_radio_unchecked.xml create mode 100644 androidApp/src/main/res/drawable/indicator_check_mark_light.xml create mode 100644 androidApp/src/main/res/layout/simple_list_item_checked.xml (limited to 'androidApp/src') diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt index bb462ef..b0aab3e 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/commands/UnitCommandsFragment.kt @@ -8,6 +8,7 @@ import android.view.ViewGroup import android.widget.ArrayAdapter import androidx.fragment.app.Fragment import kotlinx.coroutines.DelicateCoroutinesApi +import mx.trackermap.TrackerMap.android.R import mx.trackermap.TrackerMap.android.databinding.UnitDetailsCommandsBinding import mx.trackermap.TrackerMap.android.details.UnitDetailsAdapter import org.koin.androidx.viewmodel.ext.android.viewModel @@ -44,7 +45,7 @@ class UnitCommandsFragment: Fragment() { unitCommandsViewModel.commands.observe(viewLifecycleOwner) { commands -> Log.d("UnitCommandsFragment", "Device commands - $commands") val context = activity!!.applicationContext - val adapter = ArrayAdapter(context, android.R.layout.simple_list_item_1) + val adapter = ArrayAdapter(context, R.layout.simple_list_item_checked) adapter.addAll(commands.map { it.description }) binding.commandsList.adapter = adapter } diff --git a/androidApp/src/main/res/drawable/icon_radio_checked.xml b/androidApp/src/main/res/drawable/icon_radio_checked.xml new file mode 100644 index 0000000..bdf69f9 --- /dev/null +++ b/androidApp/src/main/res/drawable/icon_radio_checked.xml @@ -0,0 +1,10 @@ + + + diff --git a/androidApp/src/main/res/drawable/icon_radio_unchecked.xml b/androidApp/src/main/res/drawable/icon_radio_unchecked.xml new file mode 100644 index 0000000..2dd0d69 --- /dev/null +++ b/androidApp/src/main/res/drawable/icon_radio_unchecked.xml @@ -0,0 +1,10 @@ + + + diff --git a/androidApp/src/main/res/drawable/indicator_check_mark_light.xml b/androidApp/src/main/res/drawable/indicator_check_mark_light.xml new file mode 100644 index 0000000..8647888 --- /dev/null +++ b/androidApp/src/main/res/drawable/indicator_check_mark_light.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + diff --git a/androidApp/src/main/res/layout/simple_list_item_checked.xml b/androidApp/src/main/res/layout/simple_list_item_checked.xml new file mode 100644 index 0000000..3efbcc4 --- /dev/null +++ b/androidApp/src/main/res/layout/simple_list_item_checked.xml @@ -0,0 +1,29 @@ + + + + diff --git a/androidApp/src/main/res/layout/unit_details_commands.xml b/androidApp/src/main/res/layout/unit_details_commands.xml index e98b113..6e1d7b2 100644 --- a/androidApp/src/main/res/layout/unit_details_commands.xml +++ b/androidApp/src/main/res/layout/unit_details_commands.xml @@ -5,16 +5,26 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - + app:layout_constraintTop_toTopOf="parent"> + + + + + app:layout_constraintTop_toBottomOf="@id/commandsCard" /> \ No newline at end of file diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml index c59bb9f..7867873 100644 --- a/androidApp/src/main/res/values/strings.xml +++ b/androidApp/src/main/res/values/strings.xml @@ -2,7 +2,7 @@ TrackerMap - + https://www.google.com/maps/place/%1$f,%2$f?z=19 -- cgit v1.2.3