Merge branch 'master' of https://github.com/osmandapp/Osmand into speed_cameras

This commit is contained in:
veliymolfar 2020-06-11 11:23:00 +03:00
commit 5c4d628889
11 changed files with 121 additions and 61 deletions

View file

@ -1,15 +1,42 @@
<vector android:autoMirrored="true" android:height="92dp"
android:viewportHeight="92" android:viewportWidth="92"
android:width="92dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#000000" android:pathData="M36,54C36,56.7614 33.7614,59 31,59C28.2386,59 26,56.7614 26,54C26,51.2386 28.2386,49 31,49C33.7614,49 36,51.2386 36,54Z"/>
<path android:fillColor="#000000" android:pathData="M43,37C44.6569,37 46,35.6569 46,34C46,32.3431 44.6569,31 43,31C41.3431,31 40,32.3431 40,34C40,35.6569 41.3431,37 43,37Z"/>
<path android:fillColor="#000000" android:fillType="evenOdd" android:pathData="M19,29C19,27.3431 20.3431,26 22,26H48C49.6569,26 51,27.3431 51,29V63C51,64.6569 49.6569,66 48,66H22C20.3431,66 19,64.6569 19,63V29ZM31,62C35.4183,62 39,58.4183 39,54C39,49.5817 35.4183,46 31,46C26.5817,46 23,49.5817 23,54C23,58.4183 26.5817,62 31,62ZM48,34C48,36.7614 45.7614,39 43,39C40.2386,39 38,36.7614 38,34C38,31.2386 40.2386,29 43,29C45.7614,29 48,31.2386 48,34Z"/>
<path android:fillColor="#000000" android:pathData="M53,33H61V55H53V33Z"/>
<path android:fillColor="#000000" android:pathData="M63,39H65V42H73V54H65V59H53V57H63V39Z"/>
<path android:fillColor="#000000" android:fillType="evenOdd" android:pathData="M8,14C8,10.6863 10.6863,8 14,8H78C81.3137,8 84,10.6863 84,14V77C84,80.3137 81.3137,83 78,83H14C10.6863,83 8,80.3137 8,77V14ZM14,14H78V77H14V14Z"/>
<path android:fillColor="#EE5622"
android:pathData="M60.5071,52.532L61.2286,52.9701L60.5071,52.532L44.5991,78.7335C44.2072,79.3789 44,80.1195 44,80.8745C44,83.153 45.847,85 48.1255,85H49H81H81.8745C84.153,85 86,83.153 86,80.8745C86,80.1195 85.7928,79.3789 85.4009,78.7335L69.4929,52.532L68.6381,53.051L69.4929,52.532C68.9778,51.6836 68.2305,50.9972 67.3443,50.5541C66.6178,50.1909 65.8136,50 65,50C64.1864,50 63.3822,50.1909 62.6557,50.5541C61.7695,50.9972 61.0222,51.6836 60.5071,52.532Z"
android:strokeColor="#D13C06" android:strokeWidth="2"/>
<path android:fillColor="#ffffff" android:pathData="M65,60C63.8954,60 63,60.8954 63,62V70C63,71.1046 63.8954,72 65,72C66.1046,72 67,71.1046 67,70V62C67,60.8954 66.1046,60 65,60Z"/>
<path android:fillColor="#ffffff" android:pathData="M65,76C63.8954,76 63,76.8954 63,78C63,79.1046 63.8954,80 65,80C66.1046,80 67,79.1046 67,78C67,76.8954 66.1046,76 65,76Z"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="92dp"
android:height="92dp"
android:viewportWidth="92"
android:viewportHeight="92">
<path
android:pathData="M14,14h64v63h-64z"
android:fillColor="#ffffff"/>
<path
android:pathData="M36,54C36,56.7614 33.7614,59 31,59C28.2386,59 26,56.7614 26,54C26,51.2386 28.2386,49 31,49C33.7614,49 36,51.2386 36,54Z"
android:fillColor="#000000"/>
<path
android:pathData="M43,37C44.6569,37 46,35.6569 46,34C46,32.3431 44.6569,31 43,31C41.3431,31 40,32.3431 40,34C40,35.6569 41.3431,37 43,37Z"
android:fillColor="#000000"/>
<path
android:pathData="M19,29C19,27.3431 20.3431,26 22,26H48C49.6569,26 51,27.3431 51,29V63C51,64.6569 49.6569,66 48,66H22C20.3431,66 19,64.6569 19,63V29ZM31,62C35.4183,62 39,58.4183 39,54C39,49.5817 35.4183,46 31,46C26.5817,46 23,49.5817 23,54C23,58.4183 26.5817,62 31,62ZM48,34C48,36.7614 45.7614,39 43,39C40.2386,39 38,36.7614 38,34C38,31.2386 40.2386,29 43,29C45.7614,29 48,31.2386 48,34Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
<path
android:pathData="M53,33H61V55H53V33Z"
android:fillColor="#000000"/>
<path
android:pathData="M63,39H65V42H73V54H65V59H53V57H63V39Z"
android:fillColor="#000000"/>
<path
android:pathData="M8,14C8,10.6863 10.6863,8 14,8H78C81.3137,8 84,10.6863 84,14V77C84,80.3137 81.3137,83 78,83H14C10.6863,83 8,80.3137 8,77V14ZM14,14H78V77H14V14Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
<path
android:pathData="M70.3477,52.013L86.2557,78.2145C86.7426,79.0164 87,79.9365 87,80.8745C87,83.7052 84.7052,86 81.8745,86H48.1255C45.2948,86 43,83.7052 43,80.8745C43,79.9364 43.2574,79.0164 43.7443,78.2145L59.6523,52.013C60.7758,50.1625 62.8361,49 65,49C67.1639,49 69.2242,50.1625 70.3477,52.013Z"
android:fillColor="#D13C06"
android:fillType="evenOdd"/>
<path
android:pathData="M84.5461,79.2525L68.6381,53.051C67.874,51.7925 66.472,51 65,51C63.528,51 62.126,51.7925 61.3619,53.051L45.4539,79.2525C45.157,79.7414 45,80.3025 45,80.8745C45,82.6007 46.3993,84 48.1255,84H81.8745C83.6007,84 85,82.6007 85,80.8745C85,80.3025 84.843,79.7414 84.5461,79.2525Z"
android:fillColor="#EE5622"/>
<path
android:pathData="M65,60C63.8954,60 63,60.8954 63,62V70C63,71.1046 63.8954,72 65,72C66.1046,72 67,71.1046 67,70V62C67,60.8954 66.1046,60 65,60Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M65,76C63.8954,76 63,76.8954 63,78C63,79.1046 63.8954,80 65,80C66.1046,80 67,79.1046 67,78C67,76.8954 66.1046,76 65,76Z"
android:fillColor="#ffffff"/>
</vector>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<net.osmand.plus.widgets.TextViewEx xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/description_letter_spacing"
android:lineSpacingMultiplier="@dimen/bottom_sheet_text_spacing_multiplier"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:paddingEnd="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingBottom="@dimen/gpx_small_text_margin"
android:textAppearance="@style/TextAppearance.ListItemTitle"
app:typeface="@string/font_roboto_regular"
tools:text="@string/auto_zoom_map_descr" />

