Author: Adam Evyčędo <git@apiote.xyz>
design basic journey screen
%!v(PANIC=String method: strings: negative Repeat count)
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 407d80f9dca8393a8cb5dcc5cbc4bb5c7cb05124..a4cc503e470ba2a4a93f737d6c2b1273a9579d94 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,4 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- +SPDX-FileCopyrightText: Adam Evyčędo + +SPDX-License-Identifier: GPL-3.0-or-later +--> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tool="http://schemas.android.com/tools"> diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt index 2ab2919eb3cea85c2c7d2ea6f36b1af166550b71..ad4d49d02249fe8df2290fa316556d0aaaf7d9a2 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/MainActivity.kt @@ -279,7 +279,7 @@ startActivity(ResultsActivity.getIntent(this, mode, query)) } private fun setNavbarIcons(f: Fragment) { - binding.bottomNavigation.menu[2].setIcon(R.drawable.voyage_outline) + binding.bottomNavigation.menu[2].setIcon(R.drawable.journey_outline) binding.bottomNavigation.menu[1].setIcon(R.drawable.home_outline) binding.bottomNavigation.menu[0].setIcon(R.drawable.map_outline) when (f) { @@ -288,7 +288,7 @@ binding.bottomNavigation.menu[1].setIcon(R.drawable.home_black) } is JourneyFragment -> { - binding.bottomNavigation.menu[2].setIcon(R.drawable.voyage_black) + binding.bottomNavigation.menu[2].setIcon(R.drawable.journey_black) } is MapFragment -> { @@ -305,4 +305,4 @@ companion object { const val NOTIFICATION_PERMISSION_ASKED = "notificationPermissionAsked" const val NO_GEOCODING_DATA_SHOWN = "no_geocoding_data_shown" } -} \ No newline at end of file +} diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyFragment.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyFragment.kt index 899dcf61b0afec2a3bca1178f13e1c1f669d46dd..af3d1b59cff4373b33955ed25b1556f568a42a11 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyFragment.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyFragment.kt @@ -8,14 +8,13 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import android.widget.TextView import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider -import xyz.apiote.bimba.czwek.databinding.FragmentVoyageBinding +import xyz.apiote.bimba.czwek.databinding.FragmentJourneyBinding class JourneyFragment : Fragment() { - private var _binding: FragmentVoyageBinding? = null + private var _binding: FragmentJourneyBinding? = null // This property is only valid between onCreateView and // onDestroyView. @@ -29,13 +28,8 @@ ): View { val journeyViewModel = ViewModelProvider(this)[JourneyViewModel::class.java] - _binding = FragmentVoyageBinding.inflate(inflater, container, false) + _binding = FragmentJourneyBinding.inflate(inflater, container, false) val root: View = binding.root - - val textView: TextView = binding.textDashboard - journeyViewModel.text.observe(viewLifecycleOwner) { - textView.text = it - } journeyViewModel.getJourney(requireContext()) diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyViewModel.kt b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyViewModel.kt index 6daa824df19ef722f345bd453f8abbdb4bf4c23d..34c5c75a8496d97d672af81e4d7a6128f964c080 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyViewModel.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/dashboard/ui/journey/JourneyViewModel.kt @@ -39,4 +39,4 @@ } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/xyz/apiote/bimba/czwek/journeys/JourneysViewModel.kt b/app/src/main/java/xyz/apiote/bimba/czwek/journeys/JourneysViewModel.kt index d3104ca25c162ca11733440de58fed609f1ab301..bda6a077e6ae6089630285ae8ebd9d4bec1776f5 100644 --- a/app/src/main/java/xyz/apiote/bimba/czwek/journeys/JourneysViewModel.kt +++ b/app/src/main/java/xyz/apiote/bimba/czwek/journeys/JourneysViewModel.kt @@ -1,7 +1,6 @@ // SPDX-FileCopyrightText: Adam Evyčędo // // SPDX-License-Identifier: GPL-3.0-or-later - package xyz.apiote.bimba.czwek.journeys import androidx.lifecycle.LiveData diff --git a/app/src/main/res/drawable/destination.xml b/app/src/main/res/drawable/destination.xml new file mode 100644 index 0000000000000000000000000000000000000000..d147ea48273e230b4ce11b0ccf2612db0bfa3c34 --- /dev/null +++ b/app/src/main/res/drawable/destination.xml @@ -0,0 +1,16 @@ +<!-- +SPDX-FileCopyrightText: Adam Evyčędo + +SPDX-License-Identifier: GPL-3.0-or-later +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:tint="?attr/colorOnSurface" + android:viewportWidth="6.35" + android:viewportHeight="6.35"> + <path + android:fillColor="#000000" + android:pathData="m5.2917,3.1771 l-2.6797,-0.7959 0.5249,0.5884h-0.1185,-1.96v0.4233h1.9558,0.1228l-0.5334,0.5757z" + android:strokeWidth="2"/> +</vector> diff --git a/app/src/main/res/drawable/dropdown.xml b/app/src/main/res/drawable/dropdown.xml new file mode 100644 index 0000000000000000000000000000000000000000..4b0189872b09fbdaa0ce451485e8f41226e6ed15 --- /dev/null +++ b/app/src/main/res/drawable/dropdown.xml @@ -0,0 +1,17 @@ +<!-- +SPDX-FileCopyrightText: Google + +SPDX-License-Identifier: Apache-2.0 +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:tint="?attr/colorOnSurface" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="@android:color/white" + android:pathData="M7,10l5,5 5,-5z" /> + +</vector> diff --git a/app/src/main/res/drawable/journey_black.xml b/app/src/main/res/drawable/journey_black.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba01d2f83ee2e3bb7459a38620d6e475c8f74ffb --- /dev/null +++ b/app/src/main/res/drawable/journey_black.xml @@ -0,0 +1,16 @@ +<!-- +SPDX-FileCopyrightText: Google + +SPDX-License-Identifier: Apache-2.0 +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:tint="#000000" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/white" + android:pathData="M21.71,11.29l-9,-9c-0.39,-0.39 -1.02,-0.39 -1.41,0l-9,9c-0.39,0.39 -0.39,1.02 0,1.41l9,9c0.39,0.39 1.02,0.39 1.41,0l9,-9c0.39,-0.38 0.39,-1.01 0,-1.41zM14,14.5V12h-4v3H8v-4c0,-0.55 0.45,-1 1,-1h5V7.5l3.5,3.5 -3.5,3.5z" /> +</vector> diff --git a/app/src/main/res/drawable/journey_outline.xml b/app/src/main/res/drawable/journey_outline.xml new file mode 100644 index 0000000000000000000000000000000000000000..e07a1469076965c87a79a332cb9404c050745e62 --- /dev/null +++ b/app/src/main/res/drawable/journey_outline.xml @@ -0,0 +1,16 @@ +<!-- +SPDX-FileCopyrightText: Google + +SPDX-License-Identifier: Apache-2.0 +--> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:tint="#000000" + android:viewportWidth="24" + android:viewportHeight="24"> + <path + android:fillColor="@android:color/white" + android:pathData="M22.43,10.59l-9.01,-9.01c-0.75,-0.75 -2.07,-0.76 -2.83,0l-9,9c-0.78,0.78 -0.78,2.04 0,2.82l9,9c0.39,0.39 0.9,0.58 1.41,0.58 0.51,0 1.02,-0.19 1.41,-0.58l8.99,-8.99c0.79,-0.76 0.8,-2.02 0.03,-2.82zM12.01,20.99l-9,-9 9,-9 9,9 -9,9zM8,11v4h2v-3h4v2.5l3.5,-3.5L14,7.5L14,10L9,10c-0.55,0 -1,0.45 -1,1z" /> +</vector> diff --git a/app/src/main/res/drawable/origin.xml b/app/src/main/res/drawable/origin.xml new file mode 100644 index 0000000000000000000000000000000000000000..5464d1c625af5f9c8ddf3746af5feaa232c1efb3 --- /dev/null +++ b/app/src/main/res/drawable/origin.xml @@ -0,0 +1,16 @@ +<!-- +SPDX-FileCopyrightText: Adam Evyčędo + +SPDX-License-Identifier: GPL-3.0-or-later +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:tint="?attr/colorOnSurface" + android:viewportWidth="6.35" + android:viewportHeight="6.35"> + <path + android:pathData="m5.2874,3.3867v-0.4233h-1.3504l-0.5376,-0.5757h-0.5884l0.5376,0.5757h-0.2836l-0.5376,-0.5757h-0.5927l0.5419,0.5757h-0.2879l-0.5334,-0.5757h-0.5927l0.5419,0.5757h-0.2879,-0.254v0.4233h0.254,0.2879l-0.5419,0.5757h0.5927l0.5334,-0.5757h0.2879l-0.5419,0.5757h0.5927l0.5376,-0.5757h0.2836l-0.5376,0.5757h0.5884l0.5376,-0.5757z" + android:strokeWidth="2" + android:fillColor="#000000"/> +</vector> diff --git a/app/src/main/res/drawable/stop_alt.xml b/app/src/main/res/drawable/stop_alt.xml new file mode 100644 index 0000000000000000000000000000000000000000..b24023be0ee2e689d4e96e834dad9514c0a06786 --- /dev/null +++ b/app/src/main/res/drawable/stop_alt.xml @@ -0,0 +1,16 @@ +<!-- +SPDX-FileCopyrightText: Adam Evyčędo + +SPDX-License-Identifier: GPL-3.0-or-later +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:tint="?attr/colorOnSurface" + android:viewportWidth="6.35" + android:viewportHeight="6.35"> + <path + android:fillColor="#000000" + android:pathData="m5.2938,3.4036v-0.4233h-0.5927c-0.0339,-0.1778 -0.0931,-0.3429 -0.1863,-0.5038 -0.0931,-0.1609 -0.2032,-0.3006 -0.3387,-0.4191 -0.1355,-0.1185 -0.2921,-0.2117 -0.4614,-0.2794 -0.1693,-0.0677 -0.3514,-0.1058 -0.5376,-0.1058 -0.2032,0 -0.3895,0.0381 -0.5673,0.1058 -0.1778,0.0677 -0.3344,0.1609 -0.4741,0.2794 -0.1355,0.1185 -0.2498,0.2582 -0.3429,0.4191 -0.0931,0.1609 -0.1524,0.326 -0.1863,0.5038h-0.5503v0.4233h0.5503c0.0339,0.1947 0.0931,0.3683 0.1863,0.5249 0.0931,0.1566 0.2074,0.2921 0.3429,0.4022 0.1397,0.1101 0.2963,0.199 0.4741,0.2582 0.1778,0.0593 0.3641,0.0889 0.5673,0.0889 0.1863,0 0.3683,-0.0296 0.5376,-0.0889 0.1693,-0.0593 0.326,-0.1482 0.4614,-0.2582 0.1355,-0.1101 0.2455,-0.2455 0.3387,-0.4022 0.0931,-0.1566 0.1524,-0.3302 0.1863,-0.5249zM4.2778,3.1962c0,0.1524 -0.0296,0.2921 -0.0889,0.4233 -0.0593,0.1355 -0.1397,0.2498 -0.2413,0.3514 -0.1016,0.1016 -0.2159,0.1778 -0.3514,0.2371 -0.1355,0.0593 -0.2752,0.0889 -0.4233,0.0889 -0.1355,0 -0.2667,-0.0212 -0.3937,-0.0677 -0.1228,-0.0423 -0.2328,-0.1058 -0.3344,-0.1863 -0.1016,-0.0762 -0.1863,-0.1736 -0.2582,-0.2836 -0.072,-0.1101 -0.1228,-0.2286 -0.1566,-0.3556h1.1472v-0.4233h-1.1472c0.0339,-0.127 0.0847,-0.2413 0.1566,-0.3514 0.072,-0.1058 0.1566,-0.199 0.2582,-0.2794 0.1016,-0.0762 0.2117,-0.1397 0.3344,-0.1863 0.127,-0.0423 0.2582,-0.0677 0.3937,-0.0677 0.1482,0 0.2879,0.0296 0.4233,0.0889 0.1355,0.0593 0.2498,0.1397 0.3514,0.2413 0.1016,0.1016 0.182,0.2159 0.2413,0.3514 0.0593,0.1355 0.0889,0.2752 0.0889,0.4191z" + android:strokeWidth="2"/> +</vector> diff --git a/app/src/main/res/drawable/voyage_black.xml b/app/src/main/res/drawable/voyage_black.xml deleted file mode 100644 index ba01d2f83ee2e3bb7459a38620d6e475c8f74ffb..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/voyage_black.xml +++ /dev/null @@ -1,16 +0,0 @@ -<!-- -SPDX-FileCopyrightText: Google - -SPDX-License-Identifier: Apache-2.0 ---> - -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:tint="#000000" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="@android:color/white" - android:pathData="M21.71,11.29l-9,-9c-0.39,-0.39 -1.02,-0.39 -1.41,0l-9,9c-0.39,0.39 -0.39,1.02 0,1.41l9,9c0.39,0.39 1.02,0.39 1.41,0l9,-9c0.39,-0.38 0.39,-1.01 0,-1.41zM14,14.5V12h-4v3H8v-4c0,-0.55 0.45,-1 1,-1h5V7.5l3.5,3.5 -3.5,3.5z" /> -</vector> diff --git a/app/src/main/res/drawable/voyage_outline.xml b/app/src/main/res/drawable/voyage_outline.xml deleted file mode 100644 index e07a1469076965c87a79a332cb9404c050745e62..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/voyage_outline.xml +++ /dev/null @@ -1,16 +0,0 @@ -<!-- -SPDX-FileCopyrightText: Google - -SPDX-License-Identifier: Apache-2.0 ---> - -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:tint="#000000" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="@android:color/white" - android:pathData="M22.43,10.59l-9.01,-9.01c-0.75,-0.75 -2.07,-0.76 -2.83,0l-9,9c-0.78,0.78 -0.78,2.04 0,2.82l9,9c0.39,0.39 0.9,0.58 1.41,0.58 0.51,0 1.02,-0.19 1.41,-0.58l8.99,-8.99c0.79,-0.76 0.8,-2.02 0.03,-2.82zM12.01,20.99l-9,-9 9,-9 9,9 -9,9zM8,11v4h2v-3h4v2.5l3.5,-3.5L14,7.5L14,10L9,10c-0.55,0 -1,0.45 -1,1z" /> -</vector> diff --git a/app/src/main/res/layout/activity_journeys.xml b/app/src/main/res/layout/activity_journeys.xml index 1cb7429da693de3981b65125d5a86f94bf6a50ab..f1d8a143cb724bf7167bc25eb3a5bb95393c501c 100644 --- a/app/src/main/res/layout/activity_journeys.xml +++ b/app/src/main/res/layout/activity_journeys.xml @@ -6,7 +6,6 @@ --> <androidx.coordinatorlayout.widget.CoordinatorLayout 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" - xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".journeys.JourneysActivity"> diff --git a/app/src/main/res/layout/fragment_journey.xml b/app/src/main/res/layout/fragment_journey.xml new file mode 100644 index 0000000000000000000000000000000000000000..74e1360a0b536a83402693f56156f6823dbbd843 --- /dev/null +++ b/app/src/main/res/layout/fragment_journey.xml @@ -0,0 +1,352 @@ +<?xml version="1.0" encoding="utf-8"?> + +<!-- +SPDX-FileCopyrightText: Adam Evyčędo + +SPDX-License-Identifier: GPL-3.0-or-later +--> + +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tool="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tool:context="xyz.apiote.bimba.czwek.dashboard.ui.journey.JourneyFragment"> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/origin_input" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:layout_marginTop="16dp" + android:layout_marginRight="16dp" + android:hint="@string/origin_input_hint" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:startIconDrawable="@drawable/origin"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionSearch" /> + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.chip.ChipGroup + android:id="@+id/origin_chips" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="@+id/origin_input" + app:layout_constraintStart_toStartOf="@+id/origin_input" + app:layout_constraintTop_toBottomOf="@+id/origin_input" + tool:layout_height="48dp" /> + + <!-- via + required: false + List of via stops to visit (only stop IDs, no coordinates allowed for now). + maxItems: 2 + + viaMinimumStay + required: false + Optional. If not set, the default is `0,0` - no stay required. + For each `via` stop a minimum stay duration in minutes. + + The value `0` signals that it's allowed to stay in the same trip. + This enables via stays without counting a transfer and can lead + to better connections with less transfers. Transfer connections can + still be found with `viaMinimumStay=0`. + default: [ 0, 0 ] + type: array + maxItems: 2 + --> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/destination_input" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:layout_marginTop="16dp" + android:layout_marginRight="16dp" + android:hint="@string/destination_input_hint" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/origin_chips" + app:startIconDrawable="@drawable/destination"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionSearch" /> + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.chip.ChipGroup + android:id="@+id/destination_chips" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="@+id/destination_input" + app:layout_constraintStart_toStartOf="@+id/destination_input" + app:layout_constraintTop_toBottomOf="@+id/destination_input" + tool:layout_height="48dp" /> + + <com.google.android.material.divider.MaterialDivider + android:id="@+id/materialDivider" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + app:dividerInsetEnd="16dp" + app:dividerInsetStart="16dp" + app:layout_constraintTop_toBottomOf="@id/destination_chips" /> + + <com.google.android.material.chip.ChipGroup + android:id="@+id/chips_params_time" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/materialDivider"> + + <!-- on click menu: https://stackoverflow.com/a/67764469 --> + <com.google.android.material.chip.Chip + android:id="@+id/chip_time_reference" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/depart_after" + app:checkedIconEnabled="false" + app:closeIcon="@drawable/dropdown" + tool:ignore="MissingConstraints" + app:closeIconEnabled="true" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_date" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/today" + app:checkedIconEnabled="false" + app:closeIcon="@drawable/dropdown" + app:closeIconEnabled="true" + tool:ignore="MissingConstraints" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_time" + style="@style/Widget.Material3.Chip.Filter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/now" + app:checkedIconEnabled="false" + app:closeIcon="@drawable/dropdown" + tool:ignore="MissingConstraints" + app:closeIconEnabled="true" /> + + </com.google.android.material.chip.ChipGroup> + + <com.google.android.material.chip.ChipGroup + android:id="@+id/chips_params_accessible" + android:layout_width="match_parent" + android:layout_marginTop="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/chips_params_time" + android:layout_height="wrap_content"> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_wheelchair" + style="@style/Widget.Material3.Chip.Filter" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + app:chipIcon="@drawable/wheelchair" + app:chipIconEnabled="true" + android:text="@string/wheelchair_accessible" + tool:ignore="MissingConstraints" /> + + <com.google.android.material.chip.Chip + android:id="@+id/chip_bike" + style="@style/Widget.Material3.Chip.Filter" + android:layout_height="wrap_content" + android:layout_width="wrap_content" + app:chipIcon="@drawable/bike" + app:chipIconEnabled="true" + android:text="@string/bike_transport" + tool:ignore="MissingConstraints" /> + + </com.google.android.material.chip.ChipGroup> + + <Button + android:id="@+id/elevatedButton" + style="@style/Widget.Material3.Button.Icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + app:icon="@drawable/journey_outline" + android:text="@string/go" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <!-- + - name: maxTransfers + required: false + The maximum number of allowed transfers. + If not provided, the routing uses the server-side default value + which is hardcoded and very high to cover all use cases. + schema: + type: integer + + - name: maxHours + required: false + The maximum travel time in hours. + If not provided, the routing to uses the value + hardcoded in the server which is usually quite high. + schema: + type: number + + - name: minTransferTime + required: false + Minimum transfer time for each transfer in minutes. + schema: + type: integer + default: 0 + + - name: additionalTransferTime + required: false + Additional transfer time reserved for each transfer in minutes. + schema: + type: integer + default: 0 + + - name: transferTimeFactor + required: false + Factor to multiply minimum required transfer times with. + Values smaller than 1.0 are not supported. + schema: + type: number + default: 1.0 + + - name: maxMatchingDistance + required: true + Maximum matching distance in meters to match geo coordinates to the street network. + schema: + type: number + default: 25 + + - name: transitModes + required: false + Optional. Default is `TRANSIT` which allows all transit modes (no restriction). + Allowed modes for the transit part. If empty, no transit connections will be computed. + For example, this can be used to allow only `METRO,SUBWAY,TRAM`. + schema: + default: + - TRANSIT + type: array + + - name: directModes + required: false + Optional. Default is `WALK` which will compute walking routes as direct connections. + Modes used for direction connections from start to destination without using transit. + Results will be returned on the `direct` key. + Note: Direct connections will only be returned on the first call. For paging calls, they can be omitted. + Note: Transit connections that are slower than the fastest direct connection will not show up. + This is being used as a cut-off during transit routing to speed up the search. + To prevent this, it's possible to send two separate requests (one with only `transitModes` and one with only `directModes`). + Only non-transit modes such as `WALK`, `BIKE`, `CAR`, `BIKE_SHARING`, etc. can be used. + schema: + default: + - WALK + type: array + + - name: preTransitModes + required: false + Optional. Default is `WALK`. Only applies if the `from` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directModes`). + A list of modes that are allowed to be used from the `from` coordinate to the first transit stop. Example: `WALK,BIKE_SHARING`. + schema: + default: + - WALK + type: array + + - name: postTransitModes + required: false + Optional. Default is `WALK`. Only applies if the `to` place is a coordinate (not a transit stop). Does not apply to direct connections (see `directModes`). + A list of modes that are allowed to be used from the last transit stop to the `to` coordinate. Example: `WALK,BIKE_SHARING`. + schema: + default: + - WALK + type: array + + - name: numItineraries + required: false + The minimum number of itineraries to compute. + This is only relevant if `timetableView=true`. + schema: + type: integer + default: 5 + + - name: pageCursor + required: false + Use the cursor to go to the next "page" of itineraries. + Copy the cursor from the last response and keep the original request as is. + This will enable you to search for itineraries in the next or previous time-window. + + - name: timetableView + required: false + Search for the best trip options within a time window. + If true two itineraries are considered optimal + if one is better on arrival time (earliest wins) + and the other is better on departure time (latest wins). + In combination with arriveBy this parameter cover the following use cases: + `timetable=false` = waiting for the first transit departure/arrival is considered travel time: + - `arriveBy=true`: event (e.g. a meeting) starts at 10:00 am, + compute the best journeys that arrive by that time (maximizes departure time) + - `arriveBy=false`: event (e.g. a meeting) ends at 11:00 am, + compute the best journeys that depart after that time + `timetable=true` = optimize "later departure" + "earlier arrival" and give all options over a time window: + - `arriveBy=true`: the time window around `date` and `time` refers to the arrival time window + - `arriveBy=false`: the time window around `date` and `time` refers to the departure time window + schema: + type: boolean + default: true + + - name: searchWindow + required: false + Optional. Default is 2 hours which is `7200`. + The length of the search-window in seconds. Default value two hours. + - `arriveBy=true`: number of seconds between the earliest departure time and latest departure time + - `arriveBy=false`: number of seconds between the earliest arrival time and the latest arrival time + schema: + type: integer + default: 7200 + minium: 0 + + - name: maxPreTransitTime + required: false + Maximum time in seconds for the first street leg. + schema: + type: integer + default: 900 + minimum: 0 + + - name: maxPostTransitTime + required: false + Maximum time in seconds for the last street leg. + schema: + type: integer + default: 900 + minimum: 0 + + - name: maxDirectTime + required: false + Maximum time in seconds for direct connections. + schema: + type: integer + default: 1800 + minimum: 0 + --> + +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_voyage.xml b/app/src/main/res/layout/fragment_voyage.xml deleted file mode 100644 index 1795bb39213178519ebf3fd623efc5197b05db82..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/fragment_voyage.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- -SPDX-FileCopyrightText: Adam Evyčędo - -SPDX-License-Identifier: GPL-3.0-or-later ---> - -<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tool="http://schemas.android.com/tools" - android:layout_width="match_parent" - android:layout_height="match_parent" - tool:context="xyz.apiote.bimba.czwek.dashboard.ui.journey.JourneyFragment"> - - <com.google.android.material.textview.MaterialTextView - android:id="@+id/text_dashboard" - 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" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> -</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file diff --git a/app/src/main/res/layout/journey.xml b/app/src/main/res/layout/journey.xml index 9fb18f784ee1669ae34739802823cba34e1ca415..d04636e4844916d6078c6106ef1a7e4c0f8b707a 100644 --- a/app/src/main/res/layout/journey.xml +++ b/app/src/main/res/layout/journey.xml @@ -8,7 +8,7 @@xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" - xmlns:tool="http://schemas.android.com/tools"> + xmlns:tools="http://schemas.android.com/tools"> <androidx.constraintlayout.widget.ConstraintLayout android:padding="16dp" android:layout_width="match_parent" @@ -21,7 +21,7 @@ android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - tool:text="11:25" /> + tools:text="11:25" /> <com.google.android.material.textview.MaterialTextView android:id="@+id/lines" @@ -34,7 +34,7 @@ android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" app:layout_constraintEnd_toStartOf="@+id/end_time" app:layout_constraintStart_toEndOf="@+id/start_time" app:layout_constraintTop_toTopOf="@+id/start_time" - tool:text="Metropolitan, Circle, Hammersmith&City" /> + tools:text="Metropolitan, Circle, Hammersmith&City" /> <com.google.android.material.textview.MaterialTextView android:id="@+id/end_time" @@ -43,7 +43,7 @@ android:layout_height="wrap_content" android:textAppearance="@style/TextAppearance.Material3.HeadlineSmall" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="@+id/lines" - tool:text="12:30" /> + tools:text="12:30" /> <LinearLayout android:id="@+id/legs" diff --git a/app/src/main/res/layout/journey_leg.xml b/app/src/main/res/layout/journey_leg.xml index 89ffadb2313f07ab20c16ada3af965c236ffdeee..4d09620b97d748d141e5df41708710620432c8fc 100644 --- a/app/src/main/res/layout/journey_leg.xml +++ b/app/src/main/res/layout/journey_leg.xml @@ -1,4 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- +SPDX-FileCopyrightText: Adam Evyčędo + +SPDX-License-Identifier: GPL-3.0-or-later +--> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -9,7 +14,7 @@ android:id="@+id/leg_origin_image" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/arrow" + android:src="@drawable/origin" android:contentDescription="beginning of journey's leg" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -73,7 +78,7 @@ android:id="@+id/leg_destination_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="8dp" - android:src="@drawable/arrow" + android:src="@drawable/destination" android:contentDescription="end of journey's leg" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/leg_mode_image" /> diff --git a/app/src/main/res/menu/bottom_nav_menu.xml b/app/src/main/res/menu/bottom_nav_menu.xml index 19ae61227a47d944e0f93cf24a0f06f7e2014d01..e9baee47d1ea7c40f76098f8346b95de30bc64c7 100644 --- a/app/src/main/res/menu/bottom_nav_menu.xml +++ b/app/src/main/res/menu/bottom_nav_menu.xml @@ -16,7 +16,7 @@ android:id="@+id/navigation_home" android:icon="@drawable/home_outline" android:title="@string/title_home" /> <item - android:id="@+id/navigation_voyage" - android:icon="@drawable/voyage_outline" - android:title="Journey" /> -</menu> \ No newline at end of file + android:id="@+id/navigation_journey" + android:icon="@drawable/journey_outline" + android:title="@string/title_journey" /> +</menu> diff --git a/app/src/main/res/navigation/front_navigation.xml b/app/src/main/res/navigation/front_navigation.xml index bf3bb598a0cfb6ad56cf4f2bf21faa7b892ca44b..95683393d7bae1885eeaebed7025477c2b0eebdc 100644 --- a/app/src/main/res/navigation/front_navigation.xml +++ b/app/src/main/res/navigation/front_navigation.xml @@ -25,8 +25,8 @@ android:label="@string/title_map" tool:layout="@layout/fragment_map" /> <fragment - android:id="@+id/navigation_voyage" + android:id="@+id/navigation_journey" android:name="xyz.apiote.bimba.czwek.dashboard.ui.journey.JourneyFragment" android:label="@string/title_journey" - tool:layout="@layout/fragment_voyage" /> -</navigation> \ No newline at end of file + tool:layout="@layout/fragment_journey" /> +</navigation> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 313313506c8e7518f9acce01caa8c71959f02a23..4862655599185439634aa2e2a553ef48e471d2c4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -293,4 +293,13 @@ arrival <string name="departure_approximate">approx. dep.</string> <string name="departure">departure</string> <string name="approximately">approximately</string> + <string name="origin_input_hint">Origin</string> + <string name="destination_input_hint">Destination</string> + <string name="depart_after">Depart after</string> + <string name="arrive_by">Arrive by</string> + <string name="today">Today</string> + <string name="now">Now</string> + <string name="wheelchair_accessible">Wheelchair accessible</string> + <string name="bike_transport">Bike transport</string> + <string name="go">Go</string> </resources> diff --git a/app/src/main/res/values-en-rGB/strings.xml b/app/src/main/res/values-en-rGB/strings.xml index febf014d61a368f90e36f1774a2b1fbcf8f3baff..722359f1e44be468bf3f3c1b85e5c959de1db869 100644 --- a/app/src/main/res/values-en-rGB/strings.xml +++ b/app/src/main/res/values-en-rGB/strings.xml @@ -291,4 +291,5 @@arrival <string name="departure_approximate">approx. dep.</string> <string name="departure">departure</string> <string name="approximately">approximately</string> + <string name="depart_after">Depart after</string> </resources> diff --git a/app/src/main/res/values-en-rUS/strings.xml b/app/src/main/res/values-en-rUS/strings.xml index 53b5db71611451c372af76e76bda67502c14d749..8c8cbd4b80127310143ac5cf40cb52c6839db3cd 100644 --- a/app/src/main/res/values-en-rUS/strings.xml +++ b/app/src/main/res/values-en-rUS/strings.xml @@ -289,4 +289,5 @@arrival <string name="departure_approximate">approx. dep.</string> <string name="departure">departure</string> <string name="approximately">approximately</string> + <string name="depart_after">Depart after</string> </resources> \ No newline at end of file