Compare commits

..

47 Commits

Author SHA1 Message Date
x7z4w
2f9ce76c28 Update .git-blame-ignore-revs
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-14 20:23:46 +00:00
x7z4w
ffe07d3337 [core] Implicit m2::Point hash
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-14 20:19:02 +00:00
x7z4w
546383d755 [generator] Implement hash for OsmElement::Tag
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-14 20:19:02 +00:00
x7z4w
bf30165b5f [core] Replace SmallMap
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-14 20:19:02 +00:00
x7z4w
0288b97b13 [core] Switch to ankerl::unordered_dense
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-14 20:18:55 +00:00
x7z4w
7e561d09d3 [drape] nits
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-14 20:13:26 +00:00
map-per
298518ae72 [Android] Fix crash when selectedCountry is null
Signed-off-by: map-per <map-per@gmx.de>
2025-12-13 22:58:25 +01:00
Jean-Baptiste
3bad6d25f0 [android] Remove usage of attr fonts styles
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-13 19:28:28 +01:00
Jean-Baptiste
d36361d669 [android] Fix aligment of items in AppBar
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-13 17:08:35 +01:00
Jean-Baptiste
688e20b1a6 [android] Revert M3 changes about main fonts styles
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-13 10:39:47 +01:00
Jean-Baptiste
85462161b2 [android] Fix theme not apply correctly
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-12 21:11:04 +01:00
Henry Sternberg
b929823f6b [routing] Avoid using parking aisles
Signed-off-by: Henry Sternberg <henry@bluelightmaps.com>
Co-authored-by: Henry Sternberg <henry@bluelightmaps.com>
Co-committed-by: Henry Sternberg <henry@bluelightmaps.com>
2025-12-12 15:37:21 +01:00
Jean-Baptiste
22dd799585 [android] Remove hardcoded MaterialComponents fonts styles
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-11 20:33:24 +01:00
Jean-Baptiste
6864d101e2 [android] Migrate text appearance to Material 3
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-11 19:36:54 +01:00
Jean-Baptiste
4bfb62b373 [android] Fix height of all day view
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-11 16:22:22 +01:00
map-per
f1cf844986 [editor] Check OSM max char length in value validation
Signed-off-by: map-per <map-per@gmx.de>
2025-12-11 09:09:47 +01:00
map-per
f20c3bf50c [Android] Add info about outdated maps and update button to place page
Signed-off-by: map-per <map-per@gmx.de>
2025-12-11 08:11:44 +01:00
map-per
e7cc602904 [editor] Remove unused code from the old OSM editor
Signed-off-by: map-per <map-per@gmx.de>
2025-12-11 08:03:31 +01:00
Konstantin Pastbin
d473361e54 December R1 release notes
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-11 13:02:04 +07:00
Codeberg Translate
76d58e4a05 [strings] Update from Codeberg Translate
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Priit Jõerüüt <jrtcdbrg@noreply.codeberg.org>
Co-authored-by: Stephan-P <stephan-p@noreply.codeberg.org>
Co-authored-by: aoxa <aoxa@noreply.codeberg.org>
Co-authored-by: cirilla <cirilla@noreply.codeberg.org>
Co-authored-by: javnik <javnik@noreply.codeberg.org>
Co-authored-by: mnalis <mnalis@noreply.codeberg.org>
Co-authored-by: ovl-005 <ovl-005@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/comaps/android-typestrings/
Translate-URL: https://translate.codeberg.org/projects/comaps/android/
Translate-URL: https://translate.codeberg.org/projects/comaps/ios-typestrings/
Translation: CoMaps/Android - Map Feature Types
Translation: CoMaps/Android UI Strings
Translation: CoMaps/Countries and regions names
Translation: CoMaps/iOS - Map Feature Types
Translation: CoMaps/iOS UI Strings
2025-12-10 19:52:29 +00:00
Jean-Baptiste
7b5878b010 [editor] Remove ability to add attraction and remove name field for charging station
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
Co-authored-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
Co-committed-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-10 20:52:16 +01:00
matheusgomesms
3fabbae3f7 [core] Added landuse in address checker
Signed-off-by: matheusgomesms <matheusgomesms@noreply.codeberg.org>
2025-12-10 20:39:46 +01:00
Konstantin Pastbin
0add23fcf2 [planet] Update map data to 251209
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-10 22:55:03 +07:00
matheusgomesms
08bcb574fa [tts] Fix roundabout in French
Signed-off-by: matheusgomesms <matheusgomesms@noreply.codeberg.org>
2025-12-10 09:25:32 +01:00
gekeleda
db888f33c5 [android] fix crash when no TTS engine
Signed-off-by: gekeleda <git@davidgekeler.eu>
2025-12-10 08:07:11 +00:00
Codeberg Translate
4a96d219f0 [strings] Update from Codeberg Translate
Co-authored-by: Anonymous <anonymous@noreply.codeberg.org>
Co-authored-by: Codeberg Translate <translate@codeberg.org>
Co-authored-by: ERYpTION <eryption@noreply.codeberg.org>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Houtari <houtari@noreply.codeberg.org>
Co-authored-by: JanezPavelZebovec <janezpavelzebovec@noreply.codeberg.org>
Co-authored-by: Mickael81 <mickael81@noreply.codeberg.org>
Co-authored-by: N4ta <codeberg@n4ta.anonaddy.me>
Co-authored-by: Outbreak2096 <outbreak2096@noreply.codeberg.org>
Co-authored-by: Prefill add-on <noreply-addon-prefill@weblate.org>
Co-authored-by: Priit Jõerüüt <jrtcdbrg@noreply.codeberg.org>
Co-authored-by: Stephan-P <stephan-p@noreply.codeberg.org>
Co-authored-by: Weblate <noreply-mt-weblate@weblate.org>
Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Co-authored-by: alexgabi <alexgabi@noreply.codeberg.org>
Co-authored-by: arnyminerz <arnyminerz@noreply.codeberg.org>
Co-authored-by: dobridabar <dobridabar@noreply.codeberg.org>
Co-authored-by: eBug <ebug@noreply.codeberg.org>
Co-authored-by: hectodium <hectodium@noreply.codeberg.org>
Co-authored-by: jros <jros@noreply.codeberg.org>
Co-authored-by: loscati <loscati@noreply.codeberg.org>
Co-authored-by: matheusgomesms <matheusgomesms@noreply.codeberg.org>
Co-authored-by: mcliquid <mcliquid@noreply.codeberg.org>
Co-authored-by: mnalis <mnalis@noreply.codeberg.org>
Co-authored-by: patepelo <patepelo@noreply.codeberg.org>
Co-authored-by: phama <phama@noreply.codeberg.org>
Co-authored-by: rimas <rimas@noreply.codeberg.org>
Co-authored-by: tace16 <tace16@noreply.codeberg.org>
Co-authored-by: tagomagic <tagomagic@noreply.codeberg.org>
Translate-URL: https://translate.codeberg.org/projects/comaps/ios/
Translation: CoMaps/Android - Map Feature Types
Translation: CoMaps/Android UI Strings
Translation: CoMaps/Apple AppStore description
Translation: CoMaps/Countries and regions names
Translation: CoMaps/F-Droid app description
Translation: CoMaps/Google Play and Huawei AppGallery descriptions
Translation: CoMaps/Search synonyms / aliases
Translation: CoMaps/iOS - Map Feature Types
Translation: CoMaps/iOS Plist
Translation: CoMaps/iOS UI Strings
2025-12-09 19:10:42 +00:00
Jean-Baptiste
c2bc6c27aa [android] Add warning about speed cameras in settings
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-08 18:13:11 +01:00
gekeleda
1095e5dbc3 [android] Consider all system langs for TTS
Signed-off-by: gekeleda <git@davidgekeler.eu>
2025-12-08 15:55:49 +01:00
Leonardo Bishop
a1cbcc5885 [drape] Base zoom level on distance to next turn
This commit changes the auto zoom level behaviour during navigation
to be based off the distance to the next turn, rather than naively
coupling it to the current speed. This will improve the navigation
experience during driving.

Signed-off-by: Leonardo Bishop <me@leonardobishop.net>
2025-12-08 08:31:33 +01:00
Jean-Baptiste
641f2308c6 [android] Remove hardocded height of name text field
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-07 18:01:17 +01:00
Konstantin Pastbin
f858ebcce0 [generator] Make Taiwan_North use 5 threads for Index stage
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-07 14:06:13 +07:00
matheusgomesms
eb376f5afc Added missing Portuguese articles
Signed-off-by: matheusgomesms <matheusgomesms@noreply.codeberg.org>
2025-12-06 20:54:14 +01:00
x7z4w
71b47719af [search] Remove stop words
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-06 19:43:11 +00:00
Konstantin Pastbin
4f7230fcbe [generator] Clone repos shallowly --depth 1
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-06 08:12:42 +01:00
Konstantin Pastbin
2dafdd4338 [generator] Fix boolean action options handling
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-06 08:12:42 +01:00
Konstantin Pastbin
0237751afe [generator] Fix GENARGS in docker_maps_generator.sh
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-06 08:12:42 +01:00
Jean-Baptiste
e7fb3a2f2c [android] Improve padding of instructions during navigation
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-05 22:30:03 +01:00
x7z4w
e08d60bb40 [styles] Fix toilets label
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-05 22:11:42 +01:00
Jean-Baptiste
de4252f86c [android] Remove transparent background on textview
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-05 21:51:27 +01:00
Jean-Baptiste
9d87d77055 [android] Improve size of bookmarks button
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-05 17:53:54 +01:00
Jean-Baptiste
c88f59eb75 [android] Migrate Pop up Menu to Material 3
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-04 19:32:52 +01:00
Jean-Baptiste
9b5c700ad8 [android] Migrate Circular Progress Indicator to Material 3
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-04 18:21:45 +01:00
Jean-Baptiste
7d5e6fabcd [android] Improve size of instructions in navigation
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-04 18:12:54 +01:00
x7z4w
ebe0364030 [styles] Colored toilets label
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2025-12-03 18:30:37 +01:00
Jean-Baptiste
43e7e1eb2e [android] Fix missing property
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-03 18:20:39 +01:00
Jean-Baptiste
ce9af79a68 [android] Migrate view on map button to M3
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-03 18:15:05 +01:00
thesupertechie
b54b77bce6 [docs][strings] Correct typos
Signed-off-by: thesupertechie <thesupertechie1@gmail.com>
Co-authored-by: thesupertechie <thesupertechie@noreply.codeberg.org>
Co-committed-by: thesupertechie <thesupertechie@noreply.codeberg.org>
2025-12-03 17:25:38 +01:00
469 changed files with 9993 additions and 5857 deletions

View File

@@ -105,17 +105,17 @@ jobs:
run: | run: |
echo "Cloning $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY branch $FORGEJO_REF_NAME" echo "Cloning $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY branch $FORGEJO_REF_NAME"
cd ~ cd ~
git clone --recurse-submodules --shallow-submodules -b $FORGEJO_REF_NAME --single-branch $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY.git comaps git clone --depth 1 --recurse-submodules --shallow-submodules -b $FORGEJO_REF_NAME --single-branch $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY.git comaps
- name: Checkout wikiparser repo - name: Checkout wikiparser repo
shell: bash shell: bash
run: | run: |
cd ~ cd ~
git clone https://codeberg.org/comaps/wikiparser.git git clone --depth 1 --single-branch https://codeberg.org/comaps/wikiparser.git
- name: Checkout subways repo - name: Checkout subways repo
shell: bash shell: bash
run: | run: |
cd ~ cd ~
git clone https://codeberg.org/comaps/subways.git git clone --depth 1 --single-branch https://codeberg.org/comaps/subways.git
copy-coasts: copy-coasts:
# if: inputs.run-copy-coasts # if: inputs.run-copy-coasts

View File

@@ -2,3 +2,5 @@
480fa6c2fcf53be296504ac6ba8e6b3d70f92b42 480fa6c2fcf53be296504ac6ba8e6b3d70f92b42
a6ede2b1466f0c9d8a443600ef337ba6b5832e58 a6ede2b1466f0c9d8a443600ef337ba6b5832e58
1377b81bf1cac72bb6da192da7fed6696d5d5281 1377b81bf1cac72bb6da192da7fed6696d5d5281
0288b97b1367bb971eded1018f560598ea274e6c
bf30165b5f5de0907c3c64524a3bf8121624b0b7

83
3party/ankerl/stl.h Normal file
View File

@@ -0,0 +1,83 @@
///////////////////////// ankerl::unordered_dense::{map, set} /////////////////////////
// A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion.
// Version 4.8.1
// https://github.com/martinus/unordered_dense
//
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// SPDX-License-Identifier: MIT
// Copyright (c) 2022 Martin Leitner-Ankerl <martin.ankerl@gmail.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#ifndef ANKERL_STL_H
#define ANKERL_STL_H
#include <array> // for array
#include <cstdint> // for uint64_t, uint32_t, std::uint8_t, UINT64_C
#include <cstring> // for size_t, memcpy, memset
#include <functional> // for equal_to, hash
#include <initializer_list> // for initializer_list
#include <iterator> // for pair, distance
#include <limits> // for numeric_limits
#include <memory> // for allocator, allocator_traits, shared_ptr
#include <optional> // for optional
#include <stdexcept> // for out_of_range
#include <string> // for basic_string
#include <string_view> // for basic_string_view, hash
#include <tuple> // for forward_as_tuple
#include <type_traits> // for enable_if_t, declval, conditional_t, ena...
#include <utility> // for forward, exchange, pair, as_const, piece...
#include <vector> // for vector
// <memory_resource> includes <mutex>, which fails to compile if
// targeting GCC >= 13 with the (rewritten) win32 thread model, and
// targeting Windows earlier than Vista (0x600). GCC predefines
// _REENTRANT when using the 'posix' model, and doesn't when using the
// 'win32' model.
#if defined __MINGW64__ && defined __GNUC__ && __GNUC__ >= 13 && !defined _REENTRANT
// _WIN32_WINNT is guaranteed to be defined here because of the
// <cstdint> inclusion above.
# ifndef _WIN32_WINNT
# error "_WIN32_WINNT not defined"
# endif
# if _WIN32_WINNT < 0x600
# define ANKERL_MEMORY_RESOURCE_IS_BAD() 1 // NOLINT(cppcoreguidelines-macro-usage)
# endif
#endif
#ifndef ANKERL_MEMORY_RESOURCE_IS_BAD
# define ANKERL_MEMORY_RESOURCE_IS_BAD() 0 // NOLINT(cppcoreguidelines-macro-usage)
#endif
#if defined(__has_include) && !defined(ANKERL_UNORDERED_DENSE_DISABLE_PMR)
# if __has_include(<memory_resource>) && !ANKERL_MEMORY_RESOURCE_IS_BAD()
# define ANKERL_UNORDERED_DENSE_PMR std::pmr // NOLINT(cppcoreguidelines-macro-usage)
# include <memory_resource> // for polymorphic_allocator
# elif __has_include(<experimental/memory_resource>)
# define ANKERL_UNORDERED_DENSE_PMR std::experimental::pmr // NOLINT(cppcoreguidelines-macro-usage)
# include <experimental/memory_resource> // for polymorphic_allocator
# endif
#endif
#if defined(_MSC_VER) && defined(_M_X64)
# include <intrin.h>
# pragma intrinsic(_umul128)
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,16 @@
This file contains a list of people who have contributed to this project. This file contains a list of people who have contributed to this project.
Its not neccesarily comprehensive. It is not necessarily comprehensive as contributors must manually add themselves.
Feel free to add yourself here along with your first contribution! Feel free to add yourself here along with your first contribution!
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
CoMaps contributors: CoMaps contributors:
(in alphabetic order) (in alphabetical order)
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
Bastian Greshake Tzovaras Bastian Greshake Tzovaras
clover sage clover sage
Harry Bond <me@hbond.xyz> Harry Bond <me@hbond.xyz>
thesupertechie
vikiawv vikiawv
Yannik Bloscheck Yannik Bloscheck

View File

@@ -0,0 +1,32 @@
Una aplicació de mapes gratuïta i de codi obert dirigida per la comunitat basada en dades d'OpenStreetMap i reforçada amb el compromís amb la transparència, la privadesa i la no ànim de lucre. CoMaps és una derivació/fork d'Organic Maps, que al seu torn és una derivació de Maps.ME.
Llegiu sobre els motius del projecte i la seva direcció a <b><i>codeberg.org/comaps</i></b>.
Uneix-te a la comunitat i ajuda a crear la millor aplicació de mapes
• Utilitza l'aplicació i difon-la
• Dona comentaris i informa de problemes
• Actualitza les dades del mapa a l'aplicació o al lloc web d'OpenStreetMap
‣ <b>Enfocat fora de línia</b>: Planifica i navega pel teu viatge a l'estranger sense necessitat de servei mòbil, cerca punts de referència mentre fas una excursió llunyana, etc. Totes les funcions de l'aplicació estan dissenyades per funcionar fora de línia.
‣ <b>Respecte a la privadesa</b>: L'aplicació està dissenyada tenint en compte la privadesa: no identifica persones, no fa seguiment i no recopila informació personal. Sense anuncis.
‣ <b>Senzill i polit</b>: funcions essencials fàcils d'utilitzar que simplement funcionen.
‣ <b>Estalvia bateria i espai</b>: No consumeix bateria com altres aplicacions de navegació. Els mapes compactes estalvien espai preciós al telèfon.
‣ <b>Gratuït i creat per la comunitat</b>: Gent com tu ha ajudat a crear l'aplicació afegint llocs a OpenStreetMap, provant i donant comentaris sobre les funcions i aportant les seves habilitats de desenvolupament i diners.
‣ <b>Presa de decisions i finances obertes i transparents, sense ànim de lucre i de codi obert.</b>
<b>Característiques principals</b>:
• Mapes detallats descarregables amb llocs que no estan disponibles amb Google Maps
• Mode exterior amb rutes de senderisme destacades, càmpings, fonts d'aigua, pics, corbes de nivell, etc.
• Senders per caminar i carrils bici
• Punts d'interès com restaurants, gasolineres, hotels, botigues, llocs d'interès i molts més
• Cerca per nom, adreça o categoria de punt d'interès
• Navegació amb anuncis de veu per caminar, anar amb bicicleta o conduir
• Marca els teus llocs preferits amb un sol toc
• Articles de la Viquipèdia fora de línia
• Capa i indicacions de trànsit de metro
• Enregistrament de rutes
• Exporta i importa marcadors i rutes en formats KML, KMZ i GPX
• Un mode fosc per utilitzar durant la nit
• Millora les dades del mapa per a tothom mitjançant un editor bàsic integrat
<b>La llibertat és aquí</b>
Descobreix el teu viatge, navega pel món amb la privadesa i la comunitat al capdavant!

View File

@@ -0,0 +1,10 @@
• OpenStreetMap-Daten vom 9. Dezember
• Material 3 Design
• Im OSM-Editor können nun Ladestationen hinzugefügt werden
• Schuko und Typ E Ladestationen hinzugefügt
• Verbesserte Suchvorschläge
• Litauische und lettische Sprachankündigungen
• Die Fahranweisungen wurden vergrößert
• Der Zoomlevel passt sich an die Distanz zur nächsten Abbiegung an
• Neue Anordnung der Einstellungen
Weitere Einzelheiten auf codeberg.org/comaps/comaps/releases

View File

@@ -1,13 +1,10 @@
Fixed voice directions pronouncing weird symbols in the beginning OpenStreetMap data as of December 9
OpenStreetMap data as of November 23 Use Material 3 themes
• Support charging sockets in OSM Editor
Changes in the previous release: • Added schuko/type-E charge sockets
Added trees Improved search results ranking
Made bus stop icons smaller and show up earlier Enabled Lithuanian and Latvian in voice announcements
Reduce visibility of entrances Improved size of driving indications
Added several other POI types Base zoom level on distance to next turn
Show sand areas on the map Reordered settings
• Add business is vacant option to the OSM editor More details on codeberg.org/comaps/comaps/releases
• Improved road shields in Europe
• Avoid paved roads routing option
• Added icons to the settings page

View File

@@ -0,0 +1,11 @@
• Datos de OpenStreetMap a fecha 9/12.
• Uso de temas Material 3.
• Compatibilidad con enchufes de recarga en Editor.
• Se añaden enchufes de recarga schuko/tipo E.
• Se mejora la búsqueda.
• Se habilitan el lituano y el letón en las indicaciones de voz.
• Se aumenta el tamaño de las indicaciones de conducción.
• Nivel de zoom base según la distancia al siguiente giro.
• Se han reordenado los ajustes.
Más detalles en codeberg.org/comaps/comaps/releases

View File

@@ -0,0 +1,10 @@
• Données OpenStreetMap du 9 Décembre
• Utilisation de Material 3
• Support de l'édition des bornes de recharge dans l'éditeur OSM
• Ajout du type de prise schuko/type-E
• Amélioration de l'ordre des résultats de recherche
• Ajout du lituanien et du letton dans le guidage vocal
• Amélioration de la taille des instructions dans la navigation
• Niveau de zoom basé sur la distance jusquau prochain virage
• Réorganisation des paramètres
Plus de détails sur codeberg.org/comaps/comaps/releases

View File

@@ -0,0 +1,10 @@
• Podaci OpenStreetMap karte od 9. prosinca
• Korištenje Material 3 tema
• Podrška za utičnice za punjenje u OSM Editoru
• Dodane šuko/tip-E utičnice
• Poboljšano rangiranje rezultata pretraživanja
• Omogućeni litvanski i latvijski jezici u glasovnim najavama
• Povećana veličina indikatora vožnje
• Razina zumiranja se mijenja ovisno o udaljenosti do sljedećeg skretanja
• Promijenjen redoslijed postavki
Više detalja na codeberg.org/comaps/comaps/releases

View File

@@ -0,0 +1 @@
Paprasta ir patogi navigacija Turiningos kelionės Vystoma bendruomenės

View File

@@ -0,0 +1 @@
CoMaps keliaukite atsijungę ir privačiai

View File

@@ -0,0 +1,10 @@
• Dane OpenStreetMap z 9 grudnia
• Użycie motywów Material 3
• Obsługa gniazd ładowania w Edytorze OSM
• Dodane gniazda ładowania schuko/type-E
• Poprawiony ranking wyników wyszukiwania
• Dodane litewskie i łotewskie komunikaty głosowe
• Poprawiony rozmiar znaków drogowych
• Poziom powiększenia oparty na odległości do następnego manewru
• Zmieniona kolejność ustawień
Więcej szczegółów na codeberg.org/comaps/comaps/releases

View File

@@ -0,0 +1,10 @@
• Dados OpenStreetMap atualizados em 9 de dezembro
• Uso do estilo Material 3
• Suporte para tomadas de carregamento no Editor OSM
• Adição de tomadas de carregamento Schuko/Tipo E
• Melhoria na classificação dos resultados de busca
• Adição dos idiomas letão e lituano nas orientações por voz
• Melhoria no tamanho das indicações de direção
• Nível de zoom baseado em distância até a próxima curva
• Configurações reordenadas
Mais detalhes em codeberg.org/comaps/comaps/releases

View File

@@ -68,4 +68,4 @@ Por favor, informa de errores, sugiere ideas y únete a nuestra comunidad en el
<b>La Libertad Está Aquí</b> <b>La Libertad Está Aquí</b>
Descubre tu camino, navega el mundo con privacidad y con la comunidad como prioridad. ¡Descubre tu camino, navega el mundo con privacidad y con la comunidad como prioridad!

View File

@@ -0,0 +1 @@
Paprasta ir patogi navigacija Turiningos kelionės Vystoma bendruomenės

View File

@@ -0,0 +1 @@
CoMaps naviguokite privačiai

View File

@@ -28,7 +28,6 @@ import com.github.mikephil.charting.formatter.IAxisValueFormatter;
import com.github.mikephil.charting.highlight.Highlight; import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.listener.OnChartValueSelectedListener; import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
import com.google.android.material.textview.MaterialTextView; import com.google.android.material.textview.MaterialTextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;

View File

@@ -253,7 +253,7 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
mProgress.setMax(bytes); mProgress.setMax(bytes);
// Start progress at 1% according to M3 guidelines // Start progress at 1% according to M3 guidelines
mProgress.setProgressCompat(bytes/100, true); mProgress.setProgressCompat(bytes / 100, true);
} }
else else
finishFilesDownload(bytes); finishFilesDownload(bytes);
@@ -372,7 +372,7 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name, fileSizeString)); mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name, fileSizeString));
mProgress.setMax((int) item.totalSize); mProgress.setMax((int) item.totalSize);
// Start progress at 1% according to M3 guidelines // Start progress at 1% according to M3 guidelines
mProgress.setProgressCompat((int) (item.totalSize/100), true); mProgress.setProgressCompat((int) (item.totalSize / 100), true);
mCountryDownloadListenerSlot = MapManager.nativeSubscribe(mCountryDownloadListener); mCountryDownloadListenerSlot = MapManager.nativeSubscribe(mCountryDownloadListener);
MapManagerHelper.startDownload(mCurrentCountry); MapManagerHelper.startDownload(mCurrentCountry);
@@ -424,17 +424,17 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
default -> throw new AssertionError("Unexpected result code = " + result); default -> throw new AssertionError("Unexpected result code = " + result);
}; };
mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog) mAlertDialog = new MaterialAlertDialogBuilder(this, R.style.MwmTheme_AlertDialog)
.setTitle(titleId) .setTitle(titleId)
.setMessage(messageId) .setMessage(messageId)
.setCancelable(true) .setCancelable(true)
.setOnCancelListener((dialog) -> setAction(PAUSE)) .setOnCancelListener((dialog) -> setAction(PAUSE))
.setPositiveButton(R.string.try_again, .setPositiveButton(R.string.try_again,
(dialog, which) -> { (dialog, which) -> {
setAction(TRY_AGAIN); setAction(TRY_AGAIN);
onTryAgainClicked(); onTryAgainClicked();
}) })
.setOnDismissListener(dialog -> mAlertDialog = null) .setOnDismissListener(dialog -> mAlertDialog = null)
.show(); .show();
} }
} }

View File

@@ -107,6 +107,7 @@ import app.organicmaps.sdk.routing.RoutingOptions;
import app.organicmaps.sdk.search.SearchEngine; import app.organicmaps.sdk.search.SearchEngine;
import app.organicmaps.sdk.settings.RoadType; import app.organicmaps.sdk.settings.RoadType;
import app.organicmaps.sdk.settings.UnitLocale; import app.organicmaps.sdk.settings.UnitLocale;
import app.organicmaps.sdk.sound.TtsPlayer;
import app.organicmaps.sdk.util.Config; import app.organicmaps.sdk.util.Config;
import app.organicmaps.sdk.util.LocationUtils; import app.organicmaps.sdk.util.LocationUtils;
import app.organicmaps.sdk.util.PowerManagment; import app.organicmaps.sdk.util.PowerManagment;
@@ -132,7 +133,6 @@ import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.textview.MaterialTextView; import com.google.android.material.textview.MaterialTextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Objects; import java.util.Objects;
@@ -1813,6 +1813,26 @@ public class MwmActivity extends BaseMwmFragmentActivity
return false; return false;
} }
private void deliverTtsMessage()
{
if (Config.isTtsMessageDelivered())
return;
String languageDisplayName = TtsPlayer.INSTANCE.getLanguageDisplayName();
if (languageDisplayName != null)
{
String navigationStartMessage = getResources().getString(R.string.navigation_start_tts_message);
navigationStartMessage += languageDisplayName;
Toast.makeText(this, navigationStartMessage, Toast.LENGTH_LONG).show();
}
else
Toast.makeText(this, getResources().getString(R.string.navigation_start_tts_disabled_message), Toast.LENGTH_LONG)
.show();
Config.setTtsMessageDelivered();
}
private boolean showStartPointNotice() private boolean showStartPointNotice()
{ {
final RoutingController controller = RoutingController.get(); final RoutingController controller = RoutingController.get();
@@ -2189,6 +2209,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
if (!showRoutingDisclaimer()) if (!showRoutingDisclaimer())
return; return;
deliverTtsMessage();
closeFloatingPanels(); closeFloatingPanels();
setFullscreen(false); setFullscreen(false);
RoutingController.get().start(); RoutingController.get().start();

View File

@@ -38,8 +38,9 @@ public class OsmUploadWork extends Worker
{ {
final Constraints c = new Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build(); final Constraints c = new Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build();
OneTimeWorkRequest.Builder builder = new OneTimeWorkRequest.Builder(OsmUploadWork.class).setConstraints(c); OneTimeWorkRequest.Builder builder = new OneTimeWorkRequest.Builder(OsmUploadWork.class).setConstraints(c);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
builder.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST); {
builder.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST);
} }
final OneTimeWorkRequest wr = builder.build(); final OneTimeWorkRequest wr = builder.build();
WorkManager.getInstance(context).beginUniqueWork("UploadOsmChanges", ExistingWorkPolicy.KEEP, wr).enqueue(); WorkManager.getInstance(context).beginUniqueWork("UploadOsmChanges", ExistingWorkPolicy.KEEP, wr).enqueue();

View File

@@ -17,7 +17,6 @@ import androidx.annotation.NonNull;
import androidx.documentfile.provider.DocumentFile; import androidx.documentfile.provider.DocumentFile;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.util.log.Logger; import app.organicmaps.sdk.util.log.Logger;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;

View File

@@ -10,7 +10,6 @@ import androidx.fragment.app.DialogFragment;
public class BaseMwmDialogFragment extends DialogFragment public class BaseMwmDialogFragment extends DialogFragment
{ {
protected int getStyle() protected int getStyle()
{ {
return STYLE_NORMAL; return STYLE_NORMAL;

View File

@@ -282,11 +282,13 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
{ {
if (isEmptySearchResults()) if (isEmptySearchResults())
{ {
requirePlaceholder().setContent(R.string.search_not_found, R.string.search_not_found_query, R.drawable.ic_search_fail); requirePlaceholder().setContent(R.string.search_not_found, R.string.search_not_found_query,
R.drawable.ic_search_fail);
} }
else if (isEmpty()) else if (isEmpty())
{ {
requirePlaceholder().setContent(R.string.bookmarks_empty_list_title, R.string.bookmarks_empty_list_message, R.drawable.ic_bookmarks); requirePlaceholder().setContent(R.string.bookmarks_empty_list_title, R.string.bookmarks_empty_list_message,
R.drawable.ic_bookmarks);
} }
boolean isEmptyRecycler = isEmpty() || isEmptySearchResults(); boolean isEmptyRecycler = isEmpty() || isEmptySearchResults();

View File

@@ -23,7 +23,6 @@ import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import app.organicmaps.widget.recycler.RecyclerClickListener; import app.organicmaps.widget.recycler.RecyclerClickListener;
import app.organicmaps.widget.recycler.RecyclerLongClickListener; import app.organicmaps.widget.recycler.RecyclerLongClickListener;
import com.google.android.material.button.MaterialButton; import com.google.android.material.button.MaterialButton;
import com.google.android.material.checkbox.MaterialCheckBox; import com.google.android.material.checkbox.MaterialCheckBox;
import com.google.android.material.imageview.ShapeableImageView; import com.google.android.material.imageview.ShapeableImageView;
@@ -458,10 +457,12 @@ public class Holders
String formattedDesc = desc.replace("\n", "<br>"); String formattedDesc = desc.replace("\n", "<br>");
Spanned spannedDesc = Utils.fromHtml(formattedDesc); Spanned spannedDesc = Utils.fromHtml(formattedDesc);
if (!TextUtils.isEmpty(spannedDesc)) { if (!TextUtils.isEmpty(spannedDesc))
{
mDescText.setText(spannedDesc); mDescText.setText(spannedDesc);
} }
else { else
{
mDescText.setText(R.string.list_description_empty); mDescText.setText(R.string.list_description_empty);
} }
} }

View File

@@ -50,8 +50,8 @@ public final class IntentUtils
} }
// https://developer.android.com/reference/androidx/car/app/CarContext#startCarApp(android.content.Intent) // https://developer.android.com/reference/androidx/car/app/CarContext#startCarApp(android.content.Intent)
private static void processNavigationIntent(@NonNull CarContext carContext, private static void processNavigationIntent(@NonNull CarContext carContext, @NonNull Renderer surfaceRenderer,
@NonNull Renderer surfaceRenderer, @NonNull Intent intent) @NonNull Intent intent)
{ {
// TODO (AndrewShkrob): This logic will need to be revised when we introduce support for adding stops during // TODO (AndrewShkrob): This logic will need to be revised when we introduce support for adding stops during
// navigation or route planning. Skip navigation intents during navigation // navigation or route planning. Skip navigation intents during navigation

View File

@@ -31,7 +31,7 @@ public final class RoutingHelpers
default -> Distance.UNIT_METERS; default -> Distance.UNIT_METERS;
}; };
return Distance.create(distance.mDistance, displayUnit); return Distance.create(distance.mDistance, displayUnit);
} }
@NonNull @NonNull
@@ -52,7 +52,7 @@ public final class RoutingHelpers
default -> LaneDirection.SHAPE_UNKNOWN; default -> LaneDirection.SHAPE_UNKNOWN;
}; };
return LaneDirection.create(shape, isRecommended); return LaneDirection.create(shape, isRecommended);
} }
@NonNull @NonNull
@@ -77,7 +77,7 @@ public final class RoutingHelpers
case EXIT_HIGHWAY_TO_LEFT -> Maneuver.TYPE_OFF_RAMP_SLIGHT_LEFT; case EXIT_HIGHWAY_TO_LEFT -> Maneuver.TYPE_OFF_RAMP_SLIGHT_LEFT;
case EXIT_HIGHWAY_TO_RIGHT -> Maneuver.TYPE_OFF_RAMP_SLIGHT_RIGHT; case EXIT_HIGHWAY_TO_RIGHT -> Maneuver.TYPE_OFF_RAMP_SLIGHT_RIGHT;
}; };
final Maneuver.Builder builder = new Maneuver.Builder(maneuverType); final Maneuver.Builder builder = new Maneuver.Builder(maneuverType);
if (maneuverType == Maneuver.TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW) if (maneuverType == Maneuver.TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW)
builder.setRoundaboutExitNumber(roundaboutExitNum > 0 ? roundaboutExitNum : 1); builder.setRoundaboutExitNumber(roundaboutExitNum > 0 ? roundaboutExitNum : 1);
builder.setIcon(new CarIcon.Builder(createManeuverIcon(context, carDirection, roundaboutExitNum)).build()); builder.setIcon(new CarIcon.Builder(createManeuverIcon(context, carDirection, roundaboutExitNum)).build());
@@ -85,7 +85,8 @@ public final class RoutingHelpers
} }
@NonNull @NonNull
private static IconCompat createManeuverIcon(@NonNull final CarContext context, @NonNull CarDirection carDirection, int roundaboutExitNum) private static IconCompat createManeuverIcon(@NonNull final CarContext context, @NonNull CarDirection carDirection,
int roundaboutExitNum)
{ {
if (!CarDirection.isRoundAbout(carDirection) || roundaboutExitNum == 0) if (!CarDirection.isRoundAbout(carDirection) || roundaboutExitNum == 0)
{ {

View File

@@ -39,8 +39,7 @@ public final class UiHelpers
} }
@NonNull @NonNull
public static ActionStrip createMapActionStrip(@NonNull CarContext context, public static ActionStrip createMapActionStrip(@NonNull CarContext context, @NonNull Renderer surfaceRenderer)
@NonNull Renderer surfaceRenderer)
{ {
final CarIcon iconPlus = new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_plus)).build(); final CarIcon iconPlus = new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_plus)).build();
final CarIcon iconMinus = new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_minus)).build(); final CarIcon iconMinus = new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_minus)).build();
@@ -59,15 +58,13 @@ public final class UiHelpers
} }
@NonNull @NonNull
public static MapController createMapController(@NonNull CarContext context, public static MapController createMapController(@NonNull CarContext context, @NonNull Renderer surfaceRenderer)
@NonNull Renderer surfaceRenderer)
{ {
return new MapController.Builder().setMapActionStrip(createMapActionStrip(context, surfaceRenderer)).build(); return new MapController.Builder().setMapActionStrip(createMapActionStrip(context, surfaceRenderer)).build();
} }
@NonNull @NonNull
public static Action createSettingsAction(@NonNull BaseMapScreen mapScreen, public static Action createSettingsAction(@NonNull BaseMapScreen mapScreen, @NonNull Renderer surfaceRenderer)
@NonNull Renderer surfaceRenderer)
{ {
return createSettingsAction(mapScreen, surfaceRenderer, null); return createSettingsAction(mapScreen, surfaceRenderer, null);
} }
@@ -81,8 +78,7 @@ public final class UiHelpers
} }
@NonNull @NonNull
private static Action createSettingsAction(@NonNull BaseMapScreen mapScreen, private static Action createSettingsAction(@NonNull BaseMapScreen mapScreen, @NonNull Renderer surfaceRenderer,
@NonNull Renderer surfaceRenderer,
@Nullable OnScreenResultListener onScreenResultListener) @Nullable OnScreenResultListener onScreenResultListener)
{ {
final CarContext context = mapScreen.getCarContext(); final CarContext context = mapScreen.getCarContext();
@@ -123,8 +119,7 @@ public final class UiHelpers
return null; return null;
final Row.Builder builder = new Row.Builder(); final Row.Builder builder = new Row.Builder();
builder.setImage( builder.setImage(new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_opening_hours)).build());
new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_opening_hours)).build());
if (isEmptyTT) if (isEmptyTT)
builder.setTitle(ohStr); builder.setTitle(ohStr);

View File

@@ -125,7 +125,8 @@ public class EditTextDialogFragment extends BaseMwmDialogFragment
positiveButton.setOnClickListener(view -> { positiveButton.setOnClickListener(view -> {
final String result = mEtInput.getText().toString(); final String result = mEtInput.getText().toString();
if (validateInput(requireActivity(), result)) { if (validateInput(requireActivity(), result))
{
processInput(result); processInput(result);
editTextDialog.dismiss(); editTextDialog.dismiss();
} }

View File

@@ -4,7 +4,6 @@ import android.location.Location;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import app.organicmaps.MwmActivity; import app.organicmaps.MwmActivity;
@@ -49,7 +48,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
@Override @Override
public void onStatusChanged(List<MapManager.StorageCallbackData> data) public void onStatusChanged(List<MapManager.StorageCallbackData> data)
{ {
if (mCurrentCountry == null) { if (mCurrentCountry == null)
{
updateOfflineExplanationVisibility(); updateOfflineExplanationVisibility();
return; return;
} }
@@ -109,10 +109,13 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
return enqueued || progress || applying; return enqueued || progress || applying;
} }
private void updateOfflineExplanationVisibility() { private void updateOfflineExplanationVisibility()
if (mOfflineExplanation == null) return; {
if (mOfflineExplanation == null)
return;
// hide once threshold reached; safe to call repeatedly. // hide once threshold reached; safe to call repeatedly.
app.organicmaps.util.UiUtils.showIf(MapManager.nativeGetDownloadedCount() < (DEFAULT_MAP_BASELINE + HIDE_THRESHOLD), mOfflineExplanation); app.organicmaps.util.UiUtils.showIf(MapManager.nativeGetDownloadedCount() < (DEFAULT_MAP_BASELINE + HIDE_THRESHOLD),
mOfflineExplanation);
} }
private void updateProgressState(boolean shouldAutoDownload) private void updateProgressState(boolean shouldAutoDownload)

View File

@@ -15,7 +15,6 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AutoCompleteTextView; import android.widget.AutoCompleteTextView;
import android.widget.GridLayout; import android.widget.GridLayout;
import androidx.annotation.CallSuper; import androidx.annotation.CallSuper;
import androidx.annotation.DrawableRes; import androidx.annotation.DrawableRes;
import androidx.annotation.IdRes; import androidx.annotation.IdRes;
@@ -398,7 +397,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
List<String> SOCKET_TYPES = Arrays.stream(getResources().getStringArray(R.array.charge_socket_types)).toList(); List<String> SOCKET_TYPES = Arrays.stream(getResources().getStringArray(R.array.charge_socket_types)).toList();
for (String socketType : SOCKET_TYPES) for (String socketType : SOCKET_TYPES)
{ {
ChargeSocketDescriptor socket = new ChargeSocketDescriptor(socketType,0,0); ChargeSocketDescriptor socket = new ChargeSocketDescriptor(socketType, 0, 0);
MaterialButton btn = (MaterialButton) inflater.inflate(R.layout.button_socket_type, typeBtns, false); MaterialButton btn = (MaterialButton) inflater.inflate(R.layout.button_socket_type, typeBtns, false);
@@ -406,16 +405,16 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
// load SVG icon converted into VectorDrawable in res/drawable // load SVG icon converted into VectorDrawable in res/drawable
@SuppressLint("DiscouragedApi") @SuppressLint("DiscouragedApi")
int resIconId = int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable",
getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable", requireContext().getPackageName()); requireContext().getPackageName());
if (resIconId != 0) if (resIconId != 0)
{ {
btn.setIcon(getResources().getDrawable(resIconId)); btn.setIcon(getResources().getDrawable(resIconId));
} }
@SuppressLint("DiscouragedApi") @SuppressLint("DiscouragedApi")
int resTypeId = int resTypeId = getResources().getIdentifier("charge_socket_" + socket.visualType(), "string",
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName()); requireContext().getPackageName());
if (resTypeId != 0) if (resTypeId != 0)
{ {
btn.setText(getResources().getString(resTypeId)); btn.setText(getResources().getString(resTypeId));
@@ -463,13 +462,16 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
// Add a TextWatcher to validate on text change // Add a TextWatcher to validate on text change
countView.addTextChangedListener(new TextWatcher() { countView.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {} public void beforeTextChanged(CharSequence s, int start, int count, int after)
{}
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) {} public void onTextChanged(CharSequence s, int start, int before, int count)
{}
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s)
{
validatePositiveField(s.toString(), countInputLayout); validatePositiveField(s.toString(), countInputLayout);
} }
}); });
@@ -484,13 +486,16 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
// Add a TextWatcher to validate on text change // Add a TextWatcher to validate on text change
powerView.addTextChangedListener(new TextWatcher() { powerView.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {} public void beforeTextChanged(CharSequence s, int start, int count, int after)
{}
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) {} public void onTextChanged(CharSequence s, int start, int before, int count)
{}
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s)
{
validatePositiveField(s.toString(), powerInputLayout); validatePositiveField(s.toString(), powerInputLayout);
} }
}); });
@@ -498,74 +503,82 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
return new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmTheme_AlertDialog) return new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmTheme_AlertDialog)
.setTitle(R.string.editor_socket) .setTitle(R.string.editor_socket)
.setView(dialogView) .setView(dialogView)
.setPositiveButton(R.string.save, .setPositiveButton(
(dialog, which) -> { R.string.save,
String socketType = ""; (dialog, which) -> {
for (MaterialButton b : buttonList) String socketType = "";
{ for (MaterialButton b : buttonList)
if (b.isChecked()) {
{ if (b.isChecked())
socketType = b.getTag(R.id.socket_type).toString(); {
break; socketType = b.getTag(R.id.socket_type).toString();
} break;
} }
}
int countValue = 0; // 0 means 'unknown count' int countValue = 0; // 0 means 'unknown count'
try try
{ {
countValue = Integer.parseInt(countView.getText().toString()); countValue = Integer.parseInt(countView.getText().toString());
} }
catch (NumberFormatException ignored) catch (NumberFormatException ignored)
{ {
Logger.w(CHARGE_SOCKETS_TAG, "Invalid count value for socket:" + countView.getText().toString()); Logger.w(CHARGE_SOCKETS_TAG, "Invalid count value for socket:" + countView.getText().toString());
} }
if (countValue < 0) if (countValue < 0)
{ {
countValue = 0; countValue = 0;
Logger.w(CHARGE_SOCKETS_TAG, "Invalid count value for socket:" + countView.getText().toString()); Logger.w(CHARGE_SOCKETS_TAG, "Invalid count value for socket:" + countView.getText().toString());
} }
double powerValue = 0; // 0 means 'unknown power' double powerValue = 0; // 0 means 'unknown power'
try try
{ {
powerValue = Double.parseDouble(powerView.getText().toString()); powerValue = Double.parseDouble(powerView.getText().toString());
} }
catch (NumberFormatException ignored) catch (NumberFormatException ignored)
{ {
Logger.w(CHARGE_SOCKETS_TAG, "Invalid power value for socket:" + powerView.getText().toString()); Logger.w(CHARGE_SOCKETS_TAG, "Invalid power value for socket:" + powerView.getText().toString());
} }
if (powerValue < 0) if (powerValue < 0)
{ {
powerValue = 0; powerValue = 0;
Logger.w(CHARGE_SOCKETS_TAG, "Invalid power value for socket:" + powerView.getText().toString()); Logger.w(CHARGE_SOCKETS_TAG, "Invalid power value for socket:" + powerView.getText().toString());
} }
ChargeSocketDescriptor socket = ChargeSocketDescriptor socket = new ChargeSocketDescriptor(socketType, countValue, powerValue);
new ChargeSocketDescriptor(socketType, countValue, powerValue);
updateChargeSockets(socketIndex, socket); updateChargeSockets(socketIndex, socket);
}) })
.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); .setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
} }
// Helper method for validation logic // Helper method for validation logic
private boolean validatePositiveField(String text, TextInputLayout layout) { private boolean validatePositiveField(String text, TextInputLayout layout)
if (text.isEmpty()) { {
if (text.isEmpty())
{
layout.setError(null); // No error if empty (assuming 0 is the default) layout.setError(null); // No error if empty (assuming 0 is the default)
return true; return true;
} }
try { try
{
double value = Double.parseDouble(text); double value = Double.parseDouble(text);
if (value < 0) { if (value < 0)
{
layout.setError(getString(R.string.error_value_must_be_positive)); layout.setError(getString(R.string.error_value_must_be_positive));
return false; return false;
} else {
layout.setError(null);
return true;
} }
} catch (NumberFormatException e) { else
{
layout.setError(null);
return true;
}
}
catch (NumberFormatException e)
{
layout.setError(getString(R.string.error_invalid_number)); layout.setError(getString(R.string.error_invalid_number));
return false; return false;
} }
@@ -585,7 +598,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
{ {
sockets[socketIndex] = socket; sockets[socketIndex] = socket;
} }
else { else
{
List<ChargeSocketDescriptor> list = new ArrayList<>(Arrays.asList(sockets)); List<ChargeSocketDescriptor> list = new ArrayList<>(Arrays.asList(sockets));
list.add(socket); list.add(socket);
sockets = list.toArray(new ChargeSocketDescriptor[0]); sockets = list.toArray(new ChargeSocketDescriptor[0]);
@@ -603,7 +617,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
GridLayout socketsGrid = mChargeSockets.findViewById(R.id.socket_grid_editor); GridLayout socketsGrid = mChargeSockets.findViewById(R.id.socket_grid_editor);
socketsGrid.removeAllViews(); socketsGrid.removeAllViews();
for (int i = 0; i < sockets.length; i++) { for (int i = 0; i < sockets.length; i++)
{
final int currentIndex = i; final int currentIndex = i;
ChargeSocketDescriptor socket = sockets[i]; ChargeSocketDescriptor socket = sockets[i];
@@ -614,27 +629,30 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
MaterialTextView power = itemView.findViewById(R.id.socket_power); MaterialTextView power = itemView.findViewById(R.id.socket_power);
MaterialTextView count = itemView.findViewById(R.id.socket_count); MaterialTextView count = itemView.findViewById(R.id.socket_count);
// load SVG icon converted into VectorDrawable in res/drawable // load SVG icon converted into VectorDrawable in res/drawable
@SuppressLint("DiscouragedApi") @SuppressLint("DiscouragedApi")
int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable", int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable",
requireContext().getPackageName()); requireContext().getPackageName());
if (resIconId != 0) { if (resIconId != 0)
{
icon.setImageResource(resIconId); icon.setImageResource(resIconId);
} }
@SuppressLint("DiscouragedApi") @SuppressLint("DiscouragedApi")
int resTypeId = int resTypeId = getResources().getIdentifier("charge_socket_" + socket.visualType(), "string",
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName()); requireContext().getPackageName());
if (resTypeId != 0) { if (resTypeId != 0)
{
type.setText(resTypeId); type.setText(resTypeId);
} }
if (socket.power() != 0) { if (socket.power() != 0)
{
DecimalFormat df = new DecimalFormat("#.##"); DecimalFormat df = new DecimalFormat("#.##");
power.setText(getString(R.string.kw_label, df.format(socket.power()))); power.setText(getString(R.string.kw_label, df.format(socket.power())));
} }
else if (socket.ignorePower()) { else if (socket.ignorePower())
{
power.setVisibility(INVISIBLE); power.setVisibility(INVISIBLE);
} }
@@ -643,7 +661,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
count.setText(getString(R.string.count_label, socket.count())); count.setText(getString(R.string.count_label, socket.count()));
} }
itemView.setOnClickListener(v -> buildChargeSocketDialog(currentIndex, socket.type(), socket.count(), socket.power()).show()); itemView.setOnClickListener(
v -> buildChargeSocketDialog(currentIndex, socket.type(), socket.count(), socket.power()).show());
socketsGrid.addView(itemView); socketsGrid.addView(itemView);
} }
@@ -789,9 +808,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
View lineContactBlock = View lineContactBlock =
initBlock(view, Metadata.MetadataType.FMD_CONTACT_LINE, R.id.block_line, R.drawable.ic_line_white, initBlock(view, Metadata.MetadataType.FMD_CONTACT_LINE, R.id.block_line, R.drawable.ic_line_white,
R.string.editor_line_social_network, InputType.TYPE_TEXT_VARIATION_URI); R.string.editor_line_social_network, InputType.TYPE_TEXT_VARIATION_URI);
View blueskyContactBlock = View blueskyContactBlock = initBlock(view, Metadata.MetadataType.FMD_CONTACT_BLUESKY, R.id.block_bluesky,
initBlock(view, Metadata.MetadataType.FMD_CONTACT_BLUESKY, R.id.block_bluesky, R.drawable.ic_bluesky, R.drawable.ic_bluesky, R.string.bluesky, InputType.TYPE_TEXT_VARIATION_URI);
R.string.bluesky, InputType.TYPE_TEXT_VARIATION_URI);
View operatorBlock = initBlock(view, Metadata.MetadataType.FMD_OPERATOR, R.id.block_operator, View operatorBlock = initBlock(view, Metadata.MetadataType.FMD_OPERATOR, R.id.block_operator,
R.drawable.ic_operator, R.string.editor_operator, 0); R.drawable.ic_operator, R.string.editor_operator, 0);
@@ -1023,14 +1041,15 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
private void placeDisused() private void placeDisused()
{ {
new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmTheme_AlertDialog) new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmTheme_AlertDialog)
.setTitle(R.string.editor_mark_business_vacant_title) .setTitle(R.string.editor_mark_business_vacant_title)
.setMessage(R.string.editor_mark_business_vacant_description) .setMessage(R.string.editor_mark_business_vacant_description)
.setPositiveButton(R.string.editor_submit, (dlg, which) -> { .setPositiveButton(R.string.editor_submit,
Editor.nativeMarkPlaceAsDisused(); (dlg, which) -> {
mParent.processEditedFeatures(); Editor.nativeMarkPlaceAsDisused();
}) mParent.processEditedFeatures();
.setNegativeButton(android.R.string.cancel, null) })
.show(); .setNegativeButton(android.R.string.cancel, null)
.show();
} }
private void commitPlaceDoesntExists(@NonNull String text) private void commitPlaceDoesntExists(@NonNull String text)

View File

