Merge branch 'temp_widget' into exit_and_shield_widget

This commit is contained in:
MadWasp79 2020-01-13 18:44:47 +02:00
commit cf9f437c5b
1098 changed files with 7409 additions and 2270 deletions

View file

@ -873,7 +873,7 @@ public class GPXUtilities {
WptPt point = segment.points.get(k); WptPt point = segment.points.get(k);
if (k > 0) { if (k > 0) {
double currentSegment = 0; double currentSegment = 0;
if (!(segment.generalSegment && joinSegments && point.firstPoint)) { if (!(segment.generalSegment && !joinSegments && point.firstPoint)) {
currentSegment = metric.metric(prev, point); currentSegment = metric.metric(prev, point);
secondaryMetricEnd += secondaryMetric.metric(prev, point); secondaryMetricEnd += secondaryMetric.metric(prev, point);
} }

View file

@ -1087,14 +1087,15 @@ public class RouteResultPreparation {
t = attachKeepLeftInfoAndLanes(leftSide, prev, rr); t = attachKeepLeftInfoAndLanes(leftSide, prev, rr);
} }
if (t != null) { if (t != null) {
t.setTurnAngle((float) -mpi); t.setTurnAngle((float) - mpi);
} }
} }
return t; return t;
} }
private int[] getTurnLanesInfo(RouteSegmentResult prevSegm, int mainTurnType) { String turnLanes = getTurnLanesString(prevSegm); private int[] getTurnLanesInfo(RouteSegmentResult prevSegm, int mainTurnType) {
int[] lanesArray ; String turnLanes = getTurnLanesString(prevSegm);
int[] lanesArray;
if (turnLanes == null) { if (turnLanes == null) {
if(prevSegm.getTurnType() != null && prevSegm.getTurnType().getLanes() != null if(prevSegm.getTurnType() != null && prevSegm.getTurnType().getLanes() != null
&& prevSegm.getDistance() < 100) { && prevSegm.getDistance() < 100) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -50,7 +50,7 @@
android:id="@+id/text_container" android:id="@+id/text_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/content_padding_standard" android:layout_marginBottom="@dimen/content_padding_half"
android:animateLayoutChanges="true" android:animateLayoutChanges="true"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="@dimen/my_location_text_sides_margin" android:paddingLeft="@dimen/my_location_text_sides_margin"
@ -58,7 +58,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/action_bar_height"> android:layout_height="wrap_content">
<net.osmand.telegram.ui.views.TextViewEx <net.osmand.telegram.ui.views.TextViewEx
android:id="@+id/title" android:id="@+id/title"
@ -66,6 +66,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_weight="1" android:layout_weight="1"
android:paddingTop="@dimen/app_bar_title_padding_small"
android:paddingBottom="@dimen/app_bar_title_padding_small"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:maxLines="1" android:maxLines="1"
@ -295,6 +297,30 @@
</FrameLayout> </FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/bg_list_item_dark">
<net.osmand.telegram.ui.views.TextViewEx
android:id="@+id/back_to_osmand"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:drawableStart="@drawable/ic_action_undo"
android:drawableLeft="@drawable/ic_action_undo"
android:drawablePadding="@dimen/my_location_text_sides_margin"
android:gravity="center_vertical"
android:minHeight="@dimen/list_item_height_min"
android:paddingStart="@dimen/content_padding_standard"
android:paddingLeft="@dimen/content_padding_standard"
android:text="@string/back_to_osmand"
android:textColor="?attr/colorPrimaryDark"
android:textSize="@dimen/list_item_title_text_size"
app:typeface="@string/font_roboto_regular" />
</FrameLayout>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<FrameLayout <FrameLayout

View file

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="?attr/card_bg_color">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="@dimen/list_item_height"
android:orientation="horizontal">
<ImageView
android:id="@+id/icon"
android:layout_width="@dimen/list_item_icon_size_big"
android:layout_height="@dimen/list_item_icon_size_big"
android:layout_marginStart="@dimen/list_item_icon_margin_left"
android:layout_marginLeft="@dimen/list_item_icon_margin_left"
android:layout_marginEnd="@dimen/list_item_icon_margin_right"
android:layout_marginRight="@dimen/list_item_icon_margin_right"
tools:src="@drawable/img_user_picture" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/content_padding_half"
android:layout_marginRight="@dimen/content_padding_half"
android:layout_weight="1"
android:orientation="vertical">
<net.osmand.telegram.ui.views.TextViewEx
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/list_item_title_text_size"
app:typeface="@string/font_roboto_regular"
tools:text="Share to Share Location" />
<net.osmand.telegram.ui.views.TextViewEx
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/list_item_description_text_size"
app:typeface="@string/font_roboto_regular"
tools:text="for 1 hour" />
</LinearLayout>
<net.osmand.telegram.ui.views.TextViewEx
android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="@dimen/dialog_button_height"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/image_button_padding"
android:layout_marginRight="@dimen/image_button_padding"
android:background="?attr/secondary_btn_bg"
android:gravity="center"
android:paddingLeft="@dimen/image_button_padding"
android:paddingRight="@dimen/image_button_padding"
android:text="@string/shared_string_start"
android:textColor="?attr/ctrl_active_color"
android:textSize="@dimen/text_button_text_size"
app:typeface="@string/font_roboto_medium"
tools:text="Start" />
</LinearLayout>
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:background="?attr/card_divider_color"
android:visibility="gone"
tools:visibility="visible" />
</FrameLayout>
</LinearLayout>
</LinearLayout>

View file

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:id="@+id/divider_top"
android:layout_width="match_parent"
android:layout_height="26dp" />
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/shared_chat_card_bg"
android:orientation="vertical">
<net.osmand.telegram.ui.views.TextViewEx
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="54dp"
android:gravity="start|center_vertical"
android:paddingStart="@dimen/content_padding_standard"
android:paddingLeft="@dimen/content_padding_half"
android:paddingRight="@dimen/content_padding_half"
android:text="@string/shared_string_suggested"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/hint_text_size"
app:typeface="@string/font_roboto_mono_bold"
tools:text="Suggested" />
<LinearLayout
android:id="@+id/last_items_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
<View
android:id="@+id/divider_bottom"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/card_divider_color"
android:visibility="gone"
tools:visibility="visible" />
</LinearLayout>

View file

@ -250,4 +250,14 @@
<string name="shared_string_apply">Ужыць</string> <string name="shared_string_apply">Ужыць</string>
<string name="set_time_timeline_descr">Абраць час для паказу</string> <string name="set_time_timeline_descr">Абраць час для паказу</string>
<string name="start_end_date">Пачатак - дата завяршэння</string> <string name="start_end_date">Пачатак - дата завяршэння</string>
<string name="saved_messages">Захаваныя паведамленні</string>
<string name="time_zone_descr">Абярыце часавы пояс, каб паказваць ваш час у паведамленнях.</string>
<string name="time_zone">Часавы пояс</string>
<string name="units_and_formats">Адзінкі вымярэння і фарматы</string>
<string name="unit_of_length_descr">Змяніць адзінкі вымярэння адлегласці.</string>
<string name="unit_of_length">Адзінкі даўжыні</string>
<string name="unit_of_speed_system_descr">Вызначце адзінку вымярэння хуткасці.</string>
<string name="unit_of_speed_system">Адзінка вымярэння хуткасці</string>
<string name="buffer_time_descr">Максімальны час захоўвання пунктаў у буферы</string>
<string name="buffer_time">Час дзеяння буферу</string>
</resources> </resources>

View file

@ -35,7 +35,7 @@
<string name="shared_string_close">Schließen</string> <string name="shared_string_close">Schließen</string>
<string name="connected_account">Verbundenes Konto</string> <string name="connected_account">Verbundenes Konto</string>
<string name="shared_string_account">Konto</string> <string name="shared_string_account">Konto</string>
<string name="in_time">"in %1$s "</string> <string name="in_time">in %1$s</string>
<string name="osmand_connect_desc">Wählen Sie die OsmAnd-Version, die OsmAnd Tracker verwendet, um Positionen anzuzeigen.</string> <string name="osmand_connect_desc">Wählen Sie die OsmAnd-Version, die OsmAnd Tracker verwendet, um Positionen anzuzeigen.</string>
<string name="osmand_connect">OsmAnd verbinden</string> <string name="osmand_connect">OsmAnd verbinden</string>
<string name="location_history_desc">Blendet Kontakte aus, die sich eine bestimmte Zeit lang nicht bewegt haben.</string> <string name="location_history_desc">Blendet Kontakte aus, die sich eine bestimmte Zeit lang nicht bewegt haben.</string>
@ -199,12 +199,12 @@
<string name="privacy_policy_use_telegram">Telegram (die Messaging-App) wird verwendet, um sich mit Menschen zu verbinden und mit ihnen zu kommunizieren.</string> <string name="privacy_policy_use_telegram">Telegram (die Messaging-App) wird verwendet, um sich mit Menschen zu verbinden und mit ihnen zu kommunizieren.</string>
<string name="shared_string_ok">OK</string> <string name="shared_string_ok">OK</string>
<string name="location_recording_enabled">Standortaufzeichnung aktiviert</string> <string name="location_recording_enabled">Standortaufzeichnung aktiviert</string>
<string name="app_name_short">OsmAnd-Tracker</string> <string name="app_name_short">OsmAnd Tracker</string>
<string name="shared_string_accept">Akzeptieren</string> <string name="shared_string_accept">Akzeptieren</string>
<string name="telegram_privacy_policy">Telegram-Datenschutzerklärung</string> <string name="telegram_privacy_policy">Telegram-Datenschutzerklärung</string>
<string name="osmand_privacy_policy">OsmAnd Datenschutzerklärung</string> <string name="osmand_privacy_policy">OsmAnd Datenschutzerklärung</string>
<string name="how_it_works">Wie es funktioniert</string> <string name="how_it_works">Wie es funktioniert</string>
<string name="received_gps_points">GPX-Punkte erhalten: %1$s</string> <string name="received_gps_points">Empfangene GPS-Punkte: %1$s</string>
<string name="shared_string_appearance">Aussehen</string> <string name="shared_string_appearance">Aussehen</string>
<string name="show_gps_points">GPS-Punkte anzeigen</string> <string name="show_gps_points">GPS-Punkte anzeigen</string>
<string name="disable_monitoring">Aufzeichnung deaktivieren</string> <string name="disable_monitoring">Aufzeichnung deaktivieren</string>
@ -260,4 +260,7 @@
<string name="unit_of_length_descr">Maß für Entfernungen ändern.</string> <string name="unit_of_length_descr">Maß für Entfernungen ändern.</string>
<string name="buffer_time_descr">Maximale Zeit zum Speichern von Punkten im Puffer</string> <string name="buffer_time_descr">Maximale Zeit zum Speichern von Punkten im Puffer</string>
<string name="buffer_time">Verfallszeit des Puffers</string> <string name="buffer_time">Verfallszeit des Puffers</string>
<string name="shared_string_suggested">Empfohlen</string>
<string name="status_widget_title">OsmAnd Tracker-Status</string>
<string name="back_to_osmand">Zurück zu OsmAnd</string>
</resources> </resources>

View file

@ -69,7 +69,7 @@
<string name="mile">mi</string> <string name="mile">mi</string>
<string name="km">km</string> <string name="km">km</string>
<string name="m">m</string> <string name="m">m</string>
<string name="nm">mpk</string> <string name="nm">nmi</string>
<string name="min_mile">min/m</string> <string name="min_mile">min/m</string>
<string name="min_km">min/km</string> <string name="min_km">min/km</string>
<string name="m_s">m/s</string> <string name="m_s">m/s</string>
@ -85,4 +85,182 @@
<string name="si_km_m">Kilomeetrid/meetrid</string> <string name="si_km_m">Kilomeetrid/meetrid</string>
<string name="si_nm">Meremiilid</string> <string name="si_nm">Meremiilid</string>
<string name="si_mi_meters">Miilid/meetrid</string> <string name="si_mi_meters">Miilid/meetrid</string>
<string name="privacy">Privaatsus</string>
<string name="direction">Suund</string>
<string name="precision">Täpsus</string>
<string name="bearing">Kurss</string>
<string name="search_contacts">Otsi kontaktide hulgast</string>
<string name="search_contacts_descr">Otsi kõigist oma gruppidest ja kontaktidest.</string>
<string name="type_contact_or_group_name">Kirjuta kontakti või grupi nimi</string>
<string name="timeline_available_for_free_now">Ajaskaala on nüüd tasuta saadaval olev funktsioon.</string>
<string name="disable_monitoring">Keela jälgimine</string>
<string name="location_recording_enabled">Asukoha salvestamine lubatud</string>
<string name="timeline_description">Luba jälgimine kõigi asukohtade ajaloos salvestamiseks.</string>
<string name="app_name_short">OsmAnd Tracker</string>
<string name="shared_string_telegram">Telegram</string>
<string name="privacy_policy_use_telegram">Telegram (sõnumirakendus) on kasutusel inimestega kontakteerumiseks ja suhtlemiseks.</string>
<string name="privacy_policy_telegram_client">OsmAnd Tracker on üks Telegrami avatud platvormi kasutavaid kliente. Teie kontaktid saavad kasutada mis tahes muud Telegrami klienti.</string>
<string name="privacy_policy_agree">Vajutades \"Jätka\" nõustud Telegram ja OsmAnd rakenduste privaatsuspoliitika tingimustega.</string>
<string name="shared_string_accept">Nõustu</string>
<string name="telegram_privacy_policy">Telegram privaatsuspoliitika</string>
<string name="osmand_privacy_policy">OsmAnd privaatsuspoliitika</string>
<string name="how_it_works">Kuidas see töötab</string>
<string name="received_gps_points">Saadud GPX punktid: %1$s</string>
<string name="shared_string_appearance">Välimus</string>
<string name="show_gps_points">Kuva GPS punktid</string>
<string name="show_gps_points_descr">Kuva kogutud ja saadetud GPS punktide arv.</string>
<string name="please_update_osmand">Palun uuenda OsmAnd andmete vaatamiseks kaardil</string>
<string name="gps_points_in_buffer">saadetud (%1$d puhvris)</string>
<string name="points_size">%1$d punkti</string>
<string name="shared_string_date">Kuupäev</string>
<string name="shared_string_collected">Kogutud</string>
<string name="gps_points">GPS punktid</string>
<string name="shared_string_sent">Saadetud</string>
<string name="monitoring_is_enabled">Jälgimine on lubatud</string>
<string name="monitoring_is_disabled">Jälgimine on keelatud</string>
<string name="time_on_the_move">Liikumisaeg</string>
<string name="open_in_osmand">Kuva OsmAndis</string>
<string name="end_date">Lõppkuupäev</string>
<string name="start_date">Alguskuupäev</string>
<string name="send_location_as">Saada asukoht kui</string>
<string name="send_location_as_descr">Vali oma asukoha sõnumite välimus.</string>
<string name="shared_string_text">Tekst</string>
<string name="map_and_text">Kaart ja tekst</string>
<string name="last_update_from_telegram">Viimane Telegram poolne uuendus</string>
<string name="enter_another_device_name">Vali nimi, mida Sa pole veel kasutanud</string>
<string name="device_added_successfully">%1$s lisatud.</string>
<string name="error_adding_new_device">Uut seadet ei saanud lisada</string>
<string name="enter_device_name_description">Nimeta oma uus seade maksimaalselt 200 tähemärgiga.</string>
<string name="device_name_is_too_long">Seadme nimi liiga pikk</string>
<string name="device_name_cannot_be_empty">Seadme nimi ei tohi olla tühi</string>
<string name="device_name">Seadme nimi</string>
<string name="share_location_as_description_second_line">Seadme ID saate luua ja vaadata %1$s vestlusboti abil Telegrami kliendis. %2$s</string>
<string name="share_location_as_description">Soovides siduda ühe Telegrami kontoga mitut seadet, peate oma asukoha jagamiseks kasutama erinevat seadet.</string>
<string name="last_updated_location">Viimati värskendatud asukoht:</string>
<string name="successfully_sent_and_updated">Edukalt saadetud ja värskendatud</string>
<string name="not_possible_to_send_to_telegram_chats">Telegrami vestlusi pole võimalik saata:</string>
<string name="waiting_for_response_from_telegram">Telegram vastuse ootel</string>
<string name="sending_location_messages">Asukoha saatmine</string>
<string name="initializing">Alustamine</string>
<string name="searching_for_gps">Positsioneerimine…</string>
<string name="connecting_to_the_internet">Interneti-ühenduse loomine</string>
<string name="background_work_description">Asukoha jagamise stabiliseerimiseks muuda aku optimeerimise sätteid.</string>
<string name="background_work">Tausttöö</string>
<string name="battery_optimization_description">Lülita aku optimeerimine OsmAnd Trackeris välja, nii et see taustal olles ootamatult välja ei lülitu.</string>
<string name="sharing_in_background">Taustal jagamine</string>
<string name="go_to_settings">Mine seadete juurde</string>
<string name="shared_string_later">Hiljem</string>
<string name="not_sent_yet">Ei ole veel saadetud</string>
<string name="not_found_yet">Ei ole veel leitud</string>
<string name="re_send_location">Saada asukoht uuesti</string>
<string name="last_available_location">Viimane saadaolev asukoht</string>
<string name="sharing_status">Jagamise olek</string>
<string name="location_sharing_status">Jagamine: %1$s</string>
<string name="no_gps_connection">GPS ühendus puudub</string>
<string name="no_internet_connection">Interneti-ühendus puudub</string>
<string name="add_device">Lisa seade</string>
<string name="share_location_as">Jaga asukohta kui</string>
<string name="live_now_description">Sinuga asukohta jagavad kontaktid ja grupid.</string>
<string name="logout_from_osmand_telegram_descr">Kas soovid kindlasti OsmAnd Trackerist välja logida, et ei saaks asukohta jagada ega teiste asukohta näha\?</string>
<string name="logout_from_osmand_telegram">Logida OsmAnd Trackerist välja\?</string>
<string name="by_distance">Kauguse järgi</string>
<string name="by_name">Nime järgi</string>
<string name="by_group">Grupi järgi</string>
<string name="shared_string_sort_by">Sorteerimisalus</string>
<string name="choose_osmand_desc">Vali OsmAnd versioon, kus kontaktid kuvatakse kaardil.</string>
<string name="choose_osmand">Vali kasutatav OsmAnd versioon</string>
<string name="disable_all_sharing_desc">Lülitab asukoha jagamise välja kõikides valitud vestlustes (%1$d).</string>
<string name="disable_all_sharing">Keela igasugune jagamine</string>
<string name="turn_off_all">Lülita kõik välja</string>
<string name="time_ago">tagasi</string>
<string name="last_response">Viimane vastus</string>
<string name="shared_string_group">Grupp</string>
<string name="logout_no_internet_msg">Telegramist korrektseks väljalogimiseks loo interneti-ühendus.</string>
<string name="disconnect_from_telegram_desc">Asukoha jagamise juurdepääsu tühistamine. Ava Telegram, mine menüüsse Seaded → Privaatsus ja turvalisus → Seansid ja lõpeta OsmAnd Trackeri seanss.</string>
<string name="disconnect_from_telegram">Kuidas OsmAnd Tracker Telegramist välja lülitada</string>
<string name="logout_help_desc">Kuidas OsmAnd Tracker Telegramist välja lülitada</string>
<string name="connected_account">Ühendatud konto</string>
<string name="shared_string_account">Konto</string>
<string name="in_time">%1$s jooksul</string>
<string name="osmand_connect_desc">Vali OsmAnd Trackeri poolt asukohtade kuvamiseks kasutatav OsmAnd versioon.</string>
<string name="osmand_connect">OsmAnd ühendamine</string>
<string name="location_history_desc">Peida kontaktid, kes pole antud aja jooksul liikunud.</string>
<string name="location_history">Asukoha ajalugu</string>
<string name="stale_location_desc">Kontakti viimase liikumise aeg.</string>
<string name="stale_location">Ei liigu</string>
<string name="send_my_location_desc">Seadista asukoha jagamise minimaalne ajavahemik.</string>
<string name="send_my_location">Saada minu asukoht</string>
<string name="gps_and_location">Asukoht</string>
<string name="sharing_time">Jagamise aeg</string>
<string name="expire_at">Aegub</string>
<string name="stop_sharing_all">Jagamine on sisse lülitatud (lülita välja)</string>
<string name="turn_off_location_sharing">Lülita asukoha jagamine välja</string>
<string name="open_osmand">Ava OsmAnd</string>
<string name="shared_string_live">Reaalajas</string>
<string name="shared_string_bot">Bot</string>
<string name="get_telegram_title">Telegramis registreerumine</string>
<string name="get_telegram_account_first">Asukoha jagamiseks vajad Telegram kontot.</string>
<string name="get_telegram_description_continue">Palun paigalda Telegram ja seadista konto.</string>
<string name="get_telegram_after_creating_account">Seejärel saad seda rakendust kasutada.</string>
<string name="already_registered_in_telegram">Vajad registreeritud Telegrami kontot ja telefoninumbrit</string>
<string name="do_not_have_telegram">Mul ei ole Telegrami kontot</string>
<string name="enter_phone_number">Sisesta telefoninumber</string>
<string name="enter_authentication_code">Sisesta autentimiskood</string>
<string name="set_visible_time_for_all">Määra kõigile nähtav oleku aeg</string>
<string name="hours_and_minutes_format">%1$d h %2$d m</string>
<string name="minutes_format">%1$d m</string>
<string name="hours_format">%1$d h</string>
<string name="visible_time_for_all">Kõigile nähtav oleku aeg</string>
<string name="set_time_description">Vali aeg, mille jooksul valitud kontaktid ja rühmad näevad sinu asukohta reaalajas.</string>
<string name="set_time">Määra aeg</string>
<string name="location_sharing_description">Vali kontaktid ja rühmad, kellega soovid oma asukohta jagada.</string>
<string name="my_location_search_hint">Otsi: grupp või kontakt</string>
<string name="start_location_sharing">Jaga asukohta</string>
<string name="show_on_map">Kuva kaardil</string>
<string name="app_name">OsmAnd võrguühendusega GPS jälgija</string>
<string name="phone_number_title">Telefoninumber</string>
<string name="phone_number_descr">Telefoninumber rahvusvahelises formaadis</string>
<string name="shared_string_password">Salasõna</string>
<string name="enter_code">Sisesta kood</string>
<string name="authentication_code">Autentimiskood</string>
<string name="authentication_code_descr">Telegram saatis sulle koodi OsmAnd-i abil oma kontole sisse logimiseks.</string>
<string name="enter_password">Sisesta salasõna</string>
<string name="password_descr">Telegram salasõna</string>
<string name="shared_string_login">Logi sisse</string>
<string name="shared_string_logout">Logi välja</string>
<string name="initialization">Alustamine</string>
<string name="logging_out">Välja logimine</string>
<string name="closing">Sulgemine</string>
<string name="gps_network_not_enabled">Lülitada sisse \"Asukoht\"\?</string>
<string name="not_logged_in">Sa ei ole sisse logitud</string>
<string name="no_location_permission">Rakendusel puudub juurdepääs asukohaandmetele.</string>
<string name="gps_not_available">Palun lülita süsteemi seadetes sisse \"Asukoht\"</string>
<string name="location_service_no_gps_available">Vali oma asukoha jagamiseks üks asukoha pakkujatest.</string>
<string name="osmand_service_descr">OsmAnd Tracker töötab taustal välja lülitatud ekraaniga.</string>
<string name="shared_string_distance">Kaugus</string>
<string name="share_location">Jaga asukohta</string>
<string name="sharing_location">Asukoha jagamine</string>
<string name="process_service">OsmAnd Tracker teenus</string>
<string name="osmand_logo">OsmAnd logo</string>
<string name="install_osmand_dialog_message">Esmalt pead paigaldama OsmAnd tasuta või tasulise versiooni</string>
<string name="install_osmand">Paigalda OsmAnd</string>
<string name="show_users_on_map">Kuva kasutajad kaardil</string>
<string name="active_chats">Aktiivsed vestlused</string>
<string name="shared_string_authorization">Autoriseerimine</string>
<string name="shared_string_authorization_descr">Palun sisesta oma Telegrami telefoninumber rahvusvahelises formaadis</string>
<string name="shared_string_welcome">Tere tulemast</string>
<string name="nm_h">nmi/h</string>
<string name="si_nm_h">Meremiili tunnis (sõlm)</string>
<string name="shared_string_hour_short">h</string>
<string name="shared_string_minute_short">min</string>
<string name="shared_string_second_short">sek</string>
<string name="welcome_descr">
<b>OsmAnd Tracker</b> võimaldab sul jagada oma asukohta ja näha teiste asukohta OsmAndis. <br/>
<br/>Rakendus kasutab Telegrami API-t, seega vajad Telegrami kontot.</string>
<string name="my_location">Minu asukoht</string>
<string name="live_now">Nüüd reaalajas nähtav</string>
<string name="timeline">Ajajoon</string>
<string name="shared_string_suggested">Soovitatud</string>
<string name="status_widget_title">OsmAnd Tracker olek</string>
<string name="back_to_osmand">Tagasi OsmAnd-i</string>
</resources> </resources>

View file

@ -259,4 +259,7 @@
<string name="unit_of_speed_system">יחידת מהירות</string> <string name="unit_of_speed_system">יחידת מהירות</string>
<string name="buffer_time_descr">הזמן המרבי לשמירת נקודות בזיכרון</string> <string name="buffer_time_descr">הזמן המרבי לשמירת נקודות בזיכרון</string>
<string name="buffer_time">זמן פקיעת הזיכרון</string> <string name="buffer_time">זמן פקיעת הזיכרון</string>
<string name="shared_string_suggested">מוצע</string>
<string name="status_widget_title">מצב עוקב OsmAnd</string>
<string name="back_to_osmand">חזרה ל־OsmAnd</string>
</resources> </resources>

View file

@ -2,7 +2,7 @@
<resources> <resources>
<string name="shared_string_telegram">Telegram</string> <string name="shared_string_telegram">Telegram</string>
<string name="privacy_policy_use_telegram">A Telegram (üzenetküldő alkalmazás) a másokkal való összekapcsolódásra és kommunikációra használható.</string> <string name="privacy_policy_use_telegram">A Telegram (üzenetküldő alkalmazás) a másokkal való összekapcsolódásra és kommunikációra használható.</string>
<string name="privacy_policy_telegram_client">A Telegram nyílt platformot használó kliensprogramok egyike az OsmAnd tracker. Partnerei bármelyik másik Telegram kliensprogramot is használhatják.</string> <string name="privacy_policy_telegram_client">A Telegram nyílt platformot használó kliensprogramok egyike az OsmAnd Tracker. Partnerei bármelyik másik Telegram kliensprogramot is használhatják.</string>
<string name="privacy_policy_agree">A „Tovább”-ra kattintva elfogadja a Telegram és az OsmAnd adatvédelmi irányelveinek feltételeit.</string> <string name="privacy_policy_agree">A „Tovább”-ra kattintva elfogadja a Telegram és az OsmAnd adatvédelmi irányelveinek feltételeit.</string>
<string name="shared_string_accept">Elfogadás</string> <string name="shared_string_accept">Elfogadás</string>
<string name="telegram_privacy_policy">Telegram adatvédelmi irányelvei</string> <string name="telegram_privacy_policy">Telegram adatvédelmi irányelvei</string>
@ -257,6 +257,8 @@
<string name="unit_of_length">Hosszmértékegységek</string> <string name="unit_of_length">Hosszmértékegységek</string>
<string name="unit_of_speed_system_descr">Sebesség mértékegységének meghatározása</string> <string name="unit_of_speed_system_descr">Sebesség mértékegységének meghatározása</string>
<string name="unit_of_speed_system">Sebesség mértékegysége</string> <string name="unit_of_speed_system">Sebesség mértékegysége</string>
<string name="buffer_time_descr">Az az idő, amely után a pufferelt helyzetjelentések törlődnek</string> <string name="buffer_time_descr">Az a leghosszabb idő, ameddig a pontok a pufferben tárolódnak</string>
<string name="buffer_time">Puffer lejárati ideje</string> <string name="buffer_time">Puffer lejárati ideje</string>
<string name="shared_string_suggested">Javasolt</string>
<string name="status_widget_title">Az OsmAnd Tracker állapota</string>
</resources> </resources>

View file

@ -2,7 +2,7 @@
<resources> <resources>
<string name="background_work_description">Endre batterioptimiseringsinnstillinger for mer stabil posisjonsdeling.</string> <string name="background_work_description">Endre batterioptimiseringsinnstillinger for mer stabil posisjonsdeling.</string>
<string name="background_work">Bakgrunnsarbeid</string> <string name="background_work">Bakgrunnsarbeid</string>
<string name="battery_optimization_description">Skru av batterioptimisering for OsmAnd Tracker slik at det ikke plutselig skrur seg av når det er i bakgrunnen.</string> <string name="battery_optimization_description">Skru av batterioptimisering for OsmAnd-sporeren slik at det ikke plutselig skrur seg av når det er i bakgrunnen.</string>
<string name="sharing_in_background">Deling i bakgrunnen</string> <string name="sharing_in_background">Deling i bakgrunnen</string>
<string name="go_to_settings">Gå til innstillinger</string> <string name="go_to_settings">Gå til innstillinger</string>
<string name="shared_string_later">Senere</string> <string name="shared_string_later">Senere</string>
@ -20,8 +20,8 @@
<string name="add_device">Legg til enhet</string> <string name="add_device">Legg til enhet</string>
<string name="share_location_as">Del posisjon som</string> <string name="share_location_as">Del posisjon som</string>
<string name="live_now_description">Kontakter og grupper som deler sin posisjon med deg.</string> <string name="live_now_description">Kontakter og grupper som deler sin posisjon med deg.</string>
<string name="logout_from_osmand_telegram_descr">Er du sikker på at du vil logge ut av OsmAnd Tracker slik at du ikke kan sende din posisjon, eller se andres\?</string> <string name="logout_from_osmand_telegram_descr">Er du sikker på at du vil logge ut av OsmAnd-sporeren slik at du ikke kan sende din posisjon, eller se andres\?</string>
<string name="logout_from_osmand_telegram">Logg ut av OsmAnd Tracker\?</string> <string name="logout_from_osmand_telegram">Logg ut av OsmAnd-sporeren\?</string>
<string name="shared_string_name">Navn</string> <string name="shared_string_name">Navn</string>
<string name="by_distance">Etter distanse</string> <string name="by_distance">Etter distanse</string>
<string name="by_name">Etter navn</string> <string name="by_name">Etter navn</string>
@ -39,13 +39,13 @@
<string name="shared_string_group">Gruppe</string> <string name="shared_string_group">Gruppe</string>
<string name="logout_no_internet_msg">Koble til Internett for å logge ut av Telegram ordentlig.</string> <string name="logout_no_internet_msg">Koble til Internett for å logge ut av Telegram ordentlig.</string>
<string name="shared_string_close">Lukk</string> <string name="shared_string_close">Lukk</string>
<string name="disconnect_from_telegram_desc">For å tilbakekalle posisjonsdelingstilgang. Åpne Telegram, gå til Innstillinger - Personvern og sikkerhet - Økter, og sluttfør OsmAnd Tracker-økta.</string> <string name="disconnect_from_telegram_desc">For å tilbakekalle posisjonsdelingstilgang. Åpne Telegram, gå til Innstillinger - Personvern og sikkerhet - Økter, og sluttfør OsmAnd-sporerøkta.</string>
<string name="disconnect_from_telegram">Hvordan koble fra OsmAnd-sporeren fra Telegram</string> <string name="disconnect_from_telegram">Hvordan koble fra OsmAnd-sporeren fra Telegram</string>
<string name="logout_help_desc">Hvordan koble fra OsmAnd-sporeren fra Telegram</string> <string name="logout_help_desc">Hvordan koble fra OsmAnd-sporeren fra Telegram</string>
<string name="connected_account">Tilkoblet konto</string> <string name="connected_account">Tilkoblet konto</string>
<string name="shared_string_account">Konto</string> <string name="shared_string_account">Konto</string>
<string name="in_time">i %1$s</string> <string name="in_time">i %1$s</string>
<string name="osmand_connect_desc">Velg OsmAnd-versjonen OsmAnd Tracker bruker for å vise posisjoner på kartet.</string> <string name="osmand_connect_desc">Velg OsmAnd-versjonen OsmAnd-sporeren bruker for å vise posisjoner på kartet.</string>
<string name="osmand_connect">OsmAnd connect</string> <string name="osmand_connect">OsmAnd connect</string>
<string name="location_history_desc">Skjul kontaktene som ikke har oppdatert sin plassering etter et gitt tidsintervall.</string> <string name="location_history_desc">Skjul kontaktene som ikke har oppdatert sin plassering etter et gitt tidsintervall.</string>
<string name="location_history">Posisjonshistorikk</string> <string name="location_history">Posisjonshistorikk</string>
@ -84,7 +84,7 @@
<string name="my_location_search_hint">Søk: Gruppe eller kontakt</string> <string name="my_location_search_hint">Søk: Gruppe eller kontakt</string>
<string name="start_location_sharing">Del posisjon</string> <string name="start_location_sharing">Del posisjon</string>
<string name="show_on_map">Vis på kartet</string> <string name="show_on_map">Vis på kartet</string>
<string name="app_name">OsmAnd Online GPS Tracker</string> <string name="app_name">OsmAnd nettbasert GPS-sporer</string>
<string name="phone_number_title">Telefonnummer</string> <string name="phone_number_title">Telefonnummer</string>
<string name="phone_number_descr">Telefonnummer i internasjonalt format</string> <string name="phone_number_descr">Telefonnummer i internasjonalt format</string>
<string name="shared_string_password">Passord</string> <string name="shared_string_password">Passord</string>
@ -103,11 +103,11 @@
<string name="gps_not_available">Skru på «Posisjon» i systeminnstillingene</string> <string name="gps_not_available">Skru på «Posisjon» i systeminnstillingene</string>
<string name="location_service_no_gps_available">Velg en av posisjonstilbyderne for å dele din posisjon.</string> <string name="location_service_no_gps_available">Velg en av posisjonstilbyderne for å dele din posisjon.</string>
<string name="osmand_service">Bakgrunnsmodus</string> <string name="osmand_service">Bakgrunnsmodus</string>
<string name="osmand_service_descr">OsmAnd Tracker kjører som nisse med skjermen av.</string> <string name="osmand_service_descr">OsmAnd-sporeren kjører som nisse med skjermen av.</string>
<string name="shared_string_distance">Distanse</string> <string name="shared_string_distance">Distanse</string>
<string name="share_location">Del posisjon</string> <string name="share_location">Del posisjon</string>
<string name="sharing_location">Deler posisjon</string> <string name="sharing_location">Deler posisjon</string>
<string name="process_service">OsmAnd Tracker-tjeneste</string> <string name="process_service">OsmAnd-sporertjeneste</string>
<string name="osmand_logo">OsmAnd-logo</string> <string name="osmand_logo">OsmAnd-logo</string>
<string name="install_osmand_dialog_message">Du må installere gratis- eller betalt versjon av OsmAnd først</string> <string name="install_osmand_dialog_message">Du må installere gratis- eller betalt versjon av OsmAnd først</string>
<string name="install_osmand">Installer OsmAnd</string> <string name="install_osmand">Installer OsmAnd</string>
@ -125,7 +125,9 @@
<string name="shared_string_hour_short">t</string> <string name="shared_string_hour_short">t</string>
<string name="shared_string_minute_short">min</string> <string name="shared_string_minute_short">min</string>
<string name="shared_string_second_short">sek</string> <string name="shared_string_second_short">sek</string>
<string name="welcome_descr"><b>OsmAnd-sporer</b> lar deg dele din posisjon og se andres i OsmAnd.<br/> <br/>Programmet belager seg på Telegram-API-et, så du må ha en Telegram-konto.</string> <string name="welcome_descr">
<b>OsmAnd-sporeren</b> lar deg dele din posisjon og se andres i OsmAnd.<br/>
<br/>Programmet belager seg på Telegram-API-et, så du må ha en Telegram-konto.</string>
<string name="my_location">Min posisjon</string> <string name="my_location">Min posisjon</string>
<string name="last_updated_location">Sist oppdaterte posisjon:</string> <string name="last_updated_location">Sist oppdaterte posisjon:</string>
<string name="successfully_sent_and_updated">Sendt og oppdatert</string> <string name="successfully_sent_and_updated">Sendt og oppdatert</string>
@ -249,4 +251,15 @@
<string name="set_time_timeline_descr">Velg tid å vise</string> <string name="set_time_timeline_descr">Velg tid å vise</string>
<string name="start_end_date">Startsluttdato</string> <string name="start_end_date">Startsluttdato</string>
<string name="saved_messages">Lagrede meldinger</string> <string name="saved_messages">Lagrede meldinger</string>
<string name="time_zone_descr">Velg tidssone å vise i dine plasseringsmeldinger.</string>
<string name="time_zone">Tidssone</string>
<string name="units_and_formats">Enheter og formater</string>
<string name="unit_of_length_descr">Endre hva lengde måles i.</string>
<string name="unit_of_length">Lengdeenhet</string>
<string name="unit_of_speed_system_descr">Definer en fartsenhet</string>
<string name="unit_of_speed_system">Fartsenhet</string>
<string name="buffer_time_descr">Maksimal tid å lagre punkter i mellomlageret</string>
<string name="buffer_time">Utløpstid for mellomlager</string>
<string name="shared_string_suggested">Foreslått</string>
<string name="status_widget_title">OsmAnd-sporerstatus</string>
</resources> </resources>

View file

@ -259,4 +259,5 @@
<string name="unit_of_speed_system">Jednostka prędkości</string> <string name="unit_of_speed_system">Jednostka prędkości</string>
<string name="buffer_time_descr">Maksymalny czas przechowywania punktów w buforze</string> <string name="buffer_time_descr">Maksymalny czas przechowywania punktów w buforze</string>
<string name="buffer_time">Czas ważności bufora</string> <string name="buffer_time">Czas ważności bufora</string>
<string name="time_zone_descr">Wybierz strefę czasową, która ma być wyświetlana w wiadomościach o Twojej lokalizacji.</string>
</resources> </resources>

View file

@ -260,4 +260,7 @@
<string name="unit_of_speed_system">Unidade de velocidade</string> <string name="unit_of_speed_system">Unidade de velocidade</string>
<string name="buffer_time_descr">Tempo máximo para armazenar pontos no buffer</string> <string name="buffer_time_descr">Tempo máximo para armazenar pontos no buffer</string>
<string name="buffer_time">Tempo de expiração do buffer</string> <string name="buffer_time">Tempo de expiração do buffer</string>
<string name="shared_string_suggested">Sugerido</string>
<string name="status_widget_title">Status do OsmAnd Tracker</string>
<string name="back_to_osmand">Voltar para OsmAnd</string>
</resources> </resources>

View file

@ -260,4 +260,7 @@
<string name="unit_of_speed_system">Единица измерения скорости</string> <string name="unit_of_speed_system">Единица измерения скорости</string>
<string name="buffer_time_descr">Максимальное время хранения точек в буфере</string> <string name="buffer_time_descr">Максимальное время хранения точек в буфере</string>
<string name="buffer_time">Срок действия буфера</string> <string name="buffer_time">Срок действия буфера</string>
<string name="shared_string_suggested">Предложено</string>
<string name="status_widget_title">Статус OsmAnd Tracker</string>
<string name="back_to_osmand">Вернуться к OsmAnd</string>
</resources> </resources>

View file

@ -245,7 +245,7 @@
<string name="timeline_no_data_descr">Non tenimus datos collidos pro sa die ischertada</string> <string name="timeline_no_data_descr">Non tenimus datos collidos pro sa die ischertada</string>
<string name="timeline_no_data">Perunu datu</string> <string name="timeline_no_data">Perunu datu</string>
<string name="shared_string_end">Acaba</string> <string name="shared_string_end">Acaba</string>
<string name="shared_string_start">Incumintza</string> <string name="shared_string_start">Allughe</string>
<string name="shared_string_apply">Àplica</string> <string name="shared_string_apply">Àplica</string>
<string name="set_time_timeline_descr">Ischerta su tempus de ammustrare</string> <string name="set_time_timeline_descr">Ischerta su tempus de ammustrare</string>
<string name="start_end_date">Data de incumintzu — de acabu</string> <string name="start_end_date">Data de incumintzu — de acabu</string>
@ -257,6 +257,8 @@
<string name="unit_of_length">Unidades de longària</string> <string name="unit_of_length">Unidades de longària</string>
<string name="unit_of_speed_system_descr">Issèbera s\'unidade de letresa.</string> <string name="unit_of_speed_system_descr">Issèbera s\'unidade de letresa.</string>
<string name="unit_of_speed_system">Unidade de lestresa</string> <string name="unit_of_speed_system">Unidade de lestresa</string>
<string name="buffer_time_descr">Tempus a pustis de su cale sos messàgios de positzione in sa memòria tampone (buffer) ant a èssere iscantzellados</string> <string name="buffer_time_descr">Tempus màssimu de archiviatzione de sos puntos in sa memòria tampone (buffer)</string>
<string name="buffer_time">Tempus de iscadidura de sa memòria tampone</string> <string name="buffer_time">Tempus de iscadidura de sa memòria tampone</string>
<string name="shared_string_suggested">Cunsigiadu</string>
<string name="status_widget_title">Istadu de s\'arrastadore de OsmAnd</string>
</resources> </resources>

View file

@ -206,4 +206,6 @@
<string name="gps_points_in_buffer">poslano (%1$d v medpomnilniku)</string> <string name="gps_points_in_buffer">poslano (%1$d v medpomnilniku)</string>
<string name="timeline_available_for_free_now">Časovnica je od sedaj na voljo brezplačno.</string> <string name="timeline_available_for_free_now">Časovnica je od sedaj na voljo brezplačno.</string>
<string name="location_recording_enabled">Beleženje trenutnega mesta je omogočeno</string> <string name="location_recording_enabled">Beleženje trenutnega mesta je omogočeno</string>
<string name="units_and_formats">Enote in zapisi</string>
<string name="unit_of_length_descr">Izbor enote za prikaz razdalje.</string>
</resources> </resources>

View file

@ -260,4 +260,7 @@
<string name="unit_of_speed_system">Hız birimi</string> <string name="unit_of_speed_system">Hız birimi</string>
<string name="buffer_time_descr">Noktaların arabellekte saklanacağı maksimum süre</string> <string name="buffer_time_descr">Noktaların arabellekte saklanacağı maksimum süre</string>
<string name="buffer_time">Arabellek zaman aşım süresi</string> <string name="buffer_time">Arabellek zaman aşım süresi</string>
<string name="shared_string_suggested">Önerilen</string>
<string name="status_widget_title">OsmAnd Tracker durumu</string>
<string name="back_to_osmand">OsmAnd\'a geri dön</string>
</resources> </resources>

View file

@ -260,4 +260,7 @@
<string name="unit_of_speed_system">Одиниця вимірювання швидкості</string> <string name="unit_of_speed_system">Одиниця вимірювання швидкості</string>
<string name="buffer_time_descr">Найбільший час зберігання точок у буфері</string> <string name="buffer_time_descr">Найбільший час зберігання точок у буфері</string>
<string name="buffer_time">Термін дії буфера</string> <string name="buffer_time">Термін дії буфера</string>
<string name="shared_string_suggested">Запропоновано</string>
<string name="status_widget_title">Статус відстежувача OsmAnd</string>
<string name="back_to_osmand">Повернутися до OsmAnd</string>
</resources> </resources>

View file

@ -261,4 +261,7 @@
<string name="unit_of_speed_system">速度單位</string> <string name="unit_of_speed_system">速度單位</string>
<string name="buffer_time_descr">在緩衝中儲存點的最長時間</string> <string name="buffer_time_descr">在緩衝中儲存點的最長時間</string>
<string name="buffer_time">緩衝過期時間</string> <string name="buffer_time">緩衝過期時間</string>
<string name="shared_string_suggested">建議</string>
<string name="status_widget_title">OsmAnd Tracker 狀態</string>
<string name="back_to_osmand">回到 OsmAnd</string>
</resources> </resources>

View file

@ -12,6 +12,7 @@
<attr name="primary_btn_text_color" format="reference" /> <attr name="primary_btn_text_color" format="reference" />
<attr name="secondary_btn_bg" format="reference" /> <attr name="secondary_btn_bg" format="reference" />
<attr name="shared_chat_card_bg" format="reference" /> <attr name="shared_chat_card_bg" format="reference" />
<attr name="bg_list_item_dark" format="reference" />
</declare-styleable> </declare-styleable>
<declare-styleable name="TextViewEx"> <declare-styleable name="TextViewEx">

View file

@ -45,4 +45,6 @@
<color name="live_track_active_icon">#F54522</color> <color name="live_track_active_icon">#F54522</color>
<color name="bg_list_item_dark">#727272</color>
</resources> </resources>

View file

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="app_bar_title_padding_small">8dp</dimen>
<dimen name="app_bar_title_padding_big">14dp</dimen>
<dimen name="content_padding_tiny">2dp</dimen> <dimen name="content_padding_tiny">2dp</dimen>
<dimen name="content_padding_small">4dp</dimen> <dimen name="content_padding_small">4dp</dimen>
<dimen name="content_padding_half">8dp</dimen> <dimen name="content_padding_half">8dp</dimen>
@ -51,7 +53,7 @@
<dimen name="image_button_padding">12dp</dimen> <dimen name="image_button_padding">12dp</dimen>
<dimen name="my_location_image_height">168dp</dimen> <dimen name="my_location_image_height">148dp</dimen>
<dimen name="my_location_text_sides_margin">32dp</dimen> <dimen name="my_location_text_sides_margin">32dp</dimen>
<dimen name="my_location_user_icon_size">60dp</dimen> <dimen name="my_location_user_icon_size">60dp</dimen>

View file

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="back_to_osmand">Back to OsmAnd</string>
<string name="shared_string_suggested">Suggested</string>
<string name="status_widget_title">OsmAnd Tracker status</string>
<string name="buffer_time_descr">Maximum time to store points in the buffer</string> <string name="buffer_time_descr">Maximum time to store points in the buffer</string>
<string name="buffer_time">Buffer expiration time</string> <string name="buffer_time">Buffer expiration time</string>
<string name="time_zone_descr">Select time zone to show in your location messages.</string> <string name="time_zone_descr">Select time zone to show in your location messages.</string>

View file

@ -29,6 +29,7 @@
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
<item name="bottom_nav_shadow">@drawable/bg_bottom_bar_shadow_with_line_day</item> <item name="bottom_nav_shadow">@drawable/bg_bottom_bar_shadow_with_line_day</item>
<item name="shared_chat_card_bg">@drawable/chat_card_bg_light</item> <item name="shared_chat_card_bg">@drawable/chat_card_bg_light</item>
<item name="bg_list_item_dark">@color/bg_list_item_dark</item>
</style> </style>
<style name="AppTheme.NoActionbar"> <style name="AppTheme.NoActionbar">

View file

@ -56,6 +56,7 @@ class TelegramApplication : Application(), OsmandHelperListener {
) )
showLocationHelper.addDirectionContextMenuButton() showLocationHelper.addDirectionContextMenuButton()
showLocationHelper.startShowingLocation() showLocationHelper.startShowingLocation()
showLocationHelper.addOrUpdateStatusWidget(-1, false)
} }
} }
} }

