Merge pull request #9008 from osmandapp/Tablet_sizes

Fix tablet sizes
This commit is contained in:
vshcherb 2020-05-19 16:09:20 +02:00 committed by GitHub
commit cb93a68389
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 146 additions and 102 deletions

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto" xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -11,64 +10,41 @@
android:id="@+id/background_image" android:id="@+id/background_image"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:scaleType="centerCrop" android:background="@color/list_background_color_dark"
android:background="@color/list_background_color_dark"/> android:scaleType="centerCrop" />
<LinearLayout <net.osmand.plus.widgets.TextViewEx
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_centerInParent="true"
android:background="@color/color_transparent" android:layout_marginStart="40dp"
android:focusable="true" android:layout_marginLeft="40dp"
android:focusableInTouchMode="true" android:layout_marginEnd="40dp"
android:orientation="vertical" android:layout_marginRight="40dp"
android:paddingLeft="40dp" android:gravity="center_horizontal"
android:paddingRight="40dp" android:text="@string/first_usage_greeting"
android:paddingTop="@dimen/first_usage_title_margin" android:textColor="@color/color_white"
android:paddingStart="40dp" android:textSize="@dimen/first_usage_subtitle_text_size"
android:paddingEnd="40dp"> android:textStyle="bold"
osmand:typeface="@string/font_roboto_regular" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_centerHorizontal="true"
osmand:srcCompat="@drawable/osmand_logo"/> android:layout_marginTop="@dimen/first_usage_title_margin"
osmand:srcCompat="@drawable/osmand_logo" />
<View <androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent" android:id="@+id/start_button"
android:layout_height="0dp" android:layout_width="wrap_content"
android:layout_weight="1"/> android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/first_usage_title_margin_bottom"
android:background="@drawable/btn_round_light"
android:padding="14dp"
android:text="@string/get_started"
android:textColor="@color/color_white" />
<net.osmand.plus.widgets.TextViewEx </RelativeLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/first_usage_greeting"
android:textColor="@color/color_white"
android:layout_marginLeft="180dp"
android:layout_marginRight="180dp"
android:textSize="@dimen/first_usage_subtitle_text_size"
android:textStyle="bold"
osmand:typeface="@string/font_roboto_regular"
android:layout_marginEnd="180dp"
android:layout_marginStart="180dp" />
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/start_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/first_usage_title_margin_bottom"
android:background="@drawable/btn_round_light"
android:padding="14dp"
android:text="@string/get_started"
android:textColor="@color/color_white"/>
</LinearLayout>
</FrameLayout>

View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:theme="@style/OsmandLightTheme">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/background_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@color/list_background_color_dark"/>
<net.osmand.plus.widgets.TextViewEx
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginLeft="40dp"
android:layout_marginEnd="40dp"
android:layout_marginRight="40dp"
android:layout_gravity="center"
android:text="@string/first_usage_greeting"
android:textColor="@color/color_white"
android:textSize="@dimen/first_usage_subtitle_text_size"
android:textStyle="bold"
osmand:typeface="@string/font_roboto_regular" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:background="@color/color_transparent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
android:paddingLeft="40dp"
android:paddingRight="40dp"
android:paddingTop="@dimen/first_usage_title_margin"
android:paddingStart="40dp"
android:paddingEnd="40dp">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
osmand:srcCompat="@drawable/osmand_logo"/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/start_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/first_usage_title_margin_bottom"
android:background="@drawable/btn_round_light"
android:padding="14dp"
android:text="@string/get_started"
android:textColor="@color/color_white"/>
</LinearLayout>
</FrameLayout>

View file

@ -18,8 +18,8 @@
android:layout_width="@dimen/standard_icon_size" android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size" android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/route_info_icon_padding_right" android:layout_marginEnd="@dimen/list_content_padding"
android:layout_marginRight="@dimen/route_info_icon_padding_right" android:layout_marginRight="@dimen/list_content_padding"
osmand:srcCompat="@drawable/map_favorite" /> osmand:srcCompat="@drawable/map_favorite" />
<LinearLayout <LinearLayout

View file

@ -122,8 +122,8 @@
android:id="@+id/nearby_routes" android:id="@+id/nearby_routes"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/context_menu_direction_margin" android:layout_marginBottom="@dimen/content_padding_small"
android:layout_marginTop="@dimen/context_menu_padding_margin_tiny" android:layout_marginTop="@dimen/guide_line_vertical_offset"
android:gravity="top" android:gravity="top"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="3dp" android:paddingTop="3dp"

View file

