Merge pull request #8801 from osmandapp/Fix_2_edit_fav_icons

Fix 2 edit fav icons
This commit is contained in:
max-klaus 2020-04-16 18:42:59 +03:00 committed by GitHub
commit 28c6491911
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 260 additions and 206 deletions

View file

@ -22,7 +22,7 @@
android:paddingStart="@dimen/list_content_padding"
android:paddingRight="0dp"
android:paddingEnd="0dp"
android:minHeight="@dimen/list_item_height"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:background="?attr/expandable_list_item_background">
<CheckBox
@ -46,13 +46,13 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/list_content_padding"
android:layout_marginLeft="@dimen/list_content_padding_large"
android:layout_weight="1"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="Category name"
android:layout_marginStart="@dimen/list_content_padding" />
android:layout_marginStart="@dimen/list_content_padding_large" />
<ImageView
android:id="@+id/options"

View file

@ -5,7 +5,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/expandable_list_item_background"
android:minHeight="@dimen/list_item_height"
android:minHeight="@dimen/favorites_list_item_height"
android:orientation="vertical">
<View
@ -20,41 +20,45 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"
android:layout_marginLeft="54dp"
android:visibility="gone"
android:layout_marginStart="54dp" />
android:layout_marginLeft="@dimen/settings_divider_margin_start"
android:layout_marginStart="@dimen/settings_divider_margin_start" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/favorites_list_item_height"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/list_header_padding"
android:paddingLeft="@dimen/list_header_padding"
android:paddingStart="@dimen/list_header_padding">
android:paddingEnd="@dimen/list_header_padding"
android:paddingRight="@dimen/list_header_padding">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
android:layout_width="@dimen/favorites_icon_size"
android:layout_height="match_parent"
android:layout_gravity="center_vertical">
<CheckBox
android:id="@+id/toggle_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/list_content_padding"
android:layout_marginStart="@dimen/list_header_padding"
android:layout_marginLeft="@dimen/list_header_padding"
android:focusable="false"
android:visibility="gone"
tools:visibility="visible"
android:layout_marginEnd="@dimen/list_content_padding" />
tools:visibility="visible" />
<ImageView
android:id="@+id/favourite_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_gravity="center"
android:contentDescription="@string/favorite"
android:scaleType="center"
android:layout_marginRight="@dimen/list_header_settings_top_margin"
android:layout_marginEnd="@dimen/list_header_settings_top_margin" />
tools:src="@drawable/bg_point_circle"/>
</FrameLayout>
<LinearLayout
@ -63,16 +67,21 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingTop="6dp"
android:paddingRight="@dimen/list_content_padding"
android:paddingBottom="6dp"
android:paddingEnd="@dimen/list_content_padding">
android:layout_marginStart="@dimen/favorites_icon_right_margin"
android:layout_marginLeft="@dimen/favorites_icon_right_margin"
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:paddingTop="@dimen/context_menu_padding_margin_small"
android:paddingBottom="@dimen/context_menu_padding_margin_small">
<TextView
android:id="@+id/favourite_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:scrollbars="none"
android:textColor="?android:textColorPrimary"
android:layout_marginBottom="@dimen/subHeaderPadding"
android:textSize="@dimen/default_list_text_size"
tools:text="@string/lorem_ipsum" />
@ -85,60 +94,63 @@
android:id="@+id/direction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="2dp"
android:layout_gravity="center_vertical"
android:contentDescription="@string/show_view_angle"
android:src="@drawable/ic_direction_arrow" />
<TextView
android:id="@+id/distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginStart="@dimen/gpx_small_icon_margin"
android:layout_marginLeft="@dimen/gpx_small_icon_margin"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size"
tools:text="100500 km"
android:layout_marginStart="2dp" />
android:textSize="@dimen/default_desc_text_size"
tools:text="100500 km" />
<ImageView
android:id="@+id/group_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:src="@drawable/ic_small_group"
android:layout_marginStart="4dp" />
android:layout_marginStart="@dimen/list_item_button_padding"
android:layout_marginLeft="@dimen/list_item_button_padding"
android:contentDescription="@string/favorite_category_name"
android:src="@drawable/ic_small_group" />
<TextView
android:id="@+id/group_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="2dp"
android:layout_marginStart="@dimen/gpx_small_icon_margin"
android:layout_marginLeft="@dimen/gpx_small_icon_margin"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size"
android:layout_marginStart="2dp" />
android:textSize="@dimen/default_desc_text_size" />
</LinearLayout>
</LinearLayout>
<ImageButton
android:id="@+id/navigate_to"
android:contentDescription="@string/context_menu_item_directions_to"
android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dashFavIconMargin"
android:layout_marginLeft="@dimen/dashFavIconMargin"
android:background="?attr/dashboard_button"
android:contentDescription="@string/context_menu_item_directions_to"
android:src="@drawable/ic_action_test_light"
android:visibility="gone"
android:layout_marginStart="@dimen/dashFavIconMargin" />
android:visibility="gone" />
<ImageButton
android:id="@+id/options"
android:contentDescription="@string/shared_string_more"
android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height"
android:layout_gravity="center_vertical"
android:background="?attr/dashboard_button"
android:contentDescription="@string/shared_string_more"
android:src="@drawable/ic_overflow_menu_white"
android:visibility="gone" />
</LinearLayout>

View file

@ -139,7 +139,6 @@
android:paddingStart="12dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:scrollHorizontally="false"
android:textSize="16sp"
tools:text="@string/lorem_ipsum" />

View file