View file

@ -20,12 +20,15 @@ import net.osmand.telegram.utils.AndroidUtils
import org.drinkless.td.libcore.telegram.TdApi import org.drinkless.td.libcore.telegram.TdApi
import java.util.* import java.util.*
private const val UPDATE_WIDGET_INTERVAL_MS = 1000L // 1 sec
private const val UPDATE_LIVE_MESSAGES_INTERVAL_MS = 10000L // 10 sec private const val UPDATE_LIVE_MESSAGES_INTERVAL_MS = 10000L // 10 sec
private const val UPDATE_LIVE_TRACKS_INTERVAL_MS = 30000L // 30 sec private const val UPDATE_LIVE_TRACKS_INTERVAL_MS = 30000L // 30 sec
class TelegramService : Service(), LocationListener, TelegramIncomingMessagesListener, class TelegramService : Service(), LocationListener, TelegramIncomingMessagesListener,
TelegramOutgoingMessagesListener { TelegramOutgoingMessagesListener {
private val log = PlatformUtil.getLog(TelegramService::class.java)
private fun app() = application as TelegramApplication private fun app() = application as TelegramApplication
private val binder = LocationServiceBinder() private val binder = LocationServiceBinder()
private var shouldCleanupResources: Boolean = false private var shouldCleanupResources: Boolean = false
@ -36,6 +39,9 @@ class TelegramService : Service(), LocationListener, TelegramIncomingMessagesLis
private var updateTracksHandler: Handler? = null private var updateTracksHandler: Handler? = null
private var tracksHandlerThread = HandlerThread("TracksUpdateServiceThread") private var tracksHandlerThread = HandlerThread("TracksUpdateServiceThread")
private var updateWidgetHandler: Handler? = null
private var updateWidgetThread = HandlerThread("WidgetUpdateServiceThread")
var handler: Handler? = null var handler: Handler? = null
private set private set
var usedBy = 0 var usedBy = 0
@ -58,8 +64,10 @@ class TelegramService : Service(), LocationListener, TelegramIncomingMessagesLis
super.onCreate() super.onCreate()
mHandlerThread.start() mHandlerThread.start()
tracksHandlerThread.start() tracksHandlerThread.start()
updateWidgetThread.start()
updateShareInfoHandler = Handler(mHandlerThread.looper) updateShareInfoHandler = Handler(mHandlerThread.looper)
updateTracksHandler = Handler(tracksHandlerThread.looper) updateTracksHandler = Handler(tracksHandlerThread.looper)
updateWidgetHandler = Handler(updateWidgetThread.looper)
} }
override fun onBind(intent: Intent): IBinder? { override fun onBind(intent: Intent): IBinder? {
@ -106,6 +114,7 @@ class TelegramService : Service(), LocationListener, TelegramIncomingMessagesLis
if (isUsedByMyLocation(usedBy)) { if (isUsedByMyLocation(usedBy)) {
initLocationUpdates() initLocationUpdates()
startShareInfoUpdates() startShareInfoUpdates()
startWidgetUpdates()
} }
if (isUsedByUsersLocations(usedBy)) { if (isUsedByUsersLocations(usedBy)) {
app.telegramHelper.startLiveMessagesUpdates(app.settings.sendMyLocInterval) app.telegramHelper.startLiveMessagesUpdates(app.settings.sendMyLocInterval)
@ -139,6 +148,8 @@ class TelegramService : Service(), LocationListener, TelegramIncomingMessagesLis
app.telegramService = null app.telegramService = null
tracksHandlerThread.quit() tracksHandlerThread.quit()
mHandlerThread.quit() mHandlerThread.quit()
updateWidgetThread.quit()
app().showLocationHelper.addOrUpdateStatusWidget(-1, false)
usedBy = 0 usedBy = 0
@ -210,6 +221,35 @@ class TelegramService : Service(), LocationListener, TelegramIncomingMessagesLis
}, UPDATE_LIVE_TRACKS_INTERVAL_MS) }, UPDATE_LIVE_TRACKS_INTERVAL_MS)
} }
private fun startWidgetUpdates() {
updateWidgetHandler?.postDelayed({
if (isUsedByMyLocation(usedBy)) {
val sharingStatus = app().settings.sharingStatusChanges.last()
var isSending = sharingStatus.statusType == TelegramSettings.SharingStatusType.SENDING
val sharingChats = app().settings.getShareLocationChats()
var oldestTime = 0L
if (sharingChats.isNotEmpty() && app().shareLocationHelper.sharingLocation) {
sharingChats.forEach { id ->
val bufferMessages = app().locationMessages.getBufferedMessagesForChat(id)
if (bufferMessages.isNotEmpty()) {
val newTime = bufferMessages[0].time
if (oldestTime == 0L || newTime < oldestTime) {
oldestTime = newTime
}
} else {
oldestTime = 0L
}
}
} else {
isSending = false
oldestTime = -1
}
app().showLocationHelper.addOrUpdateStatusWidget(oldestTime, isSending)
}
startWidgetUpdates()
}, UPDATE_WIDGET_INTERVAL_MS)
}
@SuppressLint("MissingPermission") @SuppressLint("MissingPermission")
private fun getFirstTimeRunDefaultLocation(): net.osmand.Location? { private fun getFirstTimeRunDefaultLocation(): net.osmand.Location? {
val app = app() val app = app()

View file

@ -14,13 +14,14 @@ import net.osmand.telegram.helpers.TelegramHelper
import net.osmand.telegram.utils.* import net.osmand.telegram.utils.*
import net.osmand.telegram.utils.OsmandFormatter.MetricsConstants import net.osmand.telegram.utils.OsmandFormatter.MetricsConstants
import net.osmand.telegram.utils.OsmandFormatter.SpeedConstants import net.osmand.telegram.utils.OsmandFormatter.SpeedConstants
import net.osmand.telegram.utils.OsmandLocationUtils
import org.drinkless.td.libcore.telegram.TdApi import org.drinkless.td.libcore.telegram.TdApi
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONException import org.json.JSONException
import org.json.JSONObject import org.json.JSONObject
import java.util.*
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.ConcurrentLinkedQueue import java.util.concurrent.ConcurrentLinkedQueue
import kotlin.collections.ArrayList
val ADDITIONAL_ACTIVE_TIME_VALUES_SEC = listOf(15 * 60L, 30 * 60L, 60 * 60L, 180 * 60L) val ADDITIONAL_ACTIVE_TIME_VALUES_SEC = listOf(15 * 60L, 30 * 60L, 60 * 60L, 180 * 60L)
@ -110,6 +111,8 @@ private const val WAITING_TDLIB_TIME = 30 // 2 seconds
private const val GPS_UPDATE_EXPIRED_TIME = 60 * 3L // 3 minutes private const val GPS_UPDATE_EXPIRED_TIME = 60 * 3L // 3 minutes
private const val LAST_CHATS_INFO_KEY = "last_chats_info"
class TelegramSettings(private val app: TelegramApplication) { class TelegramSettings(private val app: TelegramApplication) {
private val log = PlatformUtil.getLog(TelegramSettings::class.java) private val log = PlatformUtil.getLog(TelegramSettings::class.java)
@ -118,6 +121,7 @@ class TelegramSettings(private val app: TelegramApplication) {
private var hiddenOnMapChats: Set<Long> = emptySet() private var hiddenOnMapChats: Set<Long> = emptySet()
private var shareDevices: Set<DeviceBot> = emptySet() private var shareDevices: Set<DeviceBot> = emptySet()
private var liveTracksInfo = emptyList<LiveTrackInfo>() private var liveTracksInfo = emptyList<LiveTrackInfo>()
var lastChatsInfo = LinkedList<LastChatInfo>()
var sharingStatusChanges = ConcurrentLinkedQueue<SharingStatus>() var sharingStatusChanges = ConcurrentLinkedQueue<SharingStatus>()
@ -661,6 +665,11 @@ class TelegramSettings(private val app: TelegramApplication) {
edit.putString(LIVE_TRACKS_KEY, jsonArrayLiveTracks.toString()) edit.putString(LIVE_TRACKS_KEY, jsonArrayLiveTracks.toString())
} }
val jArrayLastInfo = convertLastChatsInfoToJson()
if (jArrayLastInfo != null) {
edit.putString(LAST_CHATS_INFO_KEY, jArrayLastInfo.toString())
}
edit.apply() edit.apply()
} }
@ -688,6 +697,12 @@ class TelegramSettings(private val app: TelegramApplication) {
e.printStackTrace() e.printStackTrace()
} }
try {
parseLastChatsInfo(JSONArray(prefs.getString(LAST_CHATS_INFO_KEY, "")))
} catch (e: JSONException) {
log.error(e)
}
parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, "")) parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, ""))
val sendMyLocDef = SEND_MY_LOC_VALUES_SEC[SEND_MY_LOC_DEFAULT_INDEX] val sendMyLocDef = SEND_MY_LOC_VALUES_SEC[SEND_MY_LOC_DEFAULT_INDEX]
@ -830,6 +845,37 @@ class TelegramSettings(private val app: TelegramApplication) {
} }
} }
private fun convertLastChatsInfoToJson(): JSONArray? {
return try {
val jArray = JSONArray()
lastChatsInfo.forEach { lastInfo ->
val obj = JSONObject()
obj.put(LastChatInfo.CHAT_ID_KEY, lastInfo.chatId)
obj.put(LastChatInfo.PERIODS_KEY, convertPeriodsToJson(lastInfo.periods))
jArray.put(obj)
}
jArray
} catch (e: JSONException) {
log.error(e)
null
}
}
private fun convertPeriodsToJson(periods: LinkedList<Long>): JSONArray? {
return try {
val jArray = JSONArray()
for (i in 0 until periods.count()) {
val obj = JSONObject()
obj.put(i.toString(), periods[i])
jArray.put(obj)
}
jArray
} catch (e: JSONException) {
log.error(e)
null
}
}
private fun parseShareChatsInfo(json: JSONArray) { private fun parseShareChatsInfo(json: JSONArray) {
for (i in 0 until json.length()) { for (i in 0 until json.length()) {
val obj = json.getJSONObject(i) val obj = json.getJSONObject(i)
@ -896,6 +942,71 @@ class TelegramSettings(private val app: TelegramApplication) {
shareDevices = OsmandApiUtils.parseJsonContents(json).toHashSet() shareDevices = OsmandApiUtils.parseJsonContents(json).toHashSet()
} }
private fun parseLastChatsInfo(json: JSONArray) {
for (i in 0 until json.length()) {
val obj = json.getJSONObject(i)
val lastInfo = LastChatInfo().apply {
chatId = obj.optLong(LastChatInfo.CHAT_ID_KEY)
periods = LinkedList<Long>()
val jsonArray = obj.getJSONArray(LastChatInfo.PERIODS_KEY)
for (j in 0 until jsonArray.length()) {
val o = jsonArray.get(j) as JSONObject
periods.addLast(o.optLong(j.toString()))
}
}
lastChatsInfo.addLast(lastInfo)
}
}
fun addTimePeriodToLastItem(id: Long, time: Long) {
val lastInfo = lastChatsInfo.find { it.chatId == id }
if (lastInfo == null) {
addItemToSuggested(id, time)
} else {
val index = lastChatsInfo.indexOf(lastInfo)
lastChatsInfo[index].periods = addTimeToPeriods(lastChatsInfo[index].periods, time)
}
}
private fun addItemToSuggested(id: Long, time: Long) {
val newLastInfo = LastChatInfo().apply {
chatId = id
periods = LinkedList<Long>().apply {
addFirst(time)
}
}
if (lastChatsInfo.size < 5) {
lastChatsInfo.addFirst(newLastInfo)
} else {
lastChatsInfo.removeLast()
lastChatsInfo.addFirst(newLastInfo)
}
}
private fun addTimeToPeriods(periods: LinkedList<Long>?, time: Long): LinkedList<Long> {
if (periods?.isNotEmpty() != null) {
return if (periods.size < 5) {
periods.addFirst(time)
periods
} else {
periods.removeLast()
periods.addFirst(time)
periods
}
}
return LinkedList<Long>().apply { addFirst(time) }
}
fun calcLivePeriod(periods: LinkedList<Long>): Long {
val sortedPeriods = periods.toLongArray()
sortedPeriods.sort()
return if (sortedPeriods.size % 2 == 0) {
(sortedPeriods[sortedPeriods.size / 2] + sortedPeriods[sortedPeriods.size / 2 - 1]) / 2
} else {
sortedPeriods[sortedPeriods.size / 2]
}
}
private fun getLiveNowChats() = app.telegramHelper.getMessagesByChatIds(locHistoryTime).keys private fun getLiveNowChats() = app.telegramHelper.getMessagesByChatIds(locHistoryTime).keys
private fun updatePrefs() { private fun updatePrefs() {
@ -1397,4 +1508,15 @@ class TelegramSettings(private val app: TelegramApplication) {
internal const val SENT_MESSAGES_KEY = "sentMessages" internal const val SENT_MESSAGES_KEY = "sentMessages"
} }
} }
class LastChatInfo {
var chatId = -1L
var periods = LinkedList<Long>()
companion object {
internal const val CHAT_ID_KEY = "chatId"
internal const val PERIODS_KEY = "periods"
}
}
} }

