Merge branches 'master' and 'prepare_importing_finish' of https://github.com/osmandapp/Osmand into prepare_importing_finish

 Conflicts:
	OsmAnd/src/net/osmand/plus/settings/ImportDuplicatesFragment.java
This commit is contained in:
veliymolfar 2020-03-11 16:12:47 +02:00
commit b5659fe8b2
42 changed files with 165 additions and 100 deletions

View file

@ -38,7 +38,6 @@
android:contentDescription="@string/backToMenu"
android:layout_width="@dimen/list_item_height"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@drawable/dashboard_button_light"
android:scaleType="center"
android:src="@drawable/ic_navigation_drawer"

View file

@ -52,7 +52,7 @@
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="Category name"
android:layout_marginStart="@dimen/list_content_padding" />
android:layout_marginStart="@dimen/list_content_padding" />
<ImageView
android:id="@+id/options"
@ -67,7 +67,7 @@
android:src="@drawable/ic_overflow_menu_white"
android:visibility="gone"
tools:visiblity="visible"
android:layout_marginEnd="4dp" />
android:layout_marginEnd="4dp" />
<ImageView
android:id="@+id/explist_indicator"
@ -76,7 +76,7 @@
android:scaleType="center"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/list_content_padding"
android:layout_marginEnd="@dimen/list_content_padding" />
android:layout_marginEnd="@dimen/list_content_padding" />
</LinearLayout>

View file

@ -53,9 +53,7 @@
android:gravity="start|center_vertical"
android:maxLines="1"
android:paddingLeft="@dimen/content_padding_small"
android:paddingTop="@dimen/content_padding_half"
android:paddingRight="@dimen/content_padding_small"
android:paddingBottom="@dimen/content_padding_half"
android:text="@string/shared_string_select_all"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/default_desc_text_size"
@ -80,12 +78,10 @@
android:layout_height="match_parent"
android:background="?attr/selectableItemBackground"
android:ellipsize="end"
android:gravity="end|center_vertical"
android:gravity="center"
android:maxLines="1"
android:paddingLeft="@dimen/content_padding_small"
android:paddingTop="@dimen/content_padding_half"
android:paddingRight="@dimen/content_padding_small"
android:paddingBottom="@dimen/content_padding_half"
android:text="@string/shared_string_continue"
android:textColor="?attr/dlg_btn_primary_text"
android:textSize="@dimen/default_desc_text_size"

View file

@ -35,13 +35,13 @@
android:id="@+id/back_button_flow"
android:layout_width="@dimen/route_info_toolbar_button_size"
android:layout_height="@dimen/route_info_toolbar_button_size"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginLeft="@dimen/content_padding_half"
android:layout_marginTop="@dimen/content_padding_half"
android:layout_marginStart="@dimen/content_padding_half"
android:background="@drawable/btn_circle_transparent_full"
android:contentDescription="@string/shared_string_back"
android:src="@drawable/ic_arrow_back"
android:tint="?attr/text_color_tab_active_white"
android:layout_marginStart="8dp" />
android:tint="?attr/text_color_tab_active_white" />
<LinearLayout
android:id="@+id/toolbar_options_flow_bg"

View file

@ -54,17 +54,17 @@
android:focusable="false"
android:gravity="center_vertical"
android:visibility="gone"
tools:visibility="visible" />
tools:visibility="visible"/>
<!-- android:button="@drawable/ic_btn_wocheckbox" -->
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/toggle_item"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:layout_marginEnd="24dp"
android:focusable="false"
android:layout_gravity="center"
app:buttonTint="?attr/active_color_basic" />
</LinearLayout>

View file

