Merge branch 'r3.7' into screen_control

# Conflicts:
#	OsmAnd/res/values/strings.xml
This commit is contained in:
Vitaliy 2020-05-26 19:32:20 +03:00
commit 45e63e2a0d
125 changed files with 395 additions and 248 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 KiB

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: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,45 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7,19C7,20.1046 6.1046,21 5,21C3.8954,21 3,20.1046 3,19C3,17.8954 3.8954,17 5,17C6.1046,17 7,17.8954 7,19Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillAlpha="0.5"/>
<path
android:pathData="M14,19C14,20.1046 13.1046,21 12,21C10.8954,21 10,20.1046 10,19C10,17.8954 10.8954,17 12,17C13.1046,17 14,17.8954 14,19Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillAlpha="0.5"/>
<path
android:pathData="M19,21C20.1046,21 21,20.1046 21,19C21,17.8954 20.1046,17 19,17C17.8954,17 17,17.8954 17,19C17,20.1046 17.8954,21 19,21Z"
android:strokeAlpha="0.5"
android:fillColor="#ffffff"
android:fillAlpha="0.5"/>
<path
android:pathData="M7,12C7,13.1046 6.1046,14 5,14C3.8954,14 3,13.1046 3,12C3,10.8954 3.8954,10 5,10C6.1046,10 7,10.8954 7,12Z"
android:strokeAlpha="0.7"
android:fillColor="#ffffff"
android:fillAlpha="0.7"/>
<path
android:pathData="M14,12C14,13.1046 13.1046,14 12,14C10.8954,14 10,13.1046 10,12C10,10.8954 10.8954,10 12,10C13.1046,10 14,10.8954 14,12Z"
android:strokeAlpha="0.7"
android:fillColor="#ffffff"
android:fillAlpha="0.7"/>
<path
android:pathData="M19,14C20.1046,14 21,13.1046 21,12C21,10.8954 20.1046,10 19,10C17.8954,10 17,10.8954 17,12C17,13.1046 17.8954,14 19,14Z"
android:strokeAlpha="0.7"
android:fillColor="#ffffff"
android:fillAlpha="0.7"/>
<path
android:pathData="M7,5C7,6.1046 6.1046,7 5,7C3.8954,7 3,6.1046 3,5C3,3.8954 3.8954,3 5,3C6.1046,3 7,3.8954 7,5Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M14,5C14,6.1046 13.1046,7 12,7C10.8954,7 10,6.1046 10,5C10,3.8954 10.8954,3 12,3C13.1046,3 14,3.8954 14,5Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M19,7C20.1046,7 21,6.1046 21,5C21,3.8954 20.1046,3 19,3C17.8954,3 17,3.8954 17,5C17,6.1046 17.8954,7 19,7Z"
android:fillColor="#ffffff"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,23L6,12H8.2782L12,18.8233L15.7218,12H18L12,23Z"
android:fillColor="#505050"
android:fillType="evenOdd"/>
<path
android:pathData="M18,12L12,1L6,12H18Z"
android:fillColor="#E53935"/>
</vector>

View file

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4.1161,21.9676L12,19.7647L19.8839,21.9676C19.9609,21.9891 20.0406,22 20.1206,22H20.1832C20.6343,22 21,21.6343 21,21.1832C21,21.0626 20.9733,20.9434 20.9218,20.8344L12.7135,3.4521C12.5832,3.1761 12.3053,3 12,3C11.6947,3 11.4168,3.1761 11.2865,3.4521L3.0782,20.8344C3.0267,20.9434 3,21.0626 3,21.1832C3,21.6343 3.3657,22 3.8168,22H3.8795C3.9594,22 4.0391,21.9891 4.1161,21.9676Z"
android:fillColor="#536DFE"/>
<path
android:pathData="M10,17V11H11L13,15V11H14V17H13L11,13V17H10Z"
android:fillColor="#ffffff"/>
</vector>

View file

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4.1161,21.9676L12,19.7647L19.8839,21.9676C19.9609,21.9891 20.0406,22 20.1206,22H20.1832C20.6343,22 21,21.6343 21,21.1832C21,21.0626 20.9733,20.9434 20.9218,20.8344L12.7135,3.4521C12.5832,3.1761 12.3053,3 12,3C11.6947,3 11.4168,3.1761 11.2865,3.4521L3.0782,20.8344C3.0267,20.9434 3,21.0626 3,21.1832C3,21.6343 3.3657,22 3.8168,22H3.8795C3.9594,22 4.0391,21.9891 4.1161,21.9676Z"
android:fillColor="#536DFE"/>
<path
android:pathData="M10,17V11H11L13,15V11H14V17H13L11,13V17H10Z"
android:fillColor="#ffffff"/>
</vector>