@ -3363,7 +3363,7 @@
<string name="simulate_your_location_gpx_descr">محاكاة موقعك باستخدام مسار GPX مسجل.</string>
<string name="quick_action_directions_from_desc">زر لجعل مركز الشاشة نقطة الانطلاق. سيطلب بعد ذلك تعيين الوجهة أو تشغيل حساب المسار.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">شخصي</string>
<string name="shared_string_downloading_formatted">تنزيل %s</string>
<string name="rendering_value_thick_name">سميك</string>

View file

@ -3368,7 +3368,7 @@
<string name="save_heading">Захоўваць кірунак</string>
<string name="save_heading_descr">Падчас запісу захоўваць кірунак для кожнага пункта маршруту.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Асабісты</string>
<string name="shared_string_downloading_formatted">Спампоўванне %s</string>
<string name="rendering_value_thick_name">Тоўста</string>

View file

@ -3404,7 +3404,7 @@ Abasta l\'àrea: %1$s x %2$s</string>
<string name="join_segments">Uneix segments</string>
<string name="add_new_profile_q">Voleu afegir el nou perfil \'%1$s\'\?</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personal</string>
<string name="shared_string_downloading_formatted">S\'està baixant %s</string>
<string name="rendering_attr_showCycleNodeNetworkRoutes_name">Mostra les vies ciclistes de xarxa de nodes</string>

View file

@ -3406,7 +3406,7 @@ Repræsenterer område: %1$s x %2$s</string>
<string name="save_heading">Medtag retning</string>
<string name="save_heading_descr">Gem retning for hvert sporpunkt under optagelse.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personlig</string>
<string name="shared_string_downloading_formatted">Henter %s</string>
<string name="rendering_value_thick_name">Tyk</string>

View file

@ -3410,7 +3410,7 @@ Lon %2$s</string>
<string name="save_heading">Richtung einbeziehen</string>
<string name="save_heading_descr">Richtung zu jedem Trackpunkt während der Aufnahme speichern.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Persönlich</string>
<string name="shared_string_downloading_formatted">%s herunterladen</string>
<string name="rendering_value_thick_name">Fett</string>

View file

@ -3403,7 +3403,7 @@
<string name="save_heading">Συμπερίληψη κατεύθυνσης</string>
<string name="save_heading_descr">Αποθήκευση κατεύθυνσης για κάθε σημείο ίχνους κατά την εγγραφή.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Προσωπικό</string>
<string name="shared_string_downloading_formatted">Λήψη %s</string>
<string name="rendering_value_thick_name">Πυκνός</string>

View file

@ -3386,7 +3386,7 @@ Indikas lokon: %1$s x %2$s"</string>
<string name="save_heading">Inkluzivi direkton</string>
<string name="save_heading_descr">Konservi direkton al ĉiu punkto de kurso dum registri.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personaj</string>
<string name="shared_string_downloading_formatted">Elŝutado de %s</string>
<string name="rendering_value_thick_name">Dika</string>

View file

@ -3405,7 +3405,7 @@ Lon %2$s</string>
<string name="save_heading">Incluir rumbo</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="save_heading_descr">Guarda el rumbo para cada punto de la traza durante la grabación.</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personal</string>
<string name="shared_string_downloading_formatted">Descargando %s</string>
<string name="rendering_value_thick_name">Espesor</string>

View file

@ -3405,7 +3405,7 @@ Lon %2$s</string>
<string name="save_heading">Incluir rumbo</string>
<string name="save_heading_descr">Guarda el rumbo para cada punto de la traza durante la grabación.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personal</string>
<string name="shared_string_downloading_formatted">Descargando %s</string>
<string name="rendering_value_thick_name">Espesor</string>

View file

@ -3395,7 +3395,7 @@
<string name="save_heading">Incluir rumbo</string>
<string name="save_heading_descr">Guarda el rumbo para cada punto de la traza durante la grabación.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personal</string>
<string name="shared_string_downloading_formatted">Descargando %s</string>
<string name="rendering_value_thick_name">Grueso</string>

View file

@ -1033,7 +1033,7 @@
<string name="save_heading">Kaasa pealkiri</string>
<string name="save_heading_descr">Salvestamise ajal salvesta kurss igasse teekonnapunkti.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Isiklik</string>
<string name="shared_string_downloading_formatted">Allalaadimine %s</string>
<string name="rendering_value_thick_name">Jäme</string>

View file

@ -3409,7 +3409,7 @@ Area honi dagokio: %1$s x %2$s</string>
<string name="save_heading">Sartu norabidea</string>
<string name="save_heading_descr">Gorde lorratzeko puntu bakoitzerako norabidea grabatzean.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Pertsonala</string>
<string name="shared_string_downloading_formatted">%s deskargatzen</string>
<string name="rendering_value_thick_name">Lodia</string>

View file

@ -3431,7 +3431,7 @@
<string name="save_heading">ثبت جهت</string>
<string name="save_heading_descr">هنگام ضبط، جهت (heading) را برای هر یک از نقطه‌های رد ثبت می‌کند.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s، %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s، %2$s</string>
<string name="personal_category_name">شخصی</string>
<string name="shared_string_downloading_formatted">در حال بارگیری %s</string>
<string name="rendering_value_thick_name">ضخیم</string>

View file

@ -3376,7 +3376,7 @@ représentant la zone : %1$s x %2$s</string>
<string name="rendering_value_walkingRoutesOSMCNodes_name">Réseaux</string>
<string name="personal_category_name">Personnel</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="shared_string_downloading_formatted">Téléchargement %s</string>
<string name="rendering_value_thick_name">Épais</string>
<string name="desert_render_descr">Pour les déserts et autres zones faiblement peuplées, affiche plus de détails.</string>

View file

@ -3476,7 +3476,7 @@ Lon %2$s</string>
<string name="save_heading">Incluír encabezamento</string>
<string name="save_heading_descr">Gardar encabezamento en cada punto da pista (trackpoint) mentres se grava.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Persoal</string>
<string name="shared_string_downloading_formatted">Baixando %s</string>
<string name="rendering_value_thick_name">Groso</string>

View file

@ -3395,7 +3395,7 @@
<string name="save_heading">כולל הכותרת</string>
<string name="save_heading_descr">לשמור את הכותרת של כל נקודת דרך בזמן ההקלטה.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">אישי</string>
<string name="shared_string_downloading_formatted">%s בהורדה</string>
<string name="routing_attr_allow_classic_only_description">מסלולים שעבור גרומינג לסגנון קלסי רק ללא מסלולי ההחלקה. לרבות מסלולים שעברו גרומינג על ידי אופנוע שלג עם תוואי רופף ומסלולים שנסללו ידנית על ידי גולשי סקי.</string>

View file

@ -3233,7 +3233,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük
<string name="suggested_maps">Javasolt térképek</string>
<string name="add_new_profile_q">Hozzáadja az új „%1$s” profilt\?</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Személyes</string>
<string name="shared_string_downloading_formatted">%s letöltése</string>
<string name="new_route_calculated_dist_dbg">Útvonal: távolság %s, menetidő %s

View file

@ -3413,7 +3413,7 @@ Stendur fyrir svæði: %1$s x %2$s</string>
<string name="save_heading">Hafa með stefnu</string>
<string name="save_heading_descr">Vista stefnu í hvern ferilpunkt á meðan upptöku stendur.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Persónulegt</string>
<string name="shared_string_downloading_formatted">Sæki %s</string>
<string name="rendering_value_thick_name">Svert</string>

View file

@ -3397,7 +3397,7 @@ Rappresenta l\'area: %1$s x %2$s</string>
<string name="save_heading">Salva orientamento</string>
<string name="save_heading_descr">Durante la registrazione salva l\'orientamento per ogni punto della traccia</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personale</string>
<string name="shared_string_downloading_formatted">Scaricamento %s</string>
<string name="rendering_attr_piste_type_snow_park_name">Parco innevato</string>

View file

@ -3409,7 +3409,7 @@ POIの更新は利用できません</string>
<string name="rendering_value_thick_name">濃い</string>
<string name="desert_render_descr">砂漠などの過疎地に向いたマップスタイルです。各情報の詳細も表示されます。</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="select_navigation_icon">移動中の位置アイコン</string>
<string name="select_map_icon">静止中の位置アイコン</string>
<string name="delete_profiles_descr">[決定]をタップすると、プロファイルが完全に削除されます。</string>

View file

@ -362,7 +362,7 @@
<string name="save_heading">ಶೀರ್ಷಿಕೆಯನ್ನು ಸೇರಿಸಿ</string>
<string name="save_heading_descr">ರೆಕಾರ್ಡಿಂಗ್ ಮಾಡುವಾಗ ಪ್ರತಿ ಟ್ರ್ಯಾಕ್ ಪಾಯಿಂಟ್‌ಗೆ ಶೀರ್ಷಿಕೆ ಉಳಿಸಿ.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">ವೈಯಕ್ತಿಕ</string>
<string name="shared_string_downloading_formatted">ಡೌನ್‌ಲೋಡ್ ಮಾಡಲಾಗುತ್ತಿದೆ%s</string>
<string name="rendering_value_thick_name">ದಪ್ಪ</string>

View file

@ -3406,7 +3406,7 @@
<string name="shared_string_turn_off">Skru av</string>
<string name="new_plugin_added">Nytt programtillegg lagt til</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personlig</string>
<string name="shared_string_downloading_formatted">Laster ned %s</string>
<string name="rendering_value_thick_name">Tykk</string>

View file

@ -3281,7 +3281,7 @@ voor Gebied: %1$s x %2$s</string>
<string name="save_heading">Richting toevoegen</string>
<string name="personal_category_name">Persoonlijk</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="shared_string_downloading_formatted">Downloaden %s</string>
<string name="desert_render_descr">Voor woestijnen en andere dunbevolkte gebieden. Meer gedetailleerd.</string>
<string name="rendering_value_thick_name">Dik</string>

View file

@ -3403,7 +3403,7 @@ Reprezentuje obszar: %1$s x %2$s</string>
<string name="save_heading">Dołączenie kierunku</string>
<string name="save_heading_descr">Zapisuje podczas rejestrowania kierunek do każdego punktu trasy.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Osobiste</string>
<string name="shared_string_downloading_formatted">Pobieranie %s</string>
<string name="desert_render_descr">Dla pustyń i innych słabo zaludnionych obszarów. Bardziej szczegółowa.</string>

View file

@ -3392,7 +3392,7 @@ Pôr do Sol: %2$s</string>
<string name="save_heading">Incluir direção</string>
<string name="save_heading_descr">Salve o cabeçalho em cada ponto da trilha durante a gravação.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Pessoal</string>
<string name="shared_string_downloading_formatted">Baixando %s</string>
<string name="rendering_value_thick_name">Grosso</string>

View file

@ -3377,7 +3377,7 @@
<string name="save_heading">Incluir a direção</string>
<string name="save_heading_descr">Gravar direção para cada ponto de pista durante a gravação.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Pessoal</string>
<string name="shared_string_downloading_formatted">Descarregando %s</string>
<string name="rendering_value_thick_name">Grosso</string>

View file

@ -2654,7 +2654,7 @@
<string name="save_heading">Includeți titlu</string>
<string name="save_heading_descr">Salvați poziția fiecarui punct al traseului în timpul înregistrării.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personal</string>
<string name="shared_string_downloading_formatted">Descarcarea %s</string>
<string name="rendering_value_thick_name">Gros</string>

View file