@ -16,21 +16,21 @@
android:id="@+id/check_local_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/local_index_check_right_margin"
android:layout_marginEnd="@dimen/local_index_check_right_margin"
android:layout_marginTop="@dimen/favorites_icon_top_margin"
android:layout_marginEnd="@dimen/local_index_check_right_margin"
android:layout_marginRight="@dimen/local_index_check_right_margin"
android:focusable="false"
android:visibility="gone"/>
android:visibility="gone" />
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginTop="@dimen/favorites_icon_top_margin"
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:focusable="false"
android:src="@drawable/ic_gpx_track"/>
android:src="@drawable/ic_gpx_track" />
<LinearLayout
android:layout_width="0dp"
@ -45,7 +45,7 @@
android:layout_height="wrap_content"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
tools:text="Bangladesh"/>
tools:text="Bangladesh" />
<LinearLayout
@ -57,11 +57,11 @@
android:id="@+id/descriptionTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="7dp"
android:layout_marginEnd="7dp"
android:layout_marginRight="7dp"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_sub_text_size"
tools:text="12.34 Mb * 10/4/2015"/>
tools:text="12.34 Mb * 10/4/2015" />
</LinearLayout>
@ -69,11 +69,11 @@
<ImageButton
android:id="@+id/options"
android:contentDescription="@string/shared_string_more"
android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height"
android:background="?attr/dashboard_button"
android:contentDescription="@string/shared_string_more"
android:focusable="false"
android:src="@drawable/ic_overflow_menu_white"/>
android:src="@drawable/ic_overflow_menu_white" />
</LinearLayout>

View file

@ -679,31 +679,37 @@
app:contentInsetLeft="4dp"
app:contentInsetStart="4dp">
<ImageView
android:id="@+id/context_menu_toolbar_back"
android:layout_width="@dimen/list_item_height"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/shared_string_collapse"
android:scaleType="center"
android:src="@drawable/ic_arrow_back"
tools:visibility="visible"/>
<TextView
android:id="@+id/context_menu_toolbar_text"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:ellipsize="end"
android:lines="1"
android:maxLines="1"
android:scaleType="center"
android:singleLine="true"
android:textColor="@color/abc_primary_text_material_dark"
android:textSize="@dimen/abc_text_size_large_material"
tools:text="Toolbar"
tools:visibility="visible"/>
android:gravity="center_vertical|start"
android:orientation="horizontal">
<ImageView
android:id="@+id/context_menu_toolbar_back"
android:layout_width="@dimen/list_item_height"
android:layout_height="match_parent"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/shared_string_collapse"
android:scaleType="center"
android:src="@drawable/ic_arrow_back"
tools:visibility="visible"/>
<TextView
android:id="@+id/context_menu_toolbar_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:maxLines="1"
android:scaleType="center"
android:singleLine="true"
android:textColor="@color/abc_primary_text_material_dark"
android:textSize="@dimen/abc_text_size_large_material"
tools:text="Toolbar"
tools:visibility="visible"/>
</LinearLayout>
</androidx.appcompat.widget.Toolbar>

View file

@ -4206,4 +4206,16 @@
<string name="poi_tactile_paving_primitive">Primitive</string>
<string name="poi_tactile_paving_incorrect">Incorrect</string>
<string name="poi_seamark_water_level_part_submerged">Water level: part-submerged</string>
<string name="poi_seamark_water_level_submerged">Water level: submerged</string>
<string name="poi_seamark_water_level_dry">Water level: dry</string>
<string name="poi_seamark_water_level_covers">Water level: covers</string>
<string name="poi_seamark_water_level_awash">Water level: awash</string>
<string name="poi_seamark_water_level_floods">Water level: floods</string>
<string name="poi_seamark_water_level_floating">Water level: floating</string>
<string name="poi_seamark_water_level_above_mwl">Water level: above mean water level</string>
<string name="poi_seamark_water_level_below_mwl">Water level: below mean water level</string>
<string name="poi_seamark_obstruction">Obstruction</string>
</resources>

View file

@ -683,6 +683,11 @@ public class AndroidUtils {
return TextUtilsCompat.getLayoutDirectionFromLocale(currentLocale);
}
public static int getNavigationIconResId(@NonNull Context ctx) {
return getLayoutDirection(ctx) == ViewCompat.LAYOUT_DIRECTION_RTL ?
R.drawable.ic_arrow_forward : R.drawable.ic_arrow_back;
}
public static boolean isSupportRTL() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
}

View file

@ -394,7 +394,7 @@ public class UiUtilities {
if (image == null) {
return;
}
int rotation = layoutDirection == View.LAYOUT_DIRECTION_LTR ? 0 : 180;
int rotation = layoutDirection == ViewCompat.LAYOUT_DIRECTION_RTL ? 180 : 0;
image.setRotationY(rotation);
}