@ -6,8 +6,8 @@
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/app_mode_icon" android:id="@+id/app_mode_icon"
android:layout_width="@dimen/standard_icon_size" android:layout_width="@dimen/map_widget_icon"
android:layout_height="@dimen/standard_icon_size" android:layout_height="@dimen/map_widget_icon"
android:layout_gravity="center" android:layout_gravity="center"
tools:src="@drawable/ic_dashboard_dark" tools:src="@drawable/ic_dashboard_dark"
android:background="?attr/dashboard_button" /> android:background="?attr/dashboard_button" />

View file

@ -6,8 +6,8 @@
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/app_mode_icon" android:id="@+id/app_mode_icon"
android:layout_width="@dimen/standard_icon_size" android:layout_width="@dimen/map_widget_icon"
android:layout_height="@dimen/standard_icon_size" android:layout_height="@dimen/map_widget_icon"
android:layout_gravity="center" android:layout_gravity="center"
tools:src="@drawable/ic_dashboard_dark" /> tools:src="@drawable/ic_dashboard_dark" />

View file

@ -45,7 +45,7 @@
android:paddingStart="@dimen/content_padding_half" android:paddingStart="@dimen/content_padding_half"
android:paddingRight="@dimen/content_padding_half" android:paddingRight="@dimen/content_padding_half"
android:paddingEnd="@dimen/content_padding_half" android:paddingEnd="@dimen/content_padding_half"
android:paddingTop="@dimen/context_menu_transport_grid_item_width" android:paddingTop="@dimen/list_content_padding_large"
tools:text="@string/favorite" /> tools:text="@string/favorite" />
</FrameLayout> </FrameLayout>

View file