View file

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M16,10L12,3L8,10H16Z"
android:fillColor="#E53935"/>
<path
android:pathData="M8,21V12H10L14,18V12H16V21H14L10,15V21H8Z"
android:fillColor="#505050"/>
</vector>

View file

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M16,10L12,3L8,10H16Z"
android:fillColor="#E53935"/>
<path
android:pathData="M8,21V12H10L14,18V12H16V21H14L10,15V21H8Z"
android:fillColor="#CCCCCC"/>
</vector>

View file

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,23L6,12H8.2782L12,18.8233L15.7218,12H18L12,23Z"
android:fillColor="#CCCCCC"
android:fillType="evenOdd"/>
<path
android:pathData="M18,12L12,1L6,12H18Z"
android:fillColor="#E53935"/>
</vector>

View file

@ -5,6 +5,6 @@
android:viewportHeight="24">
<path
android:pathData="M5,3C3.8954,3 3,3.8954 3,5V19C3,20.1046 3.8954,21 5,21H19C20.1046,21 21,20.1046 21,19V5C21,3.8954 20.1046,3 19,3H5ZM19,5H5V19H19V5ZM7,7H11V11H7V7ZM17,7H13V11H17V7ZM7,13H11V17H7V13ZM17,13H13V17H17V13Z"
android:fillColor="#727272"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View file

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M13,2H11V11H2V13H11V22H13V13H22V11H13V2Z"
android:fillColor="#727272"/>
android:fillColor="#ffffff"/>
</vector>

View file

@ -5,5 +5,5 @@
android:viewportHeight="24">
<path
android:pathData="M22,11l-0,2l-20,0l-0,-2z"
android:fillColor="#727272"/>
android:fillColor="#ffffff"/>
</vector>

View file

@ -7,6 +7,7 @@
android:layout_width="fill_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
android:background="@color/app_bar_color_light"
android:padding="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetRight="0dp"

View file

@ -20,7 +20,7 @@
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/list_content_padding"
android:layout_marginRight="@dimen/list_content_padding"
osmand:srcCompat="@drawable/map_favorite" />
osmand:srcCompat="@drawable/ic_action_favorite" />
<LinearLayout
android:layout_width="0dp"

View file

@ -27,6 +27,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="@dimen/dashboard_map_toolbar"
android:padding="0dp"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"
app:contentInsetRight="0dp"
@ -93,7 +94,7 @@
android:layout_height="wrap_content"
android:background="?attr/bg_color"
app:itemBackground="?attr/bg_color"
app:labelVisibilityMode="labeled"
app:labelVisibilityMode="labeled"
app:itemIconTint="@color/bottom_navigation_color_selector_light"
app:itemTextColor="@color/bottom_navigation_color_selector_light"
app:menu="@menu/map_markers_bottom_navigation"/>

View file

@ -154,7 +154,7 @@
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/bottom_sheet_icon_margin"
tools:src="@drawable/map_directions"/>
tools:src="@drawable/ic_action_gdirections_dark"/>
<TextView
android:layout_width="wrap_content"

View file

@ -6,6 +6,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/actionModeBackground"
android:padding="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:contentInsetRight="0dp"

View file

@ -21,15 +21,15 @@
android:layout_height="match_parent"
android:background="@null"
android:gravity="center_vertical"
android:paddingLeft="@dimen/context_menu_button_padding_x"
android:paddingRight="@dimen/context_menu_button_padding_x"
android:paddingLeft="@dimen/content_padding_half"
android:paddingRight="@dimen/content_padding_half"
android:textAllCaps="true"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
android:duplicateParentState="true"
tools:text="Button"
android:paddingStart="@dimen/context_menu_button_padding_x"
android:paddingEnd="@dimen/context_menu_button_padding_x" />
android:paddingStart="@dimen/content_padding_half"
android:paddingEnd="@dimen/content_padding_half" />
</LinearLayout>

View file