View file

@ -1,6 +1,7 @@
package net.osmand.plus.activities;
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
@ -15,6 +16,7 @@ import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.ViewCompat;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
@ -50,7 +52,9 @@ public abstract class ActionBarPreferenceActivity extends AppCompatPreferenceAct
}
tb.setClickable(true);
int activeButtonsAndLinksTextColorResId = lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
tb.setNavigationIcon(((OsmandApplication) getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back, activeButtonsAndLinksTextColorResId));
int navigationIconResId = AndroidUtils.getNavigationIconResId(getApplication());
Drawable icBack = ((OsmandApplication) getApplication()).getUIUtilities().getIcon(navigationIconResId, activeButtonsAndLinksTextColorResId);
tb.setNavigationIcon(icBack);
tb.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
tb.setBackgroundColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTabBackground)));
tb.setTitleTextColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTextColor)));

View file

@ -106,7 +106,8 @@ public class FavoritesSearchFragment extends DialogFragment {
}
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_arrow_back));
Drawable icBack = app.getUIUtilities().getThemedIcon(AndroidUtils.getNavigationIconResId(activity));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(
new View.OnClickListener() {

View file

@ -176,7 +176,6 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
TextView title = (TextView) searchView.findViewById(R.id.title);
Drawable searchIcon = getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_search_dark);
AndroidUtils.setCompoundDrawablesWithIntrinsicBounds(title, searchIcon, null, null, null);
title.setHint(R.string.shared_string_search);
searchView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -5,6 +5,7 @@ import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import net.osmand.AndroidUtils;
import androidx.appcompat.app.ActionBar;
import net.osmand.plus.OsmandApplication;
@ -18,7 +19,7 @@ public class OsmandActionBarActivity extends OsmandInAppPurchaseActivity {
//should be called after set content view
protected void setupHomeButton() {
boolean lightTheme = getMyApplication().getSettings().isLightContent();
Drawable back = ((OsmandApplication)getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back,
Drawable back = ((OsmandApplication)getApplication()).getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(getApplication()),
lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
final ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {

View file

@ -1,6 +1,7 @@
package net.osmand.plus.activities;
import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.MenuItem;
@ -10,6 +11,7 @@ import android.widget.CompoundButton;
import androidx.appcompat.widget.SwitchCompat;
import androidx.appcompat.widget.Toolbar;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
@ -26,7 +28,8 @@ public class PrivacyAndSecurityActivity extends OsmandActionBarActivity {
tb.setTitle(R.string.settings_privacy_and_security);
tb.setClickable(true);
tb.setNavigationIcon(((OsmandApplication) getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back));
Drawable icBack = ((OsmandApplication) getApplication()).getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app));
tb.setNavigationIcon(icBack);
tb.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
tb.setBackgroundColor(getResources().getColor(resolveResourceId(this, R.attr.pstsTabBackground)));
tb.setTitleTextColor(getResources().getColor(resolveResourceId(this, R.attr.pstsTextColor)));

View file

@ -336,8 +336,8 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
ImageView lst = (ImageView) dashboardView.findViewById(R.id.toolbar_list);
lst.setVisibility(View.GONE);
ImageView back = (ImageView) dashboardView.findViewById(R.id.toolbar_back);
back.setImageDrawable(
getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back));
Drawable icBack = getMyApplication().getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(mapActivity));
back.setImageDrawable(icBack);
back.setOnClickListener(new View.OnClickListener() {
@Override
@ -345,8 +345,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
backPressed();
}
});
int layoutDirection = AndroidUtils.getLayoutDirection(mapActivity);
UiUtilities.rotateImageByLayoutDirection(back, layoutDirection);
if (visibleType == DashboardType.DASHBOARD || visibleType == DashboardType.LIST_MENU) {
settingsButton.setVisibility(View.VISIBLE);

View file

@ -105,7 +105,8 @@ public class DownloadResourceGroupFragment extends DialogFragment implements Dow
activity.getAccessibilityAssistant().registerPage(view, DownloadActivity.DOWNLOAD_TAB_NUMBER);
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back));
Drawable icBack = getMyApplication().getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(activity));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -28,6 +28,7 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity;
import net.osmand.AndroidUtils;
import net.osmand.Collator;
import net.osmand.CollatorStringMatcher;
import net.osmand.OsmAndCollator;
@ -113,7 +114,8 @@ public class SearchDialogFragment extends DialogFragment implements DownloadEven
int iconColorResId = isLightContent ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
Drawable icBack = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back, iconColorResId);
Drawable icBack = getMyApplication().getUIUtilities().getIcon(
AndroidUtils.getNavigationIconResId(getContext()), iconColorResId);
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {

View file

@ -103,7 +103,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
private View toolbarContainer;
private View toolbarView;
private View toolbarBackButton;
private ImageView toolbarBackButton;
private TextView toolbarTextView;
private View topButtonContainer;
private LockableScrollView menuScrollView;
@ -208,14 +208,17 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
openMenuHeaderOnly();
}
});
toolbarBackButton.setImageResource(AndroidUtils.getNavigationIconResId(mapActivity));
topButtonContainer = view.findViewById(R.id.context_menu_top_button_container);
view.findViewById(R.id.context_menu_top_back).setOnClickListener(new View.OnClickListener() {
ImageView backButton = (ImageView) view.findViewById(R.id.context_menu_top_back);
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openMenuHeaderOnly();
}
});
backButton.setImageResource(AndroidUtils.getNavigationIconResId(mapActivity));
updateVisibility(topButtonContainer, 0);
map = mapActivity.getMapView();