View file

@ -89,7 +89,10 @@ class ShareLocationHelper(private val app: TelegramApplication) {
app.settings.getChatsShareInfo().forEach { (chatId, shareInfo) -> app.settings.getChatsShareInfo().forEach { (chatId, shareInfo) ->
val currentTime = System.currentTimeMillis() / 1000 val currentTime = System.currentTimeMillis() / 1000
when { when {
shareInfo.getChatLiveMessageExpireTime() <= 0 -> app.settings.shareLocationToChat(chatId, false) shareInfo.getChatLiveMessageExpireTime() <= 0 -> {
app.settings.shareLocationToChat(chatId, false)
app.settings.addTimePeriodToLastItem(shareInfo.chatId, shareInfo.livePeriod)
}
currentTime > shareInfo.currentMessageLimit -> { currentTime > shareInfo.currentMessageLimit -> {
shareInfo.apply { shareInfo.apply {
val newLivePeriod = val newLivePeriod =

View file

@ -14,6 +14,7 @@ import net.osmand.telegram.R
import net.osmand.telegram.TelegramApplication import net.osmand.telegram.TelegramApplication
import net.osmand.telegram.helpers.OsmandAidlHelper.ContextMenuButtonsListener import net.osmand.telegram.helpers.OsmandAidlHelper.ContextMenuButtonsListener
import net.osmand.telegram.helpers.TelegramUiHelper.ListItem import net.osmand.telegram.helpers.TelegramUiHelper.ListItem
import net.osmand.telegram.ui.OPEN_MY_LOCATION_TAB_KEY
import net.osmand.telegram.utils.AndroidUtils import net.osmand.telegram.utils.AndroidUtils
import net.osmand.telegram.utils.OsmandFormatter import net.osmand.telegram.utils.OsmandFormatter
import net.osmand.telegram.utils.OsmandLocationUtils import net.osmand.telegram.utils.OsmandLocationUtils
@ -43,6 +44,15 @@ class ShowLocationHelper(private val app: TelegramApplication) {
const val GPX_COLORS_COUNT = 10 const val GPX_COLORS_COUNT = 10
private const val STATUS_WIDGET_ID = "status_widget"
private const val STATUS_WIDGET_MENU_ICON = "widget_location_sharing_night"
private const val STATUS_WIDGET_ANIM_ICON_DAY = "anim_widget_location_sharing_day"
private const val STATUS_WIDGET_ANIM_ICON_NIGHT = "anim_widget_location_sharing_night"
private const val STATUS_WIDGET_ON_ANIM_ICON_DAY = "anim_widget_location_sharing_on_day"
private const val STATUS_WIDGET_ON_ANIM_ICON_NIGHT = "anim_widget_location_sharing_on_night"
private const val STATUS_WIDGET_OFF_ICON_DAY = "widget_location_sharing_off_day"
private const val STATUS_WIDGET_OFF_ICON_NIGHT = "widget_location_sharing_off_night"
val GPX_COLORS = arrayOf( val GPX_COLORS = arrayOf(
"red", "orange", "lightblue", "blue", "purple", "red", "orange", "lightblue", "blue", "purple",
"translucent_red", "translucent_orange", "translucent_lightblue", "translucent_red", "translucent_orange", "translucent_lightblue",
@ -198,6 +208,58 @@ class ShowLocationHelper(private val app: TelegramApplication) {
} }
} }
fun addOrUpdateStatusWidget(time: Long, isSending: Boolean) {
val iconDay: String
val iconNight: String
val text = when {
time > 0L -> {
iconDay = STATUS_WIDGET_ANIM_ICON_DAY
iconNight = STATUS_WIDGET_ANIM_ICON_NIGHT
val diffTime = (System.currentTimeMillis() - time) / 1000
OsmandFormatter.getFormattedDurationForWidget(diffTime)
}
time == 0L && isSending -> {
iconDay = STATUS_WIDGET_ON_ANIM_ICON_DAY
iconNight = STATUS_WIDGET_ON_ANIM_ICON_NIGHT
app.getString(R.string.shared_string_ok)
}
time == 0L && !isSending -> {
iconDay = STATUS_WIDGET_ANIM_ICON_DAY
iconNight = STATUS_WIDGET_ANIM_ICON_NIGHT
app.getString(R.string.shared_string_ok)
}
else -> {
iconDay = STATUS_WIDGET_OFF_ICON_DAY
iconNight = STATUS_WIDGET_OFF_ICON_NIGHT
app.getString(R.string.shared_string_start)
}
}
val subText = when {
time > 0 -> {
if (text.length > 2) {
app.getString(R.string.shared_string_hour_short)
} else {
app.getString(R.string.shared_string_minute_short)
}
}
else -> ""
}
osmandAidlHelper.addMapWidget(
STATUS_WIDGET_ID,
STATUS_WIDGET_MENU_ICON,
app.getString(R.string.status_widget_title),
iconDay,
iconNight,
text, subText, 50, getStatusWidgetIntent())
}
private fun getStatusWidgetIntent(): Intent {
val startIntent = app.packageManager.getLaunchIntentForPackage(app.packageName)
startIntent.addCategory(Intent.CATEGORY_LAUNCHER)
startIntent.putExtra(OPEN_MY_LOCATION_TAB_KEY,true)
return startIntent
}
private fun getALatLonFromMessage(content: TdApi.MessageContent): ALatLon? { private fun getALatLonFromMessage(content: TdApi.MessageContent): ALatLon? {
return when (content) { return when (content) {
is TdApi.MessageLocation -> ALatLon(content.location.latitude, content.location.longitude) is TdApi.MessageLocation -> ALatLon(content.location.latitude, content.location.longitude)

View file

@ -12,6 +12,8 @@ import android.support.v4.app.DialogFragment
import android.support.v4.app.Fragment import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter import android.support.v4.app.FragmentPagerAdapter
import android.support.v4.view.PagerAdapter
import android.support.v4.view.ViewPager
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.ListPopupWindow import android.support.v7.widget.ListPopupWindow
@ -22,7 +24,6 @@ import net.osmand.PlatformUtil
import net.osmand.telegram.R import net.osmand.telegram.R
import net.osmand.telegram.TelegramApplication import net.osmand.telegram.TelegramApplication
import net.osmand.telegram.helpers.OsmandAidlHelper import net.osmand.telegram.helpers.OsmandAidlHelper
import net.osmand.telegram.helpers.TelegramHelper
import net.osmand.telegram.helpers.TelegramHelper.* import net.osmand.telegram.helpers.TelegramHelper.*
import net.osmand.telegram.ui.LoginDialogFragment.LoginDialogType import net.osmand.telegram.ui.LoginDialogFragment.LoginDialogType
import net.osmand.telegram.ui.MyLocationTabFragment.ActionButtonsListener import net.osmand.telegram.ui.MyLocationTabFragment.ActionButtonsListener
@ -66,6 +67,7 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene
private lateinit var buttonsBar: LinearLayout private lateinit var buttonsBar: LinearLayout
private lateinit var bottomNav: BottomNavigationView private lateinit var bottomNav: BottomNavigationView
private lateinit var coordinatorLayout: CoordinatorLayout private lateinit var coordinatorLayout: CoordinatorLayout
private lateinit var viewPager: ViewPager
private var snackbarShown = false private var snackbarShown = false
@ -81,7 +83,7 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene
paused = false paused = false
val viewPager = findViewById<LockableViewPager>(R.id.view_pager).apply { viewPager = findViewById<LockableViewPager>(R.id.view_pager).apply {
swipeLocked = true swipeLocked = true
offscreenPageLimit = 3 offscreenPageLimit = 3
adapter = ViewPagerAdapter(supportFragmentManager) adapter = ViewPagerAdapter(supportFragmentManager)
@ -484,6 +486,10 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene
} }
} }
fun refreshPages() {
viewPager.adapter?.notifyDataSetChanged()
}
private fun showOsmandMissingDialog() { private fun showOsmandMissingDialog() {
OsmandMissingDialogFragment().show(supportFragmentManager, null) OsmandMissingDialogFragment().show(supportFragmentManager, null)
} }
@ -510,5 +516,9 @@ class MainActivity : AppCompatActivity(), TelegramListener, ActionButtonsListene
override fun getItem(position: Int) = fragments[position] override fun getItem(position: Int) = fragments[position]
override fun getCount() = fragments.size override fun getCount() = fragments.size
override fun getItemPosition(`object`: Any): Int {
return PagerAdapter.POSITION_NONE
}
} }
} }

View file

@ -3,6 +3,8 @@ package net.osmand.telegram.ui
import android.animation.* import android.animation.*
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.graphics.ColorMatrix
import android.graphics.ColorMatrixColorFilter
import android.graphics.Typeface import android.graphics.Typeface
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.os.Build import android.os.Build
@ -17,13 +19,12 @@ import android.text.SpannableString
import android.text.SpannableStringBuilder import android.text.SpannableStringBuilder
import android.text.style.ForegroundColorSpan import android.text.style.ForegroundColorSpan
import android.text.style.StyleSpan import android.text.style.StyleSpan
import android.util.TypedValue
import android.view.* import android.view.*
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import android.widget.* import android.widget.*
import net.osmand.telegram.ADDITIONAL_ACTIVE_TIME_VALUES_SEC import net.osmand.PlatformUtil
import net.osmand.telegram.R import net.osmand.telegram.*
import net.osmand.telegram.SHARE_TYPE_MAP
import net.osmand.telegram.TelegramApplication
import net.osmand.telegram.helpers.LocationMessages import net.osmand.telegram.helpers.LocationMessages
import net.osmand.telegram.helpers.TelegramHelper import net.osmand.telegram.helpers.TelegramHelper
import net.osmand.telegram.helpers.TelegramHelper.TelegramListener import net.osmand.telegram.helpers.TelegramHelper.TelegramListener
@ -31,9 +32,13 @@ import net.osmand.telegram.helpers.TelegramUiHelper
import net.osmand.telegram.utils.AndroidUtils import net.osmand.telegram.utils.AndroidUtils
import net.osmand.telegram.utils.OsmandFormatter import net.osmand.telegram.utils.OsmandFormatter
import org.drinkless.td.libcore.telegram.TdApi import org.drinkless.td.libcore.telegram.TdApi
import java.util.*
import kotlin.Comparator
import kotlin.collections.HashSet
private const val SELECTED_CHATS_KEY = "selected_chats" private const val SELECTED_CHATS_KEY = "selected_chats"
private const val SELECTED_CHATS_USERS = "selected_users" private const val SELECTED_CHATS_USERS = "selected_users"
private const val SUGGESTED = 2
private const val SHARE_LOCATION_CHAT = 1 private const val SHARE_LOCATION_CHAT = 1
private const val DEFAULT_CHAT = 0 private const val DEFAULT_CHAT = 0
@ -41,10 +46,14 @@ private const val ADAPTER_UPDATE_INTERVAL_MIL = 5 * 1000L // 5 sec
class MyLocationTabFragment : Fragment(), TelegramListener { class MyLocationTabFragment : Fragment(), TelegramListener {
private val log = PlatformUtil.getLog(MyLocationTabFragment::class.java)
private var textMarginSmall: Int = 0 private var textMarginSmall: Int = 0
private var textMarginBig: Int = 0 private var textMarginBig: Int = 0
private var searchBoxHeight: Int = 0 private var searchBoxHeight: Int = 0
private var searchBoxSidesMargin: Int = 0 private var searchBoxSidesMargin: Int = 0
private var titlePaddingSmall: Int = 0
private var titlePaddingBig: Int = 0
private var appBarScrollRange: Int = -1 private var appBarScrollRange: Int = -1
@ -68,6 +77,7 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
private lateinit var sharingStatusTitle: TextView private lateinit var sharingStatusTitle: TextView
private lateinit var sharingStatusIcon: ImageView private lateinit var sharingStatusIcon: ImageView
private lateinit var startSharingBtn: View private lateinit var startSharingBtn: View
private lateinit var backToOsmAndBtn: TextView
private lateinit var searchBoxBg: GradientDrawable private lateinit var searchBoxBg: GradientDrawable
@ -85,6 +95,8 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
private var updateEnable: Boolean = false private var updateEnable: Boolean = false
private lateinit var lastChatsInfo: LinkedList<TelegramSettings.LastChatInfo>
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, inflater: LayoutInflater,
container: ViewGroup?, container: ViewGroup?,
@ -99,6 +111,8 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
textMarginBig = resources.getDimensionPixelSize(R.dimen.my_location_text_sides_margin) textMarginBig = resources.getDimensionPixelSize(R.dimen.my_location_text_sides_margin)
searchBoxHeight = resources.getDimensionPixelSize(R.dimen.search_box_height) searchBoxHeight = resources.getDimensionPixelSize(R.dimen.search_box_height)
searchBoxSidesMargin = resources.getDimensionPixelSize(R.dimen.content_padding_half) searchBoxSidesMargin = resources.getDimensionPixelSize(R.dimen.content_padding_half)
titlePaddingSmall = resources.getDimensionPixelSize(R.dimen.app_bar_title_padding_small)
titlePaddingBig = resources.getDimensionPixelSize(R.dimen.app_bar_title_padding_big)
sharingMode = settings.hasAnyChatToShareLocation() sharingMode = settings.hasAnyChatToShareLocation()
@ -166,7 +180,6 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
if (Build.VERSION.SDK_INT >= 16) { if (Build.VERSION.SDK_INT >= 16) {
layoutTransition.enableTransitionType(LayoutTransition.CHANGING) layoutTransition.enableTransitionType(LayoutTransition.CHANGING)
} }
AndroidUtils.addStatusBarPadding19v(app, this)
title = findViewById(R.id.title) title = findViewById(R.id.title)
description = findViewById(R.id.description) description = findViewById(R.id.description)
} }
@ -234,6 +247,9 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
} }
} }
backToOsmAndBtn = mainView.findViewById<TextView>(R.id.back_to_osmand)
lastChatsInfo = settings.lastChatsInfo
return mainView return mainView
} }
@ -268,6 +284,7 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
} }
} }
DisableSharingBottomSheet.SHARING_DISABLED_REQUEST_CODE -> { DisableSharingBottomSheet.SHARING_DISABLED_REQUEST_CODE -> {
saveChatsToLastChatsInfo()
sharingMode = false sharingMode = false
app.stopSharingLocation() app.stopSharingLocation()
updateContent() updateContent()
@ -388,10 +405,19 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
private fun adjustText() { private fun adjustText() {
val gravity = if (appBarCollapsed) Gravity.START else Gravity.CENTER val gravity = if (appBarCollapsed) Gravity.START else Gravity.CENTER
val padding = if (appBarCollapsed) textMarginSmall else textMarginBig val padding = if (appBarCollapsed) textMarginSmall else textMarginBig
val titlePadding = if (appBarCollapsed) titlePaddingBig else titlePaddingSmall
textContainer.apply { textContainer.apply {
setPadding(padding, paddingTop, padding, paddingBottom) setPadding(padding, paddingTop, padding, paddingBottom)
if (appBarCollapsed) {
AndroidUtils.addStatusBarPadding19v(app, this)
} else {
AndroidUtils.removeStatusBarPadding19v(app, this)
}
}
title.apply {
this.gravity = gravity
setPadding(paddingLeft, titlePadding, paddingRight, titlePadding)
} }
title.gravity = gravity
description.gravity = gravity description.gravity = gravity
} }
@ -470,6 +496,25 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
if (sharingMode) 0 else AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL if (sharingMode) 0 else AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL
stopSharingSwitcher.isChecked = true stopSharingSwitcher.isChecked = true
appBarScrollRange = -1 appBarScrollRange = -1
updateBackToOsmAndBtn()
}
private fun updateBackToOsmAndBtn() {
val pckg = app.settings.appToConnectPackage
backToOsmAndBtn.apply {
visibility = if (pckg.isNotEmpty() && sharingMode && AndroidUtils.isAppInstalled(app, pckg)) {
setOnClickListener {
val startIntent = app.packageManager.getLaunchIntentForPackage(pckg)
if (startIntent != null) {
startIntent.addCategory(Intent.CATEGORY_LAUNCHER)
startActivity(startIntent)
}
}
View.VISIBLE
} else {
View.GONE
}
}
} }
private fun updateSharingStatus() { private fun updateSharingStatus() {
@ -487,7 +532,8 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
} }
private fun updateList() { private fun updateList() {
val items: MutableList<TdApi.Object> = mutableListOf() val lastItems = getLastShareItems()
val items: MutableList<Any> = mutableListOf()
val chats: MutableList<TdApi.Chat> = mutableListOf() val chats: MutableList<TdApi.Chat> = mutableListOf()
val contacts = telegramHelper.getContacts() val contacts = telegramHelper.getContacts()
val chatList = if (sharingMode) { val chatList = if (sharingMode) {
@ -515,13 +561,42 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
} }
} }
if (sharingMode && settings.hasAnyChatToShareLocation()) { if (sharingMode && settings.hasAnyChatToShareLocation()) {
adapter.items = sortAdapterItems(items) val filteredLastItems = lastItems.filter { !settings.isSharingLocationToChat(it.chat.id) }.toMutableList()
val sortedItems = sortAdapterItems(items as MutableList<TdApi.Object>)
sortedItems.add(SuggestedChats(filteredLastItems))
adapter.items = sortedItems
} else { } else {
val filteredLastItems = lastItems.filter { !settings.isSharingLocationToChat(it.chat.id) }.toMutableList()
items.add(0, SuggestedChats(filteredLastItems))
adapter.items = items adapter.items = items
} }
} }
private fun sortAdapterItems(list: MutableList<TdApi.Object>): MutableList<TdApi.Object> { private fun getLastShareItems(): MutableList<LastChat> {
val lastItems: MutableList<LastChat> = mutableListOf()
val chatListIds = telegramHelper.getChatListIds()
chatListIds.forEach { chatId ->
val chat = telegramHelper.getChat(chatId)
val lastInfo = lastChatsInfo.find { it.chatId == chatId }
if (chat != null && lastInfo != null) {
val index = lastChatsInfo.indexOf(lastInfo)
lastItems.add(LastChat(chat, settings.calcLivePeriod(lastChatsInfo[index].periods)))
}
}
return lastItems
}
private fun saveChatsToLastChatsInfo() {
val chatListIds = settings.getShareLocationChats()
chatListIds.forEach { id ->
val shareInfo = settings.getChatsShareInfo()[id]
if (shareInfo != null) {
settings.addTimePeriodToLastItem(shareInfo.chatId, shareInfo.livePeriod)
}
}
}
private fun sortAdapterItems(list: MutableList<TdApi.Object>): MutableList<Any> {
list.sortWith(Comparator<TdApi.Object> { o1, o2 -> list.sortWith(Comparator<TdApi.Object> { o1, o2 ->
val title1 = when (o1) { val title1 = when (o1) {
is TdApi.Chat -> o1.title is TdApi.Chat -> o1.title
@ -535,12 +610,12 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
} }
title1.compareTo(title2) title1.compareTo(title2)
}) })
return list return list.toMutableList()
} }
inner class MyLocationListAdapter : inner class MyLocationListAdapter :
RecyclerView.Adapter<MyLocationListAdapter.BaseViewHolder>() { RecyclerView.Adapter<MyLocationListAdapter.BaseViewHolder>() {
var items = mutableListOf<TdApi.Object>() var items = mutableListOf<Any>()
set(value) { set(value) {
field = value field = value
notifyDataSetChanged() notifyDataSetChanged()
@ -553,7 +628,9 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
is TdApi.User -> item.id.toLong() is TdApi.User -> item.id.toLong()
else -> -1 else -> -1
} }
return if (settings.isSharingLocationToChat(id) && sharingMode) { return if (item is SuggestedChats) {
SUGGESTED
} else if (settings.isSharingLocationToChat(id) && sharingMode) {
SHARE_LOCATION_CHAT SHARE_LOCATION_CHAT
} else { } else {
DEFAULT_CHAT DEFAULT_CHAT
@ -572,6 +649,11 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
.inflate(R.layout.user_list_item, parent, false) .inflate(R.layout.user_list_item, parent, false)
ChatViewHolder(view) ChatViewHolder(view)
} }
SUGGESTED -> {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.suggested_list_item, parent, false)
SuggestedViewHolder(view)
}
else -> throw RuntimeException("Unsupported view type: $viewType") else -> throw RuntimeException("Unsupported view type: $viewType")
} }
} }
@ -582,40 +664,18 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
val isChat = item is TdApi.Chat val isChat = item is TdApi.Chat
val itemId = if (isChat) { val itemId = if (isChat) {
(item as TdApi.Chat).id (item as TdApi.Chat).id
} else if (item is TdApi.User) {
item.id.toLong()
} else { } else {
(item as TdApi.User).id.toLong() -1
} }
val lastItem = position == itemCount - 1 val lastItem = position == itemCount - 1
val placeholderId =
if (isChat && telegramHelper.isGroup(item as TdApi.Chat)) R.drawable.img_group_picture else R.drawable.img_user_picture
val live = (isChat && settings.isSharingLocationToChat(itemId)) val live = (isChat && settings.isSharingLocationToChat(itemId))
val shareInfo = if (isChat) settings.getChatsShareInfo()[itemId] else null val shareInfo = if (isChat) settings.getChatsShareInfo()[itemId] else null
val photoPath = when (item) { setupPhoto(item, holder.icon, isChat)
is TdApi.Chat -> item.photo?.small?.local?.path holder.title?.text = getTitleText(item)
is TdApi.User -> item.profilePhoto?.small?.local?.path
else -> null
}
TelegramUiHelper.setupPhoto(app, holder.icon, photoPath, placeholderId, false)
val currentUserId = telegramHelper.getCurrentUserId()
val title = when (item) {
is TdApi.Chat -> {
if (telegramHelper.isPrivateChat(item) && (item.type as TdApi.ChatTypePrivate).userId == currentUserId) {
getString(R.string.saved_messages)
} else {
item.title
}
}
is TdApi.User -> {
if (item.id == currentUserId) getString(R.string.saved_messages) else TelegramUiHelper.getUserName(item)
}
else -> null
}
holder.title?.text = title
if (holder is ChatViewHolder) { if (holder is ChatViewHolder) {
holder.description?.visibility = View.GONE holder.description?.visibility = View.GONE
@ -669,8 +729,9 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
settings.shareLocationToChat(itemId, false) settings.shareLocationToChat(itemId, false)
if (shareInfo != null) { if (shareInfo != null) {
telegramHelper.stopSendingLiveLocationToChat(shareInfo) telegramHelper.stopSendingLiveLocationToChat(shareInfo)
settings.addTimePeriodToLastItem(shareInfo.chatId,shareInfo.livePeriod)
} }
removeItem(item) removeItem(item as TdApi.Object)
} }
} }
} }
@ -743,12 +804,113 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
text = description text = description
} }
} }
} else if (holder is SuggestedViewHolder) {
holder.list.removeAllViews()
if ((item as SuggestedChats).list.isEmpty()) {
holder.container?.visibility = View.GONE
} else {
holder.container?.visibility = View.VISIBLE
val iterator = item.list.iterator()
iterator.forEach {
holder.list.addView(createLastChatView(it, iterator.hasNext()))
} }
} }
val tv = TypedValue()
if (!sharingMode) {
holder.dividerTop?.visibility = View.GONE
holder.dividerBottom?.visibility = View.VISIBLE
holder.header?.visibility = View.GONE
if (context?.theme?.resolveAttribute(R.attr.card_bg_color, tv, true) != null) {
holder.container?.setBackgroundColor(tv.data)
}
} else {
holder.dividerTop?.visibility = View.VISIBLE
holder.dividerBottom?.visibility = View.GONE
holder.header?.visibility = View.VISIBLE
if (context?.theme?.resolveAttribute(R.attr.shared_chat_card_bg, tv, true) != null) {
holder.container?.setBackgroundResource(tv.resourceId)
}
}
}
}
private fun getTitleText(item: Any): String? {
val currentUserId = telegramHelper.getCurrentUserId()
return when (item) {
is LastChat -> {
if (telegramHelper.isPrivateChat(item.chat) && (item.chat.type as TdApi.ChatTypePrivate).userId == currentUserId) {
getString(R.string.saved_messages)
} else {
item.chat.title
}
}
is TdApi.Chat -> {
if (telegramHelper.isPrivateChat(item) && (item.type as TdApi.ChatTypePrivate).userId == currentUserId) {
getString(R.string.saved_messages)
} else {
item.title
}
}
is TdApi.User -> {
if (item.id == currentUserId) getString(R.string.saved_messages) else TelegramUiHelper.getUserName(item)
}
else -> null
}
}
private fun setupPhoto(item: Any, icon: ImageView?, isChat: Boolean) {
val photoPath = when (item) {
is LastChat -> item.chat.photo?.small?.local?.path
is TdApi.Chat -> item.photo?.small?.local?.path
is TdApi.User -> item.profilePhoto?.small?.local?.path
else -> null
}
val placeholderId =
if (isChat && telegramHelper.isGroup(item as TdApi.Chat)) R.drawable.img_group_picture else R.drawable.img_user_picture
TelegramUiHelper.setupPhoto(app, icon, photoPath, placeholderId, false)
}
private fun createLastChatView(lastChat: LastChat, hasNext: Boolean): View {
val view = layoutInflater.inflate(R.layout.last_share_list_item, null)
val time: TextView = view.findViewById(R.id.time)
val container: LinearLayout = view.findViewById(R.id.container)
val icon: ImageView = view.findViewById(R.id.icon)
val title: TextView = view.findViewById(R.id.title)
val divider: View = view.findViewById(R.id.divider)
if (sharingMode && hasNext) {
divider.visibility = View.VISIBLE
}
container.setOnClickListener {
if (!AndroidUtils.isLocationPermissionAvailable(view!!.context)) {
AndroidUtils.requestLocationPermission(activity!!)
} else {
settings.shareLocationToChat(lastChat.chat.id, true, lastChat.time)
app.shareLocationHelper.startSharingLocation()
(activity as MainActivity).refreshPages()
}
}
title.text = getTitleText(lastChat.chat)
setupPhoto(lastChat.chat, icon, true)
icon.colorFilter = ColorMatrixColorFilter(ColorMatrix().apply { setSaturation(0F) })
val sharingTime = SpannableStringBuilder("${getString(R.string.sharing_time)}: ")
val formattedTime = OsmandFormatter.getFormattedDuration(app, lastChat.time, false)
val start = sharingTime.length
sharingTime.append(formattedTime)
sharingTime.setSpan(StyleSpan(Typeface.BOLD), start, sharingTime.length, 0)
sharingTime.setSpan(ForegroundColorSpan(ContextCompat.getColor(app, R.color.ctrl_active_light)), start, sharingTime.length, 0)
time.text = sharingTime
return view
}
private fun removeItem(chat: TdApi.Object) { private fun removeItem(chat: TdApi.Object) {
items.remove(chat) items.remove(chat)
if (items.isEmpty()) { val filtered = items.filterIsInstance<TdApi.Object>()
if (filtered.isEmpty()) {
sharingMode = false sharingMode = false
updateContent() updateContent()
shareLocationHelper.stopSharingLocation() shareLocationHelper.stopSharingLocation()
@ -778,9 +940,21 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
val sharingExpiresLine: TextView? = view.findViewById(R.id.expires_line) val sharingExpiresLine: TextView? = view.findViewById(R.id.expires_line)
val gpsPointsLine: TextView? = view.findViewById(R.id.gps_points_line) val gpsPointsLine: TextView? = view.findViewById(R.id.gps_points_line)
} }
inner class SuggestedViewHolder(val view: View) : BaseViewHolder(view) {
val list: LinearLayout = view.findViewById(R.id.last_items_list)
val container: LinearLayout? = view.findViewById(R.id.container)
val dividerBottom: View? = view.findViewById(R.id.divider_bottom)
val dividerTop: View? = view.findViewById(R.id.divider_top)
val header: TextView? = view.findViewById(R.id.header)
}
} }
interface ActionButtonsListener { interface ActionButtonsListener {
fun switchButtonsVisibility(visible: Boolean) fun switchButtonsVisibility(visible: Boolean)
} }
} }
class LastChat internal constructor(val chat: TdApi.Chat, val time: Long)
class SuggestedChats internal constructor(val list: MutableList<LastChat>)