@ -120,7 +120,7 @@
android:contentDescription="@string/shared_string_more"
android:focusable="false"
android:scaleType="center"
osmand:srcCompat="@drawable/map_overflow_menu_white"
osmand:srcCompat="@drawable/ic_actions_menu"
android:visibility="gone"
android:layout_marginEnd="2dp" />

View file

@ -11,11 +11,12 @@
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="fill_parent"
android:layout_height="@dimen/dashboard_map_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/pstsTabBackground"
android:minHeight="@dimen/dashboard_map_toolbar"
android:minHeight="@dimen/toolbar_height"
android:theme="?attr/toolbar_theme"
android:padding="0dp"
app:contentInsetLeft="72dp"
app:contentInsetStart="72dp"
app:contentInsetRight="0dp"

View file

@ -9,7 +9,7 @@
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center"
tools:src="@drawable/ic_dashboard_dark"
tools:src="@drawable/ic_dashboard"
android:background="?attr/dashboard_button" />

View file

@ -9,7 +9,7 @@
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center"
tools:src="@drawable/ic_dashboard_dark" />
tools:src="@drawable/ic_dashboard" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/selection"

View file

@ -22,6 +22,7 @@
android:layout_height="@dimen/dashboard_map_toolbar"
android:background="?attr/bg_color"
android:minHeight="@dimen/dashboard_map_toolbar"
android:padding="0dp"
android:theme="?attr/toolbar_theme"
app:contentInsetLeft="54dp"
app:contentInsetStart="54dp"
@ -38,6 +39,7 @@
android:layout_height="@dimen/dashboard_map_toolbar"
android:background="@color/osmand_orange"
android:minHeight="@dimen/dashboard_map_toolbar"
android:padding="0dp"
android:theme="?attr/toolbar_theme"
android:visibility="gone"
app:contentInsetLeft="54dp"

View file

@ -108,7 +108,7 @@
android:contentDescription="@string/shared_string_more"
android:focusable="false"
android:scaleType="center"
osmand:srcCompat="@drawable/map_overflow_menu_white"
osmand:srcCompat="@drawable/ic_actions_menu"
android:visibility="gone"
tools:visibility="visible"/>

View file

@ -51,13 +51,11 @@
<dimen name="context_menu_first_line_bottom_margin">24dp</dimen>
<dimen name="context_menu_second_line_top_margin">6dp</dimen>
<dimen name="context_menu_top_right_button_min_width">114dp</dimen>
<dimen name="context_menu_button_padding_x">15dp</dimen>
<dimen name="context_menu_buttons_top_margin">-24dp</dimen>
<dimen name="context_menu_progress_min_height">80dp</dimen>
<dimen name="context_menu_progress_cancel_button_size">66dp</dimen>
<dimen name="context_menu_sub_info_height">36dp</dimen>
<dimen name="context_menu_padding_margin_large">30dp</dimen>
<dimen name="context_menu_padding_margin_default">24dp</dimen>
<dimen name="context_menu_padding_margin_medium">15dp</dimen>
<dimen name="context_menu_padding_margin_tiny">9dp</dimen>
<dimen name="context_menu_title_padding">23dp</dimen>

View file

@ -128,6 +128,8 @@
<color name="map_widget_light_pressed">#e5e5e5</color>
<color name="map_widget_blue">#536dfe</color>
<color name="map_widget_blue_pressed">#485dd9</color>
<color name="map_button_icon_color_light">#727272</color>
<color name="map_button_icon_color_dark">#cccccc</color>
<color name="map_progress_bar_bg_light">#f0f0f0</color>
<color name="map_progress_bar_bg_dark">#1b1d1f</color>

View file

@ -164,7 +164,6 @@
<dimen name="context_menu_first_line_bottom_margin">16dp</dimen>
<dimen name="context_menu_second_line_top_margin">4dp</dimen>
<dimen name="context_menu_top_right_button_min_width">76dp</dimen>
<dimen name="context_menu_button_padding_x">10dp</dimen>
<dimen name="context_menu_buttons_top_margin">-16dp</dimen>
<dimen name="context_menu_buttons_padding_bottom">4dp</dimen>
<dimen name="context_menu_progress_min_height">54dp</dimen>

View file

