This commit is contained in:
GaidamakUA 2015-10-27 17:32:40 +02:00
commit eb1c1ec421
6 changed files with 243 additions and 11 deletions

View file

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="56dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/titleIconImageView"
android:layout_width="56dp"
android:layout_height="56dp"
android:scaleType="center"
tools:background="@color/color_warning"
tools:src="@drawable/ic_map"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/titleTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="16dp"
android:layout_marginLeft="8dp"
android:paddingRight="8dp"
android:text="@string/map_downloaded"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/dialog_header_text_size"/>
<ImageButton
android:id="@+id/closeImageButton"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_gravity="center"
style="@style/Widget.AppCompat.Button.Borderless"
tools:background="@color/color_warning"
android:src="@drawable/ic_action_remove_dark"/>
</LinearLayout>
<TextView
android:id="@+id/descriptionTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginLeft="8dp"
android:paddingRight="8dp"
android:text="@string/map_downloaded_descr"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_list_text_size"/>
<Button
android:id="@+id/actionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
style="@style/Widget.AppCompat.Button.Borderless"
android:textColor="?attr/contextMenuButtonColor"
tools:background="@color/color_warning"
android:text="@string/go_to_map"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -322,7 +322,7 @@
<string name="max_speed_none">perunu</string> <string name="max_speed_none">perunu</string>
<string name="index_name_openmaps">OpenMaps UE</string> <string name="index_name_openmaps">OpenMaps UE</string>
<string name="download_hillshade_item">Umbraduras rilievos</string> <string name="download_hillshade_item">Umbraduras rilievos</string>
<string name="download_hillshade_maps">Subrapositziones umbraduras rilievos</string> <string name="download_hillshade_maps">Umbraduras rilievos</string>
<string name="tip_recent_changes_1_1_2_t">Mudas in sa 1.1.2: <string name="tip_recent_changes_1_1_2_t">Mudas in sa 1.1.2:
\n\t* Megioramentu de su plugin àudio/vìdeo (figuras cun sas informatziones EXIF) \n\t* Megioramentu de su plugin àudio/vìdeo (figuras cun sas informatziones EXIF)
\n\t* Usabilidade attransada e plugin lìnias de livellu restruturau \n\t* Usabilidade attransada e plugin lìnias de livellu restruturau
@ -331,7 +331,7 @@
</string> </string>
<string name="local_indexes_cat_srtm">Datos lìnias de livellu</string> <string name="local_indexes_cat_srtm">Lìnias de livellu</string>
<string name="local_indexes_cat_av">Datos àudio/vìdeo</string> <string name="local_indexes_cat_av">Datos àudio/vìdeo</string>
<string name="stop_routing_confirm">Ses seguru de bòlere firmare su nàvigu?</string> <string name="stop_routing_confirm">Ses seguru de bòlere firmare su nàvigu?</string>
<string name="clear_dest_confirm">Ses seguru de bòlere burrare sa destinatzione (e sos puntos mesanos)?</string> <string name="clear_dest_confirm">Ses seguru de bòlere burrare sa destinatzione (e sos puntos mesanos)?</string>
@ -385,7 +385,7 @@
<string name="shared_string_control_start">Avia/Inghitza</string> <string name="shared_string_control_start">Avia/Inghitza</string>
<string name="map_widget_av_notes">Notas àudio/vìdeo</string> <string name="map_widget_av_notes">Notas àudio/vìdeo</string>
<string name="osmand_srtm_short_description_80_chars">Plugin OsmAnd pro sas lìnias de livellu chene lìnia</string> <string name="osmand_srtm_short_description_80_chars">Plugin OsmAnd pro sas lìnias de livellu chene lìnia</string>
<string name="osmand_srtm_long_description_1000_chars">"Custu plugin frunidi sas lìnias de livellu e sas umbraduras de sos rilievos, chi podent èssere visualizadas in supra de sas mapas non in lìnia de OsmAnd. Custa funtzionalidade at a èssere appretziada meda dae sos atletas, sos escursionistas, e totu sos chi sunt interessados in s\'orografia e su paesàggiu. <string name="osmand_srtm_long_description_1000_chars">"Custu plugin frunidi sas lìnias de livellu e sas umbraduras de sos rilievos, chi podent èssere visualizadas in supra de sas mapas regulares de OsmAnd. Custa funtzionalidade at a èssere appretziada meda dae sos atletas, sos escursionistas, e totu sos chi sunt interessados in s\'orografia e su paesàggiu.
\n\nSos datos globales (intre sos 70 grados nord e sos 70 grados sud) sunt basados in supra de sas medidas de su SRTM (Shuttle Radar Topography Mission) e de sASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), unaina medidora a bordu de Terra, su satellite de su sistema di osservatzione de sa terra de sa NASA. ASTER est unisfortzu de coperassione intre NASA, su Ministeru de sEconomia Cummèrtziu e Industria (METI) de su Giappone, e su sistema ispatziale giapponesu (J-spacesystems). "</string> \n\nSos datos globales (intre sos 70 grados nord e sos 70 grados sud) sunt basados in supra de sas medidas de su SRTM (Shuttle Radar Topography Mission) e de sASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), unaina medidora a bordu de Terra, su satellite de su sistema di osservatzione de sa terra de sa NASA. ASTER est unisfortzu de coperassione intre NASA, su Ministeru de sEconomia Cummèrtziu e Industria (METI) de su Giappone, e su sistema ispatziale giapponesu (J-spacesystems). "</string>
<string name="map_widget_distancemeasurement">Medidura de sa distantzia</string> <string name="map_widget_distancemeasurement">Medidura de sa distantzia</string>
<string name="audionotes_location_not_defined">Sa positzione da assotziare cun sa nota non est galu dessinida. \"Imprea positzione ...\" pro assinzare una nota a sa positzione dislindada</string> <string name="audionotes_location_not_defined">Sa positzione da assotziare cun sa nota non est galu dessinida. \"Imprea positzione ...\" pro assinzare una nota a sa positzione dislindada</string>
@ -395,7 +395,7 @@
<string name="audionotes_plugin_name">Plugin notas àudio/vìdeo</string> <string name="audionotes_plugin_name">Plugin notas àudio/vìdeo</string>
<string name="index_srtm_parts">partes</string> <string name="index_srtm_parts">partes</string>
<string name="index_srtm_ele">Lìnias de livellu</string> <string name="index_srtm_ele">Lìnias de livellu</string>
<string name="srtm_plugin_description">"Custu plugin frunidi sas lìnias de livellu e sas umbraduras de sos rilievos, chi podent èssere visualizadas in supra de sas mapas non in lìnia de OsmAnd. Custa funtzionalidade at a èssere appretziada meda dae sos atletas, sos escursionistas, e totu sos chi sunt interessados in s\'orografia e su paesàggiu. <string name="srtm_plugin_description">"Custu plugin frunidi sas lìnias de livellu e sas umbraduras de sos rilievos, chi podent èssere visualizadas in supra de sas mapas regulares de OsmAnd. Custa funtzionalidade at a èssere appretziada meda dae sos atletas, sos escursionistas, e totu sos chi sunt interessados in s\'orografia e su paesàggiu.
\n\nSos datos globales (intre sos 70 grados nord e sos 70 grados sud) sunt basados in supra de sas medidas de su SRTM (Shuttle Radar Topography Mission) e de sASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), unaina medidora a bordu de Terra, su satellite de su sistema di osservatzione de sa terra de sa NASA. ASTER est unisfortzu de coperassione intre NASA, su Ministeru de sEconomia Cummèrtziu e Industria (METI) de su Giappone, e su sistema ispatziale giapponesu (J-spacesystems). "</string> \n\nSos datos globales (intre sos 70 grados nord e sos 70 grados sud) sunt basados in supra de sas medidas de su SRTM (Shuttle Radar Topography Mission) e de sASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), unaina medidora a bordu de Terra, su satellite de su sistema di osservatzione de sa terra de sa NASA. ASTER est unisfortzu de coperassione intre NASA, su Ministeru de sEconomia Cummèrtziu e Industria (METI) de su Giappone, e su sistema ispatziale giapponesu (J-spacesystems). "</string>
<string name="srtm_plugin_name">Plugin lìnias de livellu</string> <string name="srtm_plugin_name">Plugin lìnias de livellu</string>
<string name="download_select_map_types">Àteras mapas</string> <string name="download_select_map_types">Àteras mapas</string>
@ -819,8 +819,8 @@
<string name="unknown_location">Positzione calu non connota</string> <string name="unknown_location">Positzione calu non connota</string>
<string name="modify_transparency">Muda sa trasparèntzia (0 - trasparente, 255 - annapau)</string> <string name="modify_transparency">Muda sa trasparèntzia (0 - trasparente, 255 - annapau)</string>
<string name="confirm_interrupt_download">Boles firmare sisgarrigamentu de sos documentos?</string> <string name="confirm_interrupt_download">Boles firmare sisgarrigamentu de sos documentos?</string>
<string name="local_indexes_cat_tile">Mapas in lìnia a tasseddos</string> <string name="local_indexes_cat_tile">Mapas in lìnia e in cache a tasseddos</string>
<string name="local_indexes_cat_map">Mapas non in lìnia (vetoriales)</string> <string name="local_indexes_cat_map">Mapas regulares (vetoriales)</string>
<string name="map_online_data">Mapas in lìnia e a tasseddos</string> <string name="map_online_data">Mapas in lìnia e a tasseddos</string>
<string name="map_online_data_descr">Imprea sas mapas in lìnia (iscàrriga e archìvia sos tasseddos in sischeda SD)</string> <string name="map_online_data_descr">Imprea sas mapas in lìnia (iscàrriga e archìvia sos tasseddos in sischeda SD)</string>
<string name="online_map_settings">Mapas in lìnia</string> <string name="online_map_settings">Mapas in lìnia</string>
@ -987,7 +987,7 @@
<string name="rendering_attr_noPolygons_description">Faghe divènnere transparentes totu sas caraterìsticas de sas àreas de su terrinu</string> <string name="rendering_attr_noPolygons_description">Faghe divènnere transparentes totu sas caraterìsticas de sas àreas de su terrinu</string>
<string name="rendering_attr_hmRendered_description">Aumenta sa cantidade ammustrada de minujos de sa mapa</string> <string name="rendering_attr_hmRendered_description">Aumenta sa cantidade ammustrada de minujos de sa mapa</string>
<string name="osmand_rastermaps_plugin_description">"Cun custu plugin podes atzèdere a medas castas de màpas in lìnia (cussas connotas comente \"a tasseddos\" o \"raster\"), dae sas predefinidas de Openstreetmap (comente Mapnik) a sas immàgines satellitares e a sos istratos pro punnas ispetziales comente sas mapas metereològicas, climàticas, geològicas, e umbradura de sos rilievos etc. <string name="osmand_rastermaps_plugin_description">"Cun custu plugin podes atzèdere a medas castas de màpas in lìnia (cussas connotas comente \"a tasseddos\" o \"raster\"), dae sas predefinidas de Openstreetmap (comente Mapnik) a sas immàgines satellitares e a sos istratos pro punnas ispetziales comente sas mapas metereològicas, climàticas, geològicas, e umbradura de sos rilievos etc.
\n\nTotu custas mapas podent èssere impreadas siat comente mapa printzipale (de base) de ammustrare in s\'ischermada mapa de OsmAnd siat comente un\'istratu se subrapositzione o de isfundu de unàtera mapa de base (comente sas mapas istandard non in lìnia de OsmAnd). Pro permìtere una visibilidade prus manna de sas mapas de isfundu, calicunu de sos elementos de sas mapas vetoriales podet èssere cuadu, impreande su menù \'Cunfigura sa mapa\' sighinde sas netzessidades tuas. \n\nTotu custas mapas podent èssere impreadas siat comente mapa printzipale (de base) de ammustrare in s\'ischermada mapa de OsmAnd siat comente un\'istratu se subrapositzione o de isfundu de unàtera mapa de base (comente sas mapas regulares non in lìnia de OsmAnd). Pro permìtere una visibilidade prus manna de sas mapas de isfundu, calicunu de sos elementos de sas mapas vetoriales podet èssere cuadu, impreande su menù \'Cunfigura sa mapa\' sighinde sas netzessidades tuas.
\n\nSas mapas a tasseddos podent èssere iscarrigadas deretamente o ammaniadas pro s\'impreu chene lìnia (e a pustis copiadas intre sa cartella de sos datos de OsmAnd) comente unu database sqlite chi podet èssere produidu dae medas ainas pro sa creatzione de mapas esternas (third-party maps). "</string> \n\nSas mapas a tasseddos podent èssere iscarrigadas deretamente o ammaniadas pro s\'impreu chene lìnia (e a pustis copiadas intre sa cartella de sos datos de OsmAnd) comente unu database sqlite chi podet èssere produidu dae medas ainas pro sa creatzione de mapas esternas (third-party maps). "</string>
<string name="tip_recent_changes_0_8_0_t">"Mudas in sa 0.8.0: <string name="tip_recent_changes_0_8_0_t">"Mudas in sa 0.8.0:
@ -1175,7 +1175,7 @@
<string name="local_index_map_data">Datos mapa</string> <string name="local_index_map_data">Datos mapa</string>
<string name="local_indexes_cat_backup">Istudadu</string> <string name="local_indexes_cat_backup">Istudadu</string>
<string name="local_indexes_cat_tts">Boghes (TTS)</string> <string name="local_indexes_cat_tts">Boghes (TTS)</string>
<string name="local_indexes_cat_voice">Boghe (registrada)</string> <string name="local_indexes_cat_voice">Boghes (registradas)</string>
<string name="ttsvoice">Boghe TTS</string> <string name="ttsvoice">Boghe TTS</string>
<string name="search_offline_clear_search">Chirca noa</string> <string name="search_offline_clear_search">Chirca noa</string>

View file

@ -9,6 +9,9 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). 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 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="map_downloaded">Map downloaded</string>
<string name="map_downloaded_descr">Map of %1$s has been downloaded. Go back to the map to start using it.</string>
<string name="go_to_map">Go to the map</string>
<string name="simulate_initial_startup_descr">"Sets the flag indicating first app startup, keeps all other settings unchanged"</string> <string name="simulate_initial_startup_descr">"Sets the flag indicating first app startup, keeps all other settings unchanged"</string>
<string name="simulate_initial_startup">Simulate first app start</string> <string name="simulate_initial_startup">Simulate first app start</string>
<string name="share_geo">geo:</string> <string name="share_geo">geo:</string>