@ -39,15 +39,12 @@
<dimen name="map_routing_progress_width">150dp</dimen> <dimen name="map_routing_progress_width">150dp</dimen>
<dimen name="map_mode_button_width">48dp</dimen> <dimen name="map_mode_button_width">48dp</dimen>
<dimen name="map_button_inset_shadow">3dp</dimen> <dimen name="map_button_inset_shadow">3dp</dimen>
<dimen name="map_button_inset">3dp</dimen> <dimen name="map_button_inset">3dp</dimen>
<dimen name="map_button_rect_rad">3dp</dimen> <dimen name="map_button_rect_rad">3dp</dimen>
<dimen name="map_widget_icon_margin">3dp</dimen> <dimen name="map_widget_icon_margin">3dp</dimen>
<!-- ContextMenu --> <!-- ContextMenu -->
<dimen name="context_menu_top_shadow_h">30dp</dimen> <dimen name="context_menu_top_shadow_h">30dp</dimen>
<dimen name="context_menu_icon_top_padding">25dp</dimen> <dimen name="context_menu_icon_top_padding">25dp</dimen>
@ -56,33 +53,22 @@
<dimen name="context_menu_top_right_button_min_width">114dp</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_button_padding_x">15dp</dimen>
<dimen name="context_menu_buttons_top_margin">-24dp</dimen> <dimen name="context_menu_buttons_top_margin">-24dp</dimen>
<dimen name="context_menu_buttons_padding_bottom">6dp</dimen>
<dimen name="context_menu_progress_min_height">80dp</dimen> <dimen name="context_menu_progress_min_height">80dp</dimen>
<dimen name="context_menu_progress_cancel_button_size">66dp</dimen> <dimen name="context_menu_progress_cancel_button_size">66dp</dimen>
<dimen name="context_menu_action_buttons_h">80dp</dimen>
<dimen name="context_menu_sub_info_height">36dp</dimen> <dimen name="context_menu_sub_info_height">36dp</dimen>
<dimen name="context_menu_buttons_bottom_height">63dp</dimen>
<dimen name="context_menu_padding_margin_large">30dp</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_default">24dp</dimen>
<dimen name="context_menu_padding_margin_medium">15dp</dimen> <dimen name="context_menu_padding_margin_medium">15dp</dimen>
<dimen name="context_menu_padding_margin_small">12dp</dimen>
<dimen name="context_menu_padding_margin_tiny">9dp</dimen> <dimen name="context_menu_padding_margin_tiny">9dp</dimen>
<dimen name="context_menu_title_padding">23dp</dimen> <dimen name="context_menu_title_padding">23dp</dimen>
<dimen name="context_menu_controller_height">54dp</dimen>
<dimen name="context_menu_progress_padding_left">27dp</dimen> <dimen name="context_menu_progress_padding_left">27dp</dimen>
<dimen name="context_menu_progress_padding_right">3dp</dimen> <dimen name="context_menu_progress_padding_right">3dp</dimen>
<dimen name="context_menu_action_buttons_height">84dp</dimen>
<dimen name="context_menu_subtitle_margin">5dp</dimen> <dimen name="context_menu_subtitle_margin">5dp</dimen>
<dimen name="context_menu_direction_margin">18dp</dimen> <dimen name="context_menu_direction_margin">18dp</dimen>
<dimen name="context_menu_transport_stop_item_height">24dp</dimen> <dimen name="context_menu_transport_stop_item_height">24dp</dimen>
<dimen name="context_menu_main_actions_padding_top">11dp</dimen> <dimen name="context_menu_main_actions_padding_top">11dp</dimen>
<dimen name="context_menu_main_actions_padding_bottom">9dp</dimen> <dimen name="context_menu_main_actions_padding_bottom">9dp</dimen>
<dimen name="context_menu_main_actions_icon_margin">5dp</dimen> <dimen name="context_menu_main_actions_icon_margin">5dp</dimen>
<dimen name="context_menu_transport_grid_spacing">6dp</dimen>
<dimen name="context_menu_transport_grid_item_width">48dp</dimen>
<dimen name="context_menu_transport_grid_item_height">27dp</dimen>
<dimen name="context_menu_transport_icon_size">24dp</dimen>
<dimen name="context_menu_transport_padding_top">18dp</dimen>
<dimen name="context_menu_big_icon_size">54dp</dimen> <dimen name="context_menu_big_icon_size">54dp</dimen>
<dimen name="fab_size_with_shadow">90dp</dimen> <dimen name="fab_size_with_shadow">90dp</dimen>
@ -91,7 +77,6 @@
<!-- General --> <!-- General -->
<dimen name="measurement_tool_select_radius">30dp</dimen> <dimen name="measurement_tool_select_radius">30dp</dimen>
<dimen name="measurement_tool_divider_margin">12dp</dimen> <dimen name="measurement_tool_divider_margin">12dp</dimen>
<dimen name="measurement_tool_content_padding_medium">18dp</dimen> <dimen name="measurement_tool_content_padding_medium">18dp</dimen>
@ -108,33 +93,22 @@
<dimen name="measurement_tool_button_padding">12dp</dimen> <dimen name="measurement_tool_button_padding">12dp</dimen>
<dimen name="measurement_tool_button_height">54dp</dimen> <dimen name="measurement_tool_button_height">54dp</dimen>
<dimen name="shadow_height">8dp</dimen> <dimen name="shadow_height">8dp</dimen>
<!--Route info--> <!--Route info-->
<dimen name="route_info_buttons_padding_top_bottom">24dp</dimen>
<dimen name="route_info_buttons_padding_left_right">33dp</dimen> <dimen name="route_info_buttons_padding_left_right">33dp</dimen>
<dimen name="route_info_button_go_margin">5dp</dimen> <dimen name="route_info_button_go_margin">5dp</dimen>
<dimen name="route_info_button_go_drawable_padding">21dp</dimen> <dimen name="route_info_button_go_drawable_padding">21dp</dimen>
<dimen name="route_info_directions_margin">72dp</dimen> <dimen name="route_info_directions_margin">72dp</dimen>
<dimen name="route_info_icon_padding_left">18dp</dimen> <dimen name="route_info_icon_padding_left">18dp</dimen>
<dimen name="route_info_icon_padding_right">24dp</dimen>
<dimen name="route_info_modes_height">72dp</dimen> <dimen name="route_info_modes_height">72dp</dimen>
<dimen name="route_info_start_divider_margin">96dp</dimen>
<dimen name="route_info_end_divider_margin">84dp</dimen>
<dimen name="route_info_list_item_height">72dp</dimen>
<dimen name="route_info_buttons_height">54dp</dimen>
<dimen name="route_info_details_padding">18dp</dimen> <dimen name="route_info_details_padding">18dp</dimen>
<dimen name="route_info_icon_vertical_padding">9dp</dimen>
<dimen name="route_info_settings_buttons_height">48dp</dimen> <dimen name="route_info_settings_buttons_height">48dp</dimen>
<dimen name="route_info_app_modes_padding">60dp</dimen> <dimen name="route_info_app_modes_padding">60dp</dimen>
<dimen name="route_info_card_row_min_height">90dp</dimen> <dimen name="route_info_card_row_min_height">90dp</dimen>
<dimen name="route_info_card_item_height">84dp</dimen> <dimen name="route_info_card_item_height">84dp</dimen>
<dimen name="route_info_list_text_padding">78dp</dimen> <dimen name="route_info_list_text_padding">78dp</dimen>
<dimen name="route_info_legend_padding">12dp</dimen>
<dimen name="route_info_warning_padding">27dp</dimen> <dimen name="route_info_warning_padding">27dp</dimen>
<dimen name="route_info_chart_height">106dp</dimen>
<dimen name="route_info_control_buttons_height">72dp</dimen>
<dimen name="route_info_button_bg_line_radius">27dp</dimen> <dimen name="route_info_button_bg_line_radius">27dp</dimen>
<dimen name="route_info_card_details_margin">13dp</dimen> <dimen name="route_info_card_details_margin">13dp</dimen>
<dimen name="route_info_legend_item_size">60dp</dimen> <dimen name="route_info_legend_item_size">60dp</dimen>
@ -153,4 +127,6 @@
<dimen name="bottom_sheet_menu_peek_height">450dp</dimen> <dimen name="bottom_sheet_menu_peek_height">450dp</dimen>
<dimen name="side_of_the_world_button_size">54dp</dimen> <dimen name="side_of_the_world_button_size">54dp</dimen>
<dimen name="toolbar_height">64dp</dimen>
</resources> </resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="first_usage_title_margin">240dp</dimen>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="first_usage_title_margin">400dp</dimen>
</resources>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="first_usage_title_margin">400dp</dimen>
</resources>