View file

@ -64,7 +64,8 @@ public abstract class PointEditorFragment extends BaseOsmAndFragment {
toolbar.setTitle(getToolbarTitle());
OsmandApplication app = requireMyApplication();
Drawable icBack = app.getUIUtilities().getIcon(R.drawable.ic_arrow_back, !editor.isLight() ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light);
Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app),
!editor.isLight() ? R.color.active_buttons_and_links_text_dark : R.color.active_buttons_and_links_text_light);
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setTitleTextColor(getResources().getColor(getResIdFromAttribute(getMapActivity(), R.attr.pstsTextColor)));

View file

@ -1,5 +1,6 @@
package net.osmand.plus.mapcontextmenu.other;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
@ -207,7 +208,8 @@ public class TrackDetailsMenuFragment extends BaseOsmAndFragment {
ImageButton backButton = (ImageButton) mainView.findViewById(R.id.top_bar_back_button);
if (backButton != null) {
backButton.setImageDrawable(getIcon(R.drawable.ic_arrow_back, R.color.color_white));
Drawable icBack = getIcon(AndroidUtils.getNavigationIconResId(ctx), R.color.color_white);
backButton.setImageDrawable(icBack);
}
}
}

View file

@ -283,7 +283,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
TextView optionsButton = mainView.findViewById(R.id.options_button);
if (orientationPortrait) {
backBtn.setImageDrawable(getColoredIcon(R.drawable.ic_arrow_back, lightTheme ? R.color.color_black : R.color.active_buttons_and_links_text_dark));
Drawable icBack = getColoredIcon(AndroidUtils.getNavigationIconResId(getContext()), lightTheme ? R.color.color_black : R.color.active_buttons_and_links_text_dark);
backBtn.setImageDrawable(icBack);
optionsButton.setTextColor(getResolvedColor(lightTheme ? R.color.active_color_primary_light : R.color.active_color_primary_dark));
TextView toolbar = (TextView) mainView.findViewById(R.id.toolbar_text);
toolbar.setTextColor(getResolvedColor(lightTheme ? R.color.text_color_primary_light : R.color.text_color_primary_dark));
@ -291,7 +292,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
setBackgroundColor(R.id.app_bar, lightTheme ? R.color.route_info_bg_light : R.color.route_info_bg_dark);
setBackgroundColor(mainView, lightTheme ? R.color.activity_background_color_light : R.color.activity_background_color_dark);
} else {
backBtn.setImageDrawable(getColoredIcon(R.drawable.ic_arrow_back, lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark));
Drawable icBack = getColoredIcon(AndroidUtils.getNavigationIconResId(getContext()), lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
backBtn.setImageDrawable(icBack);
optionsButton.setTextColor(getResolvedColor(lightTheme ? R.color.color_white : R.color.active_color_primary_dark));
TextView toolbar = (TextView) mainView.findViewById(R.id.toolbar_text);
toolbar.setTextColor(getResolvedColor(lightTheme ? R.color.color_white : R.color.text_color_primary_dark));

View file

@ -70,7 +70,8 @@ public class DirectionIndicationDialogFragment extends BaseOsmAndDialogFragment
mainView = UiUtilities.getInflater(getContext(), !settings.isLightContent()).inflate(R.layout.fragment_direction_indication_dialog, container);
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getIconsCache().getIcon(R.drawable.ic_arrow_back));
int navigationIconResId = AndroidUtils.getNavigationIconResId(getContext());
toolbar.setNavigationIcon(getIconsCache().getIcon(navigationIconResId));
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -25,6 +25,7 @@ import androidx.fragment.app.FragmentPagerAdapter;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.snackbar.Snackbar;
import net.osmand.AndroidUtils;
import net.osmand.Location;
import net.osmand.data.LatLon;
import net.osmand.plus.LockableViewPager;
@ -150,7 +151,7 @@ public class MapMarkersDialogFragment extends DialogFragment implements OnGroupS
View mainView = inflater.inflate(R.layout.fragment_map_markers_dialog, container);
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.map_markers_toolbar);
Drawable icArrowBack = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back,
Drawable icArrowBack = getMyApplication().getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(getContext()),
lightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
toolbar.setNavigationIcon(icArrowBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);