View file

@ -283,6 +283,11 @@
<item name="@android:windowExitAnimation">@anim/shrink_from_top</item> <item name="@android:windowExitAnimation">@anim/shrink_from_top</item>
</style> </style>
<style name="Animations.PopUpMenu.Bottom">
<item name="@android:windowEnterAnimation">@anim/slide_in_bottom</item>
<item name="@android:windowExitAnimation">@anim/slide_out_bottom</item>
</style>
<style name="create_poi_text_field"> <style name="create_poi_text_field">
<item name="android:layout_marginTop">8dp</item> <item name="android:layout_marginTop">8dp</item>
<item name="android:layout_marginRight">16dp</item> <item name="android:layout_marginRight">16dp</item>

View file

@ -38,6 +38,7 @@ import net.osmand.plus.download.DownloadResourceGroup.DownloadResourceGroupType;
import net.osmand.plus.download.ui.ActiveDownloadsDialogFragment; import net.osmand.plus.download.ui.ActiveDownloadsDialogFragment;
import net.osmand.plus.download.ui.DataStoragePlaceDialogFragment; import net.osmand.plus.download.ui.DataStoragePlaceDialogFragment;
import net.osmand.plus.download.ui.DownloadResourceGroupFragment; import net.osmand.plus.download.ui.DownloadResourceGroupFragment;
import net.osmand.plus.download.ui.GoToMapFragment;
import net.osmand.plus.download.ui.LocalIndexesFragment; import net.osmand.plus.download.ui.LocalIndexesFragment;
import net.osmand.plus.download.ui.UpdatesIndexFragment; import net.osmand.plus.download.ui.UpdatesIndexFragment;
import net.osmand.plus.views.controls.PagerSlidingTabStrip; import net.osmand.plus.views.controls.PagerSlidingTabStrip;
@ -213,7 +214,9 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl
@UiThread @UiThread
public void downloadHasFinished() { public void downloadHasFinished() {
visibleBanner.updateBannerInProgress(); visibleBanner.updateBannerInProgress();
if(downloadItem != null && !WorldRegion.WORLD_BASEMAP.equals(downloadItem.getRegionDownloadNameLC())) { if(downloadItem != null && downloadItem != getMyApplication().getRegions().getWorldRegion()
&& !WorldRegion.WORLD_BASEMAP.equals(downloadItem.getRegionDownloadNameLC())) {
boolean firstMap = !getMyApplication().getSettings().FIRST_MAP_IS_DOWNLOADED.get(); boolean firstMap = !getMyApplication().getSettings().FIRST_MAP_IS_DOWNLOADED.get();
if(firstMap) { if(firstMap) {
initSettingsFirstMap(downloadItem); initSettingsFirstMap(downloadItem);
@ -539,8 +542,7 @@ public class DownloadActivity extends ActionBarProgressActivity implements Downl
} }
private void showGoToMap(WorldRegion worldRegion) { private void showGoToMap(WorldRegion worldRegion) {
// TODO Show dialog go to map (coordinates to open take from WorldRegion.getCenter) GoToMapFragment.showInstance(worldRegion, this);
} }
private void showDownloadWorldMapIfNeeded() { private void showDownloadWorldMapIfNeeded() {

View file

@ -0,0 +1,122 @@
package net.osmand.plus.download.ui;
import android.app.Dialog;
import android.app.DialogFragment;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.data.LatLon;
import net.osmand.map.WorldRegion;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.download.DownloadActivity;
public class GoToMapFragment extends DialogFragment {
public static final String TAG = "GoToMapFragment";
private static final String KEY_GOTO_MAP_REGION_CENTER = "key_goto_map_region_center";
private static final String KEY_GOTO_MAP_REGION_NAME = "key_goto_map_region_name";
private LatLon regionCenter;
private String regionName;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
boolean isLightTheme = getMyApplication()
.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
int themeId = isLightTheme ? R.style.OsmandLightTheme_BottomSheet
: R.style.OsmandDarkTheme_BottomSheet;
final Dialog dialog = new Dialog(getActivity(), themeId);
dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().getAttributes().windowAnimations = R.style.Animations_PopUpMenu_Bottom;
return dialog;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (savedInstanceState != null) {
regionName = savedInstanceState.getString(KEY_GOTO_MAP_REGION_NAME, "");
Object rCenterObj = savedInstanceState.getSerializable(KEY_GOTO_MAP_REGION_CENTER);
if (rCenterObj != null) {
regionCenter = (LatLon) rCenterObj;
} else {
regionCenter = new LatLon(0, 0);
}
}
View view = inflater.inflate(R.layout.go_to_map_fragment, container, false);
((ImageView) view.findViewById(R.id.titleIconImageView))
.setImageDrawable(getIcon(R.drawable.ic_map, R.color.osmand_orange));
((TextView) view.findViewById(R.id.descriptionTextView))
.setText(getActivity().getString(R.string.map_downloaded_descr, regionName));
view.findViewById(R.id.closeImageButton)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
view.findViewById(R.id.actionButton)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
OsmandApplication app = (OsmandApplication) getActivity().getApplication();
app.getSettings().setMapLocationToShow(regionCenter.getLatitude(), regionCenter.getLongitude(), 5, null);
MapActivity.launchMapActivityMoveToTop(getActivity());
}
});
return view;
}
@Override
public void onStart() {
super.onStart();
final Window window = getDialog().getWindow();
WindowManager.LayoutParams params = window.getAttributes();
params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.BOTTOM;
params.width = ViewGroup.LayoutParams.MATCH_PARENT;
window.setAttributes(params);
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
outState.putString(KEY_GOTO_MAP_REGION_NAME, regionName);
outState.putSerializable(KEY_GOTO_MAP_REGION_CENTER, regionCenter);
}
private OsmandApplication getMyApplication() {
return (OsmandApplication) getActivity().getApplication();
}
private Drawable getIcon(@DrawableRes int drawableRes, @ColorRes int color) {
return getMyApplication().getIconsCache().getIcon(drawableRes, color);
}
public static void showInstance(WorldRegion region, DownloadActivity activity) {
GoToMapFragment fragment = new GoToMapFragment();
fragment.regionCenter = region.getRegionCenter();
fragment.regionName = region.getLocaleName();
fragment.show(activity.getFragmentManager(), TAG);
}
}