aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsidro Henoch <imhenoch@protonmail.com>2021-12-15 00:42:08 -0600
committerIsidro Henoch <imhenoch@protonmail.com>2021-12-15 00:42:08 -0600
commit64edb0466aae0f920b6a9d6c01c142e1207ae5b1 (patch)
tree1b9fb4e4613e317983a84f6a9089efa7157928fd
parent14dff03d1d705722d8184724f296deff557a3014 (diff)
downloadetbsa-trackermap-mobile-64edb0466aae0f920b6a9d6c01c142e1207ae5b1.tar.gz
etbsa-trackermap-mobile-64edb0466aae0f920b6a9d6c01c142e1207ae5b1.tar.bz2
etbsa-trackermap-mobile-64edb0466aae0f920b6a9d6c01c142e1207ae5b1.zip
Adds the profile button
It doesn't do anything atm...
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt7
-rw-r--r--androidApp/src/main/res/layout/activity_main.xml19
-rw-r--r--androidApp/src/main/res/layout/units_activity.xml31
-rw-r--r--androidApp/src/main/res/values/dimen.xml8
-rw-r--r--androidApp/src/main/res/values/strings.xml1
5 files changed, 38 insertions, 28 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt
index c895f31..2be6da3 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsActivity.kt
@@ -1,6 +1,7 @@
package mx.trackermap.TrackerMap.android.units
import android.os.Bundle
+import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.core.widget.doAfterTextChanged
import androidx.fragment.app.commit
@@ -33,13 +34,19 @@ class UnitsActivity : AppCompatActivity() {
}
private fun setupEvents() {
+ binding.profileButton.setOnClickListener {
+ Log.d("UnitsActivity", "Profile tapped")
+ }
binding.displayModeToggle.setOnClickListener {
+ Log.d("UnitsActivity", "Units display toggle tapped")
unitsViewModel.toggleDisplayMode()
}
binding.searchInput.doAfterTextChanged {
+ Log.d("UnitsActivity", "Search changed to ${it.toString()}")
unitsViewModel.searchQuery.value = it.toString()
}
binding.searchInput.setOnEditorActionListener { _, _, _ ->
+ Log.d("UnitsActivity", "Search key tapped")
unitsViewModel.search()
true
}
diff --git a/androidApp/src/main/res/layout/activity_main.xml b/androidApp/src/main/res/layout/activity_main.xml
deleted file mode 100644
index 73626a6..0000000
--- a/androidApp/src/main/res/layout/activity_main.xml
+++ /dev/null
@@ -1,19 +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"
- xmlns:tools="http://schemas.android.com/tools"
- android:id="@+id/main_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
-
- <TextView
- android:id="@+id/text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintLeft_toLeftOf="parent"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- tools:text="Hello World!" />
-
-</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
diff --git a/androidApp/src/main/res/layout/units_activity.xml b/androidApp/src/main/res/layout/units_activity.xml
index 5bfb228..4f4ee77 100644
--- a/androidApp/src/main/res/layout/units_activity.xml
+++ b/androidApp/src/main/res/layout/units_activity.xml
@@ -9,30 +9,42 @@
android:id="@+id/displayContainer"
android:layout_width="0dp"
android:layout_height="0dp"
- android:layout_marginTop="16dp"
+ android:layout_marginTop="@dimen/fab_margin"
app:layout_constraintTop_toBottomOf="@id/displayModeToggle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/profileButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ android:backgroundTint="@android:color/white"
+ app:borderWidth="0dp"
+ app:fabSize="mini"
+ android:layout_marginStart="@dimen/fab_margin"
+ android:layout_marginTop="@dimen/fab_margin"
+ app:elevation="@dimen/fab_elevation"/>
+
<com.google.android.material.card.MaterialCardView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="@id/displayModeToggle"
- app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintStart_toEndOf="@id/profileButton"
app:layout_constraintEnd_toStartOf="@id/displayModeToggle"
app:layout_constraintBottom_toBottomOf="@id/displayModeToggle"
- android:layout_marginVertical="4dp"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="8dp"
+ android:layout_marginVertical="@dimen/search_vertical_margin"
+ android:layout_marginHorizontal="@dimen/search_horizontal_margin"
app:cardCornerRadius="25dp"
- app:cardElevation="5dp">
+ app:cardElevation="@dimen/card_elevation">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/searchInput"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:hint="Type to search"
+ android:hint="@string/units_search"
android:paddingHorizontal="16dp"
android:background="@null"
android:inputType="text"
@@ -50,7 +62,8 @@
android:backgroundTint="@android:color/white"
app:borderWidth="0dp"
app:fabSize="mini"
- android:layout_marginEnd="16dp"
- android:layout_marginTop="16dp"/>
+ android:layout_marginEnd="@dimen/fab_margin"
+ android:layout_marginTop="@dimen/fab_margin"
+ app:elevation="@dimen/fab_elevation"/>
</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
diff --git a/androidApp/src/main/res/values/dimen.xml b/androidApp/src/main/res/values/dimen.xml
index c39d301..cd4d970 100644
--- a/androidApp/src/main/res/values/dimen.xml
+++ b/androidApp/src/main/res/values/dimen.xml
@@ -6,4 +6,12 @@
<dimen name="card_large_padding">32dp</dimen>
<dimen name="card_padding">16dp</dimen>
<dimen name="card_margin">16dp</dimen>
+
+ <!-- Search -->
+ <dimen name="search_horizontal_margin">8dp</dimen>
+ <dimen name="search_vertical_margin">4dp</dimen>
+
+ <!-- Floating Button -->
+ <dimen name="fab_margin">16dp</dimen>
+ <dimen name="fab_elevation">8dp</dimen>
</resources> \ 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 3919343..0a42223 100644
--- a/androidApp/src/main/res/values/strings.xml
+++ b/androidApp/src/main/res/values/strings.xml
@@ -11,4 +11,5 @@
<string name="unit_details">Details</string>
<string name="unit_reports">Reports</string>
<string name="unit_commands">Commands</string>
+ <string name="units_search">Type to search</string>
</resources> \ No newline at end of file