View file

@ -46,6 +46,7 @@ import android.view.ViewTreeObserver;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.AttrRes; import androidx.annotation.AttrRes;
@ -375,12 +376,17 @@ 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(Context ctx, ImageButton button, int iconLightId, int iconDarkId, int bgLightId, int bgDarkId, boolean night) {
button.setImageDrawable(AppCompatResources.getDrawable(ctx, night ? iconDarkId : iconLightId));
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
button.setBackground(AppCompatResources.getDrawable(ctx, night ? bgDarkId : bgLightId)); button.setBackground(AppCompatResources.getDrawable(ctx, night ? bgDarkId : bgLightId));
} else { } else {
button.setBackgroundDrawable(AppCompatResources.getDrawable(ctx, night ? bgDarkId : bgLightId)); button.setBackgroundDrawable(AppCompatResources.getDrawable(ctx, night ? bgDarkId : bgLightId));
} }
int btnSizePx = button.getLayoutParams().height;
int iconSizePx = (int) button.getContext().getResources().getDimension(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));
} }
public static void setDashButtonBackground(Context ctx, View view, boolean night) { public static void setDashButtonBackground(Context ctx, View view, boolean night) {

View file

@ -98,7 +98,7 @@ public class SecondSplashScreenFragment extends BaseOsmAndFragment {
RelativeLayout.LayoutParams logoLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT); RelativeLayout.LayoutParams logoLayoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
if (isSmartphone()) { if (isSmartphone()) {
logoLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP); logoLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
logoLayoutParams.addRule(RelativeLayout.CENTER_HORIZONTAL); logoLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
} else { } else {
logoLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT); logoLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);
} }

View file

@ -407,7 +407,7 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
int btnSizePx = mapActivity.getResources().getDimensionPixelSize(R.dimen.map_button_size); int btnSizePx = mapActivity.getResources().getDimensionPixelSize(R.dimen.map_button_size);
actionButton.setLayoutParams(getActionButtonLayoutParams(btnSizePx)); actionButton.setLayoutParams(getActionButtonLayoutParams(btnSizePx));
actionButton.setBackgroundResource(R.drawable.btn_circle_blue); actionButton.setBackgroundResource(R.drawable.btn_circle_blue);
int iconSizePx = mapActivity.getResources().getDimensionPixelSize(R.dimen.standard_icon_size); int iconSizePx = mapActivity.getResources().getDimensionPixelSize(R.dimen.map_widget_icon);
int iconPadding = (btnSizePx - iconSizePx) / 2; int iconPadding = (btnSizePx - iconSizePx) / 2;
actionButton.setPadding(iconPadding, iconPadding, iconPadding, iconPadding); actionButton.setPadding(iconPadding, iconPadding, iconPadding, iconPadding);
hideActionButton(); hideActionButton();

View file