@@ -13,7 +13,6 @@ import app.organicmaps.R;
import app.organicmaps.sdk.editor.data.FeatureCategory; import app.organicmaps.sdk.editor.data.FeatureCategory;
import app.organicmaps.sdk.util.StringUtils; import app.organicmaps.sdk.util.StringUtils;
import app.organicmaps.util.UiUtils; import app.organicmaps.util.UiUtils;
import com.google.android.material.button.MaterialButton; import com.google.android.material.button.MaterialButton;
import com.google.android.material.textfield.TextInputEditText; import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textview.MaterialTextView; import com.google.android.material.textview.MaterialTextView;
@@ -69,8 +68,7 @@ public class FeatureCategoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
} }
case TYPE_FOOTER -> case TYPE_FOOTER ->
{ {
return new FooterViewHolder(inflater.inflate(R.layout.item_feature_category_footer, parent, false), return new FooterViewHolder(inflater.inflate(R.layout.item_feature_category_footer, parent, false), mFragment);
mFragment);
} }
default -> throw new IllegalArgumentException("Unsupported viewType: " + viewType); default -> throw new IllegalArgumentException("Unsupported viewType: " + viewType);
} }
@@ -134,26 +132,21 @@ public class FeatureCategoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
mSendNoteButton = itemView.findViewById(R.id.send_note_button); mSendNoteButton = itemView.findViewById(R.id.send_note_button);
mSendNoteButton.setOnClickListener(v -> listener.onSendNoteClicked()); mSendNoteButton.setOnClickListener(v -> listener.onSendNoteClicked());
final ColorStateList bgButtonColor = new ColorStateList( final ColorStateList bgButtonColor = new ColorStateList(
new int[][]{ new int[][] {
new int[]{android.R.attr.state_enabled}, // enabled new int[] {android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled new int[] {-android.R.attr.state_enabled} // disabled
}, },
new int[]{ new int[] {ContextCompat.getColor(mSendNoteButton.getContext(), R.color.base_accent),
ContextCompat.getColor( ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_disabled)});
mSendNoteButton.getContext(), R.color.base_accent),
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_disabled)
});
final ColorStateList textButtonColor = new ColorStateList( final ColorStateList textButtonColor = new ColorStateList(
new int[][]{ new int[][] {
new int[]{android.R.attr.state_enabled}, // enabled new int[] {android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled new int[] {-android.R.attr.state_enabled} // disabled
}, },
new int[]{ new int[] {ContextCompat.getColor(mSendNoteButton.getContext(),
ContextCompat.getColor( UiUtils.getStyledResourceId(mSendNoteButton.getContext(),
mSendNoteButton.getContext(), android.R.attr.textColorPrimaryInverse)),
UiUtils.getStyledResourceId(mSendNoteButton.getContext(), android.R.attr.textColorPrimaryInverse)), ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_text_disabled)});
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_text_disabled)
});
mSendNoteButton.setBackgroundTintList(bgButtonColor); mSendNoteButton.setBackgroundTintList(bgButtonColor);
mSendNoteButton.setTextColor(textButtonColor); mSendNoteButton.setTextColor(textButtonColor);
mNoteEditText.addTextChangedListener(new StringUtils.SimpleTextWatcher() { mNoteEditText.addTextChangedListener(new StringUtils.SimpleTextWatcher() {

View File

@@ -2,19 +2,16 @@ package app.organicmaps.editor;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import com.google.android.material.timepicker.MaterialTimePicker;
import com.google.android.material.timepicker.TimeFormat;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.editor.data.HoursMinutes; import app.organicmaps.sdk.editor.data.HoursMinutes;
import app.organicmaps.sdk.util.DateUtils; import app.organicmaps.sdk.util.DateUtils;
import com.google.android.material.timepicker.MaterialTimePicker;
import com.google.android.material.timepicker.TimeFormat;
public class FromToTimePicker public class FromToTimePicker
{ {
@@ -32,18 +29,11 @@ public class FromToTimePicker
private boolean mIsFromTimePicked; private boolean mIsFromTimePicked;
private int mInputMode; private int mInputMode;
public static void pickTime(@NonNull Fragment fragment, public static void pickTime(@NonNull Fragment fragment, @NonNull FromToTimePicker.OnPickListener listener,
@NonNull FromToTimePicker.OnPickListener listener, @NonNull HoursMinutes fromTime, @NonNull HoursMinutes toTime, int id,
@NonNull HoursMinutes fromTime,
@NonNull HoursMinutes toTime,
int id,
boolean startWithToTime) boolean startWithToTime)
{ {
FromToTimePicker timePicker = new FromToTimePicker(fragment, FromToTimePicker timePicker = new FromToTimePicker(fragment, listener, fromTime, toTime, id);
listener,
fromTime,
toTime,
id);
if (startWithToTime) if (startWithToTime)
timePicker.showToTimePicker(); timePicker.showToTimePicker();
@@ -51,11 +41,8 @@ public class FromToTimePicker
timePicker.showFromTimePicker(); timePicker.showFromTimePicker();
} }
private FromToTimePicker(@NonNull Fragment fragment, private FromToTimePicker(@NonNull Fragment fragment, @NonNull FromToTimePicker.OnPickListener listener,
@NonNull FromToTimePicker.OnPickListener listener, @NonNull HoursMinutes fromTime, @NonNull HoursMinutes toTime, int id)
@NonNull HoursMinutes fromTime,
@NonNull HoursMinutes toTime,
int id)
{ {
mActivity = fragment.requireActivity(); mActivity = fragment.requireActivity();
mFragmentManager = fragment.getChildFragmentManager(); mFragmentManager = fragment.getChildFragmentManager();
@@ -100,15 +87,12 @@ public class FromToTimePicker
private MaterialTimePicker buildFromTimePicker() private MaterialTimePicker buildFromTimePicker()
{ {
MaterialTimePicker timePicker = buildTimePicker(mFromTime, MaterialTimePicker timePicker = buildTimePicker(mFromTime, mResources.getString(R.string.editor_time_from),
mResources.getString(R.string.editor_time_from), mResources.getString(R.string.next_button), null);
mResources.getString(R.string.next_button),
null);
timePicker.addOnNegativeButtonClickListener(view -> finishTimePicking(false)); timePicker.addOnNegativeButtonClickListener(view -> finishTimePicking(false));
timePicker.addOnPositiveButtonClickListener(view -> timePicker.addOnPositiveButtonClickListener(view -> {
{
mIsFromTimePicked = true; mIsFromTimePicked = true;
saveState(timePicker, true); saveState(timePicker, true);
mFromTimePicker = null; mFromTimePicker = null;
@@ -122,13 +106,10 @@ public class FromToTimePicker
private MaterialTimePicker buildToTimePicker() private MaterialTimePicker buildToTimePicker()
{ {
MaterialTimePicker timePicker = buildTimePicker(mToTime, MaterialTimePicker timePicker = buildTimePicker(mToTime, mResources.getString(R.string.editor_time_to), null,
mResources.getString(R.string.editor_time_to),
null,
mResources.getString(R.string.back)); mResources.getString(R.string.back));
timePicker.addOnNegativeButtonClickListener(view -> timePicker.addOnNegativeButtonClickListener(view -> {
{
saveState(timePicker, false); saveState(timePicker, false);
mToTimePicker = null; mToTimePicker = null;
if (mIsFromTimePicked) if (mIsFromTimePicked)
@@ -137,8 +118,7 @@ public class FromToTimePicker
finishTimePicking(false); finishTimePicking(false);
}); });
timePicker.addOnPositiveButtonClickListener(view -> timePicker.addOnPositiveButtonClickListener(view -> {
{
saveState(timePicker, false); saveState(timePicker, false);
finishTimePicking(true); finishTimePicking(true);
}); });
@@ -149,18 +129,18 @@ public class FromToTimePicker
} }
@NonNull @NonNull
private MaterialTimePicker buildTimePicker(@NonNull HoursMinutes time, private MaterialTimePicker buildTimePicker(@NonNull HoursMinutes time, @NonNull String title,
@NonNull String title,
@Nullable String positiveButtonTextOverride, @Nullable String positiveButtonTextOverride,
@Nullable String negativeButtonTextOverride) @Nullable String negativeButtonTextOverride)
{ {
MaterialTimePicker.Builder builder = new MaterialTimePicker.Builder() MaterialTimePicker.Builder builder =
.setTitleText(title) new MaterialTimePicker.Builder()
.setTimeFormat(mIs24HourFormat ? TimeFormat.CLOCK_24H : TimeFormat.CLOCK_12H) .setTitleText(title)
.setInputMode(mInputMode) .setTimeFormat(mIs24HourFormat ? TimeFormat.CLOCK_24H : TimeFormat.CLOCK_12H)
.setTheme(R.style.MwmTheme_MaterialTimePicker) .setInputMode(mInputMode)
.setHour((int) time.hours) .setTheme(R.style.MwmTheme_MaterialTimePicker)
.setMinute((int) time.minutes); .setHour((int) time.hours)
.setMinute((int) time.minutes);
if (positiveButtonTextOverride != null) if (positiveButtonTextOverride != null)
builder.setPositiveButtonText(positiveButtonTextOverride); builder.setPositiveButtonText(positiveButtonTextOverride);

View File

@@ -6,7 +6,6 @@ import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ProgressBar;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
@@ -23,6 +22,7 @@ import app.organicmaps.util.Utils;
import app.organicmaps.util.WindowInsetUtils; import app.organicmaps.util.WindowInsetUtils;
import app.organicmaps.widget.StackedButtonDialogFragment; import app.organicmaps.widget.StackedButtonDialogFragment;
import com.google.android.material.imageview.ShapeableImageView; import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.progressindicator.CircularProgressIndicator;
import com.google.android.material.textview.MaterialTextView; import com.google.android.material.textview.MaterialTextView;
import java.text.NumberFormat; import java.text.NumberFormat;
@@ -50,7 +50,7 @@ public class ProfileFragment extends BaseMwmToolbarFragment
private MaterialTextView mEditsSent; private MaterialTextView mEditsSent;
private MaterialTextView mProfileName; private MaterialTextView mProfileName;
private ShapeableImageView mProfileImage; private ShapeableImageView mProfileImage;
private ProgressBar mProfileInfoLoading; private CircularProgressIndicator mProfileInfoLoading;
@Nullable @Nullable
@Override @Override

View File

@@ -7,7 +7,6 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import androidx.annotation.IdRes; import androidx.annotation.IdRes;
import androidx.annotation.IntRange; import androidx.annotation.IntRange;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
@@ -122,20 +121,14 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
notifyItemChanged(getItemCount() - 1); notifyItemChanged(getItemCount() - 1);
} }
private void pickTime(int position, private void pickTime(int position, @IntRange(from = ID_OPENING_TIME, to = ID_CLOSED_SPAN) int id,
@IntRange(from = ID_OPENING_TIME, to = ID_CLOSED_SPAN) int id,
boolean startWithToTime) boolean startWithToTime)
{ {
final Timetable data = mItems.get(position); final Timetable data = mItems.get(position);
mPickingPosition = position; mPickingPosition = position;
FromToTimePicker.pickTime(mFragment, FromToTimePicker.pickTime(mFragment, this, data.workingTimespan.start, data.workingTimespan.end, id,
this, startWithToTime);
data.workingTimespan.start,
data.workingTimespan.end,
id,
startWithToTime);
} }
@Override @Override
@@ -384,26 +377,21 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
final String text = mFragment.getString(R.string.editor_time_add); final String text = mFragment.getString(R.string.editor_time_add);
mAdd.setEnabled(enable); mAdd.setEnabled(enable);
final ColorStateList bgButtonColor = new ColorStateList( final ColorStateList bgButtonColor = new ColorStateList(
new int[][]{ new int[][] {
new int[]{android.R.attr.state_enabled}, // enabled new int[] {android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled new int[] {-android.R.attr.state_enabled} // disabled
}, },
new int[]{ new int[] {ContextCompat.getColor(mAdd.getContext(), R.color.base_accent),
ContextCompat.getColor( ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_disabled)});
mAdd.getContext(), R.color.base_accent),
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_disabled)
});
final ColorStateList textButtonColor = new ColorStateList( final ColorStateList textButtonColor = new ColorStateList(
new int[][]{ new int[][] {
new int[]{android.R.attr.state_enabled}, // enabled new int[] {android.R.attr.state_enabled}, // enabled
new int[]{-android.R.attr.state_enabled} // disabled new int[] {-android.R.attr.state_enabled} // disabled
}, },
new int[]{ new int[] {
ContextCompat.getColor( ContextCompat.getColor(mAdd.getContext(), UiUtils.getStyledResourceId(
mAdd.getContext(), mAdd.getContext(), android.R.attr.textColorPrimaryInverse)),
UiUtils.getStyledResourceId(mAdd.getContext(), android.R.attr.textColorPrimaryInverse)), ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_text_disabled)});
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_text_disabled)
});
mAdd.setBackgroundTintList(bgButtonColor); mAdd.setBackgroundTintList(bgButtonColor);
mAdd.setTextColor(textButtonColor); mAdd.setTextColor(textButtonColor);
mAdd.setText(enable ? text + " (" + TimeFormatUtils.formatWeekdays(mComplementItem) + ")" : text); mAdd.setText(enable ? text + " (" + TimeFormatUtils.formatWeekdays(mComplementItem) + ")" : text);

View File

@@ -9,8 +9,8 @@ import androidx.annotation.Nullable;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.base.BaseMwmRecyclerFragment; import app.organicmaps.base.BaseMwmRecyclerFragment;
public class SimpleTimetableFragment extends BaseMwmRecyclerFragment<SimpleTimetableAdapter> public class SimpleTimetableFragment
implements TimetableProvider extends BaseMwmRecyclerFragment<SimpleTimetableAdapter> implements TimetableProvider
{ {
private SimpleTimetableAdapter mAdapter; private SimpleTimetableAdapter mAdapter;
@Nullable @Nullable

View File

@@ -35,25 +35,30 @@ public class LayerBottomSheetItem
@DrawableRes @DrawableRes
int drawableResId = 0; int drawableResId = 0;
@StringRes @StringRes
int buttonTextResource = switch (mode) { int buttonTextResource = switch (mode)
case OUTDOORS -> { {
drawableResId = R.drawable.ic_layers_outdoors; case OUTDOORS ->
yield R.string.button_layer_outdoor; {
} drawableResId = R.drawable.ic_layers_outdoors;
case SUBWAY -> { yield R.string.button_layer_outdoor;
drawableResId = R.drawable.ic_layers_subway; }
yield R.string.subway; case SUBWAY ->
} {
case ISOLINES -> { drawableResId = R.drawable.ic_layers_subway;
drawableResId = R.drawable.ic_layers_isoline; yield R.string.subway;
yield R.string.button_layer_isolines; }
} case ISOLINES ->
case TRAFFIC -> { {
drawableResId = R.drawable.ic_layers_traffic; drawableResId = R.drawable.ic_layers_isoline;
yield R.string.button_layer_traffic; yield R.string.button_layer_isolines;
} }
case TRAFFIC ->
{
drawableResId = R.drawable.ic_layers_traffic;
yield R.string.button_layer_traffic;
}
}; };
return new LayerBottomSheetItem(drawableResId, buttonTextResource, mode, layerItemClickListener); return new LayerBottomSheetItem(drawableResId, buttonTextResource, mode, layerItemClickListener);
} }
@NonNull @NonNull

View File

@@ -5,11 +5,9 @@ import android.widget.ImageView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.adapter.OnItemClickListener; import app.organicmaps.adapter.OnItemClickListener;
import com.google.android.material.textview.MaterialTextView;
class LayerHolder extends RecyclerView.ViewHolder class LayerHolder extends RecyclerView.ViewHolder
{ {

View File

@@ -395,7 +395,7 @@ public class MapButtonsController extends Fragment
0; 0;
// Allow offset tolerance for zoom buttons // Allow offset tolerance for zoom buttons
}; };
showButton(getViewTopOffset(translation, button) >= toleranceOffset, entry.getKey()); showButton(getViewTopOffset(translation, button) >= toleranceOffset, entry.getKey());
} }
} }
} }

View File

@@ -43,7 +43,6 @@ import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import app.organicmaps.widget.recycler.DotDividerItemDecoration; import app.organicmaps.widget.recycler.DotDividerItemDecoration;
import app.organicmaps.widget.recycler.MultilineLayoutManager; import app.organicmaps.widget.recycler.MultilineLayoutManager;
import com.google.android.material.button.MaterialButton; import com.google.android.material.button.MaterialButton;
import com.google.android.material.imageview.ShapeableImageView; import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView; import com.google.android.material.textview.MaterialTextView;
@@ -123,9 +122,9 @@ final class RoutingBottomMenuController implements View.OnClickListener
@NonNull View timeElevationLine, @NonNull View transitFrame, @NonNull View timeElevationLine, @NonNull View transitFrame,
@NonNull MaterialTextView error, @NonNull MaterialButton start, @NonNull MaterialTextView error, @NonNull MaterialButton start,
@NonNull ShapeableImageView altitudeChart, @NonNull MaterialTextView time, @NonNull ShapeableImageView altitudeChart, @NonNull MaterialTextView time,
@NonNull MaterialTextView altitudeDifference, @NonNull MaterialTextView timeVehicle, @NonNull MaterialTextView altitudeDifference,
@Nullable MaterialTextView arrival, @NonNull View actionFrame, @NonNull MaterialTextView timeVehicle, @Nullable MaterialTextView arrival,
@Nullable RoutingBottomMenuListener listener) @NonNull View actionFrame, @Nullable RoutingBottomMenuListener listener)
{ {
mContext = context; mContext = context;
mAltitudeChartFrame = altitudeChartFrame; mAltitudeChartFrame = altitudeChartFrame;

View File

@@ -12,9 +12,6 @@ import androidx.annotation.IdRes;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.core.view.ViewCompat; import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat; import androidx.core.view.WindowInsetsCompat;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.MwmApplication; import app.organicmaps.MwmApplication;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.Framework; import app.organicmaps.sdk.Framework;
@@ -29,6 +26,7 @@ import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
import app.organicmaps.widget.RoutingToolbarButton; import app.organicmaps.widget.RoutingToolbarButton;
import app.organicmaps.widget.ToolbarController; import app.organicmaps.widget.ToolbarController;
import app.organicmaps.widget.WheelProgressView; import app.organicmaps.widget.WheelProgressView;
import com.google.android.material.textview.MaterialTextView;
public class RoutingPlanController extends ToolbarController public class RoutingPlanController extends ToolbarController
{ {
@@ -264,7 +262,7 @@ public class RoutingPlanController extends ToolbarController
default -> throw new IllegalArgumentException("unknown router: " + router); default -> throw new IllegalArgumentException("unknown router: " + router);
}; };
RoutingToolbarButton button = mRouterTypes.findViewById(mRouterTypes.getCheckedRadioButtonId()); RoutingToolbarButton button = mRouterTypes.findViewById(mRouterTypes.getCheckedRadioButtonId());
button.progress(); button.progress();
updateProgressLabels(); updateProgressLabels();

View File

@@ -14,12 +14,10 @@ import androidx.annotation.NonNull;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.search.DisplayedCategories; import app.organicmaps.sdk.search.DisplayedCategories;
import app.organicmaps.sdk.util.Language; import app.organicmaps.sdk.util.Language;
import com.google.android.material.textview.MaterialTextView;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.util.Locale; import java.util.Locale;

View File

@@ -10,14 +10,12 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.search.SearchResult; import app.organicmaps.sdk.search.SearchResult;
import app.organicmaps.util.Graphics; import app.organicmaps.util.Graphics;
import app.organicmaps.util.ThemeUtils; import app.organicmaps.util.ThemeUtils;
import app.organicmaps.util.UiUtils; import app.organicmaps.util.UiUtils;
import com.google.android.material.textview.MaterialTextView;
class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHolder> class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHolder>
{ {
@@ -152,7 +150,8 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
{ {
final Resources resources = mSearchFragment.getResources(); final Resources resources = mSearchFragment.getResources();
if (result.description.openNow != SearchResult.OPEN_NOW_YES && result.description.openNow != SearchResult.OPEN_NOW_NO) if (result.description.openNow != SearchResult.OPEN_NOW_YES
&& result.description.openNow != SearchResult.OPEN_NOW_NO)
{ {
// Hide if unknown opening hours state // Hide if unknown opening hours state
UiUtils.hide(mOpen); UiUtils.hide(mOpen);
@@ -169,15 +168,18 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
{ {
final String minsToChangeStr = resources.getQuantityString( final String minsToChangeStr = resources.getQuantityString(
R.plurals.minutes_short, Math.max(minsToNextState, 1), Math.max(minsToNextState, 1)); R.plurals.minutes_short, Math.max(minsToNextState, 1), Math.max(minsToNextState, 1));
final String nextChangeFormatted = resources.getString(isOpen ? R.string.closes_in : R.string.opens_in, minsToChangeStr); final String nextChangeFormatted =
resources.getString(isOpen ? R.string.closes_in : R.string.opens_in, minsToChangeStr);
UiUtils.setTextAndShow(mOpen, nextChangeFormatted); UiUtils.setTextAndShow(mOpen, nextChangeFormatted);
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_yellow)); mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_yellow));
} }
else else
{ {
UiUtils.setTextAndShow(mOpen, isOpen ? resources.getString(R.string.editor_time_open) : resources.getString(R.string.closed)); UiUtils.setTextAndShow(
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), isOpen ? R.color.base_green : R.color.base_red)); mOpen, isOpen ? resources.getString(R.string.editor_time_open) : resources.getString(R.string.closed));
mOpen.setTextColor(
ContextCompat.getColor(mSearchFragment.getContext(), isOpen ? R.color.base_green : R.color.base_red));
} }
} }

View File

@@ -273,7 +273,8 @@ public class SearchFragment extends BaseMwmFragment implements SearchListener, C
RecyclerView mResults = mResultsFrame.findViewById(R.id.recycler); RecyclerView mResults = mResultsFrame.findViewById(R.id.recycler);
setRecyclerScrollListener(mResults); setRecyclerScrollListener(mResults);
mResultsPlaceholder = mResultsFrame.findViewById(R.id.placeholder); mResultsPlaceholder = mResultsFrame.findViewById(R.id.placeholder);
mResultsPlaceholder.setContent(R.string.search_not_found, R.string.search_not_found_query, R.drawable.ic_search_fail); mResultsPlaceholder.setContent(R.string.search_not_found, R.string.search_not_found_query,
R.drawable.ic_search_fail);
mSearchAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() mSearchAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver()
{ {

View File

@@ -5,15 +5,13 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.MwmApplication; import app.organicmaps.MwmApplication;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.routing.RoutingController; import app.organicmaps.sdk.routing.RoutingController;
import app.organicmaps.sdk.search.SearchRecents; import app.organicmaps.sdk.search.SearchRecents;
import app.organicmaps.util.Graphics; import app.organicmaps.util.Graphics;
import app.organicmaps.widget.SearchToolbarController; import app.organicmaps.widget.SearchToolbarController;
import com.google.android.material.textview.MaterialTextView;
class SearchHistoryAdapter extends RecyclerView.Adapter<SearchHistoryAdapter.ViewHolder> class SearchHistoryAdapter extends RecyclerView.Adapter<SearchHistoryAdapter.ViewHolder>
{ {

View File

@@ -8,14 +8,12 @@ import android.view.ViewGroup;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.google.android.material.materialswitch.MaterialSwitch;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.base.BaseMwmToolbarFragment; import app.organicmaps.base.BaseMwmToolbarFragment;
import app.organicmaps.sdk.routing.RoutingController; import app.organicmaps.sdk.routing.RoutingController;
import app.organicmaps.sdk.routing.RoutingOptions; import app.organicmaps.sdk.routing.RoutingOptions;
import app.organicmaps.sdk.settings.RoadType; import app.organicmaps.sdk.settings.RoadType;
import com.google.android.material.materialswitch.MaterialSwitch;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;

View File

@@ -90,8 +90,7 @@ public enum ThemeSwitcher
{ {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_YES); uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_YES);
else AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
if (RoutingController.get().isVehicleNavigation()) if (RoutingController.get().isVehicleNavigation())
style = MapStyle.VehicleDark; style = MapStyle.VehicleDark;
@@ -104,8 +103,7 @@ public enum ThemeSwitcher
{ {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_NO); uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_NO);
else AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
if (RoutingController.get().isVehicleNavigation()) if (RoutingController.get().isVehicleNavigation())
style = MapStyle.VehicleClear; style = MapStyle.VehicleClear;

View File

@@ -8,165 +8,165 @@ import android.graphics.Typeface;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
public abstract class BaseSignView extends View public abstract class BaseSignView extends View
{ {
private float mBorderWidthRatio = 0.1f; private float mBorderWidthRatio = 0.1f;
protected void setBorderWidthRatio(float ratio) { protected void setBorderWidthRatio(float ratio)
mBorderWidthRatio = ratio; {
} mBorderWidthRatio = ratio;
}
private float mBorderInsetRatio = 0f; private float mBorderInsetRatio = 0f;
protected void setBorderInsetRatio(float ratio) { protected void setBorderInsetRatio(float ratio)
mBorderInsetRatio = ratio; {
} mBorderInsetRatio = ratio;
}
// colors // colors
protected int mBackgroundColor; protected int mBackgroundColor;
protected int mBorderColor; protected int mBorderColor;
protected int mAlertColor; protected int mAlertColor;
protected int mTextColor; protected int mTextColor;
protected int mTextAlertColor; protected int mTextAlertColor;
// paints // paints
protected final Paint mBackgroundPaint; protected final Paint mBackgroundPaint;
protected final Paint mBorderPaint; protected final Paint mBorderPaint;
protected final Paint mTextPaint; protected final Paint mTextPaint;
// geometry // geometry
protected float mWidth; protected float mWidth;
protected float mHeight; protected float mHeight;
protected float mRadius; protected float mRadius;
protected float mBorderWidth; protected float mBorderWidth;
protected float mBorderRadius; protected float mBorderRadius;
public BaseSignView(Context ctx, @Nullable AttributeSet attrs) public BaseSignView(Context ctx, @Nullable AttributeSet attrs)
{
super(ctx, attrs);
mBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBorderPaint.setStyle(Paint.Style.STROKE);
mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mTextPaint.setTextAlign(Paint.Align.CENTER);
mTextPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
}
protected void setColors(int backgroundColor, int borderColor, int alertColor, int textColor, int textAlertColor)
{
mBackgroundColor = backgroundColor;
mBorderColor = borderColor;
mAlertColor = alertColor;
mTextColor = textColor;
mTextAlertColor = textAlertColor;
mBackgroundPaint.setColor(mBackgroundColor);
mBorderPaint.setColor(mBorderColor);
mTextPaint.setColor(mTextColor);
}
@Override
protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight)
{
super.onSizeChanged(width, height, oldWidth, oldHeight);
final float paddingX = getPaddingLeft() + getPaddingRight();
final float paddingY = getPaddingTop() + getPaddingBottom();
mWidth = width - paddingX;
mHeight = height - paddingY;
mRadius = Math.min(mWidth, mHeight) / 2f;
mBorderWidth = mRadius * mBorderWidthRatio;
// subtract half the stroke PLUS the extra inset
final float gap = mRadius * mBorderInsetRatio;
mBorderRadius = mRadius - (mBorderWidth / 2f) - gap;
configureTextSize();
}
@Override
protected void onDraw(@NonNull Canvas canvas)
{
super.onDraw(canvas);
final String str = getValueString();
if (str == null)
return;
final float cx = mWidth / 2f;
final float cy = mHeight / 2f;
// background & border
boolean alert = isAlert();
mBackgroundPaint.setColor(alert ? mAlertColor : mBackgroundColor);
canvas.drawCircle(cx, cy, mRadius, mBackgroundPaint);
if (!alert)
{ {
super(ctx, attrs); mBorderPaint.setStrokeWidth(mBorderWidth);
mBackgroundPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mBorderPaint.setColor(mBorderColor);
mBorderPaint = new Paint(Paint.ANTI_ALIAS_FLAG); canvas.drawCircle(cx, cy, mBorderRadius, mBorderPaint);
mBorderPaint.setStyle(Paint.Style.STROKE);
mTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mTextPaint.setTextAlign(Paint.Align.CENTER);
mTextPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
} }
protected void setColors(int backgroundColor, // text
int borderColor, mTextPaint.setColor(alert ? mTextAlertColor : mTextColor);
int alertColor, drawValueString(canvas, cx, cy, str);
int textColor, }
int textAlertColor)
@Override
public boolean onTouchEvent(@NonNull MotionEvent e)
{
final float cx = mWidth / 2f, cy = mHeight / 2f;
final float dx = e.getX() - cx, dy = e.getY() - cy;
if ((dx * dx) + (dy * dy) <= (mRadius * mRadius))
{ {
mBackgroundColor = backgroundColor; performClick();
mBorderColor = borderColor; return true;
mAlertColor = alertColor;
mTextColor = textColor;
mTextAlertColor = textAlertColor;
mBackgroundPaint.setColor(mBackgroundColor);
mBorderPaint.setColor(mBorderColor);
mTextPaint.setColor(mTextColor);
} }
return false;
}
@Override @Override
protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) { public boolean performClick()
super.onSizeChanged(width, height, oldWidth, oldHeight); {
final float paddingX = getPaddingLeft() + getPaddingRight(); super.performClick();
final float paddingY = getPaddingTop() + getPaddingBottom(); return false;
mWidth = width - paddingX; }
mHeight = height - paddingY;
mRadius = Math.min(mWidth, mHeight) / 2f;
mBorderWidth = mRadius * mBorderWidthRatio;
// subtract half the stroke PLUS the extra inset
final float gap = mRadius * mBorderInsetRatio;
mBorderRadius = mRadius - (mBorderWidth / 2f) - gap;
configureTextSize();
}
@Override private void drawValueString(Canvas c, float cx, float cy, String str)
protected void onDraw(@NonNull Canvas canvas) {
Rect b = new Rect();
mTextPaint.getTextBounds(str, 0, str.length(), b);
final float y = cy - b.exactCenterY();
c.drawText(str, cx, y, mTextPaint);
}
void configureTextSize()
{
String text = getValueString();
if (text == null)
return;
final float textRadius = mBorderRadius - mBorderWidth;
final float maxTextSize = 2f * textRadius;
final float maxTextSize2 = maxTextSize * maxTextSize;
float lo = 0f, hi = maxTextSize, sz = maxTextSize;
Rect b = new Rect();
while (lo <= hi)
{ {
super.onDraw(canvas); sz = (lo + hi) / 2f;
final String str = getValueString(); mTextPaint.setTextSize(sz);
if (str == null) return; mTextPaint.getTextBounds(text, 0, text.length(), b);
float area = b.width() * b.width() + b.height() * b.height();
final float cx = mWidth / 2f; if (area <= maxTextSize2)
final float cy = mHeight / 2f; lo = sz + 1f;
else
// background & border hi = sz - 1f;
boolean alert = isAlert();
mBackgroundPaint.setColor(alert ? mAlertColor : mBackgroundColor);
canvas.drawCircle(cx, cy, mRadius, mBackgroundPaint);
if (!alert)
{
mBorderPaint.setStrokeWidth(mBorderWidth);
mBorderPaint.setColor(mBorderColor);
canvas.drawCircle(cx, cy, mBorderRadius, mBorderPaint);
}
// text
mTextPaint.setColor(alert ? mTextAlertColor : mTextColor);
drawValueString(canvas, cx, cy, str);
} }
mTextPaint.setTextSize(Math.max(1f, sz));
}
@Override /** child must return the string to draw, or null if nothing */
public boolean onTouchEvent(@NonNull MotionEvent e) @Nullable
{ protected abstract String getValueString();
final float cx = mWidth / 2f, cy = mHeight / 2f;
final float dx = e.getX() - cx, dy = e.getY() - cy;
if ((dx * dx) + (dy * dy) <= (mRadius * mRadius))
{
performClick();
return true;
}
return false;
}
@Override /** child decides if this is in “alert” state */
public boolean performClick() protected abstract boolean isAlert();
{
super.performClick();
return false;
}
private void drawValueString(Canvas c, float cx, float cy, String str)
{
Rect b = new Rect();
mTextPaint.getTextBounds(str, 0, str.length(), b);
final float y = cy - b.exactCenterY();
c.drawText(str, cx, y, mTextPaint);
}
void configureTextSize()
{
String text = getValueString();
if (text == null) return;
final float textRadius = mBorderRadius - mBorderWidth;
final float maxTextSize = 2f * textRadius;
final float maxTextSize2 = maxTextSize * maxTextSize;
float lo = 0f, hi = maxTextSize, sz = maxTextSize;
Rect b = new Rect();
while (lo <= hi)
{
sz = (lo + hi) / 2f;
mTextPaint.setTextSize(sz);
mTextPaint.getTextBounds(text, 0, text.length(), b);
float area = b.width()*b.width() + b.height()*b.height();
if (area <= maxTextSize2)
lo = sz + 1f;
else
hi = sz - 1f;
}
mTextPaint.setTextSize(Math.max(1f, sz));
}
/** child must return the string to draw, or null if nothing */
@Nullable
protected abstract String getValueString();
/** child decides if this is in “alert” state */
protected abstract boolean isAlert();
} }

View File

@@ -4,9 +4,7 @@ import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.Pair; import android.util.Pair;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.util.StringUtils; import app.organicmaps.sdk.util.StringUtils;
@@ -22,18 +20,18 @@ public class CurrentSpeedView extends BaseSignView
setBorderWidthRatio(0.1f); setBorderWidthRatio(0.1f);
setBorderInsetRatio(0.05f); setBorderInsetRatio(0.05f);
try (TypedArray a = ctx.getTheme() try (TypedArray a = ctx.getTheme().obtainStyledAttributes(
.obtainStyledAttributes(attrs, R.styleable.CurrentSpeedView /* reuse same attrs or define new */ , 0, 0)) attrs, R.styleable.CurrentSpeedView /* reuse same attrs or define new */, 0, 0))
{ {
int bg = a.getColor(R.styleable.CurrentSpeedView_currentSpeedBackgroundColor, DefaultValues.BACKGROUND_COLOR); int bg = a.getColor(R.styleable.CurrentSpeedView_currentSpeedBackgroundColor, DefaultValues.BACKGROUND_COLOR);
int bd = a.getColor(R.styleable.CurrentSpeedView_currentSpeedBorderColor, DefaultValues.BORDER_COLOR); int bd = a.getColor(R.styleable.CurrentSpeedView_currentSpeedBorderColor, DefaultValues.BORDER_COLOR);
int tc = a.getColor(R.styleable.CurrentSpeedView_currentSpeedTextColor, DefaultValues.TEXT_COLOR); int tc = a.getColor(R.styleable.CurrentSpeedView_currentSpeedTextColor, DefaultValues.TEXT_COLOR);
setColors(bg, bd, 0, tc, 0); setColors(bg, bd, 0, tc, 0);
if (isInEditMode()) if (isInEditMode())
{ {
mSpeedMps = a.getInt(R.styleable.CurrentSpeedView_currentSpeedEditModeCurrentSpeed, 50); mSpeedMps = a.getInt(R.styleable.CurrentSpeedView_currentSpeedEditModeCurrentSpeed, 50);
mSpeedStr = Integer.toString((int)mSpeedMps); mSpeedStr = Integer.toString((int) mSpeedMps);
} }
} }
} }
@@ -47,7 +45,7 @@ public class CurrentSpeedView extends BaseSignView
} }
else else
{ {
Pair<String,String> su = StringUtils.nativeFormatSpeedAndUnits(mps); Pair<String, String> su = StringUtils.nativeFormatSpeedAndUnits(mps);
mSpeedStr = su.first; mSpeedStr = su.first;
} }
requestLayout(); requestLayout();
@@ -70,8 +68,8 @@ public class CurrentSpeedView extends BaseSignView
private interface DefaultValues private interface DefaultValues
{ {
int BACKGROUND_COLOR = 0xFFFFFFFF; int BACKGROUND_COLOR = 0xFFFFFFFF;
int BORDER_COLOR = 0xFF000000; int BORDER_COLOR = 0xFF000000;
int TEXT_COLOR = 0xFF000000; int TEXT_COLOR = 0xFF000000;
} }
} }

