diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-15 20:08:37 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-15 20:08:37 -0600 |
commit | 6aa78c8ddbcdeaace0f4596e7c717dafef036f03 (patch) | |
tree | 2bfcaff8312058e4c16cc238ded881f59727983e /androidApp | |
parent | d16483ddb5f9989315db95fe2d70747c04ebc657 (diff) | |
download | etbsa-trackermap-mobile-6aa78c8ddbcdeaace0f4596e7c717dafef036f03.tar.gz etbsa-trackermap-mobile-6aa78c8ddbcdeaace0f4596e7c717dafef036f03.tar.bz2 etbsa-trackermap-mobile-6aa78c8ddbcdeaace0f4596e7c717dafef036f03.zip |
Improved loading indicators, improved layout semantics, added translations and changed default view to MAP
Diffstat (limited to 'androidApp')
22 files changed, 498 insertions, 398 deletions
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 fa6a37a..b56a403 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 @@ -35,6 +35,7 @@ class UnitCommandsFragment: Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + binding.reportLoading.root.visibility = View.VISIBLE setupObservers() setupEvents() } @@ -47,7 +48,7 @@ class UnitCommandsFragment: Fragment() { private fun setupObservers() { unitCommandsViewModel.commands.observe(viewLifecycleOwner) { commands -> Log.d("UnitCommandsFragment", "Device commands - $commands") - binding.reportLoading.visibility = View.GONE + binding.reportLoading.root.visibility = View.GONE val context = activity!!.applicationContext val adapter = ArrayAdapter<String>(context, R.layout.simple_list_item_checked) adapter.addAll(commands.map { it.description }) diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt index 232b6e9..0c3577e 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/information/UnitInformationFragment.kt @@ -53,7 +53,7 @@ class UnitInformationFragment : Fragment() { private fun setupObservers() { unitInformationViewModel.unit.observe(viewLifecycleOwner) { unitInformation -> Log.d("UnitInformationFragment", "Unit Information Fetched - $unitInformation") - binding.reportLoading.visibility = View.GONE + binding.reportLoading.root.visibility = View.GONE unitInformation?.let { displayInformation(it) } @@ -65,7 +65,7 @@ class UnitInformationFragment : Fragment() { val name = arguments?.getString(UnitDetailsAdapter.DEVICE_NAME_ARG) unitInformationViewModel.fetchUnit(id ?: 0) binding.nameDetail.text = name - binding.reportLoading.visibility = View.VISIBLE + binding.reportLoading.root.visibility = View.VISIBLE } private fun displayInformation(unit: UnitInformation) { diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt index 957c6a7..20d2a48 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt @@ -248,7 +248,7 @@ class UnitReportsFragment : Fragment() { } private fun loading() { - binding.reportLoading.visibility = View.VISIBLE + binding.reportLoading.root.visibility = View.VISIBLE binding.eventsScroll.visibility = View.GONE binding.reportsMapContainer.visibility = View.GONE @@ -258,7 +258,7 @@ class UnitReportsFragment : Fragment() { } private fun showMap(shouldShowMap: Boolean) { - binding.reportLoading.visibility = View.GONE + binding.reportLoading.root.visibility = View.GONE binding.eventsScroll.visibility = if (shouldShowMap) View.GONE else View.VISIBLE binding.reportsMapContainer.visibility = if (shouldShowMap) View.VISIBLE else View.GONE diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt index 53e726e..344907c 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesAdapter.kt @@ -44,6 +44,7 @@ class DevicesAdapter( engineStopIcon = engineStopIcon, gridLayout = gridLayout, detailsButton = detailsButton, + reportsButton = reportsButton, commandsButton = commandsButton, unitCard = unitCard, swipeLayout = swipeLayout diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt index 3b44477..96d4696 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/devices/DevicesFragment.kt @@ -6,6 +6,8 @@ import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.view.ViewTreeObserver +import android.widget.Toast import androidx.recyclerview.widget.LinearLayoutManager import kotlinx.coroutines.DelicateCoroutinesApi import mx.trackermap.TrackerMap.android.databinding.DevicesFragmentBinding @@ -59,6 +61,7 @@ class DevicesFragment(private val unitsViewModel: UnitsViewModel) : UnitFragment false ) binding.devicesList.adapter = DevicesAdapter(emptyList(), null) + binding.infoLoading.root.visibility = View.VISIBLE } @DelicateCoroutinesApi @@ -66,6 +69,7 @@ class DevicesFragment(private val unitsViewModel: UnitsViewModel) : UnitFragment Log.d("DevicesFragment", "setupObservers()") unitsViewModel.units.observe(viewLifecycleOwner) { units -> Log.d("DevicesFragment", "Success $units") + binding.infoLoading.root.visibility = View.GONE binding.devicesList.swapAdapter( DevicesAdapter(units, this::itemAction), false diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt index 1cac5bd..f48eb93 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/LoginFragment.kt @@ -13,6 +13,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager import androidx.preference.PreferenceManager import com.zhuinden.liveevent.observe import kotlinx.coroutines.DelicateCoroutinesApi +import mx.trackermap.TrackerMap.android.R import mx.trackermap.TrackerMap.android.databinding.LoginBinding import mx.trackermap.TrackerMap.android.units.UnitsActivity import mx.trackermap.TrackerMap.controllers.SessionController @@ -75,17 +76,23 @@ class LoginFragment : Fragment() { loginViewModel.loginState.observe(viewLifecycleOwner) { result -> Log.d("LoginFragment", result.toString()) when (result) { + SessionController.LoginState.Nothing -> { + binding.infoLoading.root.visibility = View.GONE + } SessionController.LoginState.Loading -> { - Toast.makeText(context, "Loading...", Toast.LENGTH_SHORT).show() + binding.infoLoading.root.visibility = View.VISIBLE } SessionController.LoginState.EmailMissing -> { - Toast.makeText(context, "Email is missing", Toast.LENGTH_SHORT).show() + binding.infoLoading.root.visibility = View.GONE + Toast.makeText(context, getString(R.string.login_username_missing), Toast.LENGTH_SHORT).show() } SessionController.LoginState.PasswordMissing -> { - Toast.makeText(context, "Password is missing", Toast.LENGTH_SHORT).show() + binding.infoLoading.root.visibility = View.GONE + Toast.makeText(context, getString(R.string.login_password_missing), Toast.LENGTH_SHORT).show() } SessionController.LoginState.Failure -> { - Toast.makeText(context, "Failed login", Toast.LENGTH_SHORT).show() + binding.infoLoading.root.visibility = View.GONE + Toast.makeText(context, getString(R.string.login_login_failed), Toast.LENGTH_SHORT).show() } SessionController.LoginState.Success -> { broadcastManager.sendBroadcast(Intent(EVENT_LOGIN)) diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt index 5ae8c75..b0a4482 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/session/UserInformationActivity.kt @@ -84,7 +84,7 @@ class UserInformationActivity : AppCompatActivity() { } private fun setLoading(isLoading: Boolean) { - binding.infoLoading.visibility = if (isLoading) View.VISIBLE else View.GONE + binding.infoLoading.root.visibility = if (isLoading) View.VISIBLE else View.GONE binding.userInfoCard.visibility = if (isLoading) View.GONE else View.VISIBLE } diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt index 6a04cf4..08d35a2 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/units/UnitsViewModel.kt @@ -27,7 +27,7 @@ class UnitsViewModel( private val geofenceController: GeofencesController by inject() private var _searchQuery = savedStateHandle.getLiveData("searchQuery", "") - private var _unitsDisplayMode = MutableLiveData(UnitsDisplayMode.LIST) + private var _unitsDisplayMode = MutableLiveData(UnitsDisplayMode.MAP) private var _units = MutableLiveData<List<UnitInformation>>() private var _selectedUnit = MutableLiveData<UnitInformation?>() private var _mapTileInfo = MutableLiveData<TileInfoNew>() diff --git a/androidApp/src/main/res/drawable/icon_search.xml b/androidApp/src/main/res/drawable/icon_search.xml new file mode 100644 index 0000000..07b76d6 --- /dev/null +++ b/androidApp/src/main/res/drawable/icon_search.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@android:color/white" + android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> +</vector> diff --git a/androidApp/src/main/res/layout/devices_fragment.xml b/androidApp/src/main/res/layout/devices_fragment.xml index fd91db3..1dd1690 100644 --- a/androidApp/src/main/res/layout/devices_fragment.xml +++ b/androidApp/src/main/res/layout/devices_fragment.xml @@ -1,17 +1,19 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout +<FrameLayout 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"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/devicesList" android:layout_width="match_parent" + android:layout_height="match_parent" /> + + <include + android:id="@+id/infoLoading" + android:layout_width="match_parent" android:layout_height="match_parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + layout="@layout/loading_indicator" + android:visibility="gone"/> -</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file +</FrameLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/loading_indicator.xml b/androidApp/src/main/res/layout/loading_indicator.xml new file mode 100644 index 0000000..83b94d5 --- /dev/null +++ b/androidApp/src/main/res/layout/loading_indicator.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/background"> + + <ProgressBar + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center"/> + +</FrameLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/login.xml b/androidApp/src/main/res/layout/login.xml index 2512052..35c9410 100644 --- a/androidApp/src/main/res/layout/login.xml +++ b/androidApp/src/main/res/layout/login.xml @@ -1,74 +1,110 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.cardview.widget.CardView +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:name="mx.trackermap.TrackerMap.android.session.LoginFragment" android:layout_width="match_parent" - android:layout_height="wrap_content" - app:cardCornerRadius="@dimen/card_border_radius" - app:cardElevation="@dimen/card_elevation" - app:cardUseCompatPadding="true"> + android:layout_height="match_parent"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingVertical="@dimen/card_large_padding" - android:paddingHorizontal="@dimen/card_padding"> - - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/usernameInputLayout" - style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:hint="@string/login_username" - app:layout_constraintBottom_toTopOf="@+id/passwordInputLayout" + android:layout_height="match_parent"> + + <androidx.appcompat.widget.AppCompatImageView + android:id="@+id/bannerImage" + android:layout_width="0dp" + android:layout_height="@dimen/about_logo_height" + app:layout_constraintWidth_percent="0.5" + app:layout_constraintDimensionRatio="1" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.5" + android:layout_marginHorizontal="@dimen/card_margin" + app:srcCompat="@drawable/about_logo" /> + + <androidx.cardview.widget.CardView + android:layout_width="0dp" + android:layout_height="wrap_content" + app:cardCornerRadius="@dimen/card_border_radius" + app:cardElevation="@dimen/card_elevation" + app:cardUseCompatPadding="true" + app:layout_constraintTop_toBottomOf="@id/bannerImage" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent"> + app:layout_constraintEnd_toEndOf="parent" + android:layout_marginHorizontal="@dimen/card_margin" + android:layout_marginBottom="16dp"> - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/usernameEditText" + <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:inputType="textEmailAddress"/> + android:paddingVertical="@dimen/card_large_padding" + android:paddingHorizontal="@dimen/card_padding"> - </com.google.android.material.textfield.TextInputLayout> + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/usernameInputLayout" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/login_username" + app:layout_constraintBottom_toTopOf="@+id/passwordInputLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - <com.google.android.material.textfield.TextInputLayout - android:id="@+id/passwordInputLayout" - style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:hint="@string/login_password" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.5" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/usernameInputLayout" - app:layout_constraintBottom_toTopOf="@id/signinButton" - android:layout_marginTop="24dp"> + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/usernameEditText" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textEmailAddress"/> - <com.google.android.material.textfield.TextInputEditText - android:id="@+id/passwordEditText" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:inputType="textPassword"/> + </com.google.android.material.textfield.TextInputLayout> - </com.google.android.material.textfield.TextInputLayout> + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/passwordInputLayout" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/login_password" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/usernameInputLayout" + app:layout_constraintBottom_toTopOf="@id/signinButton" + android:layout_marginTop="24dp"> - <com.google.android.material.button.MaterialButton - android:id="@+id/signinButton" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:layout_constraintWidth_percent="0.5" - app:layout_constraintTop_toBottomOf="@id/passwordInputLayout" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintHorizontal_bias="0.5" - android:layout_marginTop="40dp" - android:text="@string/login_login"/> + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/passwordEditText" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textPassword"/> + + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.button.MaterialButton + android:id="@+id/signinButton" + android:layout_width="0dp" + android:layout_height="wrap_content" + app:layout_constraintWidth_percent="0.5" + app:layout_constraintTop_toBottomOf="@id/passwordInputLayout" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintHorizontal_bias="0.5" + android:layout_marginTop="40dp" + android:text="@string/login_login"/> + + </androidx.constraintlayout.widget.ConstraintLayout> + + </androidx.cardview.widget.CardView> </androidx.constraintlayout.widget.ConstraintLayout> -</androidx.cardview.widget.CardView>
\ No newline at end of file + <include + android:id="@+id/infoLoading" + android:layout_width="match_parent" + android:layout_height="match_parent" + layout="@layout/loading_indicator" + android:visibility="gone"/> + +</FrameLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/login_activity.xml b/androidApp/src/main/res/layout/login_activity.xml index be143d9..1c75a7b 100644 --- a/androidApp/src/main/res/layout/login_activity.xml +++ b/androidApp/src/main/res/layout/login_activity.xml @@ -1,30 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout +<androidx.fragment.app.FragmentContainerView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:id="@+id/loginFragment" android:layout_width="match_parent" android:layout_height="match_parent" - xmlns:app="http://schemas.android.com/apk/res-auto"> - - <androidx.appcompat.widget.AppCompatImageView - android:id="@+id/bannerImage" - android:layout_width="0dp" - android:layout_height="0dp" - app:layout_constraintWidth_percent="0.5" - app:layout_constraintDimensionRatio="1" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:srcCompat="@drawable/ic_launcher_foreground" /> - - <androidx.fragment.app.FragmentContainerView - android:id="@+id/loginFragment" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:name="mx.trackermap.TrackerMap.android.session.LoginFragment" - app:layout_constraintTop_toBottomOf="@id/bannerImage" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - android:layout_marginHorizontal="@dimen/card_margin" - android:layout_marginBottom="16dp"/> - -</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file + android:name="mx.trackermap.TrackerMap.android.session.LoginFragment" + app:layout_constraintTop_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" />
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/unit_details_commands.xml b/androidApp/src/main/res/layout/unit_details_commands.xml index 3616f75..01aefb8 100644 --- a/androidApp/src/main/res/layout/unit_details_commands.xml +++ b/androidApp/src/main/res/layout/unit_details_commands.xml @@ -1,79 +1,81 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout +<FrameLayout 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"> - <ProgressBar - android:id="@+id/reportLoading" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="@dimen/margin" - android:translationZ="9dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> - <com.google.android.material.card.MaterialCardView - android:id="@+id/commandsCard" - android:layout_width="0dp" - android:layout_height="0dp" - app:cardCornerRadius="@dimen/card_border_radius" - app:cardElevation="@dimen/card_elevation" - app:cardUseCompatPadding="true" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent"> + <com.google.android.material.card.MaterialCardView + android:id="@+id/commandsCard" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:cardCornerRadius="@dimen/card_border_radius" + app:cardElevation="@dimen/card_elevation" + app:cardUseCompatPadding="true"> - <androidx.constraintlayout.widget.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> - <TextView - android:id="@+id/nameDetail" - style="@style/TextAppearance.AppCompat.Headline" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:textColor="@color/colorPrimaryDark" - android:layout_margin="@dimen/card_padding" - android:layout_marginBottom="@dimen/margin" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toTopOf="@id/commandsList" - tools:text="1AAUTO" /> + <TextView + android:id="@+id/nameDetail" + style="@style/TextAppearance.AppCompat.Headline" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:textColor="@color/colorPrimaryDark" + android:layout_margin="@dimen/card_padding" + android:layout_marginBottom="@dimen/margin" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toTopOf="@id/commandsList" + tools:text="1AAUTO" /> - <ListView - android:id="@+id/commandsList" - android:layout_width="0dp" - android:layout_height="0dp" - android:choiceMode="singleChoice" - android:listSelector="@color/darkBackground" - app:layout_constraintTop_toBottomOf="@id/nameDetail" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toTopOf="@id/sendCommandButton" /> + <ListView + android:id="@+id/commandsList" + android:layout_width="0dp" + android:layout_height="0dp" + android:choiceMode="singleChoice" + android:listSelector="@color/darkBackground" + app:layout_constraintTop_toBottomOf="@id/nameDetail" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toTopOf="@id/sendCommandButton" /> - <com.google.android.material.button.MaterialButton - android:id="@+id/sendCommandButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="@dimen/margin" - android:text="@string/send_command" - android:enabled="false" - app:layout_constraintTop_toBottomOf="@id/commandsList" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - /> + <com.google.android.material.button.MaterialButton + android:id="@+id/sendCommandButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="@dimen/margin" + android:text="@string/send_command" + android:enabled="false" + app:layout_constraintTop_toBottomOf="@id/commandsList" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + /> - </androidx.constraintlayout.widget.ConstraintLayout> + </androidx.constraintlayout.widget.ConstraintLayout> - </com.google.android.material.card.MaterialCardView> + </com.google.android.material.card.MaterialCardView> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <include + android:id="@+id/reportLoading" + android:layout_width="match_parent" + android:layout_height="match_parent" + layout="@layout/loading_indicator" + android:visibility="gone"/> -</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file +</FrameLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/unit_details_information.xml b/androidApp/src/main/res/layout/unit_details_information.xml index 422b77e..cc8bbb7 100644 --- a/androidApp/src/main/res/layout/unit_details_information.xml +++ b/androidApp/src/main/res/layout/unit_details_information.xml @@ -1,49 +1,59 @@ <?xml version="1.0" encoding="utf-8"?> -<androidx.constraintlayout.widget.ConstraintLayout +<FrameLayout 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"> - <ProgressBar - android:id="@+id/reportLoading" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="@dimen/margin" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <com.google.android.material.card.MaterialCardView - android:layout_width="0dp" - android:layout_height="wrap_content" - app:cardCornerRadius="@dimen/card_border_radius" - app:cardElevation="@dimen/card_elevation" - app:cardUseCompatPadding="true" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:contentPadding="@dimen/card_padding"> - - <LinearLayout - android:id="@+id/detailsLayout" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - - <TextView - android:id="@+id/nameDetail" - style="@style/TextAppearance.AppCompat.Headline" + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <ScrollView + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent"> + + <com.google.android.material.card.MaterialCardView android:layout_width="match_parent" android:layout_height="wrap_content" - android:textColor="@color/colorPrimaryDark" - android:layout_marginBottom="@dimen/padding" - tools:text="1AAUTO" /> + app:cardCornerRadius="@dimen/card_border_radius" + app:cardElevation="@dimen/card_elevation" + app:cardUseCompatPadding="true" + app:contentPadding="@dimen/card_padding"> + + <LinearLayout + android:id="@+id/detailsLayout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:id="@+id/nameDetail" + style="@style/TextAppearance.AppCompat.Headline" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textColor="@color/colorPrimaryDark" + android:layout_marginBottom="@dimen/padding" + tools:text="1AAUTO" /> - </LinearLayout> + </LinearLayout> - </com.google.android.material.card.MaterialCardView> + </com.google.android.material.card.MaterialCardView> + + </ScrollView> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <include + android:id="@+id/reportLoading" + android:layout_width="match_parent" + android:layout_height="match_parent" + layout="@layout/loading_indicator" + android:visibility="gone"/> -</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file +</FrameLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/unit_details_reports.xml b/androidApp/src/main/res/layout/unit_details_reports.xml index 0a8e23d..7210e1f 100644 --- a/androidApp/src/main/res/layout/unit_details_reports.xml +++ b/androidApp/src/main/res/layout/unit_details_reports.xml @@ -162,14 +162,15 @@ </LinearLayout> - <ProgressBar + <include android:id="@+id/reportLoading" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_margin="@dimen/margin" - app:layout_constraintBottom_toTopOf="@id/periodSection" - app:layout_constraintEnd_toEndOf="parent" + android:layout_width="0dp" + android:layout_height="0dp" + layout="@layout/loading_indicator" + app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toTopOf="@id/periodSection" + android:visibility="gone"/> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/unit_item.xml b/androidApp/src/main/res/layout/unit_item.xml index cccdd69..6946d1d 100644 --- a/androidApp/src/main/res/layout/unit_item.xml +++ b/androidApp/src/main/res/layout/unit_item.xml @@ -15,10 +15,12 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="end" - android:padding="@dimen/card_padding" + android:padding="@dimen/padding" + android:paddingStart="0dp" android:gravity="center" android:orientation="horizontal" - android:visibility="visible"> + android:visibility="visible" + tools:ignore="RtlSymmetry"> <com.google.android.material.button.MaterialButton android:id="@+id/detailsButton" @@ -27,8 +29,21 @@ android:layout_weight="1" app:cardBackgroundColor="@color/colorAccent" android:text="@string/unit_details" + android:textSize="@dimen/card_action_text" android:textColor="@color/colorAccent" + android:minWidth="0dp" + style="?android:borderlessButtonStyle"/> + + <com.google.android.material.button.MaterialButton + android:id="@+id/reportsButton" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_weight="1" + app:cardBackgroundColor="@color/colorAccent" + android:text="@string/unit_reports" android:textSize="@dimen/card_action_text" + android:textColor="@color/colorAccent" + android:minWidth="0dp" style="?android:borderlessButtonStyle"/> <com.google.android.material.button.MaterialButton @@ -37,9 +52,10 @@ android:layout_height="match_parent" android:layout_weight="1" android:text="@string/unit_commands" - android:textColor="@color/colorAccent" android:textSize="@dimen/card_action_text" - style="?android:borderlessButtonStyle" /> + android:textColor="@color/colorAccent" + android:minWidth="0dp" + style="?android:borderlessButtonStyle"/> </LinearLayout> @@ -53,9 +69,11 @@ app:cardElevation="0dp" app:cardUseCompatPadding="true" app:contentPadding="@dimen/card_padding" + app:contentPaddingLeft="0dp" app:cardBackgroundColor="@color/darkBackground" android:clickable="true" - android:focusable="true"> + android:focusable="true" + tools:visibility="gone"> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/mainContent" @@ -67,7 +85,7 @@ android:id="@+id/unitIcon" android:layout_width="40dp" android:layout_height="40dp" - android:layout_margin="@dimen/card_icon_margin" + android:layout_marginHorizontal="@dimen/card_icon_margin" android:src="@drawable/map_default" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" diff --git a/androidApp/src/main/res/layout/units_activity.xml b/androidApp/src/main/res/layout/units_activity.xml index 86fd99c..a468151 100644 --- a/androidApp/src/main/res/layout/units_activity.xml +++ b/androidApp/src/main/res/layout/units_activity.xml @@ -17,19 +17,18 @@ app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.floatingactionbutton.FloatingActionButton - android:id="@+id/userButton" + android:id="@+id/displayModeToggle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/fab_margin" android:layout_marginTop="@dimen/fab_margin" + android:layout_marginStart="@dimen/fab_margin" android:backgroundTint="@android:color/white" - android:contentDescription="@string/open_profile" - android:src="@drawable/device_contact" app:borderWidth="0dp" app:elevation="@dimen/fab_elevation" app:fabSize="mini" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" + tools:ignore="ContentDescription" /> <com.google.android.material.card.MaterialCardView android:layout_width="0dp" @@ -38,10 +37,10 @@ android:layout_marginVertical="@dimen/search_vertical_margin" app:cardCornerRadius="@dimen/card_border_radius" app:cardElevation="@dimen/card_elevation" - app:layout_constraintBottom_toBottomOf="@id/displayModeToggle" + app:layout_constraintBottom_toBottomOf="@id/userButton" app:layout_constraintEnd_toStartOf="@id/mapLayerToggle" - app:layout_constraintStart_toEndOf="@id/userButton" - app:layout_constraintTop_toTopOf="@id/displayModeToggle"> + app:layout_constraintStart_toEndOf="@id/displayModeToggle" + app:layout_constraintTop_toTopOf="@id/userButton"> <com.google.android.material.textfield.TextInputLayout android:id="@+id/searchInputLayout" @@ -50,6 +49,8 @@ app:endIconMode="clear_text" app:boxBackgroundMode="none" app:boxStrokeWidth="0dp" + app:startIconDrawable="@drawable/icon_search" + app:startIconTint="@android:color/black" app:hintEnabled="false"> <com.google.android.material.textfield.TextInputEditText @@ -80,21 +81,22 @@ app:borderWidth="0dp" app:elevation="@dimen/fab_elevation" app:fabSize="mini" - app:layout_constraintEnd_toStartOf="@id/displayModeToggle" + app:layout_constraintEnd_toStartOf="@id/userButton" app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.floatingactionbutton.FloatingActionButton - android:id="@+id/displayModeToggle" + android:id="@+id/userButton" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/fab_margin" android:layout_marginEnd="@dimen/fab_margin" + android:layout_marginTop="@dimen/fab_margin" android:backgroundTint="@android:color/white" + android:contentDescription="@string/open_profile" + android:src="@drawable/device_contact" app:borderWidth="0dp" app:elevation="@dimen/fab_elevation" app:fabSize="mini" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="parent" - tools:ignore="ContentDescription" /> + app:layout_constraintTop_toTopOf="parent"/> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/layout/user_information_activity.xml b/androidApp/src/main/res/layout/user_information_activity.xml index 0b4924a..c409e98 100644 --- a/androidApp/src/main/res/layout/user_information_activity.xml +++ b/androidApp/src/main/res/layout/user_information_activity.xml @@ -6,17 +6,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - <ProgressBar - android:id="@+id/infoLoading" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintBottom_toBottomOf="parent" - android:translationZ="2dp" - android:visibility="gone"/> - <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/backButton" android:layout_width="wrap_content" @@ -31,7 +20,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - <ScrollView + <FrameLayout android:layout_width="0dp" android:layout_height="0dp" android:layout_marginTop="@dimen/fab_margin" @@ -40,173 +29,186 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintBottom_toBottomOf="parent"> - <LinearLayout + <ScrollView android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> + android:layout_height="match_parent"> - <androidx.cardview.widget.CardView - android:id="@+id/userInfoCard" - android:layout_margin="@dimen/card_margin" + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - app:contentPadding="@dimen/card_padding" - app:cardCornerRadius="@dimen/card_border_radius" - app:cardElevation="@dimen/card_elevation"> + android:orientation="vertical"> - <LinearLayout + <androidx.cardview.widget.CardView + android:id="@+id/userInfoCard" + android:layout_margin="@dimen/card_margin" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - android:text="@string/user_details" - android:textAppearance="@style/TextAppearance.AppCompat.Headline"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/username" - android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> - - <TextView - android:id="@+id/usernameInfo" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - tools:text="Username" /> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/email" - android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> - - <TextView - android:id="@+id/emailInfo" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - tools:text="Email" /> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/unique_id" - android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> - - <TextView - android:id="@+id/idInfo" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - tools:text="Unique ID" /> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/device_limit" - android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> - - <TextView - android:id="@+id/deviceLimitInfo" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - tools:text="Device Limit" /> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/admin" - android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> - - <TextView - android:id="@+id/adminInfo" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - tools:text="Admin" /> - - <com.google.android.material.button.MaterialButton - android:id="@+id/signoutButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/sign_out" /> - - </LinearLayout> - - </androidx.cardview.widget.CardView> - - <androidx.cardview.widget.CardView - android:id="@+id/aboutCard" - android:layout_margin="@dimen/card_margin" - android:layout_width="match_parent" - android:layout_height="wrap_content" - app:contentPadding="@dimen/card_padding" - app:cardCornerRadius="@dimen/card_border_radius" - app:cardElevation="@dimen/card_elevation"> - - <LinearLayout + app:contentPadding="@dimen/card_padding" + app:cardCornerRadius="@dimen/card_border_radius" + app:cardElevation="@dimen/card_elevation"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + android:text="@string/user_details" + android:textAppearance="@style/TextAppearance.AppCompat.Headline"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/username" + android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> + + <TextView + android:id="@+id/usernameInfo" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + tools:text="Username" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/email" + android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> + + <TextView + android:id="@+id/emailInfo" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + tools:text="Email" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/unique_id" + android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> + + <TextView + android:id="@+id/idInfo" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + tools:text="Unique ID" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/device_limit" + android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> + + <TextView + android:id="@+id/deviceLimitInfo" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + tools:text="Device Limit" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/admin" + android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> + + <TextView + android:id="@+id/adminInfo" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + tools:text="Admin" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/signoutButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/sign_out" /> + + </LinearLayout> + + </androidx.cardview.widget.CardView> + + <androidx.cardview.widget.CardView + android:id="@+id/aboutCard" + android:layout_margin="@dimen/card_margin" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="vertical"> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - android:text="@string/about_details" - android:textAppearance="@style/TextAppearance.AppCompat.Headline"/> - - <ImageView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - android:contentDescription="@string/about_logo" - android:src="@drawable/about_logo" /> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - android:text="@string/about_text" - android:maxLines="10"/> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/app_version" - android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> - - <TextView - android:id="@+id/appVersion" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/fields_spacing" - tools:text="1.0" /> - - <com.google.android.material.button.MaterialButton - android:id="@+id/sourceCodeButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/source_code" /> - - <com.google.android.material.button.MaterialButton - android:id="@+id/websiteButton" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/open_website" /> - - </LinearLayout> - - </androidx.cardview.widget.CardView> - - </LinearLayout> + app:contentPadding="@dimen/card_padding" + app:cardCornerRadius="@dimen/card_border_radius" + app:cardElevation="@dimen/card_elevation"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + android:text="@string/about_details" + android:textAppearance="@style/TextAppearance.AppCompat.Headline"/> + + <ImageView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + android:contentDescription="@string/about_logo" + android:src="@drawable/about_logo" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + android:text="@string/about_text" + android:maxLines="10"/> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/app_version" + android:textAppearance="@style/TextAppearance.AppCompat.Body2"/> + + <TextView + android:id="@+id/appVersion" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/fields_spacing" + tools:text="1.0" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/sourceCodeButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/source_code" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/websiteButton" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/open_website" /> + + </LinearLayout> + + </androidx.cardview.widget.CardView> + + </LinearLayout> + + </ScrollView> + + <include + android:id="@+id/infoLoading" + android:layout_width="match_parent" + android:layout_height="match_parent" + layout="@layout/loading_indicator" + android:visibility="visible"/> - </ScrollView> + </FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/androidApp/src/main/res/values-es-rMX/strings.xml b/androidApp/src/main/res/values-es-rMX/strings.xml index 7ebf7d2..bd3a281 100644 --- a/androidApp/src/main/res/values-es-rMX/strings.xml +++ b/androidApp/src/main/res/values-es-rMX/strings.xml @@ -9,6 +9,10 @@ <string name="login_password">Contraseña</string> <string name="login_login">Iniciar sesión</string> + <string name="login_username_missing">Falta el nombre de usuario</string> + <string name="login_password_missing">Falta la contraseña</string> + <string name="login_login_failed">Falló el inicio de sesión</string> + <!-- UnitsActivity --> <string name="toggle_list">Cambiar a lista de dispositivos</string> <string name="toggle_map">Cambiar a mapa</string> @@ -59,7 +63,7 @@ <string name="unit_details">Detalles</string> <string name="unit_reports">Reportes</string> <string name="unit_commands">Comandos</string> - <string name="units_search">Escribe para buscar</string> + <string name="units_search">Buscar</string> <!-- Unit Information --> <string name="unit_info_contact">Contacto</string> diff --git a/androidApp/src/main/res/values/dimen.xml b/androidApp/src/main/res/values/dimen.xml index 906c4af..271a12b 100644 --- a/androidApp/src/main/res/values/dimen.xml +++ b/androidApp/src/main/res/values/dimen.xml @@ -3,16 +3,19 @@ <dimen name="padding">8dp</dimen> <dimen name="margin">16dp</dimen> + <!-- Login --> + <dimen name="about_logo_height">160dp</dimen> + <!-- CardView --> <dimen name="card_border_radius">20dp</dimen> <dimen name="card_elevation">8dp</dimen> <dimen name="card_large_padding">32dp</dimen> <dimen name="card_padding">16dp</dimen> <dimen name="card_margin">16dp</dimen> - <dimen name="card_icon_margin">5dp</dimen> + <dimen name="card_icon_margin">10dp</dimen> <!-- Card Buttons --> - <dimen name="card_action_text">12sp</dimen> + <dimen name="card_action_text">11sp</dimen> <!-- Search --> <dimen name="search_horizontal_margin">8dp</dimen> diff --git a/androidApp/src/main/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml index 5f9714e..07419f3 100644 --- a/androidApp/src/main/res/values/strings.xml +++ b/androidApp/src/main/res/values/strings.xml @@ -32,6 +32,10 @@ <string name="login_password">Password</string> <string name="login_login">Login</string> + <string name="login_username_missing">Username is missing</string> + <string name="login_password_missing">Password is missing</string> + <string name="login_login_failed">Login failed</string> + <!-- UnitsActivity --> <string name="toggle_list">Switch to device list</string> <string name="toggle_map">Switch to map</string> @@ -82,7 +86,7 @@ <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> + <string name="units_search">Search</string> <!-- Unit Information --> <string name="unit_info_contact">Contact</string> |