View file

@ -155,14 +155,22 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
} }
private fun runSearch(text: String) { private fun runSearch(text: String) {
if (getSavedMessagesChatTitle().startsWith(text, true)) {
val savedMessages = telegramHelper.getChat(telegramHelper.getCurrentUserId().toLong())
if (savedMessages != null) {
telegramHelper.searchChats(savedMessages.title)
}
}
telegramHelper.searchChats(text) telegramHelper.searchChats(text)
telegramHelper.searchChatsOnServer(text) telegramHelper.searchChatsOnServer(text)
telegramHelper.searchContacts(text) telegramHelper.searchContacts(text)
if (text.length > 4) { if (text.length > 4 && !getSavedMessagesChatTitle().startsWith(text, true)) {
telegramHelper.searchPublicChats(text) telegramHelper.searchPublicChats(text)
} }
} }
private fun getSavedMessagesChatTitle() = getString(R.string.saved_messages)
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
telegramHelper.addSearchListener(this) telegramHelper.addSearchListener(this)
@ -231,7 +239,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
selectedChats.forEach { selectedChats.forEach {
val chat = telegramHelper.getChat(it) val chat = telegramHelper.getChat(it)
if (chat != null) { if (chat != null) {
if (!telegramHelper.isChannel(chat) && telegramHelper.getUserIdFromChatType(chat.type) != currentUserId) { if (!telegramHelper.isChannel(chat)) {
items.add(chat) items.add(chat)
} }
} else { } else {
@ -250,7 +258,7 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
searchedChatsIds.forEach { searchedChatsIds.forEach {
val chat = telegramHelper.getChat(it) val chat = telegramHelper.getChat(it)
if (chat != null && !selectedChats.contains(it)) { if (chat != null && !selectedChats.contains(it)) {
if (!telegramHelper.isChannel(chat) && telegramHelper.getUserIdFromChatType(chat.type) != currentUserId) { if (!telegramHelper.isChannel(chat)) {
chats.add(chat) chats.add(chat)
} }
} else { } else {
@ -382,9 +390,18 @@ class SearchDialogFragment : BaseDialogFragment(), TelegramHelper.TelegramSearch
TelegramUiHelper.setupPhoto(app, holder.icon, photoPath, placeholderId, false) TelegramUiHelper.setupPhoto(app, holder.icon, photoPath, placeholderId, false)
val currentUserId = telegramHelper.getCurrentUserId()
val title = when (item) { val title = when (item) {
is TdApi.Chat -> item.title is TdApi.Chat -> {
is TdApi.User -> TelegramUiHelper.getUserName(item) if (telegramHelper.isPrivateChat(item) && (item.type as TdApi.ChatTypePrivate).userId == currentUserId) {
getSavedMessagesChatTitle()
} else {
item.title
}
}
is TdApi.User -> {
if (item.id == currentUserId) getSavedMessagesChatTitle() else TelegramUiHelper.getUserName(item)
}
else -> null else -> null
} }

View file

@ -106,6 +106,14 @@ object AndroidUtils {
} }
} }
fun removeStatusBarPadding19v(ctx: Context, view: View) {
if (Build.VERSION.SDK_INT >= 19) {
view.apply {
setPadding(paddingLeft, paddingTop - getStatusBarHeight(ctx), paddingRight, paddingBottom)
}
}
}
fun getNavBarHeight(ctx: Context): Int { fun getNavBarHeight(ctx: Context): Int {
if (!hasNavBar(ctx)) { if (!hasNavBar(ctx)) {
return 0 return 0

View file

@ -45,6 +45,18 @@ object OsmandFormatter {
fixed2.minimumIntegerDigits = 1 fixed2.minimumIntegerDigits = 1
} }
fun getFormattedDurationForWidget(seconds: Long): String {
val hours = seconds / (60 * 60)
val minutes = seconds / 60 % 60
return when {
hours > 9 -> String.format("%10d:%01d", hours, minutes)
hours > 0 -> String.format("%1d:%01d", hours, minutes)
minutes > 9 -> String.format("%11d", minutes)
minutes > 0 -> String.format("%1d", minutes)
else -> "1"
}.trim()
}
fun getFormattedDuration(ctx: Context, seconds: Long, short: Boolean = false): String { fun getFormattedDuration(ctx: Context, seconds: Long, short: Boolean = false): String {
val hours = seconds / (60 * 60) val hours = seconds / (60 * 60)
val minutes = seconds / 60 % 60 val minutes = seconds / 60 % 60

9
OsmAnd/.gitignore vendored
View file

@ -18,6 +18,15 @@ huaweidrmlib/
HwDRM_SDK_* HwDRM_SDK_*
drm_strings.xml drm_strings.xml
# copy_widget_icons.sh
res/drawable-large/map_*
res/drawable-large-hdpi/map_*
res/drawable-large-xhdpi/map_*
# copy_widget_icons.sh
res/drawable-large/widget_*
res/drawable-large-hdpi/widget_*
res/drawable-large-xhdpi/widget_*
valgrind/ valgrind/
bin/ bin/
dist/ dist/

View file

@ -21,6 +21,7 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!-- The next 2 seem necessary only for Android < v4.2 (to initialize BT SCO) --> <!-- The next 2 seem necessary only for Android < v4.2 (to initialize BT SCO) -->
<uses-permission android:name="android.permission.BROADCAST_STICKY" android:maxSdkVersion="18" /> <uses-permission android:name="android.permission.BROADCAST_STICKY" android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="18" /> <uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="18" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,011 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 951 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 752 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

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