View File

@@ -12,12 +12,10 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.annotation.StringRes; import androidx.annotation.StringRes;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.util.UiUtils; import app.organicmaps.util.UiUtils;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
public class PlaceholderView extends LinearLayout public class PlaceholderView extends LinearLayout
{ {

View File

@@ -5,16 +5,14 @@ import android.content.res.TypedArray;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Paint; import android.graphics.Paint;
import android.util.AttributeSet; import android.util.AttributeSet;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import app.organicmaps.R; import app.organicmaps.R;
public class SpeedLimitView extends BaseSignView public class SpeedLimitView extends BaseSignView
{ {
private int mSpeedLimit = -1; private int mSpeedLimit = -1;
private boolean mAlert = false; private boolean mAlert = false;
private String mSpeedStr = "-1"; private String mSpeedStr = "-1";
private final int unlimitedBorderColor; private final int unlimitedBorderColor;
private final int unlimitedStripeColor; private final int unlimitedStripeColor;
@@ -27,15 +25,22 @@ public class SpeedLimitView extends BaseSignView
try (TypedArray styleAttrs = ctx.getTheme().obtainStyledAttributes(attrs, R.styleable.SpeedLimitView, 0, 0)) try (TypedArray styleAttrs = ctx.getTheme().obtainStyledAttributes(attrs, R.styleable.SpeedLimitView, 0, 0))
{ {
final int bgColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitBackgroundColor, DefaultValues.BACKGROUND_COLOR); final int bgColor =
final int borderColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitBorderColor, DefaultValues.BORDER_COLOR); styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitBackgroundColor, DefaultValues.BACKGROUND_COLOR);
final int alertColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitAlertColor, DefaultValues.ALERT_COLOR); final int borderColor =
final int textColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitTextColor, DefaultValues.TEXT_COLOR); styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitBorderColor, DefaultValues.BORDER_COLOR);
final int txtAlertColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitTextAlertColor, DefaultValues.TEXT_ALERT_COLOR); final int alertColor =
styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitAlertColor, DefaultValues.ALERT_COLOR);
final int textColor =
styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitTextColor, DefaultValues.TEXT_COLOR);
final int txtAlertColor =
styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitTextAlertColor, DefaultValues.TEXT_ALERT_COLOR);
setColors(bgColor, borderColor, alertColor, textColor, txtAlertColor); setColors(bgColor, borderColor, alertColor, textColor, txtAlertColor);
unlimitedBorderColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedBorderColor, DefaultValues.UNLIMITED_BORDER_COLOR); unlimitedBorderColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedBorderColor,
unlimitedStripeColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedStripeColor, DefaultValues.UNLIMITED_STRIPE_COLOR); DefaultValues.UNLIMITED_BORDER_COLOR);
unlimitedStripeColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedStripeColor,
DefaultValues.UNLIMITED_STRIPE_COLOR);
if (isInEditMode()) if (isInEditMode())
{ {
@@ -51,7 +56,7 @@ public class SpeedLimitView extends BaseSignView
if (mSpeedLimit != limit) if (mSpeedLimit != limit)
{ {
mSpeedLimit = limit; mSpeedLimit = limit;
mSpeedStr = Integer.toString(limit); mSpeedStr = Integer.toString(limit);
requestLayout(); requestLayout();
} }
mAlert = alert; mAlert = alert;
@@ -75,7 +80,7 @@ public class SpeedLimitView extends BaseSignView
@Override @Override
protected void onDraw(Canvas canvas) protected void onDraw(Canvas canvas)
{ {
final float cx = mWidth/2f, cy = mHeight/2f; final float cx = mWidth / 2f, cy = mHeight / 2f;
if (mSpeedLimit == 0) // 0 means unlimited speed (maxspeed=none) if (mSpeedLimit == 0) // 0 means unlimited speed (maxspeed=none)
{ {
@@ -105,7 +110,7 @@ public class SpeedLimitView extends BaseSignView
stripe.setStrokeWidth(mBorderWidth * 0.4f); stripe.setStrokeWidth(mBorderWidth * 0.4f);
final float radius = mRadius * 0.8f; // Shorten to 80% of full radius final float radius = mRadius * 0.8f; // Shorten to 80% of full radius
final float diag = (float) (1/Math.sqrt(2)); // 45 degrees final float diag = (float) (1 / Math.sqrt(2)); // 45 degrees
final float dx = -diag, dy = +diag; final float dx = -diag, dy = +diag;
final float px = -dy, py = +dx; // Perpendicular final float px = -dy, py = +dx; // Perpendicular
final float step = radius * 0.15f; // Spacing final float step = radius * 0.15f; // Spacing
@@ -122,14 +127,13 @@ public class SpeedLimitView extends BaseSignView
} }
} }
private interface DefaultValues private interface DefaultValues
{ {
int BACKGROUND_COLOR = 0xFFFFFFFF; int BACKGROUND_COLOR = 0xFFFFFFFF;
int BORDER_COLOR = 0xFFFF0000; int BORDER_COLOR = 0xFFFF0000;
int ALERT_COLOR = 0xFFFF0000; int ALERT_COLOR = 0xFFFF0000;
int TEXT_COLOR = 0xFF000000; int TEXT_COLOR = 0xFF000000;
int TEXT_ALERT_COLOR = 0xFFFFFFFF; int TEXT_ALERT_COLOR = 0xFFFFFFFF;
int UNLIMITED_BORDER_COLOR = 0xFF000000; int UNLIMITED_BORDER_COLOR = 0xFF000000;
int UNLIMITED_STRIPE_COLOR = 0xFF000000; int UNLIMITED_STRIPE_COLOR = 0xFF000000;
} }

View File

@@ -72,7 +72,7 @@ public class MyPositionButton
case LocationState.FOLLOW_AND_ROTATE -> R.drawable.ic_follow_and_rotate; case LocationState.FOLLOW_AND_ROTATE -> R.drawable.ic_follow_and_rotate;
default -> throw new IllegalArgumentException("Invalid button mode: " + mode); default -> throw new IllegalArgumentException("Invalid button mode: " + mode);
}; };
image = ResourcesCompat.getDrawable(resources, drawableRes, context.getTheme()); image = ResourcesCompat.getDrawable(resources, drawableRes, context.getTheme());
mIcons.put(mode, image); mIcons.put(mode, image);
} }