@ -3354,7 +3354,7 @@
<string name="suggested_maps">Предлагаемые карты</string>
<string name="join_segments">Объединить сегменты</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="desert_render_descr">Для пустынь и других малонаселенных районов. Более детально.</string>
<string name="select_navigation_icon">Положение значка при движении</string>
<string name="select_map_icon">Положение значка в состоянии покоя</string>

View file

@ -3404,7 +3404,7 @@ Pro praghere iscrie su còdighe intreu</string>
<string name="save_heading">Inclue sa diretzione</string>
<string name="save_heading_descr">Sarva sa diretzione pro cada puntu cando ses registrende.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personale</string>
<string name="shared_string_downloading_formatted">Iscarrighende %s</string>
<string name="rendering_value_thick_name">Grussa</string>

View file

@ -3392,7 +3392,7 @@ Zodpovedá oblasti: %1$s x %2$s</string>
<string name="save_heading">Pridať nadpis</string>
<string name="save_heading_descr">Pridať nadpis ku každému bodu trasy pri zázname.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Osobné</string>
<string name="shared_string_downloading_formatted">Sťahujem %s</string>
<string name="rendering_value_thick_name">Hrubé</string>

View file

@ -3275,7 +3275,7 @@ Koda predstavlja območje: %1$s x %2$s</string>
<string name="save_heading">Vključi glavo</string>
<string name="save_heading_descr">Shrani glavo k vsaki točki sledi med beleženjem.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Osebno</string>
<string name="shared_string_downloading_formatted">Poteka prejemanje %s</string>
<string name="rendering_value_thick_name">Debelo</string>

View file

@ -3402,7 +3402,7 @@
<string name="save_heading">Укључи заглавље</string>
<string name="save_heading_descr">Сачувај заглавље свакој тачки праћења приликом снимања.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Лични</string>
<string name="shared_string_downloading_formatted">Преузимам %s</string>
<string name="rendering_value_thick_name">Дебело</string>

View file

@ -3360,7 +3360,7 @@
<string name="save_heading">Başlığı dahil et</string>
<string name="save_heading_descr">Kayıt sırasında her izleme noktasına başlığı kaydet.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Kişisel</string>
<string name="shared_string_downloading_formatted">%s indiriliyor</string>
<string name="rendering_value_thick_name">Kalın</string>

View file

@ -3395,7 +3395,7 @@
<string name="save_heading">Зберегти заголовок</string>
<string name="save_heading_descr">Зберегти заголовок для кожної точки треку під час запису.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Особистий</string>
<string name="shared_string_downloading_formatted">Завантаження %s</string>
<string name="rendering_value_thick_name">Товсто</string>

View file

@ -3395,7 +3395,7 @@
<string name="save_heading">包含標題</string>
<string name="save_heading_descr">在記錄時將標題儲存到每個追蹤點。</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">個人</string>
<string name="shared_string_downloading_formatted">正在下載 %s</string>
<string name="rendering_value_thick_name">密集</string>

View file

@ -71,6 +71,7 @@
<dimen name="favorites_icon_right_margin">24dp</dimen>
<dimen name="favorites_icon_size">40dp</dimen>
<dimen name="favorites_list_item_height">66dp</dimen>
<dimen name="local_index_check_right_margin">10dp</dimen>
<dimen name="favorites_icon_top_margin">13dp</dimen>
<dimen name="dialog_elements_vertical_margin">16dp</dimen>

View file

@ -11,6 +11,7 @@
Thx - Hardy
-->
<string name="custom_color">Custom color</string>
<string name="lang_lmo">Lombard</string>
<string name="lang_an">Aragonese</string>
<string name="lang_ba">Bashkir</string>
@ -244,7 +245,7 @@
<string name="edit_profiles">Edit profiles</string>
<string name="select_nav_profile_dialog_message">The \'Navigation type\' governs how routes are calculated.</string>
<string name="ltr_or_rtl_combine_via_bold_point">%1$s • %2$s</string>
<string name="street_city">%1$s, %2$s</string>
<string name="ltr_or_rtl_combine_via_comma">%1$s, %2$s</string>
<string name="personal_category_name">Personal</string>
<string name="add_new_profile_q">Add the new profile \'%1$s\'?</string>
<string name="save_heading">Include heading</string>

View file