@ -22,6 +22,7 @@
<string name="system_screen_timeout_descr">Enable so the screen turns off after a certain period of inactivity, the time specified in the system settings of your device will be used.</string>
<string name="screen_control">Screen control</string>
<string name="shared_string_always">Always</string>
<string name="gpx_parse_error">OsmAnd GPX is not well formed, please contact support team to investigate further</string>
<string name="unsupported_type_error">Unsupported type</string>
<string name="index_item_world_basemap_detailed">World overview map (detailed)</string>
<string name="profiles_for_action_not_found">Could not find any such profiles.</string>

View file

@ -375,18 +375,20 @@ public class AndroidUtils {
}
}
public static void updateImageButton(Context ctx, ImageButton button, int iconLightId, int iconDarkId, int bgLightId, int bgDarkId, boolean night) {
public static void updateImageButton(OsmandApplication ctx, ImageButton button,
@DrawableRes int iconLightId, @DrawableRes int iconDarkId,
@DrawableRes int bgLightId, @DrawableRes int bgDarkId, boolean night) {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
button.setBackground(AppCompatResources.getDrawable(ctx, night ? bgDarkId : bgLightId));
button.setBackground(ctx.getUIUtilities().getIcon(night ? bgDarkId : bgLightId));
} else {
button.setBackgroundDrawable(AppCompatResources.getDrawable(ctx, night ? bgDarkId : bgLightId));
button.setBackgroundDrawable(ctx.getUIUtilities().getIcon(night ? bgDarkId : bgLightId));
}
int btnSizePx = button.getLayoutParams().height;
int iconSizePx = (int) button.getContext().getResources().getDimension(R.dimen.map_widget_icon);
int iconSizePx = ctx.getResources().getDimensionPixelSize(R.dimen.map_widget_icon);
int iconPadding = (btnSizePx - iconSizePx) / 2;
button.setPadding(iconPadding, iconPadding, iconPadding, iconPadding);
button.setScaleType(ImageView.ScaleType.FIT_CENTER);
button.setImageDrawable(AppCompatResources.getDrawable(ctx, night ? iconDarkId : iconLightId));
button.setImageDrawable(ctx.getUIUtilities().getMapIcon(night ? iconDarkId : iconLightId, !night));
}
public static void setDashButtonBackground(Context ctx, View view, boolean night) {

View file

@ -553,7 +553,8 @@ public class AppInitializer implements IProgress {
customConfigs.put(fileName, builder);
} catch (XmlPullParserException | IOException e) {
throw new IllegalStateException(e);
Algorithms.removeAllFiles(f);
LOG.error(e.getMessage(), e);
}
}
}

View file