View file

@ -251,7 +251,8 @@ public class PlanRouteFragment extends BaseOsmAndFragment implements OsmAndLocat
}
Toolbar toolbar = (Toolbar) mainView.findViewById(R.id.plan_route_toolbar);
toolbar.setNavigationIcon(getContentIcon(R.drawable.ic_arrow_back));
Drawable icBack = getContentIcon(AndroidUtils.getNavigationIconResId(mapActivity));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -32,8 +32,8 @@ public class GpxDescriptionDialogFragment extends BaseOsmAndDialogFragment {
final Toolbar topBar = new Toolbar(ctx);
topBar.setClickable(true);
Drawable back = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back);
topBar.setNavigationIcon(back);
Drawable icBack = getMyApplication().getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(ctx));
topBar.setNavigationIcon(icBack);
topBar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
topBar.setTitle(R.string.shared_string_description);
topBar.setBackgroundColor(ContextCompat.getColor(ctx, AndroidUtils.resolveAttribute(ctx, R.attr.pstsTabBackground)));

View file

@ -5,6 +5,7 @@ import android.content.DialogInterface;
import android.content.res.ColorStateList;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.DisplayMetrics;
@ -118,7 +119,8 @@ public class SplitSegmentDialogFragment extends DialogFragment {
if (trackActivityActionBar != null) {
titleTextView.setText(trackActivityActionBar.getTitle());
}
toolbar.setNavigationIcon(ic.getIcon(R.drawable.ic_arrow_back));
Drawable icBack = ic.getIcon(AndroidUtils.getNavigationIconResId(app));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -7,6 +7,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
@ -145,7 +146,8 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setTitle(isAddingPoi ? R.string.poi_create_title : R.string.poi_edit_title);
toolbar.setNavigationIcon(R.drawable.ic_arrow_back);
Drawable icBack = getMyApplication().getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(getContext()));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -331,21 +331,18 @@ public class EditProfilesFragment extends BaseOsmAndFragment {
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
LayoutInflater inflater = UiUtilities.getInflater(viewGroup.getContext(), nightMode);
View itemView;
RecyclerView.ViewHolder viewHolder;
if (viewType == INFO_TYPE) {
itemView = inflater.inflate(R.layout.bottom_sheet_item_description_long, viewGroup, false);
viewHolder = new InfoViewHolder(itemView);
View itemView = inflater.inflate(R.layout.bottom_sheet_item_description_long, viewGroup, false);
return new InfoViewHolder(itemView);
} else if (viewType == PROFILE_EDIT_TYPE) {
itemView = inflater.inflate(R.layout.profile_edit_list_item, viewGroup, false);
viewHolder = new ProfileViewHolder(itemView);
View itemView = inflater.inflate(R.layout.profile_edit_list_item, viewGroup, false);
return new ProfileViewHolder(itemView);
} else if (viewType == CATEGORY_TYPE) {
itemView = inflater.inflate(R.layout.simple_category_item, viewGroup, false);
viewHolder = new CategoryViewHolder(itemView);
View itemView = inflater.inflate(R.layout.simple_category_item, viewGroup, false);
return new CategoryViewHolder(itemView);
} else {
throw new IllegalArgumentException("Unsupported view type");
}
return viewHolder;
}
@SuppressLint("ClickableViewAccessibility")