View file

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/toolbar_switch_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/list_background_color"
android:orientation="vertical">
android:background="?attr/list_background_color">
<LinearLayout
android:id="@+id/selectable_item"
@ -47,4 +46,7 @@
</LinearLayout>
</LinearLayout>
<include layout="@layout/card_bottom_divider"
android:id="@+id/top_shadow_inner" />
</FrameLayout>

View file

@ -19,16 +19,18 @@
android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginEnd="@dimen/content_padding"
android:scaleType="centerInside"
android:tint="?attr/default_icon_color"
osmand:srcCompat="@drawable/ic_action_flag"
android:layout_marginEnd="@dimen/content_padding" />
osmand:srcCompat="@drawable/ic_action_flag" />
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginStart="@dimen/content_padding"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular"

View file

@ -46,7 +46,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bg_color"
android:background="?attr/bottom_bar_background_color"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:orientation="horizontal">
@ -74,15 +74,15 @@
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/content_padding_half"
android:layout_gravity="center_vertical|end">
android:layout_gravity="center_vertical|end"
android:layout_margin="@dimen/content_padding_half">
<FrameLayout
android:id="@+id/button_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/content_padding_half"
android:background="?attr/selectableItemBackground">
android:background="?attr/selectableItemBackground"
android:padding="@dimen/content_padding_half">
<net.osmand.plus.widgets.TextViewEx
android:id="@+id/button_text"

