Merge branch 'master' of https://github.com/osmandapp/Osmand
BIN
OsmAnd/res/drawable-hdpi/ic_small_turn_left.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-hdpi/ic_small_turn_right.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-hdpi/list_startpoint.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-hdpi/map_start_point.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_small_turn_left.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
OsmAnd/res/drawable-mdpi/ic_small_turn_right.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
OsmAnd/res/drawable-mdpi/list_startpoint.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-mdpi/map_start_point.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_small_turn_left.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xhdpi/ic_small_turn_right.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xhdpi/list_startpoint.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
OsmAnd/res/drawable-xhdpi/map_start_point.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_small_turn_left.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/ic_small_turn_right.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/list_startpoint.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/map_start_point.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
|
@ -51,12 +51,13 @@
|
|||
android:layout_height="60dp"
|
||||
android:src="@drawable/ic_world_globe_dark"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/regionReportsSpinner"
|
||||
android:layout_gravity="fill_horizontal|fill_vertical"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="42dp"
|
||||
android:gravity="center_vertical"/>
|
||||
<include
|
||||
android:id="@+id/reportsButton"
|
||||
layout="@layout/reports_for_spinner_item"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="8dp"/>
|
||||
|
||||
<View
|
||||
android:layout_height="1dp"
|
||||
|
|
39
OsmAnd/res/layout/fragment_search_list.xml
Normal file
|
@ -0,0 +1,39 @@
|
|||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context="net.osmand.plus.liveupdates.CountriesSearchSelectionFragment">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/clearButton"
|
||||
style="@style/Widget.AppCompat.Button.Borderless"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/ic_action_remove_dark"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/searchEditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:lines="1"
|
||||
android:background="@null"
|
||||
android:layout_marginLeft="16dp"
|
||||
tools:text="Search request"/>
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/shadow_bottom"/>
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
|
||||
<string name="switch_to_raster_map_to_see">Vektorové mapy toto místo neobsahují. Mapová data můžete stáhnout v Nastaveních (Spravovat mapové soubory), nebo se přepněte na online mapy.</string>
|
||||
<string name="send_files_to_osm">Nahrát GPX soubory do OSM?</string>
|
||||
|
@ -1646,7 +1647,7 @@
|
|||
<string name="gps_network_not_enabled">Služba zjištění polohy není zapnuta. Chcete ji aktivovat?</string>
|
||||
<string name="disable_recording_once_app_killed">Zabránit samostatnému logování</string>
|
||||
<string name="disable_recording_once_app_killed_descrp">Pozastaví záznam GPX trasy pokud je aplikace ukončena (přes nedávné aplikace). (OsmAnd indikátor zmizí ze stavového řádku Androidu.)</string>
|
||||
<string name="download_live_updates">Živé aktualizace</string>
|
||||
<string name="download_live_updates">Okamžité aktualizace</string>
|
||||
<string name="no_updates_available">Nejsou dostupné žádné aktualizace</string>
|
||||
<string name="traffic_warning_hazard">Nebezpečí</string>
|
||||
<string name="rendering_value_boldOutline_name">Tučný obrys</string>
|
||||
|
@ -1912,4 +1913,9 @@
|
|||
<string name="morning">Ráno</string>
|
||||
<string name="night">V noci</string>
|
||||
<string name="select_month_and_country">Vyberte měsíc a krajinu</string>
|
||||
</resources>
|
||||
<string name="shared_string_remove">Odstranit</string>
|
||||
<string name="rendering_attr_hideIcons_name">Skrýt ikonu POI</string>
|
||||
<string name="shared_string_select">Zvolit</string>
|
||||
<string name="road_blocked">Cesta je blokovaná</string>
|
||||
<string name="switch_start_finish">Zaměnit počáteční a cílový bod</string>
|
||||
</resources>
|
||||
|
|
|
@ -2626,8 +2626,8 @@
|
|||
<string name="poi_seamark_dyke">Sømærke dige</string>
|
||||
<string name="poi_dolphin">Delfin</string>
|
||||
|
||||
<string name="poi_forestry_compartment">Vejskilt: skovbrug afdeling</string>
|
||||
<string name="poi_forestry_allotment">Vejskilt: skovbrug tildeling</string>
|
||||
<string name="poi_forestry_compartment">Vejviser: skovbrug</string>
|
||||
<string name="poi_forestry_allotment">Vejviser: skovbrug tildeling</string>
|
||||
<string name="poi_inscription_n">Inskription: N</string>
|
||||
<string name="poi_inscription_nw">Inskription: NV</string>
|
||||
<string name="poi_inscription_w">Inskription: V</string>
|
||||
|
|
|
@ -2203,15 +2203,15 @@
|
|||
|
||||
<string name="update_time">Opdateringstidspunkt</string>
|
||||
|
||||
<string name="updates_size">Opdateringer: %s</string>
|
||||
<string name="updates_size">Opdateringsstørrelse</string>
|
||||
<string name="last_map_change">Sidste kortændring: %s</string>
|
||||
<string name="rec_split">Optager opdel</string>
|
||||
<string name="rec_split_title">Brug optager opdel</string>
|
||||
<string name="rec_split_desc">Omskriv klip når den brugte plads overstiger opbevaring størrelse</string>
|
||||
<string name="rec_split">Optagelse automatisk opdelt</string>
|
||||
<string name="rec_split_title">"Brug automatisk opdeling"</string>
|
||||
<string name="rec_split_desc">Overskriv klip når lagerpladsen er fuld</string>
|
||||
<string name="rec_split_clip_length">Kliplængde</string>
|
||||
<string name="rec_split_clip_length_desc">Længden af hver optaget klip bliver ikke længere end det angivne tidsinterval</string>
|
||||
<string name="rec_split_storage_size">Lagerplads</string>
|
||||
<string name="rec_split_storage_size_desc">Mængden af lagerplads, der kan være optaget af alle optagne klip</string>
|
||||
<string name="rec_split_storage_size_desc">Lagerplads, der kan bruges af alle optagne klip</string>
|
||||
<string name="hourly">Time</string>
|
||||
<string name="daily">Daglig</string>
|
||||
<string name="weekly">Ugentlig</string>
|
||||
|
@ -2231,8 +2231,8 @@
|
|||
<string name="number_of_edits">Antal redigeringer</string>
|
||||
<string name="reports_for">Rapport for:</string>
|
||||
<string name="shared_string_select">Vælg</string>
|
||||
<string name="clear_updates_proposition_message">Du kan fjerne de hentede opdateringer og vende tilbage til det oprindelige kort</string>
|
||||
<string name="clear_updates_proposition_message">Man kan fjerne de hentede opdateringer og vende tilbage til det oprindelige kort</string>
|
||||
<string name="add_time_span">Tilføj tidsinterval</string>
|
||||
<string name="road_blocked">Vej er spærret</string>
|
||||
<string name="road_blocked">Spærret vej</string>
|
||||
<string name="shared_string_remove">Fjern</string>
|
||||
</resources>
|
||||
|
|
|
@ -1019,15 +1019,15 @@
|
|||
<string name="av_widget_action">Standard-Widget-Aktion</string>
|
||||
<string name="av_video_format_descr">Wählen Sie ein Video-Ausgabeformat</string>
|
||||
<string name="av_video_format">Video-Ausgabeformat</string>
|
||||
<string name="av_use_external_recorder_descr">Externen System-Recorder für Video-Aufnahmen verwenden</string>
|
||||
<string name="av_use_external_recorder">System-Recorder</string>
|
||||
<string name="av_use_external_recorder_descr">System Video App für Videos verwenden</string>
|
||||
<string name="av_use_external_recorder">System Video App nutzen</string>
|
||||
<string name="av_settings_descr">Konfigurieren von Audio- und Video-Einstellungen</string>
|
||||
<string name="shared_string_control_stop">Stopp</string>
|
||||
<string name="av_settings">Audio/Video-Einstellungen</string>
|
||||
<string name="shared_string_control_start">Starten</string>
|
||||
<string name="av_def_action_picture">Foto aufnehmen</string>
|
||||
<string name="av_use_external_camera_descr">Externe Systemkamera für Fotoaufnahmen verwenden</string>
|
||||
<string name="av_use_external_camera">Systemkamera</string>
|
||||
<string name="av_use_external_camera_descr">System Kamera App für Fotos verwenden</string>
|
||||
<string name="av_use_external_camera">System Kamera App nutzen</string>
|
||||
<string name="av_def_action_choose">Bei Anfrage auswählen</string>
|
||||
<string name="dropbox_plugin_description">Das Dropbox-Plugin ermöglicht Ihnen eine Synchronisation von Tracks und Audio/Video-Notizen mit Ihrem Dropbox-Konto.</string>
|
||||
<string name="dropbox_plugin_name">Dropbox-Plugin</string>
|
||||
|
|
|
@ -2621,4 +2621,7 @@
|
|||
<string name="poi_fair_trade_no">Comercio justo: No</string>
|
||||
<string name="poi_fair_trade_only">Sólo productos de comercio justo</string>
|
||||
|
||||
<string name="poi_ice_hockey">Hockey sobre hielo</string>
|
||||
<string name="poi_bandy">Bandy</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1620,7 +1620,7 @@
|
|||
<string name="search_address">Buscar dirección</string>
|
||||
<string name="choose_building">Elija el edificio</string>
|
||||
<string name="choose_street">Elija la calle</string>
|
||||
<string name="choose_city">Elija la ciudad</string>
|
||||
<string name="choose_city">Elija la ciudad o el código postal</string>
|
||||
<string name="ChooseCountry">Elija el país</string>
|
||||
<string name="show_view_angle">Mostrar dirección de visualización</string>
|
||||
<string name="map_view_3d_descr">Active la vista 3D del mapa</string>
|
||||
|
|
|
@ -526,7 +526,7 @@
|
|||
<string name="search_address">Cerca indirizzo</string>
|
||||
<string name="choose_building">Scegli numero civico</string>
|
||||
<string name="choose_street">Scegli la strada</string>
|
||||
<string name="choose_city">Scegli la città</string>
|
||||
<string name="choose_city">Scegli la città o il cap</string>
|
||||
<string name="ChooseCountry">Scegli la nazione</string>
|
||||
|
||||
|
||||
|
@ -2146,5 +2146,6 @@
|
|||
<string name="reports_for">Rapporto per:</string>
|
||||
<string name="shared_string_remove">Rimuovi</string>
|
||||
<string name="clear_updates_proposition_message">Puoi eliminare gli aggiornamenti scaricati e avere la mappa originale</string>
|
||||
<string name="road_blocked">Strada chiusa</string>
|
||||
<string name="road_blocked">Strada bloccata</string>
|
||||
<string name="add_time_span">Aggiungi durata</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?><resources>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<resources>
|
||||
|
||||
<string name="recording_context_menu_show">Zobraziť</string>
|
||||
<string name="recording_photo_description">Fotografia %1$s %2$s</string>
|
||||
|
@ -231,7 +232,7 @@
|
|||
<string name="map_version_changed_info">Na serveri sú mapové súbory nekompatibilné s Vašou aktuálnou verziou aplikácie. Na ich stiahnutie a použitie, prosím, aktualizujte aplikáciu na novšiu verziu.</string>
|
||||
<string name="poi_filter_nominatim">Online Nominatim</string>
|
||||
<string name="search_position_current_location_search">Hľadám umiestnenie…</string>
|
||||
<string name="search_position_current_location_found">Umiestnenie [Nájdené]</string>
|
||||
<string name="search_position_current_location_found">Moja poloha (nájdená)</string>
|
||||
<string name="search_position_address">Adresa…</string>
|
||||
<string name="search_position_favorites">Obľúbené miesta…</string>
|
||||
<string name="search_position_undefined">Neurčené</string>
|
||||
|
@ -634,7 +635,7 @@
|
|||
<string name="search_address">Hľadať adresu</string>
|
||||
<string name="choose_building">Vybrať popisné číslo</string>
|
||||
<string name="choose_street">Vybrať ulicu</string>
|
||||
<string name="choose_city">Vybrať mesto</string>
|
||||
<string name="choose_city">Vybrať mesto alebo PSČ</string>
|
||||
<string name="ChooseCountry">Vybrať krajinu</string>
|
||||
<string name="show_view_angle">Zobraziť uhol pohľadu</string>
|
||||
<string name="map_view_3d_descr">Zapnutie 3D zobrazenia mapy</string>
|
||||
|
@ -684,7 +685,7 @@
|
|||
<string name="add_favorite_dialog_favourite_added_template">Obľúbený bod "{0}" bol úspešne pridaný.</string>
|
||||
<string name="favourites_context_menu_edit">Upraviť obľúbený bod</string>
|
||||
<string name="favourites_context_menu_delete">Vymazať obľúbený bod</string>
|
||||
<string name="favourites_remove_dialog_msg">Odstrániť obľúbený bod "%s"?</string>
|
||||
<string name="favourites_remove_dialog_msg">Zmazať obľúbený bod \'%s\'?</string>
|
||||
<string name="favourites_remove_dialog_success">Obľúbený bod {0} bol úspešne zmazaný.</string>
|
||||
|
||||
|
||||
|
@ -761,7 +762,7 @@
|
|||
<string name="osmand_parking_warning">Upozornenie</string>
|
||||
<string name="osmand_parking_warning_text">Predošle bola pridaná do kalendára pripomienka na vyzdvihnutie Vášho auta. Zostane tam, pokiaľ ju ručne nezmažete.</string>
|
||||
<string name="osmand_parking_time_limit_title">Nastavte časový limit parkovania</string>
|
||||
<string name="osmand_parking_delete_confirm">Chcete odstrániť umiestnenie zaparkovaného auta?</string>
|
||||
<string name="osmand_parking_delete_confirm">Chcete zmazať značku parkovacieho miesta?</string>
|
||||
<string name="osmand_parking_delete">Zmazať parkovaciu značku</string>
|
||||
<string name="osmand_parking_choose_type">Zvoľte typ parkovania</string>
|
||||
<string name="osmand_parking_lim_text">Časovo obmedzené</string>
|
||||
|
@ -1917,7 +1918,17 @@
|
|||
<string name="shared_string_type">Typ</string>
|
||||
<string name="starting_point">Východzí bod</string>
|
||||
<string name="select_month_and_country">Zvoľte mesiac a krajinu</string>
|
||||
<string name="item_removed">Položka vymazaná</string>
|
||||
<string name="item_removed">Položka odstránená</string>
|
||||
<string name="n_items_removed">položiek vymazaných</string>
|
||||
<string name="shared_string_undo_all">VŠETKO VRÁTIŤ SPÄŤ</string>
|
||||
</resources>
|
||||
<string name="shared_string_remove">Odstrániť</string>
|
||||
<string name="clear_updates_proposition_message">Môžete odstrániť stiahnuté aktualizácie a vrátiť sa späť k pôvodnej verzii mapy</string>
|
||||
<string name="add_time_span">Pridať časový rozsah</string>
|
||||
<string name="road_blocked">Cesta zablokovaná</string>
|
||||
<string name="shared_string_select">Vybrať</string>
|
||||
<string name="switch_start_finish">Vymeniť východzí a cieľový bod</string>
|
||||
<string name="rendering_attr_hideIcons_name">Skryť ikony bodov záujmu (POI)</string>
|
||||
<string name="number_of_contributors">Počet prispievateľov</string>
|
||||
<string name="number_of_edits">Počet zmien</string>
|
||||
<string name="reports_for">Výkaz pre:</string>
|
||||
</resources>
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
<string name="app_description">Program za navigacijo</string>
|
||||
<string name="use_internet">Uporabi internet</string>
|
||||
<string name="show_poi_over_map">Prikaži točke POI</string>
|
||||
<string name="choose_city">Izbor mesta</string>
|
||||
<string name="choose_city">Izbor mesta ali poštne številke</string>
|
||||
<string name="choose_building">Izbor hišne številke</string>
|
||||
<string name="choose_street">Izbor ulice</string>
|
||||
<string name="ChooseCountry">Izbor države</string>
|
||||
|
@ -296,7 +296,7 @@
|
|||
<string name="no_route">Ni določene poti</string>
|
||||
<string name="delete_target_point">Odstrani cilj</string>
|
||||
<string name="target_point">Ciljna točka %1$s</string>
|
||||
<string name="intermediate_point">Cilj %1$s</string>
|
||||
<string name="intermediate_point">Vmesni cilj %1$s</string>
|
||||
<string name="target_points">Cilji</string>
|
||||
<string name="poi_filter_emergency">Pomoč v sili</string>
|
||||
<string name="poi_filter_car_aid">Pomoč na cesti</string>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<resources>
|
||||
<string name="screen_is_locked">För att låsa upp skärmen tryck på låsikonen</string>
|
||||
<string name="ChooseCountry">Välj land</string>
|
||||
<string name="choose_city">Välj stad</string>
|
||||
<string name="choose_city">Välj stad eller postnummer</string>
|
||||
<string name="choose_building">Välj byggnad</string>
|
||||
<string name="choose_street">Välj gata</string>
|
||||
<string name="map_widget_top_text">Gatunamn</string>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
<string name="shared_string_remove">Remove</string>
|
||||
<string name="shared_string_remove">Remove</string>
|
||||
<string name="clear_updates_proposition_message">"You can remove downloaded updates and get back to the original map edition"</string>
|
||||
<string name="add_time_span">Add time span</string>
|
||||
<string name="road_blocked">Road blocked</string>
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
package net.osmand.plus.base;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.ColorInt;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.DrawableRes;
|
||||
import android.support.annotation.IdRes;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
|
||||
public class BaseOsmAndDialogFragment extends DialogFragment {
|
||||
private IconsCache iconsCache;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
boolean isLightTheme = ((OsmandApplication) getActivity().getApplication())
|
||||
.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
|
||||
setStyle(STYLE_NO_FRAME, themeId);
|
||||
getActivity().getWindow()
|
||||
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
}
|
||||
|
||||
|
||||
protected OsmandApplication getMyApplication() {
|
||||
return (OsmandApplication) getActivity().getApplication();
|
||||
}
|
||||
|
||||
protected OsmandActionBarActivity getMyActivity() {
|
||||
return (OsmandActionBarActivity) getActivity();
|
||||
}
|
||||
|
||||
protected IconsCache getIconsCache() {
|
||||
if (iconsCache == null) {
|
||||
iconsCache = getMyApplication().getIconsCache();
|
||||
}
|
||||
return iconsCache;
|
||||
}
|
||||
|
||||
protected Drawable getPaintedContentIcon(@DrawableRes int id, @ColorInt int color){
|
||||
return getIconsCache().getPaintedContentIcon(id, color);
|
||||
}
|
||||
|
||||
protected Drawable getIcon(@DrawableRes int id, @ColorRes int colorId){
|
||||
return getIconsCache().getIcon(id, colorId);
|
||||
}
|
||||
|
||||
protected Drawable getContentIcon(@DrawableRes int id){
|
||||
return getIconsCache().getContentIcon(id);
|
||||
}
|
||||
|
||||
protected void setThemedDrawable(View parent, @IdRes int viewId, @DrawableRes int iconId) {
|
||||
((ImageView) parent.findViewById(viewId)).setImageDrawable(getContentIcon(iconId));
|
||||
}
|
||||
|
||||
protected void setThemedDrawable(ImageView view, @DrawableRes int iconId) {
|
||||
view.setImageDrawable(getContentIcon(iconId));
|
||||
}
|
||||
|
||||
protected OsmandSettings getSettings() {
|
||||
return getMyApplication().getSettings();
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ import android.widget.ImageView;
|
|||
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
|
||||
public class BaseOsmAndFragment extends Fragment {
|
||||
|
@ -46,4 +47,12 @@ public class BaseOsmAndFragment extends Fragment {
|
|||
protected void setThemedDrawable(View parent, @IdRes int viewId, @DrawableRes int iconId) {
|
||||
((ImageView) parent.findViewById(viewId)).setImageDrawable(getContentIcon(iconId));
|
||||
}
|
||||
|
||||
protected void setThemedDrawable(View view, @DrawableRes int iconId) {
|
||||
((ImageView) view).setImageDrawable(getContentIcon(iconId));
|
||||
}
|
||||
|
||||
protected OsmandSettings getSettings() {
|
||||
return getMyApplication().getSettings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment {
|
|||
};
|
||||
private ExpandableListView listView;
|
||||
private LocalIndexesAdapter adapter;
|
||||
private AsyncTask<Void, LocalIndexInfo, List<LocalIndexInfo>> loadLocalIndexesTask;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -89,12 +90,14 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment {
|
|||
return true;
|
||||
}
|
||||
});
|
||||
new LoadLocalIndexTask(adapter, this).execute();
|
||||
loadLocalIndexesTask = new LoadLocalIndexTask(adapter, this).execute();
|
||||
return view;
|
||||
}
|
||||
|
||||
private OsmandSettings getSettings() {
|
||||
return getMyActivity().getMyApplication().getSettings();
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
super.onDestroyView();
|
||||
loadLocalIndexesTask.cancel(true);
|
||||
}
|
||||
|
||||
public void notifyLiveUpdatesChanged() {
|
||||
|
@ -389,16 +392,17 @@ public class LiveUpdatesFragment extends BaseOsmAndFragment {
|
|||
private List<LocalIndexInfo> result;
|
||||
private LocalIndexesAdapter adapter;
|
||||
private LiveUpdatesFragment fragment;
|
||||
private LocalIndexHelper helper;
|
||||
|
||||
public LoadLocalIndexTask(LocalIndexesAdapter adapter,
|
||||
LiveUpdatesFragment fragment) {
|
||||
this.adapter = adapter;
|
||||
this.fragment = fragment;
|
||||
helper = new LocalIndexHelper(fragment.getMyActivity().getMyApplication());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<LocalIndexInfo> doInBackground(Void... params) {
|
||||
LocalIndexHelper helper = new LocalIndexHelper(fragment.getMyActivity().getMyApplication());
|
||||
return helper.getLocalFullMaps(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ import android.app.PendingIntent;
|
|||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.widget.Toast;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.activities.LocalIndexInfo;
|
||||
|
@ -17,6 +17,8 @@ import net.osmand.plus.download.IndexItem;
|
|||
import net.osmand.plus.resources.IncrementalChangesManager;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -25,6 +27,8 @@ import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceUpdateFreq
|
|||
|
||||
public class PerformLiveUpdateAsyncTask
|
||||
extends AsyncTask<String, Object, IncrementalChangesManager.IncrementalUpdateList> {
|
||||
private final static Log LOG = PlatformUtil.getLog(OsmLiveActivity.class);
|
||||
|
||||
private final Context context;
|
||||
private final LocalIndexInfo localIndexInfo;
|
||||
private final boolean forceUpdate;
|
||||
|
@ -41,7 +45,6 @@ public class PerformLiveUpdateAsyncTask
|
|||
if (context instanceof AbstractDownloadActivity) {
|
||||
AbstractDownloadActivity activity = (AbstractDownloadActivity) context;
|
||||
activity.setSupportProgressBarIndeterminateVisibility(true);
|
||||
OsmandSettings settings = activity.getMyApplication().getSettings();
|
||||
}
|
||||
final OsmandApplication myApplication = getMyApplication();
|
||||
OsmandSettings.CommonPreference<Long> lastCheckPreference =
|
||||
|
@ -69,7 +72,7 @@ public class PerformLiveUpdateAsyncTask
|
|||
final OsmandApplication application = getMyApplication();
|
||||
final OsmandSettings settings = application.getSettings();
|
||||
if (result.errorMessage != null) {
|
||||
Toast.makeText(context, result.errorMessage, Toast.LENGTH_SHORT).show();
|
||||
LOG.info(result.errorMessage);
|
||||
tryRescheduleDownload(context, settings, localIndexInfo);
|
||||
} else {
|
||||
settings.LIVE_UPDATES_RETRIES.resetToDefault();
|
||||
|
@ -118,7 +121,7 @@ public class PerformLiveUpdateAsyncTask
|
|||
}
|
||||
|
||||
public static void tryRescheduleDownload(Context context, OsmandSettings settings,
|
||||
LocalIndexInfo localIndexInfo) {
|
||||
LocalIndexInfo localIndexInfo) {
|
||||
final OsmandSettings.CommonPreference<Integer> updateFrequencyPreference =
|
||||
preferenceUpdateFrequency(localIndexInfo, settings);
|
||||
final Integer frequencyOrdinal = updateFrequencyPreference.get();
|
||||
|
|
|
@ -1,27 +1,9 @@
|
|||
package net.osmand.plus.liveupdates;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.map.WorldRegion;
|
||||
import net.osmand.osm.io.NetworkUtils;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
import net.osmand.plus.base.BaseOsmAndFragment;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -32,39 +14,63 @@ import android.widget.TextView;
|
|||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
* Activities that contain this fragment must implement the
|
||||
* {@link ReportsFragment.OnFragmentInteractionListener} interface
|
||||
* to handle interaction events.
|
||||
* Use the {@link ReportsFragment#newInstance} factory method to
|
||||
* create an instance of this fragment.
|
||||
*/
|
||||
public class ReportsFragment extends BaseOsmAndFragment {
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.map.WorldRegion;
|
||||
import net.osmand.osm.io.NetworkUtils;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.BaseOsmAndFragment;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class ReportsFragment extends BaseOsmAndFragment implements SearchSelectionFragment.OnFragmentInteractionListener {
|
||||
public static final String TITLE = "Report";
|
||||
public static final String TOTAL_CHANGES_BY_MONTH_URL_PATTERN = "http://download.osmand.net/" +
|
||||
"reports/query_report.php?report=total_changes_by_month&month=%s®ion=%s";
|
||||
private static final Log LOG = PlatformUtil.getLog(ReportsFragment.class);
|
||||
|
||||
private TextView contributorsTextView;
|
||||
private TextView editsTextView;
|
||||
|
||||
private Spinner montReportsSpinner;
|
||||
private Spinner regionReportsSpinner;
|
||||
private MonthsForReportsAdapter monthsForReportsAdapter;
|
||||
private RegionsForReportsAdapter regionsForReportsAdapter;
|
||||
|
||||
CountrySearchSelectionFragment searchSelectionFragment = new CountrySearchSelectionFragment();
|
||||
private TextView countryNameTextView;
|
||||
|
||||
HashMap<String, String> queryRegionNames = new HashMap<>();
|
||||
ArrayList<String> regionNames = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
initCountries();
|
||||
View view = inflater.inflate(R.layout.fragment_reports, container, false);
|
||||
montReportsSpinner = (Spinner) view.findViewById(R.id.montReportsSpinner);
|
||||
monthsForReportsAdapter = new MonthsForReportsAdapter(getActivity());
|
||||
montReportsSpinner.setAdapter(monthsForReportsAdapter);
|
||||
|
||||
regionReportsSpinner = (Spinner) view.findViewById(R.id.regionReportsSpinner);
|
||||
regionsForReportsAdapter = new RegionsForReportsAdapter(getMyActivity());
|
||||
regionsForReportsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
regionReportsSpinner.setAdapter(regionsForReportsAdapter);
|
||||
View regionReportsButton = view.findViewById(R.id.reportsButton);
|
||||
regionReportsButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
SearchSelectionFragment countrySearchSelectionFragment =
|
||||
searchSelectionFragment;
|
||||
countrySearchSelectionFragment
|
||||
.show(getChildFragmentManager(), "CountriesSearchSelectionFragment");
|
||||
}
|
||||
});
|
||||
|
||||
countryNameTextView = (TextView) regionReportsButton.findViewById(android.R.id.text1);
|
||||
countryNameTextView.setText(regionNames.get(0));
|
||||
|
||||
setThemedDrawable(view, R.id.calendarImageView, R.drawable.ic_action_data);
|
||||
setThemedDrawable(view, R.id.regionIconImageView, R.drawable.ic_world_globe_dark);
|
||||
|
@ -88,16 +94,13 @@ public class ReportsFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
};
|
||||
montReportsSpinner.setOnItemSelectedListener(onItemSelectedListener);
|
||||
regionReportsSpinner.setOnItemSelectedListener(onItemSelectedListener);
|
||||
return view;
|
||||
}
|
||||
|
||||
public void requestAndUpdateUi() {
|
||||
int monthItemPosition = montReportsSpinner.getSelectedItemPosition();
|
||||
String monthUrlString = monthsForReportsAdapter.getQueryString(monthItemPosition);
|
||||
int regionItemPosition = regionReportsSpinner.getSelectedItemPosition();
|
||||
String regionUrlString = regionsForReportsAdapter.getQueryString(regionItemPosition);
|
||||
regionUrlString = regionUrlString == null ? "" : regionUrlString;
|
||||
String countryUrlString = queryRegionNames.get(countryNameTextView.getText().toString());
|
||||
GetJsonAsyncTask.OnResponseListener<Protocol.TotalChangesByMonthResponse> onResponseListener =
|
||||
new GetJsonAsyncTask.OnResponseListener<Protocol.TotalChangesByMonthResponse>() {
|
||||
@Override
|
||||
|
@ -112,7 +115,7 @@ public class ReportsFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
}
|
||||
};
|
||||
requestData(monthUrlString, regionUrlString, onResponseListener);
|
||||
requestData(monthUrlString, countryUrlString, onResponseListener);
|
||||
}
|
||||
|
||||
private void requestData(String monthUrlString, String regionUrlString,
|
||||
|
@ -124,6 +127,80 @@ public class ReportsFragment extends BaseOsmAndFragment {
|
|||
totalChangesByMontAsyncTask.execute(finalUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSearchResult(String name) {
|
||||
countryNameTextView.setText(name);
|
||||
requestAndUpdateUi();
|
||||
}
|
||||
|
||||
private void initCountries() {
|
||||
final WorldRegion root = getMyApplication().getRegions().getWorldRegion();
|
||||
ArrayList<WorldRegion> groups = new ArrayList<>();
|
||||
groups.add(root);
|
||||
processGroup(root, groups, getActivity());
|
||||
Collections.sort(groups, new Comparator<WorldRegion>() {
|
||||
@Override
|
||||
public int compare(WorldRegion lhs, WorldRegion rhs) {
|
||||
if (lhs == root) {
|
||||
return -1;
|
||||
}
|
||||
if (rhs == root) {
|
||||
return 1;
|
||||
}
|
||||
return getHumanReadableName(lhs).compareTo(getHumanReadableName(rhs));
|
||||
}
|
||||
});
|
||||
for (WorldRegion group : groups) {
|
||||
String name = getHumanReadableName(group);
|
||||
regionNames.add(name);
|
||||
queryRegionNames.put(name, group.getRegionDownloadName());
|
||||
}
|
||||
}
|
||||
|
||||
private static String getHumanReadableName(WorldRegion group) {
|
||||
String name;
|
||||
if (group.getLevel() > 2 || (group.getLevel() == 2
|
||||
&& group.getSuperregion().getRegionId().equals(WorldRegion.RUSSIA_REGION_ID))) {
|
||||
WorldRegion parent = group.getSuperregion();
|
||||
WorldRegion parentsParent = group.getSuperregion().getSuperregion();
|
||||
if (group.getLevel() == 3) {
|
||||
if (parentsParent.getRegionId().equals(WorldRegion.RUSSIA_REGION_ID)) {
|
||||
name = parentsParent.getLocaleName() + " " + group.getLocaleName();
|
||||
} else if (!parent.getRegionId().equals(WorldRegion.UNITED_KINGDOM_REGION_ID)) {
|
||||
name = parent.getLocaleName() + " " + group.getLocaleName();
|
||||
} else {
|
||||
name = group.getLocaleName();
|
||||
}
|
||||
} else {
|
||||
name = parent.getLocaleName() + " " + group.getLocaleName();
|
||||
}
|
||||
} else {
|
||||
name = group.getLocaleName();
|
||||
}
|
||||
if (name == null) {
|
||||
name = "";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getQueryString(int position) {
|
||||
return queryRegionNames.get(position);
|
||||
}
|
||||
|
||||
private static void processGroup(WorldRegion group,
|
||||
List<WorldRegion> nameList,
|
||||
Context context) {
|
||||
if (group.isRegionMapDownload()) {
|
||||
nameList.add(group);
|
||||
}
|
||||
|
||||
if (group.getSubregions() != null) {
|
||||
for (WorldRegion g : group.getSubregions()) {
|
||||
processGroup(g, nameList, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class MonthsForReportsAdapter extends ArrayAdapter<String> {
|
||||
private static final SimpleDateFormat queryFormat = new SimpleDateFormat("yyyy-MM", Locale.US);
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
|
@ -152,77 +229,6 @@ public class ReportsFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
}
|
||||
|
||||
private static class RegionsForReportsAdapter extends ArrayAdapter<String> {
|
||||
ArrayList<String> queryRegionNames = new ArrayList<>();
|
||||
|
||||
public RegionsForReportsAdapter(final OsmandActionBarActivity context) {
|
||||
super(context, R.layout.reports_for_spinner_item, android.R.id.text1);
|
||||
|
||||
final WorldRegion root = context.getMyApplication().getRegions().getWorldRegion();
|
||||
ArrayList<WorldRegion> groups = new ArrayList<>();
|
||||
groups.add(root);
|
||||
processGroup(root, groups, context);
|
||||
Collections.sort(groups, new Comparator<WorldRegion>() {
|
||||
@Override
|
||||
public int compare(WorldRegion lhs, WorldRegion rhs) {
|
||||
if (lhs == root) {
|
||||
return -1;
|
||||
}
|
||||
if (rhs == root) {
|
||||
return 1;
|
||||
}
|
||||
return getHumanReadableName(lhs).compareTo(getHumanReadableName(rhs));
|
||||
}
|
||||
});
|
||||
for (WorldRegion group : groups) {
|
||||
String name = getHumanReadableName(group);
|
||||
add(name);
|
||||
queryRegionNames.add(group.getRegionDownloadName());
|
||||
}
|
||||
}
|
||||
|
||||
private static String getHumanReadableName(WorldRegion group) {
|
||||
String name;
|
||||
if(group.getLevel() > 2 || (group.getLevel() == 2
|
||||
&& group.getSuperregion().getRegionId().equals(WorldRegion.RUSSIA_REGION_ID))) {
|
||||
WorldRegion parent = group.getSuperregion();
|
||||
WorldRegion parentsParent = group.getSuperregion().getSuperregion();
|
||||
if(group.getLevel() == 3) {
|
||||
if(parentsParent.getRegionId().equals(WorldRegion.RUSSIA_REGION_ID)) {
|
||||
name = parentsParent.getLocaleName() + " " + group.getLocaleName();
|
||||
} else if (!parent.getRegionId().equals(WorldRegion.UNITED_KINGDOM_REGION_ID)) {
|
||||
name = parent.getLocaleName() + " " + group.getLocaleName();
|
||||
} else {
|
||||
name = group.getLocaleName();
|
||||
}
|
||||
} else {
|
||||
name = parent.getLocaleName() + " " + group.getLocaleName();
|
||||
}
|
||||
} else {
|
||||
name = group.getLocaleName();
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getQueryString(int position) {
|
||||
return queryRegionNames.get(position);
|
||||
}
|
||||
|
||||
private static void processGroup(WorldRegion group,
|
||||
List<WorldRegion> nameList,
|
||||
Context context) {
|
||||
if (group.isRegionMapDownload()) {
|
||||
nameList.add(group);
|
||||
}
|
||||
|
||||
if (group.getSubregions() != null) {
|
||||
for (WorldRegion g : group.getSubregions()) {
|
||||
processGroup(g, nameList, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class GetJsonAsyncTask<P> extends AsyncTask<String, Void, P> {
|
||||
private static final Log LOG = PlatformUtil.getLog(GetJsonAsyncTask.class);
|
||||
private final Class<P> protocolClass;
|
||||
|
@ -260,4 +266,10 @@ public class ReportsFragment extends BaseOsmAndFragment {
|
|||
}
|
||||
}
|
||||
|
||||
public static class CountrySearchSelectionFragment extends SearchSelectionFragment {
|
||||
@Override
|
||||
protected ArrayList<String> getList() {
|
||||
return ((ReportsFragment) getParentFragment()).regionNames;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
package net.osmand.plus.liveupdates;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ListView;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.BaseOsmAndDialogFragment;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public abstract class SearchSelectionFragment extends BaseOsmAndDialogFragment {
|
||||
private OnFragmentInteractionListener mListener;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_search_list, container, false);
|
||||
ListView listView = (ListView) view.findViewById(android.R.id.list);
|
||||
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(getMyActivity(), android.R.layout.simple_list_item_1);
|
||||
if (getArray() != null) {
|
||||
adapter.addAll(getArray());
|
||||
} else if (getList() != null){
|
||||
adapter.addAll(getList());
|
||||
} else {
|
||||
throw new RuntimeException("Either getArray() or getList() must return non null value.");
|
||||
}
|
||||
listView.setAdapter(adapter);
|
||||
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
mListener.onSearchResult(adapter.getItem(position));
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
final EditText searchEditText = (EditText) view.findViewById(R.id.searchEditText);
|
||||
searchEditText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
adapter.getFilter().filter(s);
|
||||
}
|
||||
});
|
||||
ImageButton clearButton = (ImageButton) view.findViewById(R.id.clearButton);
|
||||
setThemedDrawable(clearButton, R.drawable.ic_action_remove_dark);
|
||||
clearButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
searchEditText.setText(null);
|
||||
}
|
||||
});
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof OnFragmentInteractionListener) {
|
||||
mListener = (OnFragmentInteractionListener) context;
|
||||
} else if (getParentFragment() instanceof OnFragmentInteractionListener) {
|
||||
mListener = (OnFragmentInteractionListener) getParentFragment();
|
||||
} else {
|
||||
throw new RuntimeException(context.toString()
|
||||
+ " must implement OnFragmentInteractionListener");
|
||||
}
|
||||
}
|
||||
|
||||
protected String[] getArray() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected ArrayList<String> getList() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetach() {
|
||||
super.onDetach();
|
||||
mListener = null;
|
||||
}
|
||||
|
||||
public interface OnFragmentInteractionListener {
|
||||
void onSearchResult(String name);
|
||||
}
|
||||
}
|
|
@ -60,6 +60,7 @@ import net.osmand.plus.OsmandPlugin;
|
|||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.base.BaseOsmAndDialogFragment;
|
||||
import net.osmand.plus.osmedit.dialogs.PoiSubTypeDialogFragment;
|
||||
import net.osmand.plus.osmedit.dialogs.PoiTypeDialogFragment;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
@ -73,7 +74,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class EditPoiDialogFragment extends DialogFragment {
|
||||
public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
||||
public static final String TAG = "EditPoiDialogFragment";
|
||||
private static final Log LOG = PlatformUtil.getLog(EditPoiDialogFragment.class);
|
||||
|
||||
|
@ -103,9 +104,9 @@ public class EditPoiDialogFragment extends DialogFragment {
|
|||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
OsmandSettings settings = getMyApplication().getSettings();
|
||||
OsmEditingPlugin plugin = OsmandPlugin.getPlugin(OsmEditingPlugin.class);
|
||||
if (settings.OFFLINE_EDITION.get() || !settings.isInternetConnectionAvailable(true)) {
|
||||
if (getSettings().OFFLINE_EDITION.get()
|
||||
|| !getSettings().isInternetConnectionAvailable(true)) {
|
||||
mOpenstreetmapUtil = plugin.getPoiModificationLocalUtil();
|
||||
} else {
|
||||
mOpenstreetmapUtil = plugin.getPoiModificationRemoteUtil();
|
||||
|
@ -115,23 +116,11 @@ public class EditPoiDialogFragment extends DialogFragment {
|
|||
editPoiData = new EditPoiData(node, getMyApplication());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
boolean isLightTheme = ((OsmandApplication) getActivity().getApplication())
|
||||
.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
|
||||
setStyle(STYLE_NO_FRAME, themeId);
|
||||
getActivity().getWindow()
|
||||
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
view = inflater.inflate(R.layout.fragment_edit_poi, container, false);
|
||||
final OsmandSettings settings = getMyApplication().getSettings();
|
||||
boolean isLightTheme = settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
boolean isLightTheme = getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -204,8 +193,7 @@ public class EditPoiDialogFragment extends DialogFragment {
|
|||
|
||||
final int colorId = isLightTheme ? R.color.inactive_item_orange : R.color.dash_search_icon_dark;
|
||||
final int color = getResources().getColor(colorId);
|
||||
onlineDocumentationButton.setImageDrawable(getMyApplication().getIconsCache()
|
||||
.getPaintedContentIcon(R.drawable.ic_action_help, color));
|
||||
onlineDocumentationButton.setImageDrawable(getPaintedContentIcon(R.drawable.ic_action_help, color));
|
||||
final ImageButton poiTypeButton = (ImageButton) view.findViewById(R.id.poiTypeButton);
|
||||
poiTypeButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -548,10 +536,6 @@ public class EditPoiDialogFragment extends DialogFragment {
|
|||
}
|
||||
}
|
||||
|
||||
private OsmandApplication getMyApplication() {
|
||||
return (OsmandApplication) getActivity().getApplication();
|
||||
}
|
||||
|
||||
public static EditPoiDialogFragment createAddPoiInstance(double latitude, double longitude,
|
||||
OsmandApplication application) {
|
||||
Node node = new Node(latitude, longitude, -1);
|
||||
|
|