View File

@@ -1,9 +1,9 @@
package app.organicmaps.widget.placepage; package app.organicmaps.widget.placepage;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import app.organicmaps.sdk.util.StringUtils; import app.organicmaps.sdk.util.StringUtils;
import com.github.mikephil.charting.charts.BarLineChartBase; import com.github.mikephil.charting.charts.BarLineChartBase;
import androidx.annotation.Nullable;
import com.github.mikephil.charting.components.AxisBase; import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter; import com.github.mikephil.charting.formatter.IAxisValueFormatter;

View File

@@ -105,7 +105,8 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
public EditBookmarkFragment() {} public EditBookmarkFragment() {}
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState)
{
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NORMAL, R.style.MwmTheme_FullScreenDialog); setStyle(DialogFragment.STYLE_NORMAL, R.style.MwmTheme_FullScreenDialog);
} }
@@ -184,10 +185,9 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
{ {
super.onStart(); super.onStart();
Dialog dialog = getDialog(); Dialog dialog = getDialog();
if (dialog != null) { if (dialog != null)
dialog.getWindow().setLayout( {
ViewGroup.LayoutParams.MATCH_PARENT, dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
ViewGroup.LayoutParams.MATCH_PARENT);
} }
// Focus name and show keyboard for "Unknown Place" bookmarks // Focus name and show keyboard for "Unknown Place" bookmarks

View File

@@ -6,9 +6,6 @@ import android.widget.RelativeLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.core.widget.NestedScrollView; import androidx.core.widget.NestedScrollView;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.ChartController; import app.organicmaps.ChartController;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.Framework; import app.organicmaps.sdk.Framework;
@@ -17,6 +14,7 @@ import app.organicmaps.sdk.bookmarks.data.Track;
import app.organicmaps.sdk.bookmarks.data.TrackStatistics; import app.organicmaps.sdk.bookmarks.data.TrackStatistics;
import app.organicmaps.util.UiUtils; import app.organicmaps.util.UiUtils;
import app.organicmaps.util.Utils; import app.organicmaps.util.Utils;
import com.google.android.material.textview.MaterialTextView;
import java.util.Objects; import java.util.Objects;
public class ElevationProfileViewRenderer implements PlacePageStateListener public class ElevationProfileViewRenderer implements PlacePageStateListener

View File

@@ -14,7 +14,8 @@ public class OpenStateTextFormatter
return String.format(Locale.ROOT, "%02d:%02d", hour, minute); return String.format(Locale.ROOT, "%02d:%02d", hour, minute);
int h = hour % 12; int h = hour % 12;
if (h == 0) h = 12; if (h == 0)
h = 12;
String ampm = (hour < 12) ? "AM" : "PM"; String ampm = (hour < 12) ? "AM" : "PM";
return String.format(Locale.ROOT, "%d:%02d %s", h, minute, ampm); return String.format(Locale.ROOT, "%d:%02d %s", h, minute, ampm);
} }
@@ -29,21 +30,13 @@ public class OpenStateTextFormatter
return t.getDayOfWeek().getDisplayName(TextStyle.SHORT, locale); return t.getDayOfWeek().getDisplayName(TextStyle.SHORT, locale);
} }
static String buildAtLabel( static String buildAtLabel(boolean opens, boolean isToday, String dayShort, String time, String opensAtLocalized,
boolean opens, String closesAtLocalized, String opensDayAtLocalized, String closesDayAtLocalized)
boolean isToday,
String dayShort,
String time,
String opensAtLocalized,
String closesAtLocalized,
String opensDayAtLocalized,
String closesDayAtLocalized
)
{ {
if (isToday) if (isToday)
return opens ? String.format(Locale.ROOT, opensAtLocalized, time) // Opens at %s return opens ? String.format(Locale.ROOT, opensAtLocalized, time) // Opens at %s
: String.format(Locale.ROOT, closesAtLocalized, time); // Closes at %s : String.format(Locale.ROOT, closesAtLocalized, time); // Closes at %s
return opens ? String.format(Locale.ROOT, opensDayAtLocalized, dayShort, time) // Opens %s at %s return opens ? String.format(Locale.ROOT, opensDayAtLocalized, dayShort, time) // Opens %s at %s
: String.format(Locale.ROOT, closesDayAtLocalized, dayShort, time); // Closes %s at %s : String.format(Locale.ROOT, closesDayAtLocalized, dayShort, time); // Closes %s at %s
} }
} }

View File

@@ -80,6 +80,6 @@ public class PlacePageButtonFactory
yield R.drawable.ic_more; yield R.drawable.ic_more;
} }
}; };
return new PlacePageButton(titleId, iconId, buttonType); return new PlacePageButton(titleId, iconId, buttonType);
} }
} }

View File