View file

@ -17,23 +17,30 @@
android:orientation="horizontal">
<FrameLayout
android:id="@+id/action_button"
android:layout_width="@dimen/acceptable_touch_radius"
android:layout_height="@dimen/acceptable_touch_radius"
android:layout_gravity="center">
android:layout_marginLeft="@dimen/dashCardMargin"
android:layout_marginRight="@dimen/dashCardMargin"
android:layout_gravity="center"
android:padding="@dimen/content_padding_small">
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/action_icon"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
style="@style/Widget.AppCompat.Toolbar.Button.Navigation"
android:clickable="false"
android:focusable="false"
android:duplicateParentState="true"
tools:src="@drawable/ic_action_remove"
tools:tint="@color/icon_color_default_light" />
<androidx.appcompat.widget.AppCompatCheckBox
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:tint="@color/icon_color_default_light" />
@ -103,17 +110,18 @@
<FrameLayout
android:id="@+id/move_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/acceptable_touch_radius"
android:layout_height="@dimen/acceptable_touch_radius"
android:layout_marginLeft="@dimen/dashCardMargin"
android:layout_marginRight="@dimen/dashCardMargin"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/content_padding_half"
android:layout_marginRight="@dimen/content_padding_half"
android:padding="@dimen/content_padding_small">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/move_icon"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center"
android:tint="?attr/secondary_icon_color"
osmand:srcCompat="@drawable/ic_action_item_move" />

View file

@ -106,6 +106,8 @@
<attr name="purchase_dialog_shadow_btn_bg" format="reference"/>
<attr name="purchase_dialog_outline_btn_bg" format="reference"/>
<attr name="bottom_bar_background_color" format="color" />
<attr name="bottom_nav_shadow" format="reference"/>
<attr name="purchase_dialog_active_card_bg" format="reference"/>

View file

@ -417,6 +417,9 @@
<color name="text_field_box_dark">#3F474B</color>
<color name="text_field_box_light">#eeeeee</color>
<color name="bottom_bar_background_color_dark">#252727</color>
<color name="bottom_bar_background_color_light">#FFFFFF</color>
<color name="preference_category_title">#7E33FF</color>
<color name="preference_top_switch_off">#808080</color>

View file

@ -121,6 +121,7 @@
<!-- Osmand themes styles -->
<style name="OsmandLightTheme" parent="Theme.AppCompat.Light">
<item name="bottom_bar_background_color">@color/bottom_bar_background_color_light</item>
<item name="android:textDirection">locale</item>
<item name="android:statusBarColor">@color/status_bar_color_light</item>
<item name="mapBackground">@color/map_background_color_light</item>
@ -411,6 +412,7 @@
</style>
<style name="OsmandDarkTheme" parent="Theme.AppCompat">
<item name="bottom_bar_background_color">@color/bottom_bar_background_color_dark</item>
<item name="android:textDirection">locale</item>
<item name="android:statusBarColor">@color/status_bar_color_dark</item>
<item name="mapBackground">@color/map_background_color_dark</item>

View file

@ -54,7 +54,7 @@ public class ConfirmationBottomSheet extends MenuBottomSheetDialogFragment {
items.add(new TitleItem(title));
items.add(new BottomSheetItemWithDescription.Builder()
.setDescription(message)
.setLayoutId(R.layout.bottom_sheet_item_preference_descr)
.setLayoutId(R.layout.bottom_sheet_item_primary_descr)
.create());
}

View file

