diff --git a/OsmAnd/res/layout-land/empty_state_favourites.xml b/OsmAnd/res/layout-land/empty_state_favourites.xml
index e3a77b04ab..4f28f53214 100644
--- a/OsmAnd/res/layout-land/empty_state_favourites.xml
+++ b/OsmAnd/res/layout-land/empty_state_favourites.xml
@@ -8,23 +8,23 @@
android:orientation="horizontal">
+ tools:src="@drawable/ic_empty_state_favorites_night"/>
@@ -32,11 +32,11 @@
+ android:textSize="@dimen/empty_state_text_desc_size"/>
diff --git a/OsmAnd/res/layout-land/empty_state_markers_active.xml b/OsmAnd/res/layout-land/empty_state_markers_active.xml
new file mode 100644
index 0000000000..6bd6230e40
--- /dev/null
+++ b/OsmAnd/res/layout-land/empty_state_markers_active.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout-land/empty_state_markers_groups.xml b/OsmAnd/res/layout-land/empty_state_markers_groups.xml
new file mode 100644
index 0000000000..d7e773cc43
--- /dev/null
+++ b/OsmAnd/res/layout-land/empty_state_markers_groups.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout-land/empty_state_markers_history.xml b/OsmAnd/res/layout-land/empty_state_markers_history.xml
new file mode 100644
index 0000000000..c423a8ee80
--- /dev/null
+++ b/OsmAnd/res/layout-land/empty_state_markers_history.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout-land/empty_state_my_tracks.xml b/OsmAnd/res/layout-land/empty_state_my_tracks.xml
index 80863986be..15068df0a6 100644
--- a/OsmAnd/res/layout-land/empty_state_my_tracks.xml
+++ b/OsmAnd/res/layout-land/empty_state_my_tracks.xml
@@ -8,23 +8,23 @@
android:orientation="horizontal">
+ tools:src="@drawable/ic_empty_state_trip_night"/>
@@ -32,11 +32,11 @@
+ android:textSize="@dimen/empty_state_text_desc_size"/>
diff --git a/OsmAnd/res/layout/add_favourites_group_header.xml b/OsmAnd/res/layout/add_favourites_group_header.xml
new file mode 100644
index 0000000000..b141dbf862
--- /dev/null
+++ b/OsmAnd/res/layout/add_favourites_group_header.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/empty_state_favourites.xml b/OsmAnd/res/layout/empty_state_favourites.xml
index ca57095bbc..647f454d8e 100644
--- a/OsmAnd/res/layout/empty_state_favourites.xml
+++ b/OsmAnd/res/layout/empty_state_favourites.xml
@@ -12,35 +12,35 @@
android:id="@+id/empty_state_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/my_places_empty_state_image_margin_bottom"
- android:layout_marginTop="@dimen/my_places_empty_state_image_margin_top"
- tools:src="@drawable/ic_empty_state_favorites_night_result"/>
+ android:layout_marginBottom="@dimen/empty_state_image_margin_bottom"
+ android:layout_marginTop="@dimen/empty_state_image_margin_top"
+ tools:src="@drawable/ic_empty_state_favorites_night"/>
+ android:textSize="@dimen/empty_state_text_size"/>
+ android:textSize="@dimen/empty_state_text_desc_size"/>
\ No newline at end of file
diff --git a/OsmAnd/res/layout/empty_state_markers_active.xml b/OsmAnd/res/layout/empty_state_markers_active.xml
new file mode 100644
index 0000000000..7797398219
--- /dev/null
+++ b/OsmAnd/res/layout/empty_state_markers_active.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/empty_state_markers_groups.xml b/OsmAnd/res/layout/empty_state_markers_groups.xml
new file mode 100644
index 0000000000..6d5a817bf8
--- /dev/null
+++ b/OsmAnd/res/layout/empty_state_markers_groups.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/empty_state_markers_history.xml b/OsmAnd/res/layout/empty_state_markers_history.xml
new file mode 100644
index 0000000000..94ab69e18b
--- /dev/null
+++ b/OsmAnd/res/layout/empty_state_markers_history.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/empty_state_my_tracks.xml b/OsmAnd/res/layout/empty_state_my_tracks.xml
index 2e9a969609..c82a21be74 100644
--- a/OsmAnd/res/layout/empty_state_my_tracks.xml
+++ b/OsmAnd/res/layout/empty_state_my_tracks.xml
@@ -12,18 +12,18 @@
android:id="@+id/empty_state_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/my_places_empty_state_image_margin_bottom"
- android:layout_marginTop="@dimen/my_places_empty_state_image_margin_top"
- tools:src="@drawable/ic_empty_state_trip_night_result"/>
+ android:layout_marginBottom="@dimen/empty_state_image_margin_bottom"
+ android:layout_marginTop="@dimen/empty_state_image_margin_top"
+ tools:src="@drawable/ic_empty_state_trip_night"/>
+ android:textSize="@dimen/empty_state_text_desc_size"/>
\ No newline at end of file
diff --git a/OsmAnd/res/layout/fragment_map_markers_active.xml b/OsmAnd/res/layout/fragment_map_markers_active.xml
new file mode 100644
index 0000000000..8059263bec
--- /dev/null
+++ b/OsmAnd/res/layout/fragment_map_markers_active.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/fragment_map_markers_groups.xml b/OsmAnd/res/layout/fragment_map_markers_groups.xml
new file mode 100644
index 0000000000..74911b1118
--- /dev/null
+++ b/OsmAnd/res/layout/fragment_map_markers_groups.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/fragment_map_markers_history.xml b/OsmAnd/res/layout/fragment_map_markers_history.xml
new file mode 100644
index 0000000000..99438ccd3f
--- /dev/null
+++ b/OsmAnd/res/layout/fragment_map_markers_history.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/fragment_marker_add_favourites_group_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_marker_add_favourites_group_bottom_sheet_dialog.xml
new file mode 100644
index 0000000000..3dd4b75cb7
--- /dev/null
+++ b/OsmAnd/res/layout/fragment_marker_add_favourites_group_bottom_sheet_dialog.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/fragment_marker_add_markers_group_bottom_sheet_dialog.xml b/OsmAnd/res/layout/fragment_marker_add_markers_group_bottom_sheet_dialog.xml
new file mode 100644
index 0000000000..baacf61b55
--- /dev/null
+++ b/OsmAnd/res/layout/fragment_marker_add_markers_group_bottom_sheet_dialog.xml
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/markers_group_view_holder.xml b/OsmAnd/res/layout/markers_group_view_holder.xml
new file mode 100644
index 0000000000..41f28e4ab8
--- /dev/null
+++ b/OsmAnd/res/layout/markers_group_view_holder.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml
index 2e70a6f985..3204fb9e43 100644
--- a/OsmAnd/res/values-be/strings.xml
+++ b/OsmAnd/res/values-be/strings.xml
@@ -2948,4 +2948,6 @@
%1$d лічбаў
Парайсці ў наступнае поле
Перайменаваць маркер
+ Два
+ Адзін
diff --git a/OsmAnd/res/values-ca/phrases.xml b/OsmAnd/res/values-ca/phrases.xml
index 97b24509f7..c2a9830c29 100644
--- a/OsmAnd/res/values-ca/phrases.xml
+++ b/OsmAnd/res/values-ca/phrases.xml
@@ -2289,8 +2289,8 @@
Higròmetre
Higròmetre: no
- Tipus
- Tipus
+ Tipus de combustible
+ Tipus de combustible (avia)
Tipus de pagament
Targetes per carburants
Addicional
diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml
index 21e884e1e0..da35ec83dc 100644
--- a/OsmAnd/res/values-da/strings.xml
+++ b/OsmAnd/res/values-da/strings.xml
@@ -2950,4 +2950,10 @@ Repræsenterer område: %1$s x %2$s
Skift automatisk til det næste felt efter indtastning af %1$d cifre efter decimaltegnet
%1$d cifre
Gå til næste felt
+ To
+ En
+ En linje, der forbinder din placering til placeringen af de aktive markører bliver vist på kortet.
+ En eller to pile, der angiver retningen til de aktive markører bliver vist på kortet.
+ Vælg hvordan afstanden til de aktive markører skal vises.
+ Vælg hvor mange retningsindikatorer der vises.
diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml
index b72d55784b..d713066ea9 100644
--- a/OsmAnd/res/values-fa/strings.xml
+++ b/OsmAnd/res/values-fa/strings.xml
@@ -845,7 +845,9 @@
ft
mi
اشتراکگذاری مکان با
- مکان: %1$s\n%2$s
+ موقعیت:
+\n%1$s
+\n%2$s
ارسال مکان
اشتراکگذاری مکان
در حال نمایهکردن نشانی…
@@ -1650,7 +1652,7 @@
بهاشتراکگذاری یادداشت
- مکان:
+ موقعیت:
\n عرض %1$s
\n طول %2$s
مشاهده
@@ -2939,4 +2941,10 @@
پس از واردکردن %1$d رقم بعد از ممیز، بهصورت خودکار خانۀ بعدی فعال شود
%1$d رقم
رفتن به خانهٔ بعدی
+ دو
+ یک
+ خطی بین موقعیت شما و موقعیت نشانهها، روی نقشه نشان داده میشود.
+ با یک یا دو پیکان، محل قرارگیری نشانههای فعال روی نقشه نشان داده میشود.
+ مشخص کنید که فاصلهٔ شما تا نشانههای فعال چگونه نشان داده شود.
+ مشخص کنید چند پیکان جهتنما نشان داده شود.
diff --git a/OsmAnd/res/values-he/phrases.xml b/OsmAnd/res/values-he/phrases.xml
index 8506c1cf80..118777878e 100644
--- a/OsmAnd/res/values-he/phrases.xml
+++ b/OsmAnd/res/values-he/phrases.xml
@@ -135,8 +135,8 @@
חנות מסחר
חנות צמיגים
חנות שואבי אבק
- סוג
- סוג
+ סוג דלק לתעופה
+ סוג הדלק
נוסף
סוג תשלום
שירות אופניים
@@ -787,4 +787,163 @@
מעלית סקי בישיבה
מעלית סקי בגרירה
מפעל לטיהור שופכין
+ חלוקה
+ חנות מזון יבש
+ דיזל למשאיות
+ דלק 1:50
+ E85
+ אוטם מסילת רכבת
+ מנחת
+ נמל תעופה
+ שער נמל תעופה
+
+ תחנת נמל תעופה
+ מטבח
+ פיצה
+ המבורגר
+ קפה
+ כריך
+ קבב
+ דונר (שווארמה)
+ עוף
+ גלידה
+ סושי
+ פיש אנד צ׳יפס
+ מאכלי ים
+ ברביקיו
+ אטריות
+ דונאט
+ ראמן
+ קרפ
+ ארוחת בוקר
+ גיודון
+ סטייק
+ טאפאס
+ גסטרופאב
+ הויריגר
+ קארי
+ על האש
+ בייגל
+ מזללה
+ נקניק
+ עוגה
+ פנקייק
+ פסטה
+ מזון מהיר
+ מיץ
+ סוֹבַּה
+ גורמה
+ תה
+ חנות תה
+ מרק
+ פאי
+ נקניקייה
+ פונדו
+ באגט
+ פסטל
+ בוריטו
+ טריאקי
+ פרואני
+ בוליבי
+ מלזי
+ הוואיי
+ אנגלי
+ פקיסטני
+ טאיוואני
+ טקס-מקס
+ הולנדי
+ סורי
+ אוסטרלי
+ קייג׳וני
+ מצרי
+ סנגלי
+ יהודי
+ טיבטי
+
+ מקום להאכלת חיות
+
+ משרד ספק אנרגיה
+
+ ערוץ VHF
+
+ פתוח
+ סגור
+ מוגבל
+ מקולקל
+ נדרשת תחזוקה
+
+ עמידות נקודת המים: עמידה
+ עמידות נקודת המים: בחירום
+
+ אין
+ עם כלור
+ אוסמוזה הפוכה
+ טבליות טיהור מים
+
+ באר מים
+ צנרת
+ מים זורמים
+ משאבה
+ קידוח
+ משאיות מים
+ מיכל מים
+ מים בבקבוק
+
+ קהילה
+ משפחה
+ ריבוי משפחות
+
+ מכונית: יש
+ מכונית: אין
+ אופניים: יש
+ אופניים: אין
+ קטנוע: יש
+ קטנוע: אין
+ משאית: יש
+ משאית: אין
+
+ עמלת חנייה: יש
+ עמלת חנייה: אין
+ עמלת חנייה
+
+ זרם חשמלי
+ פלט תחנת הטעינה
+
+ סוג המפה: טפוגרפית
+ סוג המפה: רחוב
+ סוג המפה: סכמה
+ סוג המפה: כיוונים
+ גודל המפה: אתר
+ גודל המפה: עיר
+ גודל המפה: אזור
+
+ תחנת טעינה
+
+מעדנייה
+ סלט
+ פרוזן יוגורט
+ אוכל מטוגן
+ פנקייקים מלוחים
+ ביסטרו
+ מאפייה
+ קוסקוס
+ עוף מטוגן
+ קינוח
+ מזנון
+ טאקוס
+ פיאדינה
+ פלאפל
+ פרי שייק
+ סופלקי
+ חטיף
+ יוגורט
+ גירוס
+ אמפנדה
+ קרפים
+ יקיניקו
+ סוקי
+ אוּדוֹן
+ בראסרי
+ באבל טי
+ יקיטורי
diff --git a/OsmAnd/res/values-hy/strings.xml b/OsmAnd/res/values-hy/strings.xml
index cf83b42826..bbbf71b944 100644
--- a/OsmAnd/res/values-hy/strings.xml
+++ b/OsmAnd/res/values-hy/strings.xml
@@ -2446,4 +2446,75 @@
Ցույց տալ GPX
Տողերի քանակը
Վստա՞հ եք?
+ - Խմբի ստեղծման ժամանակ խնդրում ենք տալ անուն և լրացնել նկարագրությունը
+\n - Ծրագրային խումբից ստեղծվում են միայն Simple տիպի, կարդալ ավելին https://osmo.mobi/g/new կայքում
+\n - Կայքի միջոցով դուք կարող եք կառավարել խումբը, տեղադրել track-եր և կետեր բոլորի համար
+\n - Մենք չենք ողջունում խմբի օգտագործումը միայն մեկ օգտագործողի կողմից, եթե դա POI խումբ չէ
+\n - Անձնական խմբերն սահմանափակվում են 8 հոգու համար
+\n - Մանրամասն պայմանները միշտ հասանելի են OsMo.mobi կայքում
+\n - Եթե Ձեզ անհրաժեշտ է հատուկ պայմաններ - խնդրում աջակցության համար դիմել՝ osmo.mobi@gmail.com
+ Ցուցադրել դիտարկման ուղղությունը
+ Ընտրեք առցանց կամ պահված քարտեզի աղբյուրը:
+ Ցանկացած չպահպնված փոփոխություն կկորցնեք: Շարունակել?
+ Մնաց %1$s ներբեռնումներ
+ Ճանապարհներ
+ Ֆայլի ներբեռնում - %1$d
+ Ցույց տալ անվճար տարբերակների պաստառը
+ Ցույց տալ անվճար տարբերակների պաստառը նաև վճարովի տարբերակում։
+ ԳՆԵԼ
+ Խնդրում ենք ակտիվացնել Ծովային քարտեզների plugin-ը
+ Խնդրում ենք ակտիվացնել SRTM plugin-ը
+ Ավելի ուշ
+ Ամբողջական տարբերակը
+ Ներբեռնումներ
+ Վստահ եք, որ ցանկանում եք ներբեռնել ճանապարհային քարտեզը, թեև արդեն ունեք ստանդարտ (ամբողջական) քարտեզ?
+ "%1$.1f %2$.1f ՄԲ"
+ %.1f ՄԲ
+ "Թարմացնել բոլորը (%1$s ՄԲ)"
+ Օգտագործված է անվճար ներբեռնումներ
+ Ցույց տալ օգտագործված անվճար ներբեռնումները։
+ Ընտրեք որտեղ եք ցանկանում պահել քարտեզների ֆայլերը և այլ տվյալներ:
+ Մուտքագրեք երկրի անունը
+ Նոր տարբերակ
+ Առաջին քայլերը OsmAnd-ի հետ
+ Հնարավորությունները
+ Օգնեք մեզ բարելավել OsmAnd-ը
+ Այլ
+ Պլագիններ (Plugins)
+ Առաջին մեկնարկը
+ Ինչպես ներբեռնել քարտեզները, սահմանել հիմնական պարամետրերը:
+ Ուղեւորության պլանավորում
+ Հաճախակի տրվող հարցեր (FAQ)
+ Հաճախակի տրվող հարցեր (FAQ)
+ Տեղադրում և խնդիրներ լուծում
+ Տեխնիկական հոդվածներ
+ Տարբերակներ
+ Արձագանք
+ Կապ մեզ հետ
+ Քարտեզի նշումներ
+ Անունը պարունակում է չափազանց շատ մեծ տառեր: Դուք իսկապես ուզում եք շարունակել?
+ Վստահ եք, որ ցանկանում եք POI-ին պահպանել առանց տեսակը նշելու?
+ Խմբագրել POI
+ Օգտագործել Վահանակը
+ Օգտագործել Մենյու
+ Վահանակը կամ Մենյու
+ Ստատիկ Մենյուի փոխարեն, դուք կարող եք օգտագործել նոր ինտերֆեյսը որպես Վահանակ էջ: Ձեր ընտրությունը միշտ կարող է փոփոխվել գլխավոր էջի կարգավորումներում:
+ Թարմացնել
+ Ներբեռնել միայն WiFi-ի միջոցով
+ Ավտո-թարմացում
+ Թարմացնել հիմա
+ Հավելվածը SD քարտի օգտագործման թույլտվություն չունի
+ Վերջին թարմացումը՝ %s
+ Թարմացնան ժամը
+ Թարմացման չափը
+ Քարտեզի վերջին փոփոխությունը՝ %s
+ Ամեն ժամ
+ Օրեկան
+ Շաբաթական
+ Առավոտ
+ Գիշեր
+ Ընտրեք ամիսը և երկիրը
+ Ներդրողների թիվը
+ Խմբագրումների քանակը
+ Հաշվետվություն
diff --git a/OsmAnd/res/values-land/sizes.xml b/OsmAnd/res/values-land/sizes.xml
index 9f19fef714..cc32b87429 100644
--- a/OsmAnd/res/values-land/sizes.xml
+++ b/OsmAnd/res/values-land/sizes.xml
@@ -5,8 +5,8 @@
24dp
48dp
- 39dp
- 39dp
+ 39dp
+ 39dp
14dp
\ No newline at end of file
diff --git a/OsmAnd/res/values-large-land/sizes.xml b/OsmAnd/res/values-large-land/sizes.xml
index e44894c275..35bc80ed66 100644
--- a/OsmAnd/res/values-large-land/sizes.xml
+++ b/OsmAnd/res/values-large-land/sizes.xml
@@ -1,7 +1,7 @@
- 59dp
- 59dp
+ 59dp
+ 59dp
21dp
\ No newline at end of file
diff --git a/OsmAnd/res/values-large/sizes.xml b/OsmAnd/res/values-large/sizes.xml
index 04cc37505e..f8ce4c32be 100644
--- a/OsmAnd/res/values-large/sizes.xml
+++ b/OsmAnd/res/values-large/sizes.xml
@@ -81,17 +81,17 @@
15sp
12sp
- 63dp
- 45dp
- 12dp
- 30dp
- 20sp
- 18sp
- 68dp
- 138dp
- 72dp
- 90dp
- 96dp
+ 63dp
+ 45dp
+ 12dp
+ 30dp
+ 20sp
+ 18sp
+ 68dp
+ 138dp
+ 72dp
+ 90dp
+ 96dp
72dp
540dp
diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml
index b13ce09b1e..85219f3d38 100644
--- a/OsmAnd/res/values-uk/strings.xml
+++ b/OsmAnd/res/values-uk/strings.xml
@@ -3072,4 +3072,11 @@
Повноекранний режим
Показати на верхній панелі
Позначати пройдене
+ Кількість цифр
+ Показати цифрову панель
+ Вставити
+ Автоматично перемикається в наступне поле після введення %1$d цифр після десяткової точки
+ %1$d цифр
+ Перейти до наступного поля
+ Перейменувати маркер
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index bf63973a07..4012fb9081 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -144,17 +144,17 @@
150dp
128dp
- 42dp
- 30dp
- 8dp
- 20dp
- 18sp
- 16sp
- 45dp
- 92dp
- 48dp
- 60dp
- 64dp
+ 42dp
+ 30dp
+ 8dp
+ 20dp
+ 18sp
+ 16sp
+ 45dp
+ 92dp
+ 48dp
+ 60dp
+ 64dp
48dp
360dp
@@ -200,4 +200,6 @@
5dp
28dp
+
+ 88dp
\ No newline at end of file
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 97cd87b31a..2d4fa740ac 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,6 +9,18 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
+ Select track waypoints of which OsmAnd will add to markers
+ Select which favourite group you want to add to markers
+ Track waypoints
+ Favourites group
+ Add group
+ You can add group of favourites or track waypoints.
+ Markers on map!
+ Mark places on map by tap.
+ Import groups
+ You can import favourite groups or track waypoints as markers.
+ @string/shared_string_history
+ Markers marked as passed will appear on this screen.
Two
One
A line connecting your location to locations of the active markers will be shown on the map.
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/AddFavouritesGroupBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/AddFavouritesGroupBottomSheetDialogFragment.java
new file mode 100644
index 0000000000..164571958b
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/AddFavouritesGroupBottomSheetDialogFragment.java
@@ -0,0 +1,84 @@
+package net.osmand.plus.mapmarkers;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
+import net.osmand.plus.MapMarkersHelper;
+import net.osmand.plus.MapMarkersHelper.MarkersSyncGroup;
+import net.osmand.plus.R;
+import net.osmand.plus.base.MenuBottomSheetDialogFragment;
+import net.osmand.plus.mapmarkers.adapters.FavouritesGroupsAdapter;
+
+import java.util.List;
+
+public class AddFavouritesGroupBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
+
+ public final static String TAG = "AddFavouritesGroupBottomSheetDialogFragment";
+
+ private AddFavouriteGroupListener listener;
+
+ private List favoriteGroups;
+ private MapMarkersHelper mapMarkersHelper;
+
+ public void setListener(AddFavouriteGroupListener listener) {
+ this.listener = listener;
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ favoriteGroups = getMyApplication().getFavorites().getFavoriteGroups();
+ mapMarkersHelper = getMyApplication().getMapMarkersHelper();
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
+ final View mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_marker_add_favourites_group_bottom_sheet_dialog, container);
+
+ final RecyclerView recyclerView = mainView.findViewById(R.id.favourites_group_recycler_view);
+ recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
+ final FavouritesGroupsAdapter adapter = new FavouritesGroupsAdapter(getContext(), favoriteGroups);
+ adapter.setAdapterListener(new FavouritesGroupsAdapter.FavouritesGroupsAdapterListener() {
+ @Override
+ public void onItemClick(View view) {
+ int position = recyclerView.getChildAdapterPosition(view);
+ if (position == RecyclerView.NO_POSITION) {
+ return;
+ }
+ FavoriteGroup group = favoriteGroups.get(position - 1);
+ MarkersSyncGroup markersSyncGroup = new MarkersSyncGroup(group.name, group.name, MarkersSyncGroup.FAVORITES_TYPE, group.color);
+ mapMarkersHelper.addMarkersSyncGroup(markersSyncGroup);
+ mapMarkersHelper.syncGroup(markersSyncGroup);
+ if (listener != null) {
+ listener.onFavouriteGroupAdded();
+ }
+ dismiss();
+ }
+ });
+ recyclerView.setAdapter(adapter);
+
+ mainView.findViewById(R.id.close_row).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dismiss();
+ }
+ });
+
+ setupHeightAndBackground(mainView, R.id.favourites_group_recycler_view);
+
+ return mainView;
+ }
+
+ public interface AddFavouriteGroupListener {
+ void onFavouriteGroupAdded();
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/AddMarkersGroupBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/AddMarkersGroupBottomSheetDialogFragment.java
new file mode 100644
index 0000000000..738ccf1766
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/AddMarkersGroupBottomSheetDialogFragment.java
@@ -0,0 +1,75 @@
+package net.osmand.plus.mapmarkers;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import net.osmand.plus.R;
+import net.osmand.plus.base.MenuBottomSheetDialogFragment;
+
+public class AddMarkersGroupBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
+
+ public final static String TAG = "AddMarkersGroupBottomSheetDialogFragment";
+
+ private AddMarkersGroupFragmentListener listener;
+
+ public void setListener(AddMarkersGroupFragmentListener listener) {
+ this.listener = listener;
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
+ final View mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_marker_add_markers_group_bottom_sheet_dialog, container);
+
+ if (nightMode) {
+ ((TextView) mainView.findViewById(R.id.add_group_title)).setTextColor(getResources().getColor(R.color.ctx_menu_info_text_dark));
+ }
+
+ ((ImageView) mainView.findViewById(R.id.favourites_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_fav_dark));
+ ((ImageView) mainView.findViewById(R.id.waypoints_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_polygom_dark));
+
+ mainView.findViewById(R.id.favourites_row).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (listener != null) {
+ listener.favouritesOnClick();
+ }
+ dismiss();
+ }
+ });
+ mainView.findViewById(R.id.waypoints_row).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (listener != null) {
+ listener.waypointsOnClick();
+ }
+ dismiss();
+ }
+ });
+
+ mainView.findViewById(R.id.close_row).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dismiss();
+ }
+ });
+
+ setupHeightAndBackground(mainView, R.id.add_markers_group_scroll_view);
+
+ return mainView;
+ }
+
+ interface AddMarkersGroupFragmentListener {
+
+ void favouritesOnClick();
+
+ void waypointsOnClick();
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java
index 2f23726980..a5390a1040 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersActiveFragment.java
@@ -10,6 +10,7 @@ import android.support.v7.widget.helper.ItemTouchHelper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import net.osmand.Location;
import net.osmand.data.LatLon;
@@ -25,6 +26,7 @@ import net.osmand.plus.dashboard.DashLocationFragment;
import net.osmand.plus.mapmarkers.adapters.MapMarkersActiveAdapter;
import net.osmand.plus.mapmarkers.adapters.MapMarkersActiveAdapter.MapMarkersActiveAdapterListener;
import net.osmand.plus.mapmarkers.adapters.MapMarkersItemTouchHelperCallback;
+import net.osmand.plus.widgets.EmptyStateRecyclerView;
import net.osmand.util.MapUtils;
public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassListener, OsmAndLocationListener {
@@ -38,10 +40,9 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- final RecyclerView recyclerView = new RecyclerView(getContext());
final MapActivity mapActivity = (MapActivity) getActivity();
- recyclerView.setPadding(0, 0, 0, (int) mapActivity.getResources().getDimension(R.dimen.map_markers_recycler_view_padding_bottom));
- recyclerView.setClipToPadding(false);
+ final View mainView = inflater.inflate(R.layout.fragment_map_markers_active, container, false);
+ final EmptyStateRecyclerView recyclerView = (EmptyStateRecyclerView) mainView.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
adapter = new MapMarkersActiveAdapter(mapActivity);
@@ -90,6 +91,11 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
compassUpdateAllowed = false;
}
});
+
+ final View emptyView = mainView.findViewById(R.id.empty_view);
+ ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
+ emptyImageView.setImageResource(mapActivity.getMyApplication().getSettings().isLightContent() ? R.drawable.ic_empty_state_marker_list_day : R.drawable.ic_empty_state_marker_list_night);
+ recyclerView.setEmptyView(emptyView);
recyclerView.setAdapter(adapter);
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
@@ -98,7 +104,7 @@ public class MapMarkersActiveFragment extends Fragment implements OsmAndCompassL
compassUpdateAllowed = newState == RecyclerView.SCROLL_STATE_IDLE;
}
});
- return recyclerView;
+ return mainView;
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
index 7386d29620..196f255e33 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDialogFragment.java
@@ -148,6 +148,7 @@ public class MapMarkersDialogFragment extends android.support.v4.app.DialogFragm
});
viewPager = mainView.findViewById(R.id.map_markers_view_pager);
+ viewPager.setOffscreenPageLimit(3);
viewPager.setSwipeLocked(true);
final MapMarkersViewPagerAdapter adapter = new MapMarkersViewPagerAdapter(getChildFragmentManager());
viewPager.setAdapter(adapter);
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java
index 88d51a7153..f6d7b732f3 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersGroupsFragment.java
@@ -19,6 +19,7 @@ import android.support.v7.widget.helper.ItemTouchHelper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.Location;
@@ -34,6 +35,9 @@ import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.dashboard.DashLocationFragment;
import net.osmand.plus.mapmarkers.adapters.MapMarkerItemViewHolder;
import net.osmand.plus.mapmarkers.adapters.MapMarkersGroupsAdapter;
+import net.osmand.plus.mapmarkers.AddMarkersGroupBottomSheetDialogFragment.AddMarkersGroupFragmentListener;
+import net.osmand.plus.mapmarkers.AddFavouritesGroupBottomSheetDialogFragment.AddFavouriteGroupListener;
+import net.osmand.plus.widgets.EmptyStateRecyclerView;
import net.osmand.util.MapUtils;
public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassListener, OsmAndLocationListener {
@@ -49,15 +53,25 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
private Paint textPaint = new Paint();
private Snackbar snackbar;
private boolean compassUpdateAllowed = true;
+ private View mainView;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final MapActivity mapActivity = (MapActivity) getActivity();
final boolean night = !mapActivity.getMyApplication().getSettings().isLightContent();
- final RecyclerView recyclerView = new RecyclerView(getContext());
- recyclerView.setPadding(0, 0, 0, (int) mapActivity.getResources().getDimension(R.dimen.map_markers_recycler_view_padding_bottom));
- recyclerView.setClipToPadding(false);
+ mainView = inflater.inflate(R.layout.fragment_map_markers_groups, container, false);
+
+ Fragment addMarkersGroupFragment = getChildFragmentManager().findFragmentByTag(AddMarkersGroupBottomSheetDialogFragment.TAG);
+ if (addMarkersGroupFragment != null) {
+ ((AddMarkersGroupBottomSheetDialogFragment) addMarkersGroupFragment).setListener(createAddMarkersGroupFragmentListener());
+ }
+ Fragment addFavouritesGroupFragment = getChildFragmentManager().findFragmentByTag(AddFavouritesGroupBottomSheetDialogFragment.TAG);
+ if (addFavouritesGroupFragment != null) {
+ ((AddFavouritesGroupBottomSheetDialogFragment) addFavouritesGroupFragment).setListener(createAddFavouritesGroupListener());
+ }
+
+ final EmptyStateRecyclerView recyclerView = (EmptyStateRecyclerView) mainView.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
@@ -222,8 +236,83 @@ public class MapMarkersGroupsFragment extends Fragment implements OsmAndCompassL
}
}
});
+ adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
+ @Override
+ public void onChanged() {
+ changeFabVisibilityIfNeeded();
+ }
+
+ @Override
+ public void onItemRangeInserted(int positionStart, int itemCount) {
+ changeFabVisibilityIfNeeded();
+ }
+
+ @Override
+ public void onItemRangeRemoved(int positionStart, int itemCount) {
+ changeFabVisibilityIfNeeded();
+ }
+ });
+
+ final View emptyView = mainView.findViewById(R.id.empty_view);
+ mainView.findViewById(R.id.import_button).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openAddGroupMenu();
+ }
+ });
+ ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
+ emptyImageView.setImageResource(night ? R.drawable.ic_empty_state_marker_group_night : R.drawable.ic_empty_state_marker_group_day);
+ recyclerView.setEmptyView(emptyView);
recyclerView.setAdapter(adapter);
- return recyclerView;
+
+ mainView.findViewById(R.id.add_group_fab).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ openAddGroupMenu();
+ }
+ });
+ return mainView;
+ }
+
+ private void changeFabVisibilityIfNeeded() {
+ mainView.findViewById(R.id.add_group_fab).setVisibility(adapter.getItemCount() > 0 ? View.VISIBLE : View.GONE);
+ }
+
+ private void openAddGroupMenu() {
+ AddMarkersGroupBottomSheetDialogFragment fragment = new AddMarkersGroupBottomSheetDialogFragment();
+ fragment.setListener(createAddMarkersGroupFragmentListener());
+ fragment.setUsedOnMap(false);
+ fragment.show(getChildFragmentManager(), AddMarkersGroupBottomSheetDialogFragment.TAG);
+ }
+
+ private void openAddFavouritesGroupMenu() {
+ AddFavouritesGroupBottomSheetDialogFragment fragment = new AddFavouritesGroupBottomSheetDialogFragment();
+ fragment.setListener(createAddFavouritesGroupListener());
+ fragment.setUsedOnMap(false);
+ fragment.show(getChildFragmentManager(), AddFavouritesGroupBottomSheetDialogFragment.TAG);
+ }
+
+ private AddFavouriteGroupListener createAddFavouritesGroupListener() {
+ return new AddFavouriteGroupListener() {
+ @Override
+ public void onFavouriteGroupAdded() {
+ updateAdapter();
+ }
+ };
+ }
+
+ private AddMarkersGroupFragmentListener createAddMarkersGroupFragmentListener() {
+ return new AddMarkersGroupFragmentListener() {
+ @Override
+ public void favouritesOnClick() {
+ openAddFavouritesGroupMenu();
+ }
+
+ @Override
+ public void waypointsOnClick() {
+
+ }
+ };
}
void updateAdapter() {
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java
index f2335ba0a6..ec12497499 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersHistoryFragment.java
@@ -18,6 +18,7 @@ import android.support.v7.widget.helper.ItemTouchHelper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.plus.MapMarkersHelper;
@@ -28,6 +29,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.mapmarkers.adapters.MapMarkerHeaderViewHolder;
import net.osmand.plus.mapmarkers.adapters.MapMarkerItemViewHolder;
import net.osmand.plus.mapmarkers.adapters.MapMarkersHistoryAdapter;
+import net.osmand.plus.widgets.EmptyStateRecyclerView;
public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHelper.MapMarkerChangedListener {
@@ -73,9 +75,8 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel
((HistoryMarkerMenuBottomSheetDialogFragment) historyMarkerMenuFragment).setListener(createHistoryMarkerMenuListener());
}
- final RecyclerView recyclerView = new RecyclerView(getContext());
- recyclerView.setPadding(0, 0, 0, (int) mapActivity.getResources().getDimension(R.dimen.map_markers_recycler_view_padding_bottom));
- recyclerView.setClipToPadding(false);
+ final View mainView = inflater.inflate(R.layout.fragment_map_markers_history, container, false);
+ final EmptyStateRecyclerView recyclerView = (EmptyStateRecyclerView) mainView.findViewById(R.id.list);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) {
@@ -203,11 +204,15 @@ public class MapMarkersHistoryFragment extends Fragment implements MapMarkersHel
}
}
});
+ final View emptyView = mainView.findViewById(R.id.empty_view);
+ ImageView emptyImageView = (ImageView) emptyView.findViewById(R.id.empty_state_image_view);
+ emptyImageView.setImageResource(night ? R.drawable.ic_empty_state_marker_history_night : R.drawable.ic_empty_state_marker_history_day);
+ recyclerView.setEmptyView(emptyView);
recyclerView.setAdapter(adapter);
app.getMapMarkersHelper().addListener(this);
- return recyclerView;
+ return mainView;
}
void hideSnackbar() {
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/FavouritesGroupsAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/FavouritesGroupsAdapter.java
new file mode 100644
index 0000000000..1ae1f03948
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/FavouritesGroupsAdapter.java
@@ -0,0 +1,89 @@
+package net.osmand.plus.mapmarkers.adapters;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
+import net.osmand.plus.IconsCache;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.R;
+
+import java.util.List;
+
+public class FavouritesGroupsAdapter extends RecyclerView.Adapter {
+
+ private static final int TYPE_HEADER = 12;
+ private static final int TYPE_ITEM = 13;
+
+ private FavouritesGroupsAdapterListener listener;
+ private OsmandApplication app;
+ private List favoriteGroups;
+ private IconsCache iconsCache;
+
+ public FavouritesGroupsAdapter(Context context, List favoriteGroups) {
+ this.app = (OsmandApplication) context.getApplicationContext();
+ this.favoriteGroups = favoriteGroups;
+ this.iconsCache = app.getIconsCache();
+ }
+
+ public void setAdapterListener(FavouritesGroupsAdapterListener listener) {
+ this.listener = listener;
+ }
+
+ @Override
+ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ if (viewType == TYPE_HEADER) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.add_favourites_group_header, parent, false);
+ return new MapMarkersGroupHeaderViewHolder(view);
+ } else {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.markers_group_view_holder, parent, false);
+ view.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (listener != null) {
+ listener.onItemClick(view);
+ }
+ }
+ });
+ return new MapMarkersGroupViewHolder(view);
+ }
+ }
+
+ @Override
+ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
+ if (holder instanceof MapMarkersGroupHeaderViewHolder) {
+ MapMarkersGroupHeaderViewHolder markersGroupHeaderViewHolder = (MapMarkersGroupHeaderViewHolder) holder;
+ markersGroupHeaderViewHolder.title.setText(app.getText(R.string.favourites_group));
+ markersGroupHeaderViewHolder.description.setText(app.getText(R.string.add_favourites_group_to_markers_descr));
+ } else if (holder instanceof MapMarkersGroupViewHolder) {
+ FavoriteGroup favoriteGroup = getItem(position);
+ MapMarkersGroupViewHolder markersGroupViewHolder = (MapMarkersGroupViewHolder) holder;
+ int color = favoriteGroup.color == 0 || favoriteGroup.color == Color.BLACK ? app.getResources().getColor(R.color.color_favorite) : favoriteGroup.color;
+ markersGroupViewHolder.icon.setImageDrawable(iconsCache.getPaintedIcon(R.drawable.ic_action_folder, color | 0xff000000));
+ markersGroupViewHolder.name.setText(favoriteGroup.name.length() == 0 ? app.getString(R.string.shared_string_favorites) : favoriteGroup.name);
+ markersGroupViewHolder.numberCount.setText(String.valueOf(favoriteGroup.points.size()));
+ }
+ }
+
+ @Override
+ public int getItemViewType(int position) {
+ return position == 0 ? TYPE_HEADER : TYPE_ITEM;
+ }
+
+ @Override
+ public int getItemCount() {
+ return favoriteGroups.size() + 1;
+ }
+
+ private FavoriteGroup getItem(int position) {
+ return favoriteGroups.get(position - 1);
+ }
+
+ public interface FavouritesGroupsAdapterListener {
+ void onItemClick(View view);
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupHeaderViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupHeaderViewHolder.java
new file mode 100644
index 0000000000..5f1d6ad17e
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupHeaderViewHolder.java
@@ -0,0 +1,19 @@
+package net.osmand.plus.mapmarkers.adapters;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.TextView;
+
+import net.osmand.plus.R;
+
+public class MapMarkersGroupHeaderViewHolder extends RecyclerView.ViewHolder {
+
+ TextView title;
+ TextView description;
+
+ public MapMarkersGroupHeaderViewHolder(View itemView) {
+ super(itemView);
+ title = itemView.findViewById(R.id.title);
+ description = itemView.findViewById(R.id.description);
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupViewHolder.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupViewHolder.java
new file mode 100644
index 0000000000..e2340da0ff
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersGroupViewHolder.java
@@ -0,0 +1,22 @@
+package net.osmand.plus.mapmarkers.adapters;
+
+import android.support.v7.widget.RecyclerView;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import net.osmand.plus.R;
+
+public class MapMarkersGroupViewHolder extends RecyclerView.ViewHolder {
+
+ ImageView icon;
+ TextView name;
+ TextView numberCount;
+
+ public MapMarkersGroupViewHolder(View itemView) {
+ super(itemView);
+ icon = itemView.findViewById(R.id.icon);
+ name = itemView.findViewById(R.id.name_text);
+ numberCount = itemView.findViewById(R.id.number_count_text);
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java
index 05033b02e8..9769c66bc5 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapMarkersLayer.java
@@ -219,7 +219,14 @@ public class MapMarkersLayer extends OsmandMapLayer implements IContextMenuProvi
@Override
public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings nightMode) {
- Location myLoc = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
+ Location myLoc;
+ if (useFingerLocation && fingerLocation != null) {
+ myLoc = new Location("");
+ myLoc.setLatitude(fingerLocation.getLatitude());
+ myLoc.setLongitude(fingerLocation.getLongitude());
+ } else {
+ myLoc = map.getMyApplication().getLocationProvider().getLastStaleKnownLocation();
+ }
MapMarkersHelper markersHelper = map.getMyApplication().getMapMarkersHelper();
List activeMapMarkers = markersHelper.getMapMarkers();
int displayedWidgets = map.getMyApplication().getSettings().DISPLAYED_MARKERS_WIDGETS_COUNT.get();
diff --git a/OsmAnd/src/net/osmand/plus/widgets/EmptyStateRecyclerView.java b/OsmAnd/src/net/osmand/plus/widgets/EmptyStateRecyclerView.java
new file mode 100644
index 0000000000..ee2b129c72
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/widgets/EmptyStateRecyclerView.java
@@ -0,0 +1,70 @@
+package net.osmand.plus.widgets;
+
+import android.content.Context;
+import android.support.annotation.Nullable;
+import android.support.v7.widget.RecyclerView;
+import android.util.AttributeSet;
+import android.view.View;
+
+public class EmptyStateRecyclerView extends RecyclerView {
+ private View emptyView;
+
+ public EmptyStateRecyclerView(Context context) {
+ super(context);
+ }
+
+ public EmptyStateRecyclerView(Context context, @Nullable AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public EmptyStateRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ private AdapterDataObserver emptyStateObserver = new AdapterDataObserver() {
+ @Override
+ public void onChanged() {
+ checkIfEmpty();
+ }
+
+ @Override
+ public void onItemRangeInserted(int positionStart, int itemCount) {
+ checkIfEmpty();
+ }
+
+ @Override
+ public void onItemRangeRemoved(int positionStart, int itemCount) {
+ checkIfEmpty();
+ }
+ };
+
+ @Override
+ public void setAdapter(Adapter adapter) {
+ final Adapter oldAdapter = getAdapter();
+ if (oldAdapter != null) {
+ oldAdapter.unregisterAdapterDataObserver(emptyStateObserver);
+ }
+ super.setAdapter(adapter);
+ if (adapter != null) {
+ adapter.registerAdapterDataObserver(emptyStateObserver);
+ }
+ checkIfEmpty();
+ }
+
+ public void setEmptyView(View emptyView) {
+ this.emptyView = emptyView;
+ checkIfEmpty();
+ }
+
+ private void checkIfEmpty() {
+ if (emptyView != null && getAdapter() != null) {
+ if (getAdapter().getItemCount() == 0) {
+ setVisibility(View.GONE);
+ emptyView.setVisibility(View.VISIBLE);
+ } else {
+ emptyView.setVisibility(View.GONE);
+ setVisibility(View.VISIBLE);
+ }
+ }
+ }
+}