mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 14:43:43 +00:00
Compare commits
47 Commits
generate-n
...
x7z4w-map
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f9ce76c28 | ||
|
|
ffe07d3337 | ||
|
|
546383d755 | ||
|
|
bf30165b5f | ||
|
|
0288b97b13 | ||
|
|
7e561d09d3 | ||
|
|
298518ae72 | ||
|
|
3bad6d25f0 | ||
|
|
d36361d669 | ||
|
|
688e20b1a6 | ||
|
|
85462161b2 | ||
|
|
b929823f6b | ||
|
|
22dd799585 | ||
|
|
6864d101e2 | ||
|
|
4bfb62b373 | ||
|
|
f1cf844986 | ||
|
|
f20c3bf50c | ||
|
|
e7cc602904 | ||
|
|
d473361e54 | ||
|
|
76d58e4a05 | ||
|
|
7b5878b010 | ||
|
|
3fabbae3f7 | ||
|
|
0add23fcf2 | ||
|
|
08bcb574fa | ||
|
|
db888f33c5 | ||
|
|
4a96d219f0 | ||
|
|
c2bc6c27aa | ||
|
|
1095e5dbc3 | ||
|
|
a1cbcc5885 | ||
|
|
641f2308c6 | ||
|
|
f858ebcce0 | ||
|
|
eb376f5afc | ||
|
|
71b47719af | ||
|
|
4f7230fcbe | ||
|
|
2dafdd4338 | ||
|
|
0237751afe | ||
|
|
e7fb3a2f2c | ||
|
|
e08d60bb40 | ||
|
|
de4252f86c | ||
|
|
9d87d77055 | ||
|
|
c88f59eb75 | ||
|
|
9b5c700ad8 | ||
|
|
7d5e6fabcd | ||
|
|
ebe0364030 | ||
|
|
43e7e1eb2e | ||
|
|
ce9af79a68 | ||
|
|
b54b77bce6 |
@@ -105,17 +105,17 @@ jobs:
|
||||
run: |
|
||||
echo "Cloning $FORGEJO_SERVER_URL/$FORGEJO_REPOSITORY branch $FORGEJO_REF_NAME"
|
||||
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
|
||||
shell: bash
|
||||
run: |
|
||||
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
|
||||
shell: bash
|
||||
run: |
|
||||
cd ~
|
||||
git clone https://codeberg.org/comaps/subways.git
|
||||
git clone --depth 1 --single-branch https://codeberg.org/comaps/subways.git
|
||||
|
||||
copy-coasts:
|
||||
# if: inputs.run-copy-coasts
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
480fa6c2fcf53be296504ac6ba8e6b3d70f92b42
|
||||
a6ede2b1466f0c9d8a443600ef337ba6b5832e58
|
||||
1377b81bf1cac72bb6da192da7fed6696d5d5281
|
||||
0288b97b1367bb971eded1018f560598ea274e6c
|
||||
bf30165b5f5de0907c3c64524a3bf8121624b0b7
|
||||
|
||||
83
3party/ankerl/stl.h
Normal file
83
3party/ankerl/stl.h
Normal 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
|
||||
2239
3party/ankerl/unordered_dense.h
Normal file
2239
3party/ankerl/unordered_dense.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,16 @@
|
||||
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!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
CoMaps contributors:
|
||||
(in alphabetic order)
|
||||
(in alphabetical order)
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Bastian Greshake Tzovaras
|
||||
clover sage
|
||||
Harry Bond <me@hbond.xyz>
|
||||
thesupertechie
|
||||
vikiawv
|
||||
Yannik Bloscheck
|
||||
|
||||
|
||||
32
android/app/src/fdroid/play/listings/ca/full-description.txt
Normal file
32
android/app/src/fdroid/play/listings/ca/full-description.txt
Normal 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!
|
||||
10
android/app/src/fdroid/play/listings/de-DE/release-notes.txt
Normal file
10
android/app/src/fdroid/play/listings/de-DE/release-notes.txt
Normal 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
|
||||
@@ -1,13 +1,10 @@
|
||||
• Fixed voice directions pronouncing weird symbols in the beginning
|
||||
• OpenStreetMap data as of November 23
|
||||
|
||||
Changes in the previous release:
|
||||
• Added trees
|
||||
• Made bus stop icons smaller and show up earlier
|
||||
• Reduce visibility of entrances
|
||||
• Added several other POI types
|
||||
• Show sand areas on the map
|
||||
• Add business is vacant option to the OSM editor
|
||||
• Improved road shields in Europe
|
||||
• Avoid paved roads routing option
|
||||
• Added icons to the settings page
|
||||
• OpenStreetMap data as of December 9
|
||||
• Use Material 3 themes
|
||||
• Support charging sockets in OSM Editor
|
||||
• Added schuko/type-E charge sockets
|
||||
• Improved search results ranking
|
||||
• Enabled Lithuanian and Latvian in voice announcements
|
||||
• Improved size of driving indications
|
||||
• Base zoom level on distance to next turn
|
||||
• Reordered settings
|
||||
More details on codeberg.org/comaps/comaps/releases
|
||||
|
||||
11
android/app/src/fdroid/play/listings/es-ES/release-notes.txt
Normal file
11
android/app/src/fdroid/play/listings/es-ES/release-notes.txt
Normal 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
|
||||
10
android/app/src/fdroid/play/listings/fr-FR/release-notes.txt
Normal file
10
android/app/src/fdroid/play/listings/fr-FR/release-notes.txt
Normal 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 jusqu’au prochain virage
|
||||
• Réorganisation des paramètres
|
||||
Plus de détails sur codeberg.org/comaps/comaps/releases
|
||||
10
android/app/src/fdroid/play/listings/hr/release-notes.txt
Normal file
10
android/app/src/fdroid/play/listings/hr/release-notes.txt
Normal 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
|
||||
@@ -0,0 +1 @@
|
||||
Paprasta ir patogi navigacija – Turiningos kelionės – Vystoma bendruomenės
|
||||
1
android/app/src/fdroid/play/listings/lt/title.txt
Normal file
1
android/app/src/fdroid/play/listings/lt/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
CoMaps – keliaukite atsijungę ir privačiai
|
||||
10
android/app/src/fdroid/play/listings/pl-PL/release-notes.txt
Normal file
10
android/app/src/fdroid/play/listings/pl-PL/release-notes.txt
Normal 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
|
||||
10
android/app/src/fdroid/play/listings/pt-BR/release-notes.txt
Normal file
10
android/app/src/fdroid/play/listings/pt-BR/release-notes.txt
Normal 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
|
||||
@@ -68,4 +68,4 @@ Por favor, informa de errores, sugiere ideas y únete a nuestra comunidad en el
|
||||
|
||||
<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!
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Paprasta ir patogi navigacija – Turiningos kelionės – Vystoma bendruomenės
|
||||
1
android/app/src/google/play/listings/lt/title.txt
Normal file
1
android/app/src/google/play/listings/lt/title.txt
Normal file
@@ -0,0 +1 @@
|
||||
CoMaps – naviguokite privačiai
|
||||
@@ -28,7 +28,6 @@ import com.github.mikephil.charting.formatter.IAxisValueFormatter;
|
||||
import com.github.mikephil.charting.highlight.Highlight;
|
||||
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
@@ -253,7 +253,7 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
|
||||
mProgress.setMax(bytes);
|
||||
// Start progress at 1% according to M3 guidelines
|
||||
mProgress.setProgressCompat(bytes/100, true);
|
||||
mProgress.setProgressCompat(bytes / 100, true);
|
||||
}
|
||||
else
|
||||
finishFilesDownload(bytes);
|
||||
@@ -372,7 +372,7 @@ public class DownloadResourcesLegacyActivity extends BaseMwmFragmentActivity
|
||||
mTvMessage.setText(getString(R.string.downloading_country_can_proceed, item.name, fileSizeString));
|
||||
mProgress.setMax((int) item.totalSize);
|
||||
// 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);
|
||||
MapManagerHelper.startDownload(mCurrentCountry);
|
||||
|
||||
@@ -107,6 +107,7 @@ import app.organicmaps.sdk.routing.RoutingOptions;
|
||||
import app.organicmaps.sdk.search.SearchEngine;
|
||||
import app.organicmaps.sdk.settings.RoadType;
|
||||
import app.organicmaps.sdk.settings.UnitLocale;
|
||||
import app.organicmaps.sdk.sound.TtsPlayer;
|
||||
import app.organicmaps.sdk.util.Config;
|
||||
import app.organicmaps.sdk.util.LocationUtils;
|
||||
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.floatingactionbutton.FloatingActionButton;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -1813,6 +1813,26 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
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()
|
||||
{
|
||||
final RoutingController controller = RoutingController.get();
|
||||
@@ -2189,6 +2209,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
|
||||
if (!showRoutingDisclaimer())
|
||||
return;
|
||||
|
||||
deliverTtsMessage();
|
||||
|
||||
closeFloatingPanels();
|
||||
setFullscreen(false);
|
||||
RoutingController.get().start();
|
||||
|
||||
@@ -38,7 +38,8 @@ public class OsmUploadWork extends Worker
|
||||
{
|
||||
final Constraints c = new Constraints.Builder().setRequiredNetworkType(NetworkType.CONNECTED).build();
|
||||
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);
|
||||
}
|
||||
final OneTimeWorkRequest wr = builder.build();
|
||||
|
||||
@@ -17,7 +17,6 @@ import androidx.annotation.NonNull;
|
||||
import androidx.documentfile.provider.DocumentFile;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.util.log.Logger;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -10,7 +10,6 @@ import androidx.fragment.app.DialogFragment;
|
||||
|
||||
public class BaseMwmDialogFragment extends DialogFragment
|
||||
{
|
||||
|
||||
protected int getStyle()
|
||||
{
|
||||
return STYLE_NORMAL;
|
||||
|
||||
@@ -282,11 +282,13 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
||||
{
|
||||
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())
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -23,7 +23,6 @@ import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.widget.recycler.RecyclerClickListener;
|
||||
import app.organicmaps.widget.recycler.RecyclerLongClickListener;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.checkbox.MaterialCheckBox;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
@@ -458,10 +457,12 @@ public class Holders
|
||||
|
||||
String formattedDesc = desc.replace("\n", "<br>");
|
||||
Spanned spannedDesc = Utils.fromHtml(formattedDesc);
|
||||
if (!TextUtils.isEmpty(spannedDesc)) {
|
||||
if (!TextUtils.isEmpty(spannedDesc))
|
||||
{
|
||||
mDescText.setText(spannedDesc);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
mDescText.setText(R.string.list_description_empty);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ public final class IntentUtils
|
||||
}
|
||||
|
||||
// https://developer.android.com/reference/androidx/car/app/CarContext#startCarApp(android.content.Intent)
|
||||
private static void processNavigationIntent(@NonNull CarContext carContext,
|
||||
@NonNull Renderer surfaceRenderer, @NonNull Intent intent)
|
||||
private static void processNavigationIntent(@NonNull CarContext carContext, @NonNull Renderer surfaceRenderer,
|
||||
@NonNull Intent intent)
|
||||
{
|
||||
// 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
|
||||
|
||||
@@ -85,7 +85,8 @@ public final class RoutingHelpers
|
||||
}
|
||||
|
||||
@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)
|
||||
{
|
||||
|
||||
@@ -39,8 +39,7 @@ public final class UiHelpers
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static ActionStrip createMapActionStrip(@NonNull CarContext context,
|
||||
@NonNull Renderer surfaceRenderer)
|
||||
public static ActionStrip createMapActionStrip(@NonNull CarContext context, @NonNull Renderer surfaceRenderer)
|
||||
{
|
||||
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();
|
||||
@@ -59,15 +58,13 @@ public final class UiHelpers
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static MapController createMapController(@NonNull CarContext context,
|
||||
@NonNull Renderer surfaceRenderer)
|
||||
public static MapController createMapController(@NonNull CarContext context, @NonNull Renderer surfaceRenderer)
|
||||
{
|
||||
return new MapController.Builder().setMapActionStrip(createMapActionStrip(context, surfaceRenderer)).build();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Action createSettingsAction(@NonNull BaseMapScreen mapScreen,
|
||||
@NonNull Renderer surfaceRenderer)
|
||||
public static Action createSettingsAction(@NonNull BaseMapScreen mapScreen, @NonNull Renderer surfaceRenderer)
|
||||
{
|
||||
return createSettingsAction(mapScreen, surfaceRenderer, null);
|
||||
}
|
||||
@@ -81,8 +78,7 @@ public final class UiHelpers
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static Action createSettingsAction(@NonNull BaseMapScreen mapScreen,
|
||||
@NonNull Renderer surfaceRenderer,
|
||||
private static Action createSettingsAction(@NonNull BaseMapScreen mapScreen, @NonNull Renderer surfaceRenderer,
|
||||
@Nullable OnScreenResultListener onScreenResultListener)
|
||||
{
|
||||
final CarContext context = mapScreen.getCarContext();
|
||||
@@ -123,8 +119,7 @@ public final class UiHelpers
|
||||
return null;
|
||||
|
||||
final Row.Builder builder = new Row.Builder();
|
||||
builder.setImage(
|
||||
new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_opening_hours)).build());
|
||||
builder.setImage(new CarIcon.Builder(IconCompat.createWithResource(context, R.drawable.ic_opening_hours)).build());
|
||||
|
||||
if (isEmptyTT)
|
||||
builder.setTitle(ohStr);
|
||||
|
||||
@@ -125,7 +125,8 @@ public class EditTextDialogFragment extends BaseMwmDialogFragment
|
||||
|
||||
positiveButton.setOnClickListener(view -> {
|
||||
final String result = mEtInput.getText().toString();
|
||||
if (validateInput(requireActivity(), result)) {
|
||||
if (validateInput(requireActivity(), result))
|
||||
{
|
||||
processInput(result);
|
||||
editTextDialog.dismiss();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.location.Location;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import app.organicmaps.MwmActivity;
|
||||
@@ -49,7 +48,8 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
|
||||
@Override
|
||||
public void onStatusChanged(List<MapManager.StorageCallbackData> data)
|
||||
{
|
||||
if (mCurrentCountry == null) {
|
||||
if (mCurrentCountry == null)
|
||||
{
|
||||
updateOfflineExplanationVisibility();
|
||||
return;
|
||||
}
|
||||
@@ -109,10 +109,13 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
|
||||
return enqueued || progress || applying;
|
||||
}
|
||||
|
||||
private void updateOfflineExplanationVisibility() {
|
||||
if (mOfflineExplanation == null) return;
|
||||
private void updateOfflineExplanationVisibility()
|
||||
{
|
||||
if (mOfflineExplanation == null)
|
||||
return;
|
||||
// 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)
|
||||
|
||||
@@ -15,7 +15,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.GridLayout;
|
||||
|
||||
import androidx.annotation.CallSuper;
|
||||
import androidx.annotation.DrawableRes;
|
||||
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();
|
||||
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);
|
||||
|
||||
@@ -406,16 +405,16 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
|
||||
// load SVG icon converted into VectorDrawable in res/drawable
|
||||
@SuppressLint("DiscouragedApi")
|
||||
int resIconId =
|
||||
getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable", requireContext().getPackageName());
|
||||
int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable",
|
||||
requireContext().getPackageName());
|
||||
if (resIconId != 0)
|
||||
{
|
||||
btn.setIcon(getResources().getDrawable(resIconId));
|
||||
}
|
||||
|
||||
@SuppressLint("DiscouragedApi")
|
||||
int resTypeId =
|
||||
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName());
|
||||
int resTypeId = getResources().getIdentifier("charge_socket_" + socket.visualType(), "string",
|
||||
requireContext().getPackageName());
|
||||
if (resTypeId != 0)
|
||||
{
|
||||
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
|
||||
countView.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after)
|
||||
{}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count)
|
||||
{}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
public void afterTextChanged(Editable s)
|
||||
{
|
||||
validatePositiveField(s.toString(), countInputLayout);
|
||||
}
|
||||
});
|
||||
@@ -484,13 +486,16 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
// Add a TextWatcher to validate on text change
|
||||
powerView.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {}
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after)
|
||||
{}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {}
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count)
|
||||
{}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
public void afterTextChanged(Editable s)
|
||||
{
|
||||
validatePositiveField(s.toString(), powerInputLayout);
|
||||
}
|
||||
});
|
||||
@@ -498,7 +503,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
return new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.editor_socket)
|
||||
.setView(dialogView)
|
||||
.setPositiveButton(R.string.save,
|
||||
.setPositiveButton(
|
||||
R.string.save,
|
||||
(dialog, which) -> {
|
||||
String socketType = "";
|
||||
for (MaterialButton b : buttonList)
|
||||
@@ -542,8 +548,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
Logger.w(CHARGE_SOCKETS_TAG, "Invalid power value for socket:" + powerView.getText().toString());
|
||||
}
|
||||
|
||||
ChargeSocketDescriptor socket =
|
||||
new ChargeSocketDescriptor(socketType, countValue, powerValue);
|
||||
ChargeSocketDescriptor socket = new ChargeSocketDescriptor(socketType, countValue, powerValue);
|
||||
|
||||
updateChargeSockets(socketIndex, socket);
|
||||
})
|
||||
@@ -551,21 +556,29 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
// Helper method for validation logic
|
||||
private boolean validatePositiveField(String text, TextInputLayout layout) {
|
||||
if (text.isEmpty()) {
|
||||
private boolean validatePositiveField(String text, TextInputLayout layout)
|
||||
{
|
||||
if (text.isEmpty())
|
||||
{
|
||||
layout.setError(null); // No error if empty (assuming 0 is the default)
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
try
|
||||
{
|
||||
double value = Double.parseDouble(text);
|
||||
if (value < 0) {
|
||||
if (value < 0)
|
||||
{
|
||||
layout.setError(getString(R.string.error_value_must_be_positive));
|
||||
return false;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
layout.setError(null);
|
||||
return true;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
layout.setError(getString(R.string.error_invalid_number));
|
||||
return false;
|
||||
}
|
||||
@@ -585,7 +598,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
{
|
||||
sockets[socketIndex] = socket;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
List<ChargeSocketDescriptor> list = new ArrayList<>(Arrays.asList(sockets));
|
||||
list.add(socket);
|
||||
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);
|
||||
socketsGrid.removeAllViews();
|
||||
|
||||
for (int i = 0; i < sockets.length; i++) {
|
||||
for (int i = 0; i < sockets.length; i++)
|
||||
{
|
||||
final int currentIndex = 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 count = itemView.findViewById(R.id.socket_count);
|
||||
|
||||
|
||||
// load SVG icon converted into VectorDrawable in res/drawable
|
||||
@SuppressLint("DiscouragedApi")
|
||||
int resIconId = getResources().getIdentifier("ic_charge_socket_" + socket.visualType(), "drawable",
|
||||
requireContext().getPackageName());
|
||||
if (resIconId != 0) {
|
||||
if (resIconId != 0)
|
||||
{
|
||||
icon.setImageResource(resIconId);
|
||||
}
|
||||
|
||||
@SuppressLint("DiscouragedApi")
|
||||
int resTypeId =
|
||||
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName());
|
||||
if (resTypeId != 0) {
|
||||
int resTypeId = getResources().getIdentifier("charge_socket_" + socket.visualType(), "string",
|
||||
requireContext().getPackageName());
|
||||
if (resTypeId != 0)
|
||||
{
|
||||
type.setText(resTypeId);
|
||||
}
|
||||
|
||||
if (socket.power() != 0) {
|
||||
if (socket.power() != 0)
|
||||
{
|
||||
DecimalFormat df = new DecimalFormat("#.##");
|
||||
power.setText(getString(R.string.kw_label, df.format(socket.power())));
|
||||
}
|
||||
else if (socket.ignorePower()) {
|
||||
else if (socket.ignorePower())
|
||||
{
|
||||
power.setVisibility(INVISIBLE);
|
||||
}
|
||||
|
||||
@@ -643,7 +661,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -789,9 +808,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
View lineContactBlock =
|
||||
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);
|
||||
View blueskyContactBlock =
|
||||
initBlock(view, Metadata.MetadataType.FMD_CONTACT_BLUESKY, R.id.block_bluesky, R.drawable.ic_bluesky,
|
||||
R.string.bluesky, InputType.TYPE_TEXT_VARIATION_URI);
|
||||
View blueskyContactBlock = initBlock(view, Metadata.MetadataType.FMD_CONTACT_BLUESKY, R.id.block_bluesky,
|
||||
R.drawable.ic_bluesky, R.string.bluesky, InputType.TYPE_TEXT_VARIATION_URI);
|
||||
View operatorBlock = initBlock(view, Metadata.MetadataType.FMD_OPERATOR, R.id.block_operator,
|
||||
R.drawable.ic_operator, R.string.editor_operator, 0);
|
||||
|
||||
@@ -1025,7 +1043,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe
|
||||
new MaterialAlertDialogBuilder(requireActivity(), R.style.MwmTheme_AlertDialog)
|
||||
.setTitle(R.string.editor_mark_business_vacant_title)
|
||||
.setMessage(R.string.editor_mark_business_vacant_description)
|
||||
.setPositiveButton(R.string.editor_submit, (dlg, which) -> {
|
||||
.setPositiveButton(R.string.editor_submit,
|
||||
(dlg, which) -> {
|
||||
Editor.nativeMarkPlaceAsDisused();
|
||||
mParent.processEditedFeatures();
|
||||
})
|
||||
|
||||
@@ -13,7 +13,6 @@ import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.editor.data.FeatureCategory;
|
||||
import app.organicmaps.sdk.util.StringUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
@@ -69,8 +68,7 @@ public class FeatureCategoryAdapter extends RecyclerView.Adapter<RecyclerView.Vi
|
||||
}
|
||||
case TYPE_FOOTER ->
|
||||
{
|
||||
return new FooterViewHolder(inflater.inflate(R.layout.item_feature_category_footer, parent, false),
|
||||
mFragment);
|
||||
return new FooterViewHolder(inflater.inflate(R.layout.item_feature_category_footer, parent, false), mFragment);
|
||||
}
|
||||
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.setOnClickListener(v -> listener.onSendNoteClicked());
|
||||
final ColorStateList bgButtonColor = new ColorStateList(
|
||||
new int[][]{
|
||||
new int[]{android.R.attr.state_enabled}, // enabled
|
||||
new int[]{-android.R.attr.state_enabled} // disabled
|
||||
new int[][] {
|
||||
new int[] {android.R.attr.state_enabled}, // enabled
|
||||
new int[] {-android.R.attr.state_enabled} // disabled
|
||||
},
|
||||
new int[]{
|
||||
ContextCompat.getColor(
|
||||
mSendNoteButton.getContext(), R.color.base_accent),
|
||||
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_disabled)
|
||||
});
|
||||
new int[] {ContextCompat.getColor(mSendNoteButton.getContext(), R.color.base_accent),
|
||||
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_disabled)});
|
||||
final ColorStateList textButtonColor = new ColorStateList(
|
||||
new int[][]{
|
||||
new int[]{android.R.attr.state_enabled}, // enabled
|
||||
new int[]{-android.R.attr.state_enabled} // disabled
|
||||
new int[][] {
|
||||
new int[] {android.R.attr.state_enabled}, // enabled
|
||||
new int[] {-android.R.attr.state_enabled} // disabled
|
||||
},
|
||||
new int[]{
|
||||
ContextCompat.getColor(
|
||||
mSendNoteButton.getContext(),
|
||||
UiUtils.getStyledResourceId(mSendNoteButton.getContext(), android.R.attr.textColorPrimaryInverse)),
|
||||
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_text_disabled)
|
||||
});
|
||||
new int[] {ContextCompat.getColor(mSendNoteButton.getContext(),
|
||||
UiUtils.getStyledResourceId(mSendNoteButton.getContext(),
|
||||
android.R.attr.textColorPrimaryInverse)),
|
||||
ContextCompat.getColor(mSendNoteButton.getContext(), R.color.button_accent_text_disabled)});
|
||||
mSendNoteButton.setBackgroundTintList(bgButtonColor);
|
||||
mSendNoteButton.setTextColor(textButtonColor);
|
||||
mNoteEditText.addTextChangedListener(new StringUtils.SimpleTextWatcher() {
|
||||
|
||||
@@ -2,19 +2,16 @@ package app.organicmaps.editor;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
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.sdk.editor.data.HoursMinutes;
|
||||
import app.organicmaps.sdk.util.DateUtils;
|
||||
import com.google.android.material.timepicker.MaterialTimePicker;
|
||||
import com.google.android.material.timepicker.TimeFormat;
|
||||
|
||||
public class FromToTimePicker
|
||||
{
|
||||
@@ -32,18 +29,11 @@ public class FromToTimePicker
|
||||
private boolean mIsFromTimePicked;
|
||||
private int mInputMode;
|
||||
|
||||
public static void pickTime(@NonNull Fragment fragment,
|
||||
@NonNull FromToTimePicker.OnPickListener listener,
|
||||
@NonNull HoursMinutes fromTime,
|
||||
@NonNull HoursMinutes toTime,
|
||||
int id,
|
||||
public static void pickTime(@NonNull Fragment fragment, @NonNull FromToTimePicker.OnPickListener listener,
|
||||
@NonNull HoursMinutes fromTime, @NonNull HoursMinutes toTime, int id,
|
||||
boolean startWithToTime)
|
||||
{
|
||||
FromToTimePicker timePicker = new FromToTimePicker(fragment,
|
||||
listener,
|
||||
fromTime,
|
||||
toTime,
|
||||
id);
|
||||
FromToTimePicker timePicker = new FromToTimePicker(fragment, listener, fromTime, toTime, id);
|
||||
|
||||
if (startWithToTime)
|
||||
timePicker.showToTimePicker();
|
||||
@@ -51,11 +41,8 @@ public class FromToTimePicker
|
||||
timePicker.showFromTimePicker();
|
||||
}
|
||||
|
||||
private FromToTimePicker(@NonNull Fragment fragment,
|
||||
@NonNull FromToTimePicker.OnPickListener listener,
|
||||
@NonNull HoursMinutes fromTime,
|
||||
@NonNull HoursMinutes toTime,
|
||||
int id)
|
||||
private FromToTimePicker(@NonNull Fragment fragment, @NonNull FromToTimePicker.OnPickListener listener,
|
||||
@NonNull HoursMinutes fromTime, @NonNull HoursMinutes toTime, int id)
|
||||
{
|
||||
mActivity = fragment.requireActivity();
|
||||
mFragmentManager = fragment.getChildFragmentManager();
|
||||
@@ -100,15 +87,12 @@ public class FromToTimePicker
|
||||
|
||||
private MaterialTimePicker buildFromTimePicker()
|
||||
{
|
||||
MaterialTimePicker timePicker = buildTimePicker(mFromTime,
|
||||
mResources.getString(R.string.editor_time_from),
|
||||
mResources.getString(R.string.next_button),
|
||||
null);
|
||||
MaterialTimePicker timePicker = buildTimePicker(mFromTime, mResources.getString(R.string.editor_time_from),
|
||||
mResources.getString(R.string.next_button), null);
|
||||
|
||||
timePicker.addOnNegativeButtonClickListener(view -> finishTimePicking(false));
|
||||
|
||||
timePicker.addOnPositiveButtonClickListener(view ->
|
||||
{
|
||||
timePicker.addOnPositiveButtonClickListener(view -> {
|
||||
mIsFromTimePicked = true;
|
||||
saveState(timePicker, true);
|
||||
mFromTimePicker = null;
|
||||
@@ -122,13 +106,10 @@ public class FromToTimePicker
|
||||
|
||||
private MaterialTimePicker buildToTimePicker()
|
||||
{
|
||||
MaterialTimePicker timePicker = buildTimePicker(mToTime,
|
||||
mResources.getString(R.string.editor_time_to),
|
||||
null,
|
||||
MaterialTimePicker timePicker = buildTimePicker(mToTime, mResources.getString(R.string.editor_time_to), null,
|
||||
mResources.getString(R.string.back));
|
||||
|
||||
timePicker.addOnNegativeButtonClickListener(view ->
|
||||
{
|
||||
timePicker.addOnNegativeButtonClickListener(view -> {
|
||||
saveState(timePicker, false);
|
||||
mToTimePicker = null;
|
||||
if (mIsFromTimePicked)
|
||||
@@ -137,8 +118,7 @@ public class FromToTimePicker
|
||||
finishTimePicking(false);
|
||||
});
|
||||
|
||||
timePicker.addOnPositiveButtonClickListener(view ->
|
||||
{
|
||||
timePicker.addOnPositiveButtonClickListener(view -> {
|
||||
saveState(timePicker, false);
|
||||
finishTimePicking(true);
|
||||
});
|
||||
@@ -149,12 +129,12 @@ public class FromToTimePicker
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private MaterialTimePicker buildTimePicker(@NonNull HoursMinutes time,
|
||||
@NonNull String title,
|
||||
private MaterialTimePicker buildTimePicker(@NonNull HoursMinutes time, @NonNull String title,
|
||||
@Nullable String positiveButtonTextOverride,
|
||||
@Nullable String negativeButtonTextOverride)
|
||||
{
|
||||
MaterialTimePicker.Builder builder = new MaterialTimePicker.Builder()
|
||||
MaterialTimePicker.Builder builder =
|
||||
new MaterialTimePicker.Builder()
|
||||
.setTitleText(title)
|
||||
.setTimeFormat(mIs24HourFormat ? TimeFormat.CLOCK_24H : TimeFormat.CLOCK_12H)
|
||||
.setInputMode(mInputMode)
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
@@ -23,6 +22,7 @@ import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.util.WindowInsetUtils;
|
||||
import app.organicmaps.widget.StackedButtonDialogFragment;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import com.google.android.material.progressindicator.CircularProgressIndicator;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ProfileFragment extends BaseMwmToolbarFragment
|
||||
private MaterialTextView mEditsSent;
|
||||
private MaterialTextView mProfileName;
|
||||
private ShapeableImageView mProfileImage;
|
||||
private ProgressBar mProfileInfoLoading;
|
||||
private CircularProgressIndicator mProfileInfoLoading;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.annotation.IntRange;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -122,20 +121,14 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
|
||||
notifyItemChanged(getItemCount() - 1);
|
||||
}
|
||||
|
||||
private void pickTime(int position,
|
||||
@IntRange(from = ID_OPENING_TIME, to = ID_CLOSED_SPAN) int id,
|
||||
private void pickTime(int position, @IntRange(from = ID_OPENING_TIME, to = ID_CLOSED_SPAN) int id,
|
||||
boolean startWithToTime)
|
||||
{
|
||||
final Timetable data = mItems.get(position);
|
||||
mPickingPosition = position;
|
||||
|
||||
FromToTimePicker.pickTime(mFragment,
|
||||
this,
|
||||
data.workingTimespan.start,
|
||||
data.workingTimespan.end,
|
||||
id,
|
||||
FromToTimePicker.pickTime(mFragment, this, data.workingTimespan.start, data.workingTimespan.end, id,
|
||||
startWithToTime);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -384,26 +377,21 @@ class SimpleTimetableAdapter extends RecyclerView.Adapter<SimpleTimetableAdapter
|
||||
final String text = mFragment.getString(R.string.editor_time_add);
|
||||
mAdd.setEnabled(enable);
|
||||
final ColorStateList bgButtonColor = new ColorStateList(
|
||||
new int[][]{
|
||||
new int[]{android.R.attr.state_enabled}, // enabled
|
||||
new int[]{-android.R.attr.state_enabled} // disabled
|
||||
new int[][] {
|
||||
new int[] {android.R.attr.state_enabled}, // enabled
|
||||
new int[] {-android.R.attr.state_enabled} // disabled
|
||||
},
|
||||
new int[]{
|
||||
ContextCompat.getColor(
|
||||
mAdd.getContext(), R.color.base_accent),
|
||||
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_disabled)
|
||||
});
|
||||
new int[] {ContextCompat.getColor(mAdd.getContext(), R.color.base_accent),
|
||||
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_disabled)});
|
||||
final ColorStateList textButtonColor = new ColorStateList(
|
||||
new int[][]{
|
||||
new int[]{android.R.attr.state_enabled}, // enabled
|
||||
new int[]{-android.R.attr.state_enabled} // disabled
|
||||
new int[][] {
|
||||
new int[] {android.R.attr.state_enabled}, // enabled
|
||||
new int[] {-android.R.attr.state_enabled} // disabled
|
||||
},
|
||||
new int[]{
|
||||
ContextCompat.getColor(
|
||||
mAdd.getContext(),
|
||||
UiUtils.getStyledResourceId(mAdd.getContext(), android.R.attr.textColorPrimaryInverse)),
|
||||
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_text_disabled)
|
||||
});
|
||||
new int[] {
|
||||
ContextCompat.getColor(mAdd.getContext(), UiUtils.getStyledResourceId(
|
||||
mAdd.getContext(), android.R.attr.textColorPrimaryInverse)),
|
||||
ContextCompat.getColor(mAdd.getContext(), R.color.button_accent_text_disabled)});
|
||||
mAdd.setBackgroundTintList(bgButtonColor);
|
||||
mAdd.setTextColor(textButtonColor);
|
||||
mAdd.setText(enable ? text + " (" + TimeFormatUtils.formatWeekdays(mComplementItem) + ")" : text);
|
||||
|
||||
@@ -9,8 +9,8 @@ import androidx.annotation.Nullable;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.base.BaseMwmRecyclerFragment;
|
||||
|
||||
public class SimpleTimetableFragment extends BaseMwmRecyclerFragment<SimpleTimetableAdapter>
|
||||
implements TimetableProvider
|
||||
public class SimpleTimetableFragment
|
||||
extends BaseMwmRecyclerFragment<SimpleTimetableAdapter> implements TimetableProvider
|
||||
{
|
||||
private SimpleTimetableAdapter mAdapter;
|
||||
@Nullable
|
||||
|
||||
@@ -35,20 +35,25 @@ public class LayerBottomSheetItem
|
||||
@DrawableRes
|
||||
int drawableResId = 0;
|
||||
@StringRes
|
||||
int buttonTextResource = switch (mode) {
|
||||
case OUTDOORS -> {
|
||||
int buttonTextResource = switch (mode)
|
||||
{
|
||||
case OUTDOORS ->
|
||||
{
|
||||
drawableResId = R.drawable.ic_layers_outdoors;
|
||||
yield R.string.button_layer_outdoor;
|
||||
}
|
||||
case SUBWAY -> {
|
||||
case SUBWAY ->
|
||||
{
|
||||
drawableResId = R.drawable.ic_layers_subway;
|
||||
yield R.string.subway;
|
||||
}
|
||||
case ISOLINES -> {
|
||||
case ISOLINES ->
|
||||
{
|
||||
drawableResId = R.drawable.ic_layers_isoline;
|
||||
yield R.string.button_layer_isolines;
|
||||
}
|
||||
case TRAFFIC -> {
|
||||
case TRAFFIC ->
|
||||
{
|
||||
drawableResId = R.drawable.ic_layers_traffic;
|
||||
yield R.string.button_layer_traffic;
|
||||
}
|
||||
|
||||
@@ -5,11 +5,9 @@ import android.widget.ImageView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.adapter.OnItemClickListener;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
class LayerHolder extends RecyclerView.ViewHolder
|
||||
{
|
||||
|
||||
@@ -43,7 +43,6 @@ import app.organicmaps.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import app.organicmaps.widget.recycler.DotDividerItemDecoration;
|
||||
import app.organicmaps.widget.recycler.MultilineLayoutManager;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
@@ -123,9 +122,9 @@ final class RoutingBottomMenuController implements View.OnClickListener
|
||||
@NonNull View timeElevationLine, @NonNull View transitFrame,
|
||||
@NonNull MaterialTextView error, @NonNull MaterialButton start,
|
||||
@NonNull ShapeableImageView altitudeChart, @NonNull MaterialTextView time,
|
||||
@NonNull MaterialTextView altitudeDifference, @NonNull MaterialTextView timeVehicle,
|
||||
@Nullable MaterialTextView arrival, @NonNull View actionFrame,
|
||||
@Nullable RoutingBottomMenuListener listener)
|
||||
@NonNull MaterialTextView altitudeDifference,
|
||||
@NonNull MaterialTextView timeVehicle, @Nullable MaterialTextView arrival,
|
||||
@NonNull View actionFrame, @Nullable RoutingBottomMenuListener listener)
|
||||
{
|
||||
mContext = context;
|
||||
mAltitudeChartFrame = altitudeChartFrame;
|
||||
|
||||
@@ -12,9 +12,6 @@ import androidx.annotation.IdRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.WindowInsetsCompat;
|
||||
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.MwmApplication;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.Framework;
|
||||
@@ -29,6 +26,7 @@ import app.organicmaps.util.WindowInsetUtils.PaddingInsetsListener;
|
||||
import app.organicmaps.widget.RoutingToolbarButton;
|
||||
import app.organicmaps.widget.ToolbarController;
|
||||
import app.organicmaps.widget.WheelProgressView;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
public class RoutingPlanController extends ToolbarController
|
||||
{
|
||||
|
||||
@@ -14,12 +14,10 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.search.DisplayedCategories;
|
||||
import app.organicmaps.sdk.util.Language;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -10,14 +10,12 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.search.SearchResult;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.util.ThemeUtils;
|
||||
import app.organicmaps.util.UiUtils;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHolder>
|
||||
{
|
||||
@@ -152,7 +150,8 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
|
||||
{
|
||||
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
|
||||
UiUtils.hide(mOpen);
|
||||
@@ -169,15 +168,18 @@ class SearchAdapter extends RecyclerView.Adapter<SearchAdapter.SearchDataViewHol
|
||||
{
|
||||
final String minsToChangeStr = resources.getQuantityString(
|
||||
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);
|
||||
mOpen.setTextColor(ContextCompat.getColor(mSearchFragment.getContext(), R.color.base_yellow));
|
||||
}
|
||||
else
|
||||
{
|
||||
UiUtils.setTextAndShow(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));
|
||||
UiUtils.setTextAndShow(
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,8 @@ public class SearchFragment extends BaseMwmFragment implements SearchListener, C
|
||||
RecyclerView mResults = mResultsFrame.findViewById(R.id.recycler);
|
||||
setRecyclerScrollListener(mResults);
|
||||
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()
|
||||
|
||||
{
|
||||
|
||||
@@ -5,15 +5,13 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.MwmApplication;
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
import app.organicmaps.sdk.search.SearchRecents;
|
||||
import app.organicmaps.util.Graphics;
|
||||
import app.organicmaps.widget.SearchToolbarController;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
class SearchHistoryAdapter extends RecyclerView.Adapter<SearchHistoryAdapter.ViewHolder>
|
||||
{
|
||||
|
||||
@@ -8,14 +8,12 @@ import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.base.BaseMwmToolbarFragment;
|
||||
import app.organicmaps.sdk.routing.RoutingController;
|
||||
import app.organicmaps.sdk.routing.RoutingOptions;
|
||||
import app.organicmaps.sdk.settings.RoadType;
|
||||
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
@@ -90,7 +90,6 @@ public enum ThemeSwitcher
|
||||
{
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
|
||||
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_YES);
|
||||
else
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
|
||||
if (RoutingController.get().isVehicleNavigation())
|
||||
@@ -104,7 +103,6 @@ public enum ThemeSwitcher
|
||||
{
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
|
||||
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_NO);
|
||||
else
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
|
||||
if (RoutingController.get().isVehicleNavigation())
|
||||
|
||||
@@ -8,19 +8,20 @@ import android.graphics.Typeface;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public abstract class BaseSignView extends View
|
||||
{
|
||||
private float mBorderWidthRatio = 0.1f;
|
||||
protected void setBorderWidthRatio(float ratio) {
|
||||
protected void setBorderWidthRatio(float ratio)
|
||||
{
|
||||
mBorderWidthRatio = ratio;
|
||||
}
|
||||
|
||||
private float mBorderInsetRatio = 0f;
|
||||
protected void setBorderInsetRatio(float ratio) {
|
||||
protected void setBorderInsetRatio(float ratio)
|
||||
{
|
||||
mBorderInsetRatio = ratio;
|
||||
}
|
||||
|
||||
@@ -54,11 +55,7 @@ public abstract class BaseSignView extends View
|
||||
mTextPaint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
|
||||
}
|
||||
|
||||
protected void setColors(int backgroundColor,
|
||||
int borderColor,
|
||||
int alertColor,
|
||||
int textColor,
|
||||
int textAlertColor)
|
||||
protected void setColors(int backgroundColor, int borderColor, int alertColor, int textColor, int textAlertColor)
|
||||
{
|
||||
mBackgroundColor = backgroundColor;
|
||||
mBorderColor = borderColor;
|
||||
@@ -72,7 +69,8 @@ public abstract class BaseSignView extends View
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
|
||||
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();
|
||||
@@ -91,7 +89,8 @@ public abstract class BaseSignView extends View
|
||||
{
|
||||
super.onDraw(canvas);
|
||||
final String str = getValueString();
|
||||
if (str == null) return;
|
||||
if (str == null)
|
||||
return;
|
||||
|
||||
final float cx = mWidth / 2f;
|
||||
final float cy = mHeight / 2f;
|
||||
@@ -143,7 +142,8 @@ public abstract class BaseSignView extends View
|
||||
void configureTextSize()
|
||||
{
|
||||
String text = getValueString();
|
||||
if (text == null) return;
|
||||
if (text == null)
|
||||
return;
|
||||
final float textRadius = mBorderRadius - mBorderWidth;
|
||||
final float maxTextSize = 2f * textRadius;
|
||||
final float maxTextSize2 = maxTextSize * maxTextSize;
|
||||
@@ -154,7 +154,7 @@ public abstract class BaseSignView extends View
|
||||
sz = (lo + hi) / 2f;
|
||||
mTextPaint.setTextSize(sz);
|
||||
mTextPaint.getTextBounds(text, 0, text.length(), b);
|
||||
float area = b.width()*b.width() + b.height()*b.height();
|
||||
float area = b.width() * b.width() + b.height() * b.height();
|
||||
if (area <= maxTextSize2)
|
||||
lo = sz + 1f;
|
||||
else
|
||||
|
||||
@@ -4,9 +4,7 @@ import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import app.organicmaps.R;
|
||||
import app.organicmaps.sdk.util.StringUtils;
|
||||
|
||||
@@ -22,8 +20,8 @@ public class CurrentSpeedView extends BaseSignView
|
||||
setBorderWidthRatio(0.1f);
|
||||
setBorderInsetRatio(0.05f);
|
||||
|
||||
try (TypedArray a = ctx.getTheme()
|
||||
.obtainStyledAttributes(attrs, R.styleable.CurrentSpeedView /* reuse same attrs or define new */ , 0, 0))
|
||||
try (TypedArray a = ctx.getTheme().obtainStyledAttributes(
|
||||
attrs, R.styleable.CurrentSpeedView /* reuse same attrs or define new */, 0, 0))
|
||||
{
|
||||
int bg = a.getColor(R.styleable.CurrentSpeedView_currentSpeedBackgroundColor, DefaultValues.BACKGROUND_COLOR);
|
||||
int bd = a.getColor(R.styleable.CurrentSpeedView_currentSpeedBorderColor, DefaultValues.BORDER_COLOR);
|
||||
@@ -33,7 +31,7 @@ public class CurrentSpeedView extends BaseSignView
|
||||
if (isInEditMode())
|
||||
{
|
||||
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
|
||||
{
|
||||
Pair<String,String> su = StringUtils.nativeFormatSpeedAndUnits(mps);
|
||||
Pair<String, String> su = StringUtils.nativeFormatSpeedAndUnits(mps);
|
||||
mSpeedStr = su.first;
|
||||
}
|
||||
requestLayout();
|
||||
|
||||
@@ -12,12 +12,10 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
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.util.UiUtils;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
public class PlaceholderView extends LinearLayout
|
||||
{
|
||||
|
||||
@@ -5,9 +5,7 @@ import android.content.res.TypedArray;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import app.organicmaps.R;
|
||||
|
||||
public class SpeedLimitView extends BaseSignView
|
||||
@@ -27,15 +25,22 @@ public class SpeedLimitView extends BaseSignView
|
||||
|
||||
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 borderColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitBorderColor, DefaultValues.BORDER_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);
|
||||
final int bgColor =
|
||||
styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitBackgroundColor, DefaultValues.BACKGROUND_COLOR);
|
||||
final int borderColor =
|
||||
styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitBorderColor, DefaultValues.BORDER_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);
|
||||
|
||||
unlimitedBorderColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedBorderColor, DefaultValues.UNLIMITED_BORDER_COLOR);
|
||||
unlimitedStripeColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedStripeColor, DefaultValues.UNLIMITED_STRIPE_COLOR);
|
||||
unlimitedBorderColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedBorderColor,
|
||||
DefaultValues.UNLIMITED_BORDER_COLOR);
|
||||
unlimitedStripeColor = styleAttrs.getColor(R.styleable.SpeedLimitView_speedLimitUnlimitedStripeColor,
|
||||
DefaultValues.UNLIMITED_STRIPE_COLOR);
|
||||
|
||||
if (isInEditMode())
|
||||
{
|
||||
@@ -75,7 +80,7 @@ public class SpeedLimitView extends BaseSignView
|
||||
@Override
|
||||
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)
|
||||
{
|
||||
@@ -105,7 +110,7 @@ public class SpeedLimitView extends BaseSignView
|
||||
stripe.setStrokeWidth(mBorderWidth * 0.4f);
|
||||
|
||||
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 px = -dy, py = +dx; // Perpendicular
|
||||
final float step = radius * 0.15f; // Spacing
|
||||
@@ -122,7 +127,6 @@ public class SpeedLimitView extends BaseSignView
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private interface DefaultValues
|
||||
{
|
||||
int BACKGROUND_COLOR = 0xFFFFFFFF;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package app.organicmaps.widget.placepage;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import app.organicmaps.sdk.util.StringUtils;
|
||||
import com.github.mikephil.charting.charts.BarLineChartBase;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.github.mikephil.charting.components.AxisBase;
|
||||
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
|
||||
|
||||
|
||||
@@ -105,7 +105,8 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
|
||||
public EditBookmarkFragment() {}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
public void onCreate(@Nullable Bundle savedInstanceState)
|
||||
{
|
||||
super.onCreate(savedInstanceState);
|
||||
setStyle(DialogFragment.STYLE_NORMAL, R.style.MwmTheme_FullScreenDialog);
|
||||
}
|
||||
@@ -184,10 +185,9 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
|
||||
{
|
||||
super.onStart();
|
||||
Dialog dialog = getDialog();
|
||||
if (dialog != null) {
|
||||
dialog.getWindow().setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
if (dialog != null)
|
||||
{
|
||||
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
}
|
||||
|
||||
// Focus name and show keyboard for "Unknown Place" bookmarks
|
||||
|
||||
@@ -6,9 +6,6 @@ import android.widget.RelativeLayout;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
import app.organicmaps.ChartController;
|
||||
import app.organicmaps.R;
|
||||
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.util.UiUtils;
|
||||
import app.organicmaps.util.Utils;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
import java.util.Objects;
|
||||
|
||||
public class ElevationProfileViewRenderer implements PlacePageStateListener
|
||||
|
||||
@@ -14,7 +14,8 @@ public class OpenStateTextFormatter
|
||||
return String.format(Locale.ROOT, "%02d:%02d", hour, minute);
|
||||
|
||||
int h = hour % 12;
|
||||
if (h == 0) h = 12;
|
||||
if (h == 0)
|
||||
h = 12;
|
||||
String ampm = (hour < 12) ? "AM" : "PM";
|
||||
return String.format(Locale.ROOT, "%d:%02d %s", h, minute, ampm);
|
||||
}
|
||||
@@ -29,16 +30,8 @@ public class OpenStateTextFormatter
|
||||
return t.getDayOfWeek().getDisplayName(TextStyle.SHORT, locale);
|
||||
}
|
||||
|
||||
static String buildAtLabel(
|
||||
boolean opens,
|
||||
boolean isToday,
|
||||
String dayShort,
|
||||
String time,
|
||||
String opensAtLocalized,
|
||||
String closesAtLocalized,
|
||||
String opensDayAtLocalized,
|
||||
String closesDayAtLocalized
|
||||
)
|
||||
static String buildAtLabel(boolean opens, boolean isToday, String dayShort, String time, String opensAtLocalized,
|
||||
String closesAtLocalized, String opensDayAtLocalized, String closesDayAtLocalized)
|
||||
{
|
||||
if (isToday)
|
||||
return opens ? String.format(Locale.ROOT, opensAtLocalized, time) // Opens at %s
|
||||
|
||||
@@ -31,7 +31,6 @@ import androidx.fragment.app.FragmentFactory;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
||||
import app.organicmaps.MwmActivity;
|
||||
import app.organicmaps.MwmApplication;
|
||||
import app.organicmaps.R;
|
||||
@@ -154,6 +153,7 @@ public class PlacePageView extends Fragment
|
||||
private MaterialTextView mTvLastChecked;
|
||||
private View mEditPlace;
|
||||
private View mAddPlace;
|
||||
private View mMapTooOld;
|
||||
private View mEditTopSpace;
|
||||
private ShapeableImageView mColorIcon;
|
||||
private MaterialTextView mTvCategory;
|
||||
@@ -318,6 +318,7 @@ public class PlacePageView extends Fragment
|
||||
mTvLastChecked = mFrame.findViewById(R.id.place_page_last_checked);
|
||||
mEditPlace = mFrame.findViewById(R.id.ll__place_editor);
|
||||
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);
|
||||
latlon.setOnLongClickListener(this);
|
||||
address.setOnLongClickListener(this);
|
||||
@@ -684,42 +685,72 @@ public class PlacePageView extends Fragment
|
||||
|
||||
if (RoutingController.get().isNavigating() || RoutingController.get().isPlanning())
|
||||
{
|
||||
UiUtils.hide(mEditPlace, mAddPlace, mEditTopSpace);
|
||||
UiUtils.hide(mEditPlace, mAddPlace, mEditTopSpace, mMapTooOld);
|
||||
}
|
||||
else
|
||||
{
|
||||
UiUtils.showIf(Editor.nativeShouldShowEditPlace(), mEditPlace);
|
||||
UiUtils.showIf(Editor.nativeShouldShowAddPlace(), mAddPlace);
|
||||
UiUtils.hide(mMapTooOld);
|
||||
MaterialButton mTvEditPlace = mEditPlace.findViewById(R.id.mb__place_editor);
|
||||
MaterialButton mTvAddPlace = mAddPlace.findViewById(R.id.mb__place_add);
|
||||
|
||||
boolean shouldEnableEditPlace = Editor.nativeShouldEnableEditPlace();
|
||||
|
||||
if (shouldEnableEditPlace)
|
||||
{
|
||||
mTvEditPlace.setOnClickListener(this);
|
||||
mTvAddPlace.setOnClickListener(this);
|
||||
mTvEditPlace.setEnabled(Editor.nativeShouldEnableEditPlace());
|
||||
mTvAddPlace.setEnabled(Editor.nativeShouldEnableAddPlace());
|
||||
final int editTextButtonColor =
|
||||
Editor.nativeShouldEnableEditPlace()
|
||||
}
|
||||
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(
|
||||
getContext(),
|
||||
UiUtils.getStyledResourceId(getContext(), com.google.android.material.R.attr.colorSecondary))
|
||||
: ContextCompat.getColor(getContext(), R.color.button_accent_text_disabled);
|
||||
final ColorStateList editStrokeButtonColor = new ColorStateList(
|
||||
new int[][]{
|
||||
new int[]{android.R.attr.state_enabled}, // enabled
|
||||
new int[]{-android.R.attr.state_enabled} // disabled
|
||||
},
|
||||
new int[]{
|
||||
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);
|
||||
|
||||
mTvEditPlace.setTextColor(editButtonColor);
|
||||
mTvAddPlace.setTextColor(editButtonColor);
|
||||
mTvEditPlace.setStrokeColor(ColorStateList.valueOf(editButtonColor));
|
||||
mTvAddPlace.setStrokeColor(ColorStateList.valueOf(editButtonColor));
|
||||
UiUtils.showIf(UiUtils.isVisible(mEditPlace) || UiUtils.isVisible(mAddPlace), mEditTopSpace);
|
||||
}
|
||||
updateLinksView();
|
||||
updateOpeningHoursView();
|
||||
@@ -820,8 +851,7 @@ public class PlacePageView extends Fragment
|
||||
}
|
||||
|
||||
// Get colours
|
||||
final ForegroundColorSpan colorGreen =
|
||||
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_green));
|
||||
final ForegroundColorSpan colorGreen = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_green));
|
||||
final ForegroundColorSpan colorYellow =
|
||||
new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_yellow));
|
||||
final ForegroundColorSpan colorRed = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.base_red));
|
||||
@@ -849,13 +879,12 @@ public class PlacePageView extends Fragment
|
||||
if (nextStateTime > 0 && nextStateTime < Long.MAX_VALUE / 2)
|
||||
{
|
||||
// NOTE: Timezone is currently device timezone. TODO: use feature-specific timezone.
|
||||
nextChangeLocal = ZonedDateTime.ofInstant(
|
||||
Instant.ofEpochSecond(nextStateTime), ZoneId.systemDefault()
|
||||
);
|
||||
nextChangeLocal = ZonedDateTime.ofInstant(Instant.ofEpochSecond(nextStateTime), ZoneId.systemDefault());
|
||||
hasFiniteNextChange = true;
|
||||
}
|
||||
}
|
||||
catch (Throwable ignored) {}
|
||||
catch (Throwable ignored)
|
||||
{}
|
||||
}
|
||||
|
||||
if (!hasFiniteNextChange) // No valid next change
|
||||
@@ -895,16 +924,14 @@ public class PlacePageView extends Fragment
|
||||
final boolean isToday =
|
||||
OpenStateTextFormatter.isSameLocalDate(nextChangeLocal, ZonedDateTime.now(nextChangeLocal.getZone()));
|
||||
// Full weekday name per design feedback.
|
||||
final String dayName =
|
||||
nextChangeLocal.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.getDefault());
|
||||
final String dayName = nextChangeLocal.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.getDefault());
|
||||
|
||||
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);
|
||||
|
||||
final String atLabel =
|
||||
OpenStateTextFormatter.buildAtLabel(false, isToday, dayName, localizedTimeString,
|
||||
opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
|
||||
final String atLabel = OpenStateTextFormatter.buildAtLabel(
|
||||
false, isToday, dayName, localizedTimeString, opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
|
||||
|
||||
if (!TextUtils.isEmpty(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);
|
||||
|
||||
final String atLabel =
|
||||
OpenStateTextFormatter.buildAtLabel(true, isToday, dayName, localizedTimeString,
|
||||
opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
|
||||
final String atLabel = OpenStateTextFormatter.buildAtLabel(
|
||||
true, isToday, dayName, localizedTimeString, opensAtStr, closesAtStr, opensDayAtStr, closesDayAtStr);
|
||||
|
||||
if (!TextUtils.isEmpty(atLabel))
|
||||
openStateString.append(" • ").append(atLabel);
|
||||
|
||||
@@ -3,9 +3,7 @@ package app.organicmaps.widget.placepage;
|
||||
import androidx.lifecycle.LiveData;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import app.organicmaps.sdk.bookmarks.data.MapObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PlacePageViewModel extends ViewModel
|
||||
|
||||
@@ -31,7 +31,8 @@ import app.organicmaps.widget.placepage.PlacePageViewModel;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
|
||||
public class PlacePageBookmarkFragment extends Fragment implements View.OnClickListener, View.OnLongClickListener,
|
||||
Observer<MapObject>, EditBookmarkFragment.EditBookmarkListener
|
||||
Observer<MapObject>,
|
||||
EditBookmarkFragment.EditBookmarkListener
|
||||
{
|
||||
private View mFrame;
|
||||
private MaterialTextView mTvBookmarkNote;
|
||||
|
||||
@@ -13,15 +13,13 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
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.sdk.Framework;
|
||||
import app.organicmaps.sdk.bookmarks.data.ChargeSocketDescriptor;
|
||||
import app.organicmaps.sdk.bookmarks.data.MapObject;
|
||||
import app.organicmaps.widget.placepage.PlacePageViewModel;
|
||||
import com.google.android.material.imageview.ShapeableImageView;
|
||||
import com.google.android.material.textview.MaterialTextView;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class PlacePageChargeSocketsFragment extends Fragment implements Observer<MapObject>
|
||||
@@ -96,8 +94,8 @@ public class PlacePageChargeSocketsFragment extends Fragment implements Observer
|
||||
}
|
||||
|
||||
@SuppressLint("DiscouragedApi")
|
||||
int resTypeId =
|
||||
getResources().getIdentifier("charge_socket_" + socket.visualType(), "string", requireContext().getPackageName());
|
||||
int resTypeId = getResources().getIdentifier("charge_socket_" + socket.visualType(), "string",
|
||||
requireContext().getPackageName());
|
||||
if (resTypeId != 0)
|
||||
{
|
||||
type.setText(resTypeId);
|
||||
@@ -108,7 +106,8 @@ public class PlacePageChargeSocketsFragment extends Fragment implements Observer
|
||||
DecimalFormat df = new DecimalFormat("#.##");
|
||||
power.setText(getString(R.string.kw_label, df.format(socket.power())));
|
||||
}
|
||||
else if (socket.ignorePower()) {
|
||||
else if (socket.ignorePower())
|
||||
{
|
||||
power.setVisibility(INVISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +192,8 @@ public class PlacePageLinksFragment extends Fragment implements Observer<MapObje
|
||||
default -> mMapObject.getMetadata(type);
|
||||
};
|
||||
// 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)
|
||||
PlacePageUtils.copyToClipboard(requireContext(), mFrame, items.get(0));
|
||||
|
||||
10
android/app/src/main/res/drawable/info_icon.xml
Normal file
10
android/app/src/main/res/drawable/info_icon.xml
Normal 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>
|
||||
@@ -33,9 +33,13 @@
|
||||
style="@style/MwmWidget.TextView.NavStreet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="@dimen/margin_quarter_plus"
|
||||
android:maxLines="2"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="16sp"
|
||||
android:autoSizeMaxTextSize="25sp"
|
||||
android:textColor="@android:color/white"
|
||||
tools:text="Sample street name.\nLong looooooooong!!!!"/>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
app:tint="?colorSecondary"/>
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/head_message"
|
||||
style="?fontHeadline6"
|
||||
style="@style/TextAppearance.Headline6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_base"
|
||||
@@ -36,7 +36,7 @@
|
||||
android:text="@string/download_map_title" />
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/download_message"
|
||||
style="?fontBody2"
|
||||
style="@style/TextAppearance.Body2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/aa_connected_title"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4"
|
||||
android:textAppearance="@style/TextAppearance.Headline4"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
@@ -36,7 +36,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/car_used_on_the_car_screen"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body1" />
|
||||
android:textAppearance="@style/TextAppearance.Body1" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:layout_marginStart="32dp"
|
||||
android:text="@string/aa_request_permission_activity_text"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Headline4"
|
||||
android:textAppearance="@style/TextAppearance.Headline4"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:maxLines="3"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?fontHeadline6"
|
||||
android:textAppearance="@style/TextAppearance.Headline6"
|
||||
tools:text="Title" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:text="@string/download_country_ask"
|
||||
android:textAppearance="?fontBody2"
|
||||
android:textAppearance="@style/TextAppearance.Body2"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
<com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
android:textAppearance="@style/MwmTextAppearance.Title" />
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/et__input_layout"
|
||||
style="?fontBody1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:hintEnabled="false">
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
android:layout_marginTop="@dimen/margin_base">
|
||||
|
||||
<RadioButton
|
||||
style="?fontSubtitle1"
|
||||
style="@style/TextAppearance.Subtitle1"
|
||||
android:id="@+id/sort_by_default"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -37,7 +37,7 @@
|
||||
app:buttonTint="@null"/>
|
||||
|
||||
<RadioButton
|
||||
style="?fontSubtitle1"
|
||||
style="@style/TextAppearance.Subtitle1"
|
||||
android:id="@+id/sort_by_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -47,7 +47,7 @@
|
||||
app:buttonTint="@null"/>
|
||||
|
||||
<RadioButton
|
||||
style="?fontSubtitle1"
|
||||
style="@style/TextAppearance.Subtitle1"
|
||||
android:id="@+id/sort_by_type"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -57,7 +57,7 @@
|
||||
app:buttonTint="@null"/>
|
||||
|
||||
<RadioButton
|
||||
style="?fontSubtitle1"
|
||||
style="@style/TextAppearance.Subtitle1"
|
||||
android:id="@+id/sort_by_distance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -67,7 +67,7 @@
|
||||
app:buttonTint="@null"/>
|
||||
|
||||
<RadioButton
|
||||
style="?fontSubtitle1"
|
||||
style="@style/TextAppearance.Subtitle1"
|
||||
android:id="@+id/sort_by_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
android:orientation="vertical">
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/edit_bookmark_name_input"
|
||||
style="?fontBody1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/name"
|
||||
@@ -88,7 +87,6 @@
|
||||
tools:src="@drawable/ic_bookmark_none" />
|
||||
</RelativeLayout>
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="?fontBody1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/margin_half"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_marginEnd="@dimen/margin_base"
|
||||
android:paddingTop="@dimen/margin_half"
|
||||
android:paddingBottom="@dimen/margin_base"
|
||||
android:textAppearance="?fontHeadline6"
|
||||
android:textAppearance="@style/TextAppearance.Headline6"
|
||||
tools:text="Xindian Shitoushan Trail" />
|
||||
<include
|
||||
layout="@layout/item_divider"
|
||||
|
||||
@@ -30,12 +30,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/margin_base"
|
||||
android:background="?colorPrimary">
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/user_profile_loading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:trackColor="@color/text_light"
|
||||
app:indicatorColor="@color/text_light"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminateTint="@color/text_light"
|
||||
android:indeterminate="true"
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible" />
|
||||
<LinearLayout
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/progress"
|
||||
style="@style/Widget.AppCompat.ProgressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center" />
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true"/>
|
||||
<include
|
||||
layout="@layout/feedback_fab"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
android:layout_marginStart="@dimen/margin_base"
|
||||
android:layout_marginTop="@dimen/margin_base"
|
||||
android:text="@string/layers_title"
|
||||
android:textAppearance="?fontHeadline6"
|
||||
android:textAppearance="@style/TextAppearance.Headline6"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<com.google.android.material.button.MaterialButton
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/progress"
|
||||
style="@style/Widget.AppCompat.ProgressBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"/>
|
||||
android:layout_gravity="center"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
<include layout="@layout/shadow_top"/>
|
||||
</FrameLayout>
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:fontFamily="@string/robotoMedium"
|
||||
tools:text="Some text should go here"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body3"
|
||||
android:textAppearance="@style/MwmTextAppearance.Body1"
|
||||
android:textColor="?colorSecondary"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAppearance="?fontBody1"
|
||||
android:textAppearance="@style/TextAppearance.Body1"
|
||||
tools:text="Bookmark name looooooooooooooooooongasdasdasd" />
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_line_container"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
android:layout_marginEnd="@dimen/bookmark_collection_item_end_margin"
|
||||
android:ellipsize="middle"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?fontBody1"
|
||||
android:textAppearance="@style/TextAppearance.Body1"
|
||||
tools:text="Bookmark name looooooooooooooooooongasdasdasd" />
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/size"
|
||||
@@ -37,7 +37,7 @@
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
style="?fontBody2"
|
||||
style="@style/TextAppearance.Body2"
|
||||
tools:text="42000000" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
android:paddingBottom="@dimen/margin_half_plus">
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/text_message"
|
||||
style="?fontHeadline6"
|
||||
style="@style/TextAppearance.Headline6"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|bottom"
|
||||
android:background="@android:color/transparent"
|
||||
android:clickable="true"
|
||||
android:gravity="start|top"
|
||||
android:text="@string/category_desc_more"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/text"
|
||||
style="?fontHeadline6"
|
||||
style="@style/TextAppearance.Headline6"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?windowBackgroundForced"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
android:gravity="center"
|
||||
android:maxWidth="500dp"
|
||||
android:text="@string/editor_category_unsuitable_title"
|
||||
android:textAppearance="@style/TextAppearance.MdcTypographyStyles.Headline6"
|
||||
android:textAppearance="@style/TextAppearance.Headline6"
|
||||
android:textStyle="bold" />
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/editor_category_unsuitable_text"
|
||||
|
||||
@@ -4,18 +4,16 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/editor_height_field"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/input_layout"
|
||||
style="?fontBody1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/editor_edit_place_name_hint"
|
||||
android:textColorHint="?android:textColorSecondary">
|
||||
android:hint="@string/editor_edit_place_name_hint">
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/input"
|
||||
style="@style/MwmWidget.Editor.FieldLayout.EditText"
|
||||
@@ -31,5 +29,5 @@
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/margin_half_plus"
|
||||
app:srcCompat="@drawable/ic_close"
|
||||
app:tint="@color/base_red" />
|
||||
app:tint="?iconTint" />
|
||||
</LinearLayout>
|
||||
@@ -147,12 +147,12 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/allday"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/editor_height_allday"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="?clickableBackground"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/margin_half_plus">
|
||||
android:padding="@dimen/margin_half">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="0dp"
|
||||
@@ -164,7 +164,8 @@
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/sw__allday"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/margin_quarter"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
android:layout_marginTop="@dimen/margin_base"
|
||||
android:layout_marginEnd="@dimen/bookmark_collection_item_end_margin"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?fontBody1"
|
||||
android:textAppearance="@style/TextAppearance.Body1"
|
||||
tools:text="@string/tracks_title" />
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/tv__bookmark_distance"
|
||||
@@ -39,7 +39,7 @@
|
||||
android:layout_marginBottom="@dimen/margin_half_plus"
|
||||
android:singleLine="true"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textAppearance="?fontBody2"
|
||||
android:textAppearance="@style/TextAppearance.Body2"
|
||||
tools:text="@string/by_distance" />
|
||||
</LinearLayout>
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:padding="@dimen/margin_half"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="19sp"
|
||||
android:autoSizeMaxTextSize="24sp"
|
||||
android:minHeight="60dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -34,8 +34,7 @@
|
||||
android:textAppearance="?android:attr/textAppearance"
|
||||
android:gravity="start|top"
|
||||
android:textColor="?attr/colorSecondary"
|
||||
android:text="@string/category_desc_more"
|
||||
android:background="@android:color/transparent"/>
|
||||
android:text="@string/category_desc_more" />
|
||||
<include
|
||||
layout="@layout/item_divider"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -82,13 +82,15 @@
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/place_page_last_checked"
|
||||
style="?fontCaption"
|
||||
style="@style/TextAppearance.Caption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/margin_half"
|
||||
android:paddingHorizontal="@dimen/margin_base"
|
||||
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_add"/>
|
||||
|
||||
65
android/app/src/main/res/layout/place_page_map_too_old.xml
Normal file
65
android/app/src/main/res/layout/place_page_map_too_old.xml
Normal 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>
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/oh_check_date"
|
||||
style="?fontCaption"
|
||||
style="@style/TextAppearance.Caption"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
|
||||
@@ -6,11 +6,10 @@
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
<ProgressBar
|
||||
style="@style/Widget.AppCompat.ProgressBar"
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null" />
|
||||
android:indeterminate="true"/>
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -6,9 +6,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/search_show_on_map"
|
||||
style="@style/FAB"
|
||||
style="@style/MwmWidget.ExtendedFAB"
|
||||
app:icon="@drawable/ic_show_on_map"
|
||||
android:text="@string/search_show_on_map"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:fabSize="mini"/>
|
||||
android:focusable="true" />
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
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_height="@dimen/height_block_base"
|
||||
android:padding="@dimen/margin_half"
|
||||
android:background="@null"/>
|
||||
android:indeterminate="true"
|
||||
app:trackColor="@color/text_light"
|
||||
app:indicatorColor="@color/text_light" />
|
||||
|
||||
@@ -34,16 +34,17 @@
|
||||
android:singleLine="true"
|
||||
android:textCursorDrawable="@drawable/cursor_drawable" />
|
||||
|
||||
<ProgressBar
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/progress"
|
||||
style="@style/Widget.AppCompat.ProgressBar"
|
||||
android:layout_width="@dimen/search_progress_size"
|
||||
android:layout_height="@dimen/search_progress_size"
|
||||
android:layout_marginEnd="@dimen/margin_half"
|
||||
android:layout_weight="0"
|
||||
android:background="@null"
|
||||
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
|
||||
android:id="@+id/clear"
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
<!-- location service disabled -->
|
||||
<string name="enable_location_services">Activeu els serveis de geolocalització</string>
|
||||
<string name="save">Desa</string>
|
||||
<string name="create">crea</string>
|
||||
<string name="create">Crear</string>
|
||||
<!-- red color -->
|
||||
<string name="red">Vermell</string>
|
||||
<!-- yellow color -->
|
||||
@@ -473,7 +473,7 @@
|
||||
<string name="error_enter_correct_house_number">Introduïu un número d’edifici vàlid</string>
|
||||
<!-- 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="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>
|
||||
<!-- Title for OSM note section in the editor -->
|
||||
<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 -->
|
||||
<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. -->
|
||||
<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_1">Assegureu-vos que no heu introduït cap dada personal.</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>
|
||||
<!-- Shown as toast when starting the recent track recording -->
|
||||
<string name="track_recording">S’està enregistrant el recorregut</string>
|
||||
@@ -875,4 +875,41 @@
|
||||
<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="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>
|
||||
|
||||
@@ -905,4 +905,6 @@
|
||||
</plurals>
|
||||
<string name="power_management">Správa výkonu</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>
|
||||
|
||||
@@ -607,7 +607,7 @@
|
||||
<!-- Recommended length for CarPlay and Android Auto is around 25-27 characters -->
|
||||
<string name="avoid_tolls">Undgå betalingsveje</string>
|
||||
<!-- 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 -->
|
||||
<string name="avoid_ferry">Undgå færger</string>
|
||||
<string name="avoid_motorways">Undgå motorveje</string>
|
||||
@@ -894,4 +894,6 @@
|
||||
<string name="editor_submit">Indsend</string>
|
||||
<string name="power_management">Strømstyring</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>
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
<string name="prefs_group_information">Información</string>
|
||||
<string name="prefs_group_route">Navegación</string>
|
||||
<string name="pref_zoom_title">Botones de zoom</string>
|
||||
<string name="pref_zoom_summary">Visualizar en la pantalla</string>
|
||||
<string name="pref_zoom_summary">Ver en el mapa</string>
|
||||
<!-- Settings «Map» category: «Night style» title -->
|
||||
<string name="pref_map_style_title">Modo nocturno</string>
|
||||
<!-- Generic «Off» string -->
|
||||
@@ -297,7 +297,7 @@
|
||||
<!-- location service disabled -->
|
||||
<string name="enable_location_services">Por favor, activa los Servicios de Localización</string>
|
||||
<string name="save">Guardar</string>
|
||||
<string name="create">crear</string>
|
||||
<string name="create">Crear</string>
|
||||
<!-- red color -->
|
||||
<string name="red">Rojo</string>
|
||||
<!-- yellow color -->
|
||||
@@ -493,7 +493,7 @@
|
||||
<string name="editor_category_unsuitable_title">¿No halla una categoría adecuada?</string>
|
||||
<string name="editor_category_unsuitable_text">CoMaps permite añadir únicamente categorías de puntos sencillos, es decir, no ciudades, carreteras, lagos, contornos de edificios, etc. Por favor, añade dichas categorías directamente en <a href="https://www.openstreetmap.org">OpenStreetMap.org</a>. Consulta nuestra <a href="https://www.comaps.app/support/advanced-map-editing/">guía</a> para obtener instrucciones detalladas paso a paso.</string>
|
||||
<string name="downloader_no_downloaded_maps_title">No has descargado ningún mapa</string>
|
||||
<string name="downloader_no_downloaded_maps_message">Descargue mapas para encontrar la ubicación y navegar sin conexión</string>
|
||||
<string name="downloader_no_downloaded_maps_message">Descarga mapas para buscar ubicaciones y navegar sin conexión</string>
|
||||
<string name="current_location_unknown_error_title">Se desconoce la ubicación actual</string>
|
||||
<!-- abbreviation for kilometers per hour -->
|
||||
<string name="kilometers_per_hour">km/h</string>
|
||||
@@ -524,11 +524,11 @@
|
||||
<!-- Displayed when saving some edits to the map to warn against publishing personal data -->
|
||||
<string name="editor_share_to_all_dialog_title">¿Quieres enviarlo a todos los usuarios?</string>
|
||||
<!-- Dialog before publishing the modifications to the public map. -->
|
||||
<string name="editor_share_to_all_dialog_message_1">Cerciórate de que no has introducido ningún dato privado o personal</string>
|
||||
<string name="editor_share_to_all_dialog_message_2">Los editores de OpenStreetMap comprobarán los cambios y se pondrán en contacto contigo si tienen alguna pregunta</string>
|
||||
<string name="editor_share_to_all_dialog_message_1">Cerciórate de que no has introducido ningún dato privado o personal.</string>
|
||||
<string name="editor_share_to_all_dialog_message_2">Los editores de OpenStreetMap comprobarán los cambios y se pondrán en contacto contigo si tienen alguna pregunta.</string>
|
||||
<string name="navigation_stop_button">Detener</string>
|
||||
<!-- Shown as toast when starting the recent track recording -->
|
||||
<string name="track_recording">Grabando el trayeco</string>
|
||||
<string name="track_recording">Grabando el trayecto</string>
|
||||
<!-- For the first routing -->
|
||||
<string name="accept">Aceptar</string>
|
||||
<!-- For the first routing -->
|
||||
@@ -539,7 +539,7 @@
|
||||
<string name="mobile_data_option_not_today">No usar hoy</string>
|
||||
<string name="mobile_data">Internet móvil</string>
|
||||
<!-- NOTE to translators: please synchronize your translation with the English one. -->
|
||||
<string name="mobile_data_description">Se requiere Internet móvil para recibir notificaciones de actualización de mapas y cargar ediciones</string>
|
||||
<string name="mobile_data_description">Se requiere conexión a Internet para recibir notificaciones de actualización de mapas y cargar ediciones</string>
|
||||
<string name="mobile_data_option_never">No usar nunca</string>
|
||||
<string name="mobile_data_option_ask">Preguntar siempre</string>
|
||||
<string name="traffic_update_maps_text">Para mostrar los datos de tráfico, deben actualizarse los mapas</string>
|
||||
|
||||
@@ -903,4 +903,6 @@
|
||||
<string name="editor_submit">Saada</string>
|
||||
<string name="power_management">Toitehaldus</string>
|
||||
<string name="charge_socket_schuko">EU-sisene</string>
|
||||
<string name="prefs_speed_cameras_information">Kiiruskaamerate teavitused on nendes riikides lülitatud välja, kus seda keelab kohalik seadusandlus.</string>
|
||||
<string name="navigation_start_tts_message">"Alustan tee juhatamist, hääljuhiste keel: "</string>
|
||||
</resources>
|
||||
|
||||
@@ -868,4 +868,5 @@
|
||||
<string name="opens_day_at">1$s ean %2$s tan irekitzen da</string>
|
||||
<string name="closes_day_at">%1$s ean %2$s etan itxiko da</string>
|
||||
<string name="editor_place_doesnt_exist_description">Deskribatu nolakoa den lekua orain OpenStreetMap komunitateari errore-ohar bat bidaltzeko.</string>
|
||||
<string name="offline_explanation_title">Lineaz kanpoko mapak</string>
|
||||
</resources>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user