@ -77,7 +77,11 @@ public class FavouritePoint implements Serializable, LocationPoint {
}
public int getColor() {
if ((color & 0xFF000000) != 0) {
return color;
} else {
return color | 0xFF000000;
}
}
public String getAddress() {

View file

@ -1,5 +1,6 @@
package net.osmand.plus;
import android.app.Activity;
import android.content.Context;
import androidx.annotation.NonNull;
@ -101,7 +102,11 @@ public class FavouritesDbHelper {
}
public int getColor() {
if ((color & 0xFF000000) != 0) {
return color;
} else {
return color | 0xFF000000;
}
}
public boolean isVisible() {
@ -354,7 +359,7 @@ public class FavouritesDbHelper {
}
}
public static AlertDialog.Builder checkDuplicates(FavouritePoint p, FavouritesDbHelper fdb, Context uiContext) {
public static AlertDialog.Builder checkDuplicates(FavouritePoint p, FavouritesDbHelper fdb, Activity activity) {
boolean emoticons = false;
String index = "";
int number = 0;
@ -383,12 +388,15 @@ public class FavouritesDbHelper {
}
}
if ((index.length() > 0 || emoticons)) {
AlertDialog.Builder builder = new AlertDialog.Builder(uiContext);
OsmandApplication app = (OsmandApplication) activity.getApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
Context themedContext = UiUtilities.getThemedContext(activity, nightMode);
AlertDialog.Builder builder = new AlertDialog.Builder(themedContext);
builder.setTitle(R.string.fav_point_dublicate);
if (emoticons) {
builder.setMessage(uiContext.getString(R.string.fav_point_emoticons_message, name));
builder.setMessage(activity.getString(R.string.fav_point_emoticons_message, name));
} else {
builder.setMessage(uiContext.getString(R.string.fav_point_dublicate_message, name));
builder.setMessage(activity.getString(R.string.fav_point_dublicate_message, name));
}
p.setName(name);
return builder;

View file

@ -5,7 +5,6 @@ package net.osmand.plus.activities;
import android.app.Activity;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
@ -29,6 +28,7 @@ import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.UiUtilities.UpdateLocationViewCache;
import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
@ -200,8 +200,8 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
if (row == null) {
LayoutInflater inflater = activity.getLayoutInflater();
row = inflater.inflate(R.layout.favorites_list_item, parent, false);
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
row = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.favorites_list_item, parent, false);
}
TextView name = (TextView) row.findViewById(R.id.favourite_label);

View file

@ -840,7 +840,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
int color = model.getColor() == 0 || model.getColor() == Color.BLACK ? getResources().getColor(R.color.color_favorite) : model.getColor();
if (!model.isPersonal()) {
setCategoryIcon(app, app.getUIUtilities().getPaintedIcon(
R.drawable.ic_action_fav_dark, visible ? (color | 0xff000000) : getResources().getColor(disabledColor)),
R.drawable.ic_action_folder, visible ? color : getResources().getColor(disabledColor)),
groupPosition, isExpanded, row, light);
}
adjustIndicator(app, groupPosition, isExpanded, row, light);
@ -955,7 +955,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
name.setTextColor(getResources().getColor(visible ? enabledColor : disabledColor));
distanceText.setText(distance);
if (model.isAddressSpecified()) {
distanceText.setText(String.format(getString(R.string.ltr_or_rtl_combine_via_bold_point), distance.trim(), model.getAddress()));
distanceText.setText(String.format(getString(R.string.ltr_or_rtl_combine_via_comma), distance.trim(), model.getAddress()));
}
icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(),
visible ? model.getColor() : getResources().getColor(disabledIconColor), false, model));

View file