@ -175,12 +175,13 @@ public class QuickActionListFragment extends BaseOsmAndFragment
rv.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
if (screenType == SCREEN_TYPE_REORDER) {
if (dy > 0 && fab.getVisibility() == View.VISIBLE)
if (newState == RecyclerView.SCROLL_STATE_DRAGGING) {
fab.hide();
else if (dy < 0 && fab.getVisibility() != View.VISIBLE)
} else if (newState == RecyclerView.SCROLL_STATE_IDLE) {
fab.show();
}
}
}
});
@ -505,11 +506,11 @@ public class QuickActionListFragment extends BaseOsmAndFragment
final QuickAction action = (QuickAction) item.value;
if (screenType == SCREEN_TYPE_REORDER) {
h.handleView.setVisibility(View.VISIBLE);
h.deleteBtn.setVisibility(View.VISIBLE);
h.moveButton.setVisibility(View.VISIBLE);
h.deleteIcon.setVisibility(View.VISIBLE);
h.checkbox.setVisibility(View.GONE);
h.handleView.setOnTouchListener(new View.OnTouchListener() {
h.moveButton.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (MotionEventCompat.getActionMasked(event) ==
@ -530,6 +531,8 @@ public class QuickActionListFragment extends BaseOsmAndFragment
}
});
h.deleteBtn.setClickable(true);
h.deleteBtn.setFocusable(true);
h.itemContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -543,12 +546,14 @@ public class QuickActionListFragment extends BaseOsmAndFragment
});
} else if (screenType == SCREEN_TYPE_DELETE) {
h.handleView.setVisibility(View.GONE);
h.deleteBtn.setVisibility(View.GONE);
h.moveButton.setVisibility(View.GONE);
h.deleteIcon.setVisibility(View.GONE);
h.checkbox.setVisibility(View.VISIBLE);
h.checkbox.setClickable(false);
h.deleteBtn.setClickable(false);
h.deleteBtn.setFocusable(false);
h.itemContainer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -655,22 +660,9 @@ public class QuickActionListFragment extends BaseOsmAndFragment
}
saveQuickActions();
updateListItems();
showFABIfNotScrollable();
}
}
private void showFABIfNotScrollable() {
LinearLayoutManager layoutManager = (LinearLayoutManager) rv.getLayoutManager();
int lastVisibleItemPosition = layoutManager.findLastVisibleItemPosition();
if (screenType == SCREEN_TYPE_REORDER &&
(lastVisibleItemPosition == items.size() - 1
|| lastVisibleItemPosition == items.size()) &&
layoutManager.findFirstVisibleItemPosition() == 0 &&
fab.getVisibility() != View.VISIBLE ||
items.size() == 0)
fab.show();
}
public List<QuickAction> getQuickActions() {
List<QuickAction> result = new ArrayList<>();
for (ListItem item : items) {
@ -717,8 +709,10 @@ public class QuickActionListFragment extends BaseOsmAndFragment
public ImageView icon;
public View itemDivider;
public View longDivider;
public ImageView handleView;
public ImageView deleteBtn;
public View moveButton;
public ImageView moveIcon;
public View deleteBtn;
public ImageView deleteIcon;
public CompoundButton checkbox;
public View itemContainer;
@ -730,14 +724,16 @@ public class QuickActionListFragment extends BaseOsmAndFragment
icon = (ImageView) itemView.findViewById(R.id.imageView);
itemDivider = itemView.findViewById(R.id.item_divider);
longDivider = itemView.findViewById(R.id.long_divider);
deleteBtn = (ImageView) itemView.findViewById(R.id.action_icon);
handleView = (ImageView) itemView.findViewById(R.id.move_icon);
deleteBtn = itemView.findViewById(R.id.action_button);
deleteIcon = (ImageView) itemView.findViewById(R.id.action_icon);
moveButton = itemView.findViewById(R.id.move_button);
moveIcon = (ImageView) itemView.findViewById(R.id.move_icon);
checkbox = (CompoundButton) itemView.findViewById(R.id.checkbox);
itemContainer = itemView.findViewById(R.id.searchListItemLayout);
deleteBtn.setImageDrawable(app.getUIUtilities()
.getIcon(R.drawable.ic_action_remove, R.color.color_osm_edit_delete));
handleView.setImageDrawable(app.getUIUtilities()
deleteIcon.setImageDrawable(app.getUIUtilities()
.getIcon(R.drawable.ic_action_delete_item, R.color.color_osm_edit_delete));
moveIcon.setImageDrawable(app.getUIUtilities()
.getThemedIcon(R.drawable.ic_action_item_move));
UiUtilities.setupCompoundButton(checkbox, nightMode,
UiUtilities.CompoundButtonType.GLOBAL);