@ -79,7 +79,7 @@ public class OsmAndLocationSimulation {
@Override
public boolean processResult(GPXUtilities.GPXFile[] result) {
GPXRouteParamsBuilder builder = new GPXRouteParamsBuilder(result[0], app.getSettings());
startAnimationThread(app, builder.getPoints(), true, speedup.getValue() + 1);
startAnimationThread(app, builder.getPoints(app), true, speedup.getValue() + 1);
if (runnable != null) {
runnable.run();
}

View file

@ -144,7 +144,7 @@ public class UiUtilities {
}
public Drawable getMapIcon(@DrawableRes int id, boolean light) {
return getDrawable(id, light ? R.color.icon_color_default_light : 0);
return getDrawable(id, light ? R.color.map_button_icon_color_light : R.color.map_button_icon_color_dark);
}
public static Drawable getSelectableDrawable(Context ctx) {

View file

@ -368,7 +368,7 @@ public class MapActivityActions implements DialogProvider {
adapter.addItem(itemBuilder
.setTitleId(R.string.shared_string_actions, mapActivity)
.setId(MAP_CONTEXT_MENU_MORE_ID)
.setIcon(R.drawable.map_overflow_menu_white)
.setIcon(R.drawable.ic_actions_menu)
.setOrder(40)
.createItem());
@ -514,7 +514,7 @@ public class MapActivityActions implements DialogProvider {
params.setCalculateOsmAndRouteParts(settings.GPX_ROUTE_CALC_OSMAND_PARTS.get());
params.setUseIntermediatePointsRTE(settings.GPX_CALCULATE_RTEPT.get());
params.setCalculateOsmAndRoute(settings.GPX_ROUTE_CALC.get());
List<Location> ps = params.getPoints();
List<Location> ps = params.getPoints(settings.getContext());
mapActivity.getRoutingHelper().setGpxParams(params);
settings.FOLLOW_THE_GPX_ROUTE.set(result.path);
if (!ps.isEmpty()) {
@ -776,7 +776,7 @@ public class MapActivityActions implements DialogProvider {
optionsMenuHelper.addItem(new ItemBuilder().setTitleId(R.string.home, mapActivity)
.setId(DRAWER_DASHBOARD_ID)
.setIcon(R.drawable.map_dashboard)
.setIcon(R.drawable.ic_dashboard)
.setListener(new ItemClickListener() {
@Override
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int pos, boolean isChecked, int[] viewCoordinates) {

View file

@ -166,17 +166,18 @@ public class OsmandInAppPurchaseActivity extends AppCompatActivity implements In
@Override
public void onItemPurchased(String sku, boolean active) {
FragmentManager fragmentManager = getSupportFragmentManager();
if (purchaseHelper != null && purchaseHelper.getLiveUpdates().containsSku(sku)) {
getMyApplication().logEvent("live_osm_subscription_purchased");
if (!active) {
if (!active && !fragmentManager.isStateSaved()) {
OsmLiveRestartBottomSheetDialogFragment fragment = new OsmLiveRestartBottomSheetDialogFragment();
fragment.setUsedOnMap(this instanceof MapActivity);
fragment.show(getSupportFragmentManager(), OsmLiveRestartBottomSheetDialogFragment.TAG);
fragment.show(fragmentManager, OsmLiveRestartBottomSheetDialogFragment.TAG);
}
}
onInAppPurchaseItemPurchased(sku);
fireInAppPurchaseItemPurchasedOnFragments(getSupportFragmentManager(), sku, active);
fireInAppPurchaseItemPurchasedOnFragments(fragmentManager, sku, active);
}
public void fireInAppPurchaseItemPurchasedOnFragments(@NonNull FragmentManager fragmentManager,

View file

@ -1,6 +1,7 @@
package net.osmand.plus.dashboard;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -96,7 +97,7 @@ public class DashFavoritesFragment extends DashLocationFragment {
public void setupFavorites() {
View mainView = getView();
OsmandApplication app = getMyApplication();
final OsmandApplication app = getMyApplication();
if (mainView == null || app == null) {
return;
}
@ -112,7 +113,7 @@ public class DashFavoritesFragment extends DashLocationFragment {
Collections.sort(points, new Comparator<FavouritePoint>() {
@Override
public int compare(FavouritePoint point, FavouritePoint point2) {
// LatLon lastKnownMapLocation = getMyApplication().getSettings().getLastKnownMapLocation();
// LatLon lastKnownMapLocation = app.getSettings().getLastKnownMapLocation();
int dist = (int) (MapUtils.getDistance(point.getLatitude(), point.getLongitude(),
loc.getLatitude(), loc.getLongitude()));
int dist2 = (int) (MapUtils.getDistance(point2.getLatitude(), point2.getLongitude(),
@ -123,7 +124,7 @@ public class DashFavoritesFragment extends DashLocationFragment {
}
LinearLayout favorites = (LinearLayout) mainView.findViewById(R.id.items);
favorites.removeAllViews();
DashboardOnMap.handleNumberOfRows(points, getMyApplication().getSettings(), ROW_NUMBER_TAG);
DashboardOnMap.handleNumberOfRows(points, app.getSettings(), ROW_NUMBER_TAG);
List<DashLocationView> distances = new ArrayList<DashLocationFragment.DashLocationView>();
for (final FavouritePoint point : points) {
LayoutInflater inflater = getActivity().getLayoutInflater();
@ -136,38 +137,40 @@ public class DashFavoritesFragment extends DashLocationFragment {
view.findViewById(R.id.divider).setVisibility(View.VISIBLE);
ImageView groupImage = (ImageView)view.findViewById(R.id.group_image);
if (point.getCategory().length() > 0) {
((TextView) view.findViewById(R.id.group_name)).setText(point.getCategoryDisplayName(getMyApplication()));
groupImage.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_group_name_16));
((TextView) view.findViewById(R.id.group_name)).setText(point.getCategoryDisplayName(app));
groupImage.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_group_name_16));
} else {
groupImage.setVisibility(View.GONE);
}
((ImageView) view.findViewById(R.id.favourite_icon)).setImageDrawable(FavoriteImageDrawable.getOrCreate(
getActivity(), point.getColor(), false, point));
int iconColor = app.getFavorites().getColorWithCategory(point, getResources().getColor(R.color.color_favorite));
Drawable favoriteIcon = FavoriteImageDrawable.getOrCreate(app, iconColor, false, point);
((ImageView) view.findViewById(R.id.favourite_icon)).setImageDrawable(favoriteIcon);
DashLocationView dv = new DashLocationView(direction, label, new LatLon(point.getLatitude(),
point.getLongitude()));
distances.add(dv);
name.setText(point.getDisplayName(getMyApplication()));
name.setText(point.getDisplayName(app));
name.setTypeface(Typeface.DEFAULT, point.isVisible() ? Typeface.NORMAL : Typeface.ITALIC);
view.findViewById(R.id.navigate_to).setVisibility(View.VISIBLE);
((ImageView) view.findViewById(R.id.navigate_to)).setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_gdirections_dark));
Drawable directionIcon = app.getUIUtilities().getThemedIcon(R.drawable.ic_action_gdirections_dark);
((ImageView) view.findViewById(R.id.navigate_to)).setImageDrawable(directionIcon);
view.findViewById(R.id.navigate_to).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DirectionsDialogs.directionsToDialogAndLaunchMap(getActivity(), point.getLatitude(),
point.getLongitude(),
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, point.getDisplayName(getMyApplication())));
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, point.getDisplayName(app)));
}
});
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
getMyApplication().getSettings().setMapLocationToShow(point.getLatitude(), point.getLongitude(),
15, new PointDescription(PointDescription.POINT_TYPE_FAVORITE, point.getDisplayName(getMyApplication())), true,
point); //$NON-NLS-1$
app.getSettings().setMapLocationToShow(point.getLatitude(), point.getLongitude(),
15, new PointDescription(PointDescription.POINT_TYPE_FAVORITE, point.getDisplayName(app)),
true, point);
MapActivity.launchMapActivityMoveToTop(getActivity());
}
});

View file

@ -415,7 +415,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
DashboardActionButton myLocationButton = new DashboardActionButton();
myLocationButton.icon = AppCompatResources.getDrawable(mapActivity, R.drawable.map_my_location);
myLocationButton.icon = AppCompatResources.getDrawable(mapActivity, R.drawable.ic_my_location);
myLocationButton.text = mapActivity.getString(R.string.map_widget_back_to_loc);
myLocationButton.onClickListener = new View.OnClickListener() {
@Override
@ -430,7 +430,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
};
DashboardActionButton navigateButton = new DashboardActionButton();
navigateButton.icon = AppCompatResources.getDrawable(mapActivity, R.drawable.map_start_navigation);
navigateButton.icon = AppCompatResources.getDrawable(mapActivity, R.drawable.ic_action_start_navigation);
navigateButton.text = mapActivity.getString(R.string.follow);
navigateButton.onClickListener = new View.OnClickListener() {
@Override
@ -441,7 +441,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
};
DashboardActionButton routeButton = new DashboardActionButton();
routeButton.icon = AppCompatResources.getDrawable(mapActivity, R.drawable.map_directions);
routeButton.icon = AppCompatResources.getDrawable(mapActivity, R.drawable.ic_action_gdirections_dark);
routeButton.text = mapActivity.getString(R.string.layer_route);
routeButton.onClickListener = new View.OnClickListener() {
@Override

View file

@ -215,7 +215,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
SunriseSunset sunriseSunset = getMyApplication().getDaynightHelper().getSunriseSunset();
pref = new Preference(this);
pref.setTitle(R.string.day_night_info);
if (sunriseSunset != null) {
if (sunriseSunset != null && sunriseSunset.getSunrise() != null && sunriseSunset.getSunset() != null) {
SimpleDateFormat prt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
pref.setSummary(getString(R.string.day_night_info_description, prt.format(sunriseSunset.getSunrise()),
prt.format(sunriseSunset.getSunset())));

View file

@ -504,7 +504,7 @@ public class ConfigureMapMenu {
String description = "";
SunriseSunset sunriseSunset = activity.getMyApplication().getDaynightHelper().getSunriseSunset();
if (sunriseSunset != null) {
if (sunriseSunset != null && sunriseSunset.getSunrise() != null && sunriseSunset.getSunset() != null) {
DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.SHORT);
String sunriseTime = dateFormat.format(sunriseSunset.getSunrise());
String sunsetTime = dateFormat.format(sunriseSunset.getSunset());

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