diff --git a/OsmAnd/res/anim/slide_in_right.xml b/OsmAnd/res/anim/slide_in_right.xml new file mode 100644 index 0000000000..a58a25ac16 --- /dev/null +++ b/OsmAnd/res/anim/slide_in_right.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/anim/slide_out_right.xml b/OsmAnd/res/anim/slide_out_right.xml new file mode 100644 index 0000000000..7bc5c5a50b --- /dev/null +++ b/OsmAnd/res/anim/slide_out_right.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout-land/track_details.xml b/OsmAnd/res/layout-land/track_details.xml index 5f10c6bcb8..969676e1db 100644 --- a/OsmAnd/res/layout-land/track_details.xml +++ b/OsmAnd/res/layout-land/track_details.xml @@ -12,8 +12,7 @@ android:id="@+id/main_view" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical" - android:background="@drawable/bg_left_menu_dark"> + android:orientation="vertical"> + tools:text="Some Title" /> @drawable/bg_map_context_menu_light @drawable/bg_bottom_menu_light @drawable/bg_left_menu_light + @drawable/bg_right_menu_light @drawable/bg_point_editor_view_light @color/divider_color_light @color/divider_color diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java index 55a808272e..c753babe48 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/BaseMenuController.java @@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import net.osmand.AndroidUtils; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; @@ -67,7 +68,8 @@ public abstract class BaseMenuController { public int getSlideInAnimation() { if (isLandscapeLayout()) { - return R.anim.slide_in_left; + return AndroidUtils.isLayoutRtl(getMapActivity()) + ? R.anim.slide_in_right : R.anim.slide_in_left; } else { return R.anim.slide_in_bottom; } @@ -75,7 +77,8 @@ public abstract class BaseMenuController { public int getSlideOutAnimation() { if (isLandscapeLayout()) { - return R.anim.slide_out_left; + return AndroidUtils.isLayoutRtl(getMapActivity()) + ? R.anim.slide_out_right : R.anim.slide_out_left; } else { return R.anim.slide_out_bottom; } diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 3fb8d61fa8..685335866b 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -278,7 +278,7 @@ public class AmenityMenuBuilder extends MenuBuilder { light ? R.color.ctx_menu_controller_button_text_color_light_n : R.color.ctx_menu_controller_button_text_color_dark_n); Drawable pressed = app.getUIUtilities().getIcon(R.drawable.ic_action_read_text, light ? R.color.ctx_menu_controller_button_text_color_light_p : R.color.ctx_menu_controller_button_text_color_dark_p); - button.setCompoundDrawablesWithIntrinsicBounds(Build.VERSION.SDK_INT >= 21 + AndroidUtils.setCompoundDrawablesWithIntrinsicBounds(button, Build.VERSION.SDK_INT >= 21 ? AndroidUtils.createPressedStateListDrawable(normal, pressed) : normal, null, null, null); button.setCompoundDrawablePadding(dpToPx(8f)); llText.addView(button); diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java index f5a27329b0..04628bcb48 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/other/TrackDetailsMenu.java @@ -172,6 +172,8 @@ public class TrackDetailsMenu { } } }); + int navigationIconResId = AndroidUtils.getNavigationIconResId(mapActivity); + toolbarController.setBackBtnIconIds(navigationIconResId, navigationIconResId); toolbarController.setOnCloseButtonClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java index 5b1705157f..e8b7100c0a 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/MapRouteInfoMenuFragment.java @@ -511,8 +511,9 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment { slideInAnim = R.anim.slide_in_bottom; slideOutAnim = R.anim.slide_out_bottom; } else { - slideInAnim = R.anim.slide_in_left; - slideOutAnim = R.anim.slide_out_left; + boolean isLayoutRtl = AndroidUtils.isLayoutRtl(mapActivity); + slideInAnim = isLayoutRtl ? R.anim.slide_in_right : R.anim.slide_in_left; + slideOutAnim = isLayoutRtl ? R.anim.slide_out_right : R.anim.slide_out_left; } } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java index 20c93dadc6..34c655ae0b 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/ShowAlongTheRouteBottomSheet.java @@ -82,7 +82,8 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment int expandType = args.getInt(EXPAND_TYPE_KEY, -1); final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme; - final View titleView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.bottom_sheet_item_toolbar_title, null); + final View titleView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), + R.layout.bottom_sheet_item_toolbar_title, null); TextView textView = (TextView) titleView.findViewById(R.id.title); textView.setText(R.string.show_along_the_route); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java index 8da0063324..f4bbd99d8c 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/MapMarkersCard.java @@ -114,7 +114,7 @@ public class MapMarkersCard extends BaseCard { if (i > 0) { View div = new View(ctx); LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, AndroidUtils.dpToPx(ctx, 1f)); - p.setMargins(listTextPadding, 0, 0, 0); + AndroidUtils.setMargins(p, listTextPadding, 0, 0, 0); div.setLayoutParams(p); AndroidUtils.setBackgroundColor(ctx, div, nightMode, R.color.divider_color_light, R.color.divider_color_dark); div.setVisibility(View.VISIBLE); diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PedestrianRouteCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PedestrianRouteCard.java index e331ee1be5..37129373b7 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PedestrianRouteCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/PedestrianRouteCard.java @@ -1,12 +1,14 @@ package net.osmand.plus.routepreparationmenu.cards; import android.graphics.Typeface; +import android.graphics.drawable.Drawable; import android.os.Build; import android.text.SpannableString; import android.text.Spanned; import android.text.style.StyleSpan; import android.view.View; import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; @@ -59,6 +61,11 @@ public class PedestrianRouteCard extends BaseCard { } else { AndroidUtils.setBackground(app, buttonDescr, nightMode, R.drawable.btn_border_trans_light, R.drawable.btn_border_trans_dark); } + Drawable icPedestrian = app.getUIUtilities().getIcon( + R.drawable.ic_action_pedestrian_dark, + R.color.description_font_and_bottom_sheet_icons); + ((ImageView) view.findViewById(R.id.image)).setImageDrawable( + AndroidUtils.getDrawableForDirection(app, icPedestrian)); view.findViewById(R.id.card_divider).setVisibility(View.VISIBLE); view.findViewById(R.id.top_divider).setVisibility(View.GONE); } diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java index b223049553..b04cfb77aa 100644 --- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java +++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java @@ -11,6 +11,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.view.ContextThemeWrapper; import androidx.core.content.ContextCompat; +import net.osmand.AndroidUtils; import net.osmand.GPXUtilities.GPXFile; import net.osmand.IndexConstants; import net.osmand.plus.GPXDatabase.GpxDataItem; @@ -110,7 +111,7 @@ public class TracksCard extends BaseCard { img.setVisibility(View.VISIBLE); LinearLayout container = (LinearLayout) v.findViewById(R.id.container); container.setMinimumHeight(minCardHeight); - container.setPadding(listContentPadding, 0, 0, 0); + AndroidUtils.setPadding(container, listContentPadding, 0, 0, 0); v.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {