Fix my places icon size

This commit is contained in:
Dima-1 2020-05-15 14:00:38 +03:00
parent b7a19e76bb
commit 234c95dcb2
5 changed files with 19 additions and 22 deletions

View file

@ -19,8 +19,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/context_menu_padding_margin_large"
android:paddingStart="@dimen/context_menu_padding_margin_large"
android:paddingLeft="@dimen/content_padding"
android:paddingStart="@dimen/content_padding"
android:paddingRight="0dp"
android:paddingEnd="0dp"
android:minHeight="@dimen/bottom_sheet_list_item_height"
@ -47,13 +47,13 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/card_content_padding_large"
android:layout_marginLeft="@dimen/list_content_padding_large"
android:layout_weight="1"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="Category name"
android:layout_marginStart="@dimen/card_content_padding_large" />
android:layout_marginStart="@dimen/list_content_padding_large" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/options"

View file

@ -31,13 +31,13 @@
android:minHeight="@dimen/favorites_list_item_height"
android:layout_gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/content_padding_small"
android:paddingLeft="@dimen/content_padding_small"
android:paddingEnd="@dimen/content_padding_small"
android:paddingRight="@dimen/content_padding_small">
android:paddingStart="@dimen/favorites_my_places_icon_left_padding"
android:paddingLeft="@dimen/favorites_my_places_icon_left_padding"
android:paddingEnd="@dimen/favorites_my_places_icon_left_padding"
android:paddingRight="@dimen/favorites_my_places_icon_left_padding">
<FrameLayout
android:layout_width="@dimen/favorites_icon_size"
android:layout_width="@dimen/favorites_my_places_icon_size"
android:layout_height="match_parent"
android:layout_gravity="center_vertical">
@ -67,10 +67,10 @@
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:layout_marginStart="@dimen/context_menu_padding_margin_large"
android:layout_marginLeft="@dimen/context_menu_padding_margin_large"
android:layout_marginEnd="@dimen/context_menu_padding_margin_large"
android:layout_marginRight="@dimen/context_menu_padding_margin_large"
android:layout_marginStart="@dimen/favorites_my_places_icon_right_padding"
android:layout_marginLeft="@dimen/favorites_my_places_icon_right_padding"
android:layout_marginEnd="@dimen/favorites_my_places_icon_right_padding"
android:layout_marginRight="@dimen/favorites_my_places_icon_right_padding"
android:paddingTop="@dimen/context_menu_padding_margin_small"
android:paddingBottom="@dimen/context_menu_padding_margin_small">

View file

@ -73,6 +73,9 @@
<dimen name="favorites_icon_right_margin">24dp</dimen>
<dimen name="favorites_icon_size">40dp</dimen>
<dimen name="favorites_my_places_icon_size">30dp</dimen>
<dimen name="favorites_my_places_icon_left_padding">13dp</dimen>
<dimen name="favorites_my_places_icon_right_padding">28dp</dimen>
<dimen name="favorites_icon_outline_size">48dp</dimen>
<dimen name="favorites_icon_padding">2dp</dimen>
<dimen name="favorites_list_item_height">60dp</dimen>

View file

@ -1032,13 +1032,8 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment implemen
int color = visible
? app.getFavorites().getColorWithCategory(model, getResources().getColor(R.color.color_favorite))
: ContextCompat.getColor(app, disabledIconColor);
int iconSize = (int) getResources().getDimension(R.dimen.favorites_icon_size);
if(model.getBackgroundType().equals(FavouritePoint.BackgroundType.CIRCLE)){
icon.setImageDrawable(UiUtilities.createTintedDrawable(getActivity(), model.getIconId(), color));
iconSize = (int) getResources().getDimension(R.dimen.standard_icon_size);
}else {
icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(), color, false, model));
}
icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(getActivity(), color, false, model));
int iconSize = (int) getResources().getDimension(R.dimen.favorites_my_places_icon_size);
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(iconSize, iconSize, CENTER);
icon.setLayoutParams(lp);
row.findViewById(R.id.group_image).setVisibility(View.GONE);

View file

@ -289,8 +289,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
@Override
public void onResume() {
super.onResume();
if (!descriptionEdit.getText().toString().isEmpty() || descriptionCaption.getVisibility() != View.VISIBLE
|| descriptionEdit.hasFocus()) {
if (!descriptionEdit.getText().toString().isEmpty() || descriptionEdit.hasFocus()) {
descriptionCaption.setVisibility(View.VISIBLE);
addDelDescription.setText(app.getString(R.string.delete_description));
} else {