@ -1574,7 +1574,7 @@ public class MapContextMenuFragment extends BaseOsmAndFragment implements Downlo
private int getRoutesBadgesColumnsPerRow(@Nullable String nearInDistance, int minBadgeWidth) { private int getRoutesBadgesColumnsPerRow(@Nullable String nearInDistance, int minBadgeWidth) {
try { try {
double gridSpacing = getResources().getDimension(R.dimen.context_menu_transport_grid_spacing); double gridSpacing = getResources().getDimension(R.dimen.context_menu_transport_grid_spacing);
double gridPadding = getResources().getDimension(R.dimen.context_menu_padding_margin_default); double gridPadding = getResources().getDimension(R.dimen.content_padding);
int availableSpace; int availableSpace;
if (nearInDistance == null) { if (nearInDistance == null) {
availableSpace = (int) (routesBadgesContainer.getWidth() - gridPadding * 2); availableSpace = (int) (routesBadgesContainer.getWidth() - gridPadding * 2);

View file

@ -824,8 +824,8 @@ public class MenuBuilder {
baseView.setOrientation(LinearLayout.HORIZONTAL); baseView.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams llBaseViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams llBaseViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
baseView.setLayoutParams(llBaseViewParams); baseView.setLayoutParams(llBaseViewParams);
AndroidUtils.setPadding(baseView, dpToPx(16), 0, dpToPx(16), dpToPx(12));
baseView.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground)); baseView.setBackgroundResource(AndroidUtils.resolveAttribute(view.getContext(), android.R.attr.selectableItemBackground));
AndroidUtils.setPadding(baseView, dpToPx(16), 0, dpToPx(16), dpToPx(12));
TextViewEx transportRect = new TextViewEx(view.getContext()); TextViewEx transportRect = new TextViewEx(view.getContext());
LinearLayout.LayoutParams trParams = new LinearLayout.LayoutParams(dpToPx(32), dpToPx(18)); LinearLayout.LayoutParams trParams = new LinearLayout.LayoutParams(dpToPx(32), dpToPx(18));

View file

@ -125,7 +125,7 @@ public class RearrangeMenuItemsAdapter extends RecyclerView.Adapter<RecyclerView
if (holder instanceof DescriptionHolder) { if (holder instanceof DescriptionHolder) {
DescriptionHolder h = (DescriptionHolder) holder; DescriptionHolder h = (DescriptionHolder) holder;
ScreenType screenType = (ScreenType) item.value; ScreenType screenType = (ScreenType) item.value;
int paddingStart = (int) app.getResources().getDimension(R.dimen.toolbar_height); int paddingStart = (int) app.getResources().getDimension(R.dimen.dashboard_map_toolbar);
int paddingTop = (int) app.getResources().getDimension(R.dimen.content_padding); int paddingTop = (int) app.getResources().getDimension(R.dimen.content_padding);
h.description.setText(String.format(app.getString(R.string.reorder_or_hide_from), app.getString(screenType.titleRes))); h.description.setText(String.format(app.getString(R.string.reorder_or_hide_from), app.getString(screenType.titleRes)));
h.image.setImageResource(nightMode ? screenType.imageNightRes : screenType.imageDayRes); h.image.setImageResource(nightMode ? screenType.imageNightRes : screenType.imageDayRes);

View file

@ -281,10 +281,15 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
} }
private void updateQuickActionButton(boolean widgetVisible) { private void updateQuickActionButton(boolean widgetVisible) {
quickActionButton.setImageDrawable(app.getUIUtilities().getMapIcon( quickActionButton.setBackgroundResource(
nightMode ? R.drawable.btn_circle_night : R.drawable.btn_circle_trans);
int btnSizePx = quickActionButton.getLayoutParams().height;
int iconSizePx = (int) quickActionButton.getContext().getResources().getDimension(R.dimen.map_widget_icon);
int iconPadding = (btnSizePx - iconSizePx) / 2;
quickActionButton.setPadding(iconPadding, iconPadding, iconPadding, iconPadding);
quickActionButton.setScaleType(ImageView.ScaleType.FIT_CENTER);
quickActionButton.setImageDrawable(app.getUIUtilities().getMapIcon(
!widgetVisible ? R.drawable.map_quick_action : R.drawable.ic_action_close, !nightMode)); !widgetVisible ? R.drawable.map_quick_action : R.drawable.ic_action_close, !nightMode));
quickActionButton.setBackgroundResource(
nightMode ? R.drawable.btn_circle_night : R.drawable.btn_circle_trans);
quickActionButton.setContentDescription(mapActivity.getString(!widgetVisible ? R.string.configure_screen_quick_action : R.string.shared_string_cancel)); quickActionButton.setContentDescription(mapActivity.getString(!widgetVisible ? R.string.configure_screen_quick_action : R.string.shared_string_cancel));
} }