View file

@ -4,6 +4,7 @@ import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
@ -21,6 +22,7 @@ import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
@ -152,7 +154,8 @@ public class CreateEditActionDialog extends DialogFragment {
int buttonsAndLinksTextColorResId = isLightContent ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark;
toolbar.setTitleTextColor(ContextCompat.getColor(getContext(), buttonsAndLinksTextColorResId));
toolbar.setNavigationIcon(getIconsCache().getIcon(R.drawable.ic_arrow_back, buttonsAndLinksTextColorResId));
Drawable icBack = getIconsCache().getIcon(AndroidUtils.getNavigationIconResId(getContext()), buttonsAndLinksTextColorResId);
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);

View file

@ -28,6 +28,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import net.osmand.AndroidUtils;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
@ -122,9 +123,10 @@ public class QuickActionListFragment extends BaseOsmAndFragment implements Quick
private void setUpToolbar(View view) {
Toolbar toolbar = (Toolbar) view.findViewById(R.id.custom_toolbar);
Drawable back = getMyApplication().getUIUtilities().getIcon(R.drawable.ic_arrow_back,
OsmandApplication app = requireMyApplication();
Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app),
isLightContent ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
toolbar.setNavigationIcon(back);
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -102,7 +102,8 @@ public class AvoidRoadsBottomSheetDialogFragment extends MenuBottomSheetDialogFr
textView.setText(!hideImpassableRoads ? R.string.impassable_road : R.string.avoid_pt_types);
Toolbar toolbar = (Toolbar) titleView.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getContentIcon(R.drawable.ic_arrow_back));
int icBackResId = AndroidUtils.getNavigationIconResId(app);
toolbar.setNavigationIcon(getContentIcon(icBackResId));
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -25,6 +25,8 @@ import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.appcompat.widget.AppCompatImageButton;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@ -482,8 +484,8 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
}
private void buildMenuButtons(@NonNull View view) {
View backButton = view.findViewById(R.id.back_button);
View backButtonFlow = view.findViewById(R.id.back_button_flow);
AppCompatImageView backButton = (AppCompatImageView) view.findViewById(R.id.back_button);
AppCompatImageButton backButtonFlow = (AppCompatImageButton) view.findViewById(R.id.back_button_flow);
OnClickListener backOnClick = new OnClickListener() {
@Override
public void onClick(View v) {
@ -492,6 +494,9 @@ public class ChooseRouteFragment extends BaseOsmAndFragment implements ContextMe
};
backButton.setOnClickListener(backOnClick);
backButtonFlow.setOnClickListener(backOnClick);
int navigationIconResId = AndroidUtils.getNavigationIconResId(getContext());
backButton.setImageResource(navigationIconResId);
backButtonFlow.setImageResource(navigationIconResId);
OnClickListener printOnClick = new OnClickListener() {
@Override

View file

@ -20,6 +20,7 @@ import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import net.osmand.AndroidUtils;
import net.osmand.ValueHolder;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.DialogListItemAdapter;
@ -85,7 +86,8 @@ public class ShowAlongTheRouteBottomSheet extends MenuBottomSheetDialogFragment
textView.setText(R.string.show_along_the_route);
Toolbar toolbar = (Toolbar) titleView.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getContentIcon(R.drawable.ic_arrow_back));
Drawable icBack = getContentIcon(AndroidUtils.getNavigationIconResId(ctx));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -1,6 +1,7 @@
package net.osmand.plus.routepreparationmenu;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.CountDownTimer;
@ -116,7 +117,8 @@ public class WaypointsFragment extends BaseOsmAndFragment implements ObservableS
listView.setDynamicListViewCallbacks(this);
final ImageView backButton = (ImageView) view.findViewById(R.id.back_button);
backButton.setImageDrawable(getContentIcon(R.drawable.ic_arrow_back));
Drawable icBack = getContentIcon(AndroidUtils.getNavigationIconResId(mapActivity));
backButton.setImageDrawable(icBack);
backButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -31,6 +31,7 @@ import com.google.openlocationcode.OpenLocationCode;
import com.jwetherell.openmap.common.LatLonPoint;
import com.jwetherell.openmap.common.UTMPoint;
import net.osmand.AndroidUtils;
import net.osmand.Collator;
import net.osmand.CollatorStringMatcher;
import net.osmand.LocationConvert;
@ -131,7 +132,7 @@ public class QuickSearchCoordinatesFragment extends DialogFragment implements Os
view = inflater.inflate(R.layout.search_advanced_coords, container, false);
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
Drawable icBack = app.getUIUtilities().getIcon(R.drawable.ic_arrow_back,
Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(app),
isLightTheme ? R.color.active_buttons_and_links_text_light : R.color.active_buttons_and_links_text_dark);
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);

View file

@ -5,6 +5,7 @@ import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Editable;
@ -451,7 +452,8 @@ public class QuickSearchDialogFragment extends DialogFragment implements OsmAndC
if (!app.getSettings().isLightContent()) {
toolbar.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.app_bar_color_dark));
}
toolbar.setNavigationIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_arrow_back));
Drawable icBack = app.getUIUtilities().getThemedIcon(AndroidUtils.getNavigationIconResId(app));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(
new OnClickListener() {

View file

@ -1,5 +1,6 @@
package net.osmand.plus.settings;
import android.graphics.drawable.Drawable;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;

View file

@ -24,6 +24,7 @@ import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil;
import net.osmand.ResultMatcher;
import net.osmand.ValueHolder;
@ -313,8 +314,8 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon
final Toolbar topBar = new Toolbar(ctx);
topBar.setClickable(true);
Drawable back = app.getUIUtilities().getIcon(R.drawable.ic_arrow_back);
topBar.setNavigationIcon(back);
Drawable icBack = app.getUIUtilities().getIcon(AndroidUtils.getNavigationIconResId(ctx));
topBar.setNavigationIcon(icBack);
topBar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
topBar.setTitle(title);
topBar.setBackgroundColor(ContextCompat.getColor(ctx, getResIdFromAttribute(ctx, R.attr.pstsTabBackground)));

View file

@ -21,6 +21,7 @@ import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import net.osmand.AndroidUtils;
import net.osmand.plus.R;
import net.osmand.plus.base.BaseOsmAndDialogFragment;
@ -84,7 +85,8 @@ public class WikiBaseDialogFragment extends BaseOsmAndDialogFragment {
}
protected void setupToolbar(Toolbar toolbar) {
toolbar.setNavigationIcon(getContentIcon(R.drawable.ic_arrow_back));
Drawable icBack = getContentIcon(AndroidUtils.getNavigationIconResId(getContext()));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override

View file

@ -1,6 +1,7 @@
package net.osmand.plus.wikivoyage;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@ -13,6 +14,7 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import net.osmand.AndroidUtils;
import net.osmand.plus.R;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.wikivoyage.explore.WikivoyageExploreActivity;
@ -28,8 +30,9 @@ public class WikivoyageWelcomeDialogFragment extends WikiBaseDialogFragment {
View mainView = inflate(R.layout.fragment_wikivoyage_welcome_dialog, container);
Drawable icBack = getContentIcon(AndroidUtils.getNavigationIconResId(getContext()));
ImageView backBtn = (ImageView) mainView.findViewById(R.id.back_button);
backBtn.setImageDrawable(getContentIcon(R.drawable.ic_arrow_back));
backBtn.setImageDrawable(icBack);
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View file

@ -85,7 +85,8 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv
}
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setNavigationIcon(getContentIcon(R.drawable.ic_arrow_back));
Drawable icBack = getContentIcon(AndroidUtils.getNavigationIconResId(app));
toolbar.setNavigationIcon(icBack);
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override