@ -29,6 +29,7 @@ import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.FavoritesListFragment.FavouritesAdapter;
import net.osmand.plus.activities.MapActivity;
@ -41,6 +42,8 @@ public class FavoriteDialogs {
public static Dialog createReplaceFavouriteDialog(final Activity activity, final Bundle args) {
OsmandApplication app = (OsmandApplication) activity.getApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
Context themedContext = UiUtilities.getThemedContext(activity, nightMode);
final FavouritesDbHelper helper = app.getFavorites();
final List<FavouritePoint> points = new ArrayList<FavouritePoint>(helper.getFavouritePoints());
final FavouritesAdapter favouritesAdapter = new FavouritesAdapter(activity, points,false);
@ -56,15 +59,18 @@ public class FavoriteDialogs {
favouritesAdapter.sortByDefault(true);
if(points.size() == 0){
Toast.makeText(activity, activity.getString(R.string.fav_points_not_exist), Toast.LENGTH_SHORT).show();
Toast.makeText(themedContext, activity.getString(R.string.fav_points_not_exist), Toast.LENGTH_SHORT).show();
return null;
}
return showFavoritesDialog(activity, favouritesAdapter, click, null, dlgHolder, true);
return showFavoritesDialog(themedContext, favouritesAdapter, click, null, dlgHolder, true);
}
private static void confirmReplace(final Activity activity, final Bundle args, final FavouritesDbHelper helper,
final FavouritesAdapter favouritesAdapter, final Dialog[] dlgHolder, int position) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
OsmandApplication app = (OsmandApplication) activity.getApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
Context themedContext = UiUtilities.getThemedContext(activity, nightMode);
AlertDialog.Builder builder = new AlertDialog.Builder(themedContext);
builder.setTitle(R.string.update_existing);
final FavouritePoint fp = favouritesAdapter.getItem(position);
builder.setMessage(activity.getString(R.string.replace_favorite_confirmation, fp.getName()));
@ -111,10 +117,13 @@ public class FavoriteDialogs {
}
public static Dialog createAddFavouriteDialog(final Activity activity, final Bundle args) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
final OsmandApplication app = (OsmandApplication) activity.getApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
final Context themedContext = UiUtilities.getThemedContext(activity, nightMode);
AlertDialog.Builder builder = new AlertDialog.Builder(themedContext);
builder.setTitle(R.string.favourites_context_menu_edit);
final View v = activity.getLayoutInflater().inflate(R.layout.favorite_edit_dialog, null, false);
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
final View v = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.favorite_edit_dialog, null, false);
final FavouritesDbHelper helper = app.getFavorites();
builder.setView(v);
final EditText editText = (EditText) v.findViewById(R.id.Name);
final EditText description = (EditText) v.findViewById(R.id.description);
@ -125,15 +134,14 @@ public class FavoriteDialogs {
list[i] = gs.get(i).getName();
}
cat.setAdapter(new ArrayAdapter<String>(activity, R.layout.list_textview, list));
if (((OsmandApplication)activity.getApplication()).accessibilityEnabled()) {
if (app.accessibilityEnabled()) {
final TextView textButton = (TextView)v.findViewById(R.id.TextButton);
textButton.setClickable(true);
textButton.setFocusable(true);
textButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlertDialog.Builder b = new AlertDialog.Builder(activity);
AlertDialog.Builder b = new AlertDialog.Builder(themedContext);
b.setTitle(R.string.access_category_choice);
b.setItems(list, new DialogInterface.OnClickListener() {
@Override
@ -165,7 +173,6 @@ public class FavoriteDialogs {
@Override
public void onClick(DialogInterface dialog, int which) {
final FavouritePoint point = (FavouritePoint) args.getSerializable(KEY_FAVORITE);
OsmandApplication app = (OsmandApplication) activity.getApplication();
String categoryStr = cat.getText().toString().trim();
final FavouritesDbHelper helper = app.getFavorites();
app.getSettings().LAST_FAV_CATEGORY_ENTERED.set(categoryStr);

View file

@ -1,12 +1,9 @@
package net.osmand.plus.helpers;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
@ -15,7 +12,7 @@ import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.TextView;
import androidx.annotation.ColorRes;
import androidx.annotation.ColorInt;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -26,7 +23,7 @@ import java.util.Random;
import gnu.trove.list.array.TIntArrayList;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
import static net.osmand.AndroidUtils.dpToPx;
public class ColorDialogs {
public static int[] paletteColors = new int[] {
@ -45,17 +42,17 @@ public class ColorDialogs {
};
public static int[] pallette = new int[] {
0xb4eecc22,
0xb4d00d0d,
0xb4ff5020,
0xb4eeee10,
0xb488e030,
0xb400842b,
0xb410c0f0,
0xb41010a0,
0xb4a71de1,
0xb4e044bb,
0xb48e2512,
0xffeecc22,
0xffd00d0d,
0xffff5020,
0xffeeee10,
0xff88e030,
0xff00842b,
0xff10c0f0,
0xff1010a0,
0xffa71de1,
0xffe044bb,
0xff8e2512,
0xff000001
};
@ -171,7 +168,7 @@ public class ColorDialogs {
colorSpinner.setSelection(selection);
}
public static void setupColorSpinnerEx(final Activity ctx, int selectedColor, final Spinner colorSpinner,
public static void setupColorSpinnerEx(final Context ctx, int selectedColor, final Spinner colorSpinner,
final TIntArrayList colors, OnItemSelectedListener listener) {
colors.add(pallette);
List<String> colorNames = new ArrayList<String>();
@ -237,16 +234,15 @@ public class ColorDialogs {
return "#" + c; //$NON-NLS-1$
}
private static Drawable getIcon(final Activity activity, int resId, int color) {
OsmandApplication app = (OsmandApplication)activity.getApplication();
Drawable d = app.getResources().getDrawable(resId).mutate();
private static Drawable getIcon(final Context ctx, int resId, int color) {
Drawable d = ctx.getResources().getDrawable(resId).mutate();
d.clearColorFilter();
d.setColorFilter(color, PorterDuff.Mode.SRC_IN);
return d;
}
public static int getColorName(@ColorRes int color) {
int colorName = R.string.rendering_value_darkyellow_name;
public static int getColorName(@ColorInt int color) {
int colorName = R.string.custom_color;
for (int i = 0; i < ColorDialogs.pallette.length; i++) {
if (ColorDialogs.pallette[i] == color) {
colorName = ColorDialogs.paletteColors[i];
@ -256,12 +252,14 @@ public class ColorDialogs {
return colorName;
}
private static int dpToPx(final Activity activity, float dp) {
Resources r = activity.getResources();
return (int) TypedValue.applyDimension(
COMPLEX_UNIT_DIP,
dp,
r.getDisplayMetrics()
);
public static boolean isPaletteColor(@ColorInt int color) {
boolean isPaletteColor = false;
for (int i = 0; i < ColorDialogs.pallette.length; i++) {
if (ColorDialogs.pallette[i] == color) {
isPaletteColor = true;
break;
}
}
return isPaletteColor;
}
}

View file

@ -31,6 +31,7 @@ import net.osmand.IProgress;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
import net.osmand.data.FavouritePoint;
import net.osmand.data.FavouritePoint.BackgroundType;
import net.osmand.plus.AppInitializer;
import net.osmand.plus.AppInitializer.AppInitializeListener;
import net.osmand.plus.AppInitializer.InitEvents;
@ -1181,6 +1182,7 @@ public class ImportHelper {
}
fp.setColor(p.getColor(0));
fp.setIconIdFromName(app, p.getIconName());
fp.setBackgroundType(BackgroundType.getByTypeName(p.getBackgroundType(), BackgroundType.CIRCLE));
favourites.add(fp);
}
}

View file

@ -20,6 +20,7 @@ import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.util.Algorithms;
@ -69,10 +70,10 @@ public class EditCategoryDialogFragment extends DialogFragment {
} else if (getArguments() != null) {
restoreState(getArguments());
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
AlertDialog.Builder builder = new AlertDialog.Builder(UiUtilities.getThemedContext(activity, nightMode));
builder.setTitle(R.string.favorite_category_add_new_title);
final View v = activity.getLayoutInflater().inflate(R.layout.favorite_category_edit_dialog, null, false);
final View v = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.favorite_category_edit_dialog, null, false);
nameEdit = (EditText)v.findViewById(R.id.edit_name);
nameEdit.setText(name);
@ -81,7 +82,7 @@ public class EditCategoryDialogFragment extends DialogFragment {
colorSpinner = (Spinner)v.findViewById(R.id.edit_color);
final TIntArrayList colors = new TIntArrayList();
final int intColor = color;
ColorDialogs.setupColorSpinnerEx(activity, intColor, colorSpinner, colors, new AdapterView.OnItemSelectedListener() {
ColorDialogs.setupColorSpinnerEx(v.getContext(), intColor, colorSpinner, colors, new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
color = colors.get(position);

View file

@ -24,6 +24,7 @@ import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.dialogs.FavoriteDialogs;
@ -351,7 +352,9 @@ public class FavoritePointEditorFragmentNew extends PointEditorFragmentNew {
FragmentActivity activity = getActivity();
final FavouritePoint favorite = getFavorite();
if (activity != null && favorite != null) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
final OsmandApplication app = (OsmandApplication) activity.getApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
AlertDialog.Builder builder = new AlertDialog.Builder(UiUtilities.getThemedContext(activity, nightMode));
builder.setMessage(getString(R.string.favourites_remove_dialog_msg, favorite.getName()));
builder.setNegativeButton(R.string.shared_string_no, null);
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {

View file

@ -1,5 +1,6 @@
package net.osmand.plus.mapcontextmenu.editors;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
@ -10,6 +11,7 @@ import android.os.Bundle;
import android.os.IBinder;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
@ -22,7 +24,6 @@ import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar;
@ -65,7 +66,7 @@ import static net.osmand.util.Algorithms.capitalizeFirstLetter;
public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
public static final String TAG = "PointEditorFragmentNew";
public static final String TAG = PointEditorFragmentNew.class.getSimpleName();
private View view;
private EditText nameEdit;
@ -87,6 +88,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
private View descriptionCaption;
private EditText descriptionEdit;
@SuppressLint("ClickableViewAccessibility")
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
@ -95,6 +97,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
nightMode = app.getDaynightHelper().isNightModeForMapControls();
view = UiUtilities.getMaterialInflater(getContext(), nightMode)
.inflate(R.layout.point_editor_fragment_new, container, false);
AndroidUtils.addStatusBarPadding21v(getActivity(), view);
final PointEditor editor = getEditor();
if (editor == null) {
@ -131,6 +134,8 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
if (scrollViewY != scrollView.getScrollY()) {
scrollViewY = scrollView.getScrollY();
hideKeyboard();
descriptionEdit.clearFocus();
nameEdit.clearFocus();
}
}
});
@ -259,6 +264,23 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
createShapeSelector();
updateColorSelector(selectedColor, view);
updateShapeSelector(selectedShape, view);
scrollView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
descriptionEdit.getParent().requestDisallowInterceptTouchEvent(false);
return false;
}
});
descriptionEdit.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
descriptionEdit.getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
});
return view;
}
@ -289,9 +311,13 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
for (int color : ColorDialogs.pallette) {
selectColor.addView(createColorItemView(color, selectColor), new FlowLayout.LayoutParams(0, 0));
}
int customColor = getPointColor();
if (!ColorDialogs.isPaletteColor(customColor)) {
selectColor.addView(createColorItemView(customColor, selectColor), new FlowLayout.LayoutParams(0, 0));
}
}
private View createColorItemView(@ColorRes final int color, final FlowLayout rootView) {
private View createColorItemView(@ColorInt final int color, final FlowLayout rootView) {
FrameLayout colorItemView = (FrameLayout) UiUtilities.getInflater(getContext(), nightMode)
.inflate(R.layout.point_editor_button, rootView, false);
ImageView outline = colorItemView.findViewById(R.id.outline);
@ -442,10 +468,11 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
}
IconCategoriesAdapter iconCategoriesAdapter = new IconCategoriesAdapter();
iconCategoriesAdapter.setItems(new ArrayList<>(iconCategories.keySet()));
RecyclerView groupNameRecyclerView = view.findViewById(R.id.group_name_recycler_view);
groupNameRecyclerView.setAdapter(iconCategoriesAdapter);
groupNameRecyclerView.setLayoutManager(new LinearLayoutManager(app, RecyclerView.HORIZONTAL, false));
RecyclerView iconCategoriesRecyclerView = view.findViewById(R.id.group_name_recycler_view);
iconCategoriesRecyclerView.setAdapter(iconCategoriesAdapter);
iconCategoriesRecyclerView.setLayoutManager(new LinearLayoutManager(app, RecyclerView.HORIZONTAL, false));
iconCategoriesAdapter.notifyDataSetChanged();
iconCategoriesRecyclerView.scrollToPosition(iconCategoriesAdapter.getItemPosition(selectedIconCategory));
for (String name : iconNameList) {
selectIcon.addView(createIconItemView(name, selectIcon), new FlowLayout.LayoutParams(0, 0));
}
@ -562,7 +589,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
@Override
protected boolean isFullScreenAllowed() {
return false;
return true;
}
private void hideKeyboard() {
@ -921,6 +948,10 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
public int getItemCount() {
return items.size();
}
int getItemPosition(String name) {
return items.indexOf(name);
}
}
static class NameViewHolder extends RecyclerView.ViewHolder {

View file

@ -70,26 +70,29 @@ public class SelectCategoryDialogFragment extends DialogFragment {
}
final FragmentActivity activity = requireActivity();
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
final OsmandApplication app = (OsmandApplication) activity.getApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
AlertDialog.Builder builder = new AlertDialog.Builder(UiUtilities.getThemedContext(activity, nightMode));
builder.setTitle(R.string.favorite_category_select);
final View v = activity.getLayoutInflater().inflate(R.layout.favorite_categories_dialog, null, false);
final View v = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.favorite_categories_dialog, null, false);
LinearLayout ll = (LinearLayout) v.findViewById(R.id.list_container);
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
final FavouritesDbHelper helper = app.getFavorites();
if (gpxFile != null) {
if (gpxCategories != null) {
for (Map.Entry<String, Integer> e : gpxCategories.entrySet()) {
String categoryName = e.getKey();
addCategory(activity, ll, categoryName, e.getValue());
ll.addView(createCategoryItem(activity, nightMode, categoryName, e.getValue()));
}
}
} else {
List<FavouritesDbHelper.FavoriteGroup> gs = helper.getFavoriteGroups();
for (final FavouritesDbHelper.FavoriteGroup category : gs) {
addCategory(activity, ll, category.getDisplayName(getContext()), category.getColor());
ll.addView(createCategoryItem(activity, nightMode, category.getDisplayName(getContext()),
category.getColor()));
}
}
View itemView = activity.getLayoutInflater().inflate(R.layout.favorite_category_dialog_item, null);
View itemView = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.favorite_category_dialog_item, null);
Button button = (Button)itemView.findViewById(R.id.button);
button.setCompoundDrawablesWithIntrinsicBounds(getIcon(activity, R.drawable.map_zoom_in), null, null, null);
button.setCompoundDrawablePadding(AndroidUtils.dpToPx(activity,15f));
@ -113,8 +116,8 @@ public class SelectCategoryDialogFragment extends DialogFragment {
return builder.create();
}
private void addCategory(@NonNull final Activity activity, @NonNull LinearLayout ll, final String categoryName, final int categoryColor) {
View itemView = activity.getLayoutInflater().inflate(R.layout.favorite_category_dialog_item, null);
private View createCategoryItem(@NonNull final Activity activity, boolean nightMode, final String categoryName, final int categoryColor) {
View itemView = UiUtilities.getInflater(activity, nightMode).inflate(R.layout.favorite_category_dialog_item, null);
Button button = (Button)itemView.findViewById(R.id.button);
if (categoryColor != 0) {
button.setCompoundDrawablesWithIntrinsicBounds(
@ -143,7 +146,7 @@ public class SelectCategoryDialogFragment extends DialogFragment {
dismiss();
}
});
ll.addView(itemView);
return itemView;
}
public static SelectCategoryDialogFragment createInstance(String editorTag) {

View file

@ -11,6 +11,7 @@ import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity;
import net.osmand.GPXUtilities;
import net.osmand.GPXUtilities.GPXFile;
@ -23,6 +24,7 @@ import net.osmand.plus.MapMarkersHelper;
import net.osmand.plus.MapMarkersHelper.MapMarkersGroup;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.base.FavoriteImageDrawable;
@ -306,7 +308,11 @@ public class WptPtEditorFragmentNew extends PointEditorFragmentNew {
@Override
protected void delete(final boolean needDismiss) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
FragmentActivity activity = getActivity();
if (activity != null) {
final OsmandApplication app = (OsmandApplication) activity.getApplication();
boolean nightMode = app.getDaynightHelper().isNightModeForMapControls();
AlertDialog.Builder builder = new AlertDialog.Builder(UiUtilities.getThemedContext(activity, nightMode));
builder.setMessage(getString(R.string.context_menu_item_delete_waypoint));
builder.setNegativeButton(R.string.shared_string_no, null);
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@ -341,6 +347,7 @@ public class WptPtEditorFragmentNew extends PointEditorFragmentNew {
});
builder.create().show();
}
}
@Override
public void setCategory(String name, int color) {

View file

@ -1,12 +1,11 @@
package net.osmand.plus.quickaction;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@ -41,7 +40,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
import static net.osmand.AndroidUtils.dpToPx;
/**
* Created by okorsun on 20.12.16.
@ -224,11 +223,10 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
if (viewType == SCREEN_ITEM_TYPE) {
final QuickActionItemVH itemVH = (QuickActionItemVH) holder;
itemVH.title.setText(item.getName(getContext()));
Context ctx = getContext();
itemVH.title.setText(item.getName(ctx));
itemVH.subTitle.setText(getResources().getString(R.string.quick_action_item_action, getActionPosition(position)));
itemVH.icon.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(item.getIconRes(getContext())));
itemVH.icon.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(item.getIconRes(ctx)));
itemVH.handleView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
@ -256,7 +254,7 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
LinearLayout.LayoutParams dividerParams = (LinearLayout.LayoutParams) itemVH.divider.getLayoutParams();
//noinspection ResourceType
dividerParams.setMargins(!isLongDivider(position) ? dpToPx(56f) : 0, 0, 0, 0);
dividerParams.setMargins(!isLongDivider(position) ? dpToPx(ctx, 56f) : 0, 0, 0, 0);
itemVH.divider.setLayoutParams(dividerParams);
} else {
QuickActionHeaderVH headerVH = (QuickActionHeaderVH) holder;
@ -361,15 +359,6 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
return getActionPosition(globalPosition) == ITEMS_IN_GROUP || globalPosition == getItemCount() - 1;
}
private int dpToPx(float dp) {
Resources r = getActivity().getResources();
return (int) TypedValue.applyDimension(
COMPLEX_UNIT_DIP,
dp,
r.getDisplayMetrics()
);
}
@Override
public boolean onItemMove(int selectedPosition, int targetPosition) {
Log.v(TAG, "selected: " + selectedPosition + ", target: " + targetPosition);

View file

@ -275,7 +275,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
if (pointDescription != null) {
String typeName = pointDescription.getTypeName();
if (!Algorithms.isEmpty(typeName)) {
name = mapActivity.getString(R.string.street_city, pointDescription.getName(), typeName);
name = mapActivity.getString(R.string.ltr_or_rtl_combine_via_comma, pointDescription.getName(), typeName);
} else {
name = pointDescription.getName();
}

View file

@ -2,7 +2,6 @@ package net.osmand.plus.views;
import android.app.Dialog;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
@ -53,7 +52,7 @@ import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
import static net.osmand.AndroidUtils.dpToPx;
public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider,
MapTextProvider<Amenity>, IRouteInformationListener {
@ -446,15 +445,4 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
@Override
public void routeWasFinished() {
}
public static int dpToPx(Context ctx, float dp) {
Resources r = ctx.getResources();
return (int) TypedValue.applyDimension(
COMPLEX_UNIT_DIP,
dp,
r.getDisplayMetrics()
);
}
}