@@ -31,7 +31,6 @@ import androidx.fragment.app.FragmentFactory;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import app.organicmaps.MwmActivity; import app.organicmaps.MwmActivity;
import app.organicmaps.MwmApplication; import app.organicmaps.MwmApplication;
import app.organicmaps.R; import app.organicmaps.R;
@@ -154,6 +153,7 @@ public class PlacePageView extends Fragment
private MaterialTextView mTvLastChecked; private MaterialTextView mTvLastChecked;
private View mEditPlace; private View mEditPlace;
private View mAddPlace; private View mAddPlace;
private View mMapTooOld;
private View mEditTopSpace; private View mEditTopSpace;
private ShapeableImageView mColorIcon; private ShapeableImageView mColorIcon;
private MaterialTextView mTvCategory; private MaterialTextView mTvCategory;
@@ -318,6 +318,7 @@ public class PlacePageView extends Fragment
mTvLastChecked = mFrame.findViewById(R.id.place_page_last_checked); mTvLastChecked = mFrame.findViewById(R.id.place_page_last_checked);
mEditPlace = mFrame.findViewById(R.id.ll__place_editor); mEditPlace = mFrame.findViewById(R.id.ll__place_editor);
mAddPlace = mFrame.findViewById(R.id.ll__place_add); mAddPlace = mFrame.findViewById(R.id.ll__place_add);
mMapTooOld = mFrame.findViewById(R.id.cv__map_too_old);
mEditTopSpace = mFrame.findViewById(R.id.edit_top_space); mEditTopSpace = mFrame.findViewById(R.id.edit_top_space);
latlon.setOnLongClickListener(this); latlon.setOnLongClickListener(this);
address.setOnLongClickListener(this); address.setOnLongClickListener(this);
@@ -684,42 +685,72 @@ public class PlacePageView extends Fragment
if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning()) if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning())
{ {
UiUtils.hide(mEditPlace, mAddPlace, mEditTopSpace); UiUtils.hide(mEditPlace, mAddPlace, mEditTopSpace, mMapTooOld);
} }
else else
{ {
UiUtils.showIf(Editor.nativeShouldShowEditPlace(), mEditPlace); UiUtils.showIf(Editor.nativeShouldShowEditPlace(), mEditPlace);
UiUtils.showIf(Editor.nativeShouldShowAddPlace(), mAddPlace); UiUtils.showIf(Editor.nativeShouldShowAddPlace(), mAddPlace);
UiUtils.hide(mMapTooOld);
MaterialButton mTvEditPlace = mEditPlace.findViewById(R.id.mb__place_editor); MaterialButton mTvEditPlace = mEditPlace.findViewById(R.id.mb__place_editor);
MaterialButton mTvAddPlace = mAddPlace.findViewById(R.id.mb__place_add); MaterialButton mTvAddPlace = mAddPlace.findViewById(R.id.mb__place_add);
mTvEditPlace.setOnClickListener(this);
mTvAddPlace.setOnClickListener(this); boolean shouldEnableEditPlace = Editor.nativeShouldEnableEditPlace();
mTvEditPlace.setEnabled(Editor.nativeShouldEnableEditPlace());
mTvAddPlace.setEnabled(Editor.nativeShouldEnableAddPlace()); if (shouldEnableEditPlace)
final int editTextButtonColor = {
Editor.nativeShouldEnableEditPlace() mTvEditPlace.setOnClickListener(this);
mTvAddPlace.setOnClickListener(this);
}
else
{
mTvEditPlace.setOnClickListener(
(v) -> { Utils.showSnackbar(v.getContext(), v.getRootView(), R.string.place_page_too_old_to_edit); });
mTvAddPlace.setOnClickListener(
(v) -> { Utils.showSnackbar(v.getContext(), v.getRootView(), R.string.place_page_too_old_to_edit); });
String countryId = MapManager.nativeGetSelectedCountry();
if (countryId != null)
{
CountryItem map = CountryItem.fill(countryId);
if (map.status == CountryItem.STATUS_UPDATABLE || map.status == CountryItem.STATUS_DONE
|| map.status == CountryItem.STATUS_FAILED)
{
UiUtils.show(mMapTooOld);
boolean canUpdateMap = map.status != CountryItem.STATUS_DONE;
MaterialButton mTvUpdateTooOldMap = mMapTooOld.findViewById(R.id.mb__update_too_old_map);
UiUtils.showIf(canUpdateMap, mTvUpdateTooOldMap);
MaterialTextView mapTooOldDescription = mMapTooOld.findViewById(R.id.tv__map_too_old_description);
if (canUpdateMap)
{
mapTooOldDescription.setText(R.string.place_page_map_too_old_description);
mTvUpdateTooOldMap.setOnClickListener((v) -> {
MapManagerHelper.warn3gAndDownload(requireActivity(), map.id, null);
UiUtils.hide(mMapTooOld);
});
}
else
mapTooOldDescription.setText(R.string.place_page_app_too_old_description);
}
}
}
final int editButtonColor =
shouldEnableEditPlace
? ContextCompat.getColor( ? ContextCompat.getColor(
getContext(), getContext(),
UiUtils.getStyledResourceId(getContext(), com.google.android.material.R.attr.colorSecondary)) UiUtils.getStyledResourceId(getContext(), com.google.android.material.R.attr.colorSecondary))
: ContextCompat.getColor(getContext(), R.color.button_accent_text_disabled); : ContextCompat.getColor(getContext(), R.color.button_accent_text_disabled);
final ColorStateList editStrokeButtonColor = new ColorStateList(
new int[][]{ mTvEditPlace.setTextColor(editButtonColor);
new int[]{android.R.attr.state_enabled}, // enabled mTvAddPlace.setTextColor(editButtonColor);
new int[]{-android.R.attr.state_enabled} // disabled mTvEditPlace.setStrokeColor(ColorStateList.valueOf(editButtonColor));
}, mTvAddPlace.setStrokeColor(ColorStateList.valueOf(editButtonColor));
new int[]{ UiUtils.showIf(UiUtils.isVisible(mEditPlace) || UiUtils.isVisible(mAddPlace), mEditTopSpace);
ContextCompat.getColor(
getContext(),
UiUtils.getStyledResourceId(getContext(), com.google.android.material.R.attr.colorSecondary)),
ContextCompat.getColor(getContext(), R.color.button_accent_text_disabled)
});
mTvEditPlace.setTextColor(editTextButtonColor);
mTvAddPlace.setTextColor(editTextButtonColor);
mTvEditPlace.setStrokeColor(editStrokeButtonColor);
mTvAddPlace.setStrokeColor(editStrokeButtonColor);
UiUtils.showIf(
UiUtils.isVisible(mEditPlace) || UiUtils.isVisible(mAddPlace),
mEditTopSpace);
} }
updateLinksView(); updateLinksView();
updateOpeningHoursView(); updateOpeningHoursView();
@@ -820,10 +851,9 @@ public class PlacePageView extends Fragment
} }
// Get colours // Get colours
final ForegroundColorSpan colorGreen = final ForegroundColorSpan colorGreen = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_green));
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_green));
final ForegroundColorSpan colorYellow = final ForegroundColorSpan colorYellow =
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_yellow)); new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_yellow));
final ForegroundColorSpan colorRed = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_red)); final ForegroundColorSpan colorRed = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_red));
// Get next state info // Get next state info
@@ -849,13 +879,12 @@ public class PlacePageView extends Fragment
if (nextStateTime > 0 && nextStateTime < Long.MAX_VALUE / 2) if (nextStateTime > 0 && nextStateTime < Long.MAX_VALUE / 2)
{ {
// NOTE: Timezone is currently device timezone. TODO: use feature-specific timezone. // NOTE: Timezone is currently device timezone. TODO: use feature-specific timezone.
nextChangeLocal = ZonedDateTime.ofInstant( nextChangeLocal = ZonedDateTime.ofInstant(Instant.ofEpochSecond(nextStateTime), ZoneId.systemDefault());
Instant.ofEpochSecond(nextStateTime), ZoneId.systemDefault()
);
hasFiniteNextChange = true; hasFiniteNextChange = true;
} }
} }
catch (Throwable ignored) {} catch (Throwable ignored)
{}
} }
if (!hasFiniteNextChange) // No valid next change if (!hasFiniteNextChange) // No valid next change
@@ -870,7 +899,7 @@ public class PlacePageView extends Fragment
} }
String localizedTimeString = OpenStateTextFormatter.formatHoursMinutes( String localizedTimeString = OpenStateTextFormatter.formatHoursMinutes(
nextChangeLocal.getHour(), nextChangeLocal.getMinute(), DateUtils.is24HourFormat(context)); nextChangeLocal.getHour(), nextChangeLocal.getMinute(), DateUtils.is24HourFormat(context));
final boolean shortHorizonClosing = isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_CLOSE_MIN; final boolean shortHorizonClosing = isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_CLOSE_MIN;
final boolean shortHorizonOpening = !isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_OPEN_MIN; final boolean shortHorizonOpening = !isOpen && minsToNextState >= 0 && minsToNextState <= SHORT_HORIZON_OPEN_MIN;
@@ -878,12 +907,12 @@ public class PlacePageView extends Fragment
if (shortHorizonClosing || shortHorizonOpening) // POI Opens/Closes in 60 mins • at 18:00 if (shortHorizonClosing || shortHorizonOpening) // POI Opens/Closes in 60 mins • at 18:00
{ {
final String minsToChangeStr = getResources().getQuantityString( final String minsToChangeStr = getResources().getQuantityString(
R.plurals.minutes_short, Math.max(minsToNextState, 1), Math.max(minsToNextState, 1)); R.plurals.minutes_short, Math.max(minsToNextState, 1), Math.max(minsToNextState, 1));
final String nextChangeFormatted = getString(isOpen ? R.string.closes_in : R.string.opens_in, minsToChangeStr); final String nextChangeFormatted = getString(isOpen ? R.string.closes_in : R.string.opens_in, minsToChangeStr);
openStateString.append(nextChangeFormatted, colorYellow, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE) openStateString.append(nextChangeFormatted, colorYellow, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
.append("") // Add spacer .append("") // Add spacer
.append(getString(R.string.at, localizedTimeString)); .append(getString(R.string.at, localizedTimeString));
} }
else else
{ {
@@ -893,18 +922,16 @@ public class PlacePageView extends Fragment
final String closesDayAtStr = getString(R.string.closes_day_at); // "Closes %1$s at %2$s" final String closesDayAtStr = getString(R.string.closes_day_at); // "Closes %1$s at %2$s"
final boolean isToday = final boolean isToday =
OpenStateTextFormatter.isSameLocalDate(nextChangeLocal, ZonedDateTime.now(nextChangeLocal.getZone())); OpenStateTextFormatter.isSameLocalDate(nextChangeLocal, ZonedDateTime.now(nextChangeLocal.getZone()));
// Full weekday name per design feedback. // Full weekday name per design feedback.
final String dayName = final String dayName = nextChangeLocal.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.getDefault());
nextChangeLocal.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.getDefault());
if (isOpen) // > 60 minutes OR negative (safety). Show “Open now • Closes at 18:00” if (isOpen) // > 60 minutes OR negative (safety). Show “Open now • Closes at 18:00”
{ {
openStateString.append(getString(R.string.open_now), colorGreen, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); openStateString.append(getString(R.string.open_now), colorGreen, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
final String atLabel = final String atLabel = OpenStateTextFormatter.buildAtLabel(
OpenStateTextFormatter.buildAtLabel(false, isToday, dayName, localizedTimeString, false, isToday, dayName, localizedTimeString, opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
if (!TextUtils.isEmpty(atLabel)) if (!TextUtils.isEmpty(atLabel))
openStateString.append("").append(atLabel); openStateString.append("").append(atLabel);
@@ -913,9 +940,8 @@ public class PlacePageView extends Fragment
{ {
openStateString.append(getString(R.string.closed_now), colorRed, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); openStateString.append(getString(R.string.closed_now), colorRed, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
final String atLabel = final String atLabel = OpenStateTextFormatter.buildAtLabel(
OpenStateTextFormatter.buildAtLabel(true, isToday, dayName, localizedTimeString, true, isToday, dayName, localizedTimeString, opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
if (!TextUtils.isEmpty(atLabel)) if (!TextUtils.isEmpty(atLabel))
openStateString.append("").append(atLabel); openStateString.append("").append(atLabel);

View File

@@ -3,9 +3,7 @@ package app.organicmaps.widget.placepage;
import androidx.lifecycle.LiveData; import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel; import androidx.lifecycle.ViewModel;
import app.organicmaps.sdk.bookmarks.data.MapObject; import app.organicmaps.sdk.bookmarks.data.MapObject;
import java.util.List; import java.util.List;
public class PlacePageViewModel extends ViewModel public class PlacePageViewModel extends ViewModel

View File

@@ -31,7 +31,8 @@ import app.organicmaps.widget.placepage.PlacePageViewModel;
import com.google.android.material.textview.MaterialTextView; import com.google.android.material.textview.MaterialTextView;
public class PlacePageBookmarkFragment extends Fragment implements View.OnClickListener, View.OnLongClickListener, public class PlacePageBookmarkFragment extends Fragment implements View.OnClickListener, View.OnLongClickListener,
Observer<MapObject>, EditBookmarkFragment.EditBookmarkListener Observer<MapObject>,
EditBookmarkFragment.EditBookmarkListener
{ {
private View mFrame; private View mFrame;
private MaterialTextView mTvBookmarkNote; private MaterialTextView mTvBookmarkNote;

View File

@@ -13,15 +13,13 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelProvider;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
import app.organicmaps.R; import app.organicmaps.R;
import app.organicmaps.sdk.Framework; import app.organicmaps.sdk.Framework;
import app.organicmaps.sdk.bookmarks.data.ChargeSocketDescriptor; import app.organicmaps.sdk.bookmarks.data.ChargeSocketDescriptor;
import app.organicmaps.sdk.bookmarks.data.MapObject; import app.organicmaps.sdk.bookmarks.data.MapObject;
import app.organicmaps.widget.placepage.PlacePageViewModel; import app.organicmaps.widget.placepage.PlacePageViewModel;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
import java.text.DecimalFormat; import java.text.DecimalFormat;
public class PlacePageChargeSocketsFragment extends Fragment implements Observer<MapObject> public class PlacePageChargeSocketsFragment extends Fragment implements Observer<MapObject>
@@ -96,8 +94,8 @@ public class PlacePageChargeSocketsFragment extends Fragment implements Observer
} }
@SuppressLint("DiscouragedApi") @SuppressLint("DiscouragedApi")
int resTypeId = int resTypeId = getResources().getIdentifier("charge_socket_" + socket.visualType(), "string",
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName()); requireContext().getPackageName());
if (resTypeId != 0) if (resTypeId != 0)
{ {
type.setText(resTypeId); type.setText(resTypeId);
@@ -108,7 +106,8 @@ public class PlacePageChargeSocketsFragment extends Fragment implements Observer
DecimalFormat df = new DecimalFormat("#.##"); DecimalFormat df = new DecimalFormat("#.##");
power.setText(getString(R.string.kw_label, df.format(socket.power()))); power.setText(getString(R.string.kw_label, df.format(socket.power())));
} }
else if (socket.ignorePower()) { else if (socket.ignorePower())
{
power.setVisibility(INVISIBLE); power.setVisibility(INVISIBLE);
} }

View File

@@ -191,8 +191,9 @@ public class PlacePageLinksFragment extends Fragment implements Observer<MapObje
case FMD_PANORAMAX -> null; // Don't add raw ID to list, as it's useless for users. case FMD_PANORAMAX -> null; // Don't add raw ID to list, as it's useless for users.
default -> mMapObject.getMetadata(type); default -> mMapObject.getMetadata(type);
}; };
// Add user names for social media if available // Add user names for social media if available
if (!TextUtils.isEmpty(title) && !title.equals(url) && !title.contains("/")) items.add(title); if (!TextUtils.isEmpty(title) && !title.equals(url) && !title.contains("/"))
items.add(title);
if (items.size() == 1) if (items.size() == 1)
PlacePageUtils.copyToClipboard(requireContext(), mFrame, items.get(0)); PlacePageUtils.copyToClipboard(requireContext(), mFrame, items.get(0));

View File

@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M453,680L513,680L513,440L453,440L453,680ZM479.98,366Q494,366 503.5,356.8Q513,347.6 513,334Q513,319.55 503.52,309.78Q494.04,300 480.02,300Q466,300 456.5,309.78Q447,319.55 447,334Q447,347.6 456.48,356.8Q465.96,366 479.98,366ZM480.27,880Q397.53,880 324.77,848.5Q252,817 197.5,762.5Q143,708 111.5,635.16Q80,562.32 80,479.5Q80,396.68 111.5,323.84Q143,251 197.5,197Q252,143 324.84,111.5Q397.68,80 480.5,80Q563.32,80 636.16,111.5Q709,143 763,197Q817,251 848.5,324Q880,397 880,479.73Q880,562.47 848.5,635.23Q817,708 763,762.32Q709,816.63 636,848.32Q563,880 480.27,880ZM480.5,820Q622,820 721,720.5Q820,621 820,479.5Q820,338 721.19,239Q622.38,140 480,140Q339,140 239.5,238.81Q140,337.62 140,480Q140,621 239.5,720.5Q339,820 480.5,820ZM480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Q480,480 480,480Z"/>
</vector>

View File

@@ -33,9 +33,13 @@
style="@style/MwmWidget.TextView.NavStreet" style="@style/MwmWidget.TextView.NavStreet"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:padding="@dimen/margin_quarter_plus"
android:maxLines="2" android:maxLines="2"
android:layout_gravity="center_horizontal" android:layout_gravity="center_vertical"
android:gravity="center" android:gravity="center"
android:autoSizeTextType="uniform"
android:autoSizeMinTextSize="16sp"
android:autoSizeMaxTextSize="25sp"
android:textColor="@android:color/white" android:textColor="@android:color/white"
tools:text="Sample street name.\nLong looooooooong!!!!"/> tools:text="Sample street name.\nLong looooooooong!!!!"/>
</RelativeLayout> </RelativeLayout>

View File

@@ -26,7 +26,7 @@
app:tint="?colorSecondary"/> app:tint="?colorSecondary"/>
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/head_message" android:id="@+id/head_message"
style="?fontHeadline6" style="@style/TextAppearance.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_base" android:layout_marginTop="@dimen/margin_base"
@@ -36,7 +36,7 @@
android:text="@string/download_map_title" /> android:text="@string/download_map_title" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/download_message" android:id="@+id/download_message"
style="?fontBody2" style="@style/TextAppearance.Body2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base" android:layout_marginStart="@dimen/margin_base"

View File

@@ -28,7 +28,7 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:text="@string/aa_connected_title" android:text="@string/aa_connected_title"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4" android:textAppearance="@style/TextAppearance.Headline4"
android:textStyle="bold" /> android:textStyle="bold" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
@@ -36,7 +36,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/car_used_on_the_car_screen" android:text="@string/car_used_on_the_car_screen"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" /> android:textAppearance="@style/TextAppearance.Body1" />
</LinearLayout> </LinearLayout>
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton

View File

@@ -20,7 +20,7 @@
android:layout_marginStart="32dp" android:layout_marginStart="32dp"
android:text="@string/aa_request_permission_activity_text" android:text="@string/aa_request_permission_activity_text"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4" android:textAppearance="@style/TextAppearance.Headline4"
android:textStyle="bold" /> android:textStyle="bold" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton

View File

@@ -22,7 +22,7 @@
android:layout_marginStart="@dimen/margin_base" android:layout_marginStart="@dimen/margin_base"
android:maxLines="3" android:maxLines="3"
android:ellipsize="end" android:ellipsize="end"
android:textAppearance="?fontHeadline6" android:textAppearance="@style/TextAppearance.Headline6"
tools:text="Title" /> tools:text="Title" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView

View File

@@ -12,7 +12,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_base" android:layout_marginStart="@dimen/margin_base"
android:text="@string/download_country_ask" android:text="@string/download_country_ask"
android:textAppearance="?fontBody2" android:textAppearance="@style/TextAppearance.Body2"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"/> tools:visibility="visible"/>
<com.google.android.material.progressindicator.LinearProgressIndicator <com.google.android.material.progressindicator.LinearProgressIndicator

View File

@@ -14,7 +14,6 @@
android:textAppearance="@style/MwmTextAppearance.Title" /> android:textAppearance="@style/MwmTextAppearance.Title" />
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/et__input_layout" android:id="@+id/et__input_layout"
style="?fontBody1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:hintEnabled="false"> app:hintEnabled="false">

View File

@@ -27,7 +27,7 @@
android:layout_marginTop="@dimen/margin_base"> android:layout_marginTop="@dimen/margin_base">
<RadioButton <RadioButton
style="?fontSubtitle1" style="@style/TextAppearance.Subtitle1"
android:id="@+id/sort_by_default" android:id="@+id/sort_by_default"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -37,7 +37,7 @@
app:buttonTint="@null"/> app:buttonTint="@null"/>
<RadioButton <RadioButton
style="?fontSubtitle1" style="@style/TextAppearance.Subtitle1"
android:id="@+id/sort_by_name" android:id="@+id/sort_by_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -47,7 +47,7 @@
app:buttonTint="@null"/> app:buttonTint="@null"/>
<RadioButton <RadioButton
style="?fontSubtitle1" style="@style/TextAppearance.Subtitle1"
android:id="@+id/sort_by_type" android:id="@+id/sort_by_type"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -57,7 +57,7 @@
app:buttonTint="@null"/> app:buttonTint="@null"/>
<RadioButton <RadioButton
style="?fontSubtitle1" style="@style/TextAppearance.Subtitle1"
android:id="@+id/sort_by_distance" android:id="@+id/sort_by_distance"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -67,7 +67,7 @@
app:buttonTint="@null"/> app:buttonTint="@null"/>
<RadioButton <RadioButton
style="?fontSubtitle1" style="@style/TextAppearance.Subtitle1"
android:id="@+id/sort_by_time" android:id="@+id/sort_by_time"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@@ -17,7 +17,6 @@
android:orientation="vertical"> android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/edit_bookmark_name_input" android:id="@+id/edit_bookmark_name_input"
style="?fontBody1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/name" android:hint="@string/name"
@@ -88,7 +87,6 @@
tools:src="@drawable/ic_bookmark_none" /> tools:src="@drawable/ic_bookmark_none" />
</RelativeLayout> </RelativeLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
style="?fontBody1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_half" android:layout_marginEnd="@dimen/margin_half"

View File

@@ -17,7 +17,7 @@
android:layout_marginEnd="@dimen/margin_base" android:layout_marginEnd="@dimen/margin_base"
android:paddingTop="@dimen/margin_half" android:paddingTop="@dimen/margin_half"
android:paddingBottom="@dimen/margin_base" android:paddingBottom="@dimen/margin_base"
android:textAppearance="?fontHeadline6" android:textAppearance="@style/TextAppearance.Headline6"
tools:text="Xindian Shitoushan Trail" /> tools:text="Xindian Shitoushan Trail" />
<include <include
layout="@layout/item_divider" layout="@layout/item_divider"

View File

@@ -30,12 +30,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="@dimen/margin_base" android:padding="@dimen/margin_base"
android:background="?colorPrimary"> android:background="?colorPrimary">
<ProgressBar <com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/user_profile_loading" android:id="@+id/user_profile_loading"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:trackColor="@color/text_light"
app:indicatorColor="@color/text_light"
android:layout_gravity="center" android:layout_gravity="center"
android:indeterminateTint="@color/text_light" android:indeterminate="true"
android:visibility="invisible" android:visibility="invisible"
tools:visibility="visible" /> tools:visibility="visible" />
<LinearLayout <LinearLayout

View File

@@ -10,12 +10,12 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" /> android:visibility="gone" />
<ProgressBar <com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progress" android:id="@+id/progress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" /> android:layout_gravity="center"
android:indeterminate="true"/>
<include <include
layout="@layout/feedback_fab" layout="@layout/feedback_fab"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -16,7 +16,7 @@
android:layout_marginStart="@dimen/margin_base" android:layout_marginStart="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_base" android:layout_marginTop="@dimen/margin_base"
android:text="@string/layers_title" android:text="@string/layers_title"
android:textAppearance="?fontHeadline6" android:textAppearance="@style/TextAppearance.Headline6"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton

View File

@@ -10,12 +10,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone"/> android:visibility="gone"/>
<ProgressBar <com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progress" android:id="@+id/progress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"/> android:layout_gravity="center"
android:indeterminate="true"/>
<include layout="@layout/shadow_top"/> <include layout="@layout/shadow_top"/>
</FrameLayout> </FrameLayout>

View File

@@ -24,6 +24,6 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:fontFamily="@string/robotoMedium" android:fontFamily="@string/robotoMedium"
tools:text="Some text should go here" tools:text="Some text should go here"
android:textAppearance="@style/MwmTextAppearance.Body3" android:textAppearance="@style/MwmTextAppearance.Body1"
android:textColor="?colorSecondary"/> android:textColor="?colorSecondary"/>
</LinearLayout> </LinearLayout>

View File

@@ -30,7 +30,7 @@
android:ellipsize="middle" android:ellipsize="middle"
android:singleLine="true" android:singleLine="true"
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textAppearance="?fontBody1" android:textAppearance="@style/TextAppearance.Body1"
tools:text="Bookmark name looooooooooooooooooongasdasdasd" /> tools:text="Bookmark name looooooooooooooooooongasdasdasd" />
<LinearLayout <LinearLayout
android:id="@+id/bottom_line_container" android:id="@+id/bottom_line_container"

View File

@@ -25,7 +25,7 @@
android:layout_marginEnd="@dimen/bookmark_collection_item_end_margin" android:layout_marginEnd="@dimen/bookmark_collection_item_end_margin"
android:ellipsize="middle" android:ellipsize="middle"
android:singleLine="true" android:singleLine="true"
android:textAppearance="?fontBody1" android:textAppearance="@style/TextAppearance.Body1"
tools:text="Bookmark name looooooooooooooooooongasdasdasd" /> tools:text="Bookmark name looooooooooooooooooongasdasdasd" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/size" android:id="@+id/size"
@@ -37,7 +37,7 @@
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
style="?fontBody2" style="@style/TextAppearance.Body2"
tools:text="42000000" /> tools:text="42000000" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@@ -12,7 +12,7 @@
android:paddingBottom="@dimen/margin_half_plus"> android:paddingBottom="@dimen/margin_half_plus">
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/text_message" android:id="@+id/text_message"
style="?fontHeadline6" style="@style/TextAppearance.Headline6"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"

View File

@@ -25,7 +25,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="start|bottom" android:layout_gravity="start|bottom"
android:background="@android:color/transparent"
android:clickable="true" android:clickable="true"
android:gravity="start|top" android:gravity="start|top"
android:text="@string/category_desc_more" android:text="@string/category_desc_more"

View File

@@ -2,7 +2,7 @@
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text" android:id="@+id/text"
style="?fontHeadline6" style="@style/TextAppearance.Headline6"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?windowBackgroundForced" android:background="?windowBackgroundForced"

View File

@@ -14,7 +14,7 @@
android:gravity="center" android:gravity="center"
android:maxWidth="500dp" android:maxWidth="500dp"
android:text="@string/editor_category_unsuitable_title" android:text="@string/editor_category_unsuitable_title"
android:textAppearance="@style/TextAppearance.MdcTypographyStyles.Headline6" android:textAppearance="@style/TextAppearance.Headline6"
android:textStyle="bold" /> android:textStyle="bold" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/editor_category_unsuitable_text" android:id="@+id/editor_category_unsuitable_text"

View File

@@ -4,18 +4,16 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/name" android:id="@+id/name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/editor_height_field" android:layout_height="wrap_content"
android:animateLayoutChanges="true" android:animateLayoutChanges="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_layout" android:id="@+id/input_layout"
style="?fontBody1"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:hint="@string/editor_edit_place_name_hint" android:hint="@string/editor_edit_place_name_hint">
android:textColorHint="?android:textColorSecondary">
<com.google.android.material.textfield.TextInputEditText <com.google.android.material.textfield.TextInputEditText
android:id="@+id/input" android:id="@+id/input"
style="@style/MwmWidget.Editor.FieldLayout.EditText" style="@style/MwmWidget.Editor.FieldLayout.EditText"
@@ -31,5 +29,5 @@
android:background="?selectableItemBackgroundBorderless" android:background="?selectableItemBackgroundBorderless"
android:padding="@dimen/margin_half_plus" android:padding="@dimen/margin_half_plus"
app:srcCompat="@drawable/ic_close" app:srcCompat="@drawable/ic_close"
app:tint="@color/base_red" /> app:tint="?iconTint" />
</LinearLayout> </LinearLayout>

View File

@@ -147,12 +147,12 @@
<LinearLayout <LinearLayout
android:id="@+id/allday" android:id="@+id/allday"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/editor_height_allday" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:background="?clickableBackground" android:background="?clickableBackground"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="@dimen/margin_half_plus"> android:padding="@dimen/margin_half">
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="0dp" android:layout_width="0dp"
@@ -164,7 +164,8 @@
<com.google.android.material.materialswitch.MaterialSwitch <com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/sw__allday" android:id="@+id/sw__allday"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_quarter"/>
</LinearLayout> </LinearLayout>

View File

@@ -29,7 +29,7 @@
android:layout_marginTop="@dimen/margin_base" android:layout_marginTop="@dimen/margin_base"
android:layout_marginEnd="@dimen/bookmark_collection_item_end_margin" android:layout_marginEnd="@dimen/bookmark_collection_item_end_margin"
android:singleLine="true" android:singleLine="true"
android:textAppearance="?fontBody1" android:textAppearance="@style/TextAppearance.Body1"
tools:text="@string/tracks_title" /> tools:text="@string/tracks_title" />
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/tv__bookmark_distance" android:id="@+id/tv__bookmark_distance"
@@ -39,7 +39,7 @@
android:layout_marginBottom="@dimen/margin_half_plus" android:layout_marginBottom="@dimen/margin_half_plus"
android:singleLine="true" android:singleLine="true"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:textAppearance="?fontBody2" android:textAppearance="@style/TextAppearance.Body2"
tools:text="@string/by_distance" /> tools:text="@string/by_distance" />
</LinearLayout> </LinearLayout>
<com.google.android.material.imageview.ShapeableImageView <com.google.android.material.imageview.ShapeableImageView

View File

@@ -35,6 +35,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:maxLines="2" android:maxLines="2"
android:padding="@dimen/margin_half"
android:autoSizeTextType="uniform"
android:autoSizeMinTextSize="19sp"
android:autoSizeMaxTextSize="24sp"
android:minHeight="60dp" android:minHeight="60dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:gravity="center" android:gravity="center"

View File

@@ -34,8 +34,7 @@
android:textAppearance="?android:attr/textAppearance" android:textAppearance="?android:attr/textAppearance"
android:gravity="start|top" android:gravity="start|top"
android:textColor="?attr/colorSecondary" android:textColor="?attr/colorSecondary"
android:text="@string/category_desc_more" android:text="@string/category_desc_more" />
android:background="@android:color/transparent"/>
<include <include
layout="@layout/item_divider"/> layout="@layout/item_divider"/>
</LinearLayout> </LinearLayout>

View File

@@ -82,13 +82,15 @@
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/place_page_last_checked" android:id="@+id/place_page_last_checked"
style="?fontCaption" style="@style/TextAppearance.Caption"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="@dimen/margin_half" android:paddingBottom="@dimen/margin_half"
android:paddingHorizontal="@dimen/margin_base" android:paddingHorizontal="@dimen/margin_base"
tools:text="Existence confirmed 1 month ago"/> tools:text="Existence confirmed 1 month ago"/>
<include android:visibility="gone" layout="@layout/place_page_map_too_old"/>
<include android:visibility="gone" layout="@layout/place_page_editor"/> <include android:visibility="gone" layout="@layout/place_page_editor"/>
<include android:visibility="gone" layout="@layout/place_page_add"/> <include android:visibility="gone" layout="@layout/place_page_add"/>

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/cv__map_too_old"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_half"
app:strokeWidth="1dp"
app:strokeColor="@color/base_accent"
app:cardBackgroundColor="@color/bg_cards">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="@dimen/margin_base"
android:gravity="center_vertical">
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginEnd="@dimen/margin_base"
app:srcCompat="@drawable/info_icon"
app:tint="@color/base_accent" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<com.google.android.material.textview.MaterialTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_quarter"
android:text="@string/place_page_map_too_old_title"
android:textAppearance="@style/MwmTextAppearance.Body2"
android:textStyle="bold"
android:textColor="?android:textColorPrimary" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tv__map_too_old_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_quarter"
android:text="@string/place_page_map_too_old_description"
android:fontFamily="@string/robotoRegular"
android:textAppearance="@style/MwmTextAppearance.Body3"
android:textColor="?android:textColorPrimary" />
<com.google.android.material.button.MaterialButton
android:id="@+id/mb__update_too_old_map"
style="@style/MwmWidget.M3.Button.Primary"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="end"
android:text="@string/place_page_update_too_old_map"/>
</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>

View File

@@ -65,7 +65,7 @@
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/oh_check_date" android:id="@+id/oh_check_date"
style="?fontCaption" style="@style/TextAppearance.Caption"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"

View File

@@ -6,11 +6,10 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ProgressBar <com.google.android.material.progressindicator.CircularProgressIndicator
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@null" /> android:indeterminate="true"/>
<com.google.android.material.textview.MaterialTextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@@ -6,9 +6,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:contentDescription="@string/search_show_on_map" android:contentDescription="@string/search_show_on_map"
style="@style/FAB" style="@style/MwmWidget.ExtendedFAB"
app:icon="@drawable/ic_show_on_map" app:icon="@drawable/ic_show_on_map"
android:text="@string/search_show_on_map" android:text="@string/search_show_on_map"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true" />
app:fabSize="mini"/>

View File

@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ProgressBar <com.google.android.material.progressindicator.CircularProgressIndicator
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Widget.AppCompat.ProgressBar" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="@dimen/height_block_base" android:layout_width="@dimen/height_block_base"
android:layout_height="@dimen/height_block_base" android:layout_height="@dimen/height_block_base"
android:padding="@dimen/margin_half" android:padding="@dimen/margin_half"
android:background="@null"/> android:indeterminate="true"
app:trackColor="@color/text_light"
app:indicatorColor="@color/text_light" />

View File

@@ -34,16 +34,17 @@
android:singleLine="true" android:singleLine="true"
android:textCursorDrawable="@drawable/cursor_drawable" /> android:textCursorDrawable="@drawable/cursor_drawable" />
<ProgressBar <com.google.android.material.progressindicator.CircularProgressIndicator
android:id="@+id/progress" android:id="@+id/progress"
style="@style/Widget.AppCompat.ProgressBar"
android:layout_width="@dimen/search_progress_size" android:layout_width="@dimen/search_progress_size"
android:layout_height="@dimen/search_progress_size" android:layout_height="@dimen/search_progress_size"
android:layout_marginEnd="@dimen/margin_half" android:layout_marginEnd="@dimen/margin_half"
android:layout_weight="0" android:layout_weight="0"
android:background="@null"
android:minHeight="@dimen/search_progress_size" android:minHeight="@dimen/search_progress_size"
android:minWidth="@dimen/search_progress_size"/> android:minWidth="@dimen/search_progress_size"
app:trackColor="@color/text_light"
app:indicatorColor="@color/text_light"
android:indeterminate="true"/>
<com.google.android.material.imageview.ShapeableImageView <com.google.android.material.imageview.ShapeableImageView
android:id="@+id/clear" android:id="@+id/clear"

View File

@@ -295,7 +295,7 @@
<!-- location service disabled --> <!-- location service disabled -->
<string name="enable_location_services">Activeu els serveis de geolocalització</string> <string name="enable_location_services">Activeu els serveis de geolocalització</string>
<string name="save">Desa</string> <string name="save">Desa</string>
<string name="create">crea</string> <string name="create">Crear</string>
<!-- red color --> <!-- red color -->
<string name="red">Vermell</string> <string name="red">Vermell</string>
<!-- yellow color --> <!-- yellow color -->
@@ -473,7 +473,7 @@
<string name="error_enter_correct_house_number">Introduïu un número dedifici vàlid</string> <string name="error_enter_correct_house_number">Introduïu un número dedifici vàlid</string>
<!-- Error message in Editor when a user tries to set the number of floors for a building higher than %d floors --> <!-- Error message in Editor when a user tries to set the number of floors for a building higher than %d floors -->
<string name="error_enter_correct_storey_number">El nombre de plantes no pot excedir de %d</string> <string name="error_enter_correct_storey_number">El nombre de plantes no pot excedir de %d</string>
<string name="editor_zip_code">Codi postal</string> <string name="editor_zip_code">Codi Postal</string>
<string name="error_enter_correct_zip_code">Introduïu un codi postal vàlid</string> <string name="error_enter_correct_zip_code">Introduïu un codi postal vàlid</string>
<!-- Title for OSM note section in the editor --> <!-- Title for OSM note section in the editor -->
<string name="editor_other_info">Nota per als voluntaris d\'OpenStreetMap (opcional)</string> <string name="editor_other_info">Nota per als voluntaris d\'OpenStreetMap (opcional)</string>
@@ -521,8 +521,8 @@
<!-- Displayed when saving some edits to the map to warn against publishing personal data --> <!-- Displayed when saving some edits to the map to warn against publishing personal data -->
<string name="editor_share_to_all_dialog_title">Voleu enviar-ho a tots els usuaris?</string> <string name="editor_share_to_all_dialog_title">Voleu enviar-ho a tots els usuaris?</string>
<!-- Dialog before publishing the modifications to the public map. --> <!-- Dialog before publishing the modifications to the public map. -->
<string name="editor_share_to_all_dialog_message_1">Assegureu-vos que no heu introduït cap dada personal</string> <string name="editor_share_to_all_dialog_message_1">Assegureu-vos que no heu introduït cap dada personal.</string>
<string name="editor_share_to_all_dialog_message_2">Revisarem els canvis. Si tenim cap pregunta contactem amb vós via correu electrònic</string> <string name="editor_share_to_all_dialog_message_2">Els editors d\'OpenStreetMap revisaran els canvis. Et contactaran si tenen cap pregunta.</string>
<string name="navigation_stop_button">Atura</string> <string name="navigation_stop_button">Atura</string>
<!-- Shown as toast when starting the recent track recording --> <!-- Shown as toast when starting the recent track recording -->
<string name="track_recording">Sestà enregistrant el recorregut</string> <string name="track_recording">Sestà enregistrant el recorregut</string>
@@ -875,4 +875,41 @@
<string name="delete_track_dialog_title">Voleu eliminar %s?</string> <string name="delete_track_dialog_title">Voleu eliminar %s?</string>
<string name="pref_tts_no_system_tts_short">No s\'ha trobat cap motor de text a veu, comproveu la configuració de l\'app</string> <string name="pref_tts_no_system_tts_short">No s\'ha trobat cap motor de text a veu, comproveu la configuració de l\'app</string>
<string name="offline_explanation_title">Mapes sense Connexió</string> <string name="offline_explanation_title">Mapes sense Connexió</string>
<string name="charge_socket_schuko">EU Domèstic</string>
<string name="unknown_socket_type">endoll desconegut</string>
<string name="edit_socket_info_tooltip">Crea nous endolls o edita els existents.</string>
<string name="charging_station_available_sockets">Endolls disponibles</string>
<string name="charge_socket_unknown_other">Altres o desconegut</string>
<string name="charge_socket_count">Recompte</string>
<string name="charge_socket_power">Potència (kW)</string>
<string name="editor_socket">Editar endoll</string>
<string name="unknown_count">desconegut</string>
<string name="error_value_must_be_positive">El valor ha de ser positiu</string>
<string name="error_invalid_number">Número invàlid</string>
<string name="offline_explanation_text">Un mapa ha de ser desconegut per a veure i navegar l\'àrea.\nDescarrega mapes per a àrees on vulgues viatjar.</string>
<string name="list_description_empty">Edita la llista per afegir una descripció</string>
<string name="opens_at">Obre a %s</string>
<string name="closes_at">Tanca a %s</string>
<string name="opens_day_at">Obre els %1$s a %2$s</string>
<string name="closes_day_at">Tanca els %1$s a %2$s</string>
<plurals name="minutes_short">
<item quantity="one">%d min</item>
<item quantity="many">%d mins</item>
<item quantity="other">%d mins</item>
</plurals>
<string name="editor_place_doesnt_exist_description">Descriu com és el lloc ara mateix per enviar una nota d\'error a la comunitat d\'OpenStreetMap</string>
<string name="editor_business_vacant_button">El negoci està vacant</string>
<string name="editor_mark_business_vacant_title">Marcar negoci com a vacant</string>
<string name="editor_mark_business_vacant_description">Fes servir aquesta funció si el negoci s\'ha mogut, i l\'espai està buit i llest per a un altre llogater.</string>
<string name="editor_submit">Enviar</string>
<string name="power_management">Gestió de Potència</string>
<string name="avoid_steps">Evita escales</string>
<string name="avoid_paved">Evita carreteres asfaltades</string>
<string name="unknown_power_output">desconegut</string>
<string name="charge_socket_type2">Tipus 2 (sense cable)</string>
<string name="charge_socket_type2_cable">Tipus 2 (amb cable)</string>
<string name="charge_socket_type2_combo">Tipus 2 comb.</string>
<string name="charge_socket_type1">Tipus 1</string>
<string name="charge_socket_nacs">NACS</string>
<string name="charge_socket_chademo">CHAdeMO</string>
</resources> </resources>

View File

@@ -905,4 +905,6 @@
</plurals> </plurals>
<string name="power_management">Správa výkonu</string> <string name="power_management">Správa výkonu</string>
<string name="charge_socket_schuko">Domovní EU</string> <string name="charge_socket_schuko">Domovní EU</string>
<string name="prefs_speed_cameras_information">Upozornění na radary jsou vypnuty v zemích, kde je tato funkcionalita zakázána místními zákony.</string>
<string name="navigation_start_tts_message">"Spouštím navigaci, jazyk hlasových instrukcí: "</string>
</resources> </resources>

View File

@@ -607,7 +607,7 @@
<!-- Recommended length for CarPlay and Android Auto is around 25-27 characters --> <!-- Recommended length for CarPlay and Android Auto is around 25-27 characters -->
<string name="avoid_tolls">Undgå betalingsveje</string> <string name="avoid_tolls">Undgå betalingsveje</string>
<!-- Recommended length for CarPlay and Android Auto is around 25-27 characters --> <!-- Recommended length for CarPlay and Android Auto is around 25-27 characters -->
<string name="avoid_unpaved">Undgå ikke-asfalterede veje</string> <string name="avoid_unpaved">Undgå veje uden fast belægning</string>
<!-- Recommended length for CarPlay and Android Auto is around 25-27 characters --> <!-- Recommended length for CarPlay and Android Auto is around 25-27 characters -->
<string name="avoid_ferry">Undgå færger</string> <string name="avoid_ferry">Undgå færger</string>
<string name="avoid_motorways">Undgå motorveje</string> <string name="avoid_motorways">Undgå motorveje</string>
@@ -894,4 +894,6 @@
<string name="editor_submit">Indsend</string> <string name="editor_submit">Indsend</string>
<string name="power_management">Strømstyring</string> <string name="power_management">Strømstyring</string>
<string name="charge_socket_schuko">Europæisk</string> <string name="charge_socket_schuko">Europæisk</string>
<string name="prefs_speed_cameras_information">Advarsler om hastighedskameraer er deaktiveret i lande, hvor advarsler er forbudt i henhold til lokal lovgivning.</string>
<string name="navigation_start_tts_message">"Starter navigation, sprog for stemmeinstruktioner: "</string>
</resources> </resources>

Some files were not shown because too many files have changed in this diff Show More