[android] Fix bookmark icon in place plage

Signed-off-by: Andrei Shkrob <github@shkrob.dev>
This commit is contained in:
Andrei Shkrob
2025-08-07 18:31:11 +02:00
committed by Konstantin Pastbin
parent e98ecce375
commit 89d82be2b9
2 changed files with 23 additions and 27 deletions

View File

@@ -484,8 +484,7 @@ public class PlacePageView extends Fragment
Icon icon = bookmark.getIcon();
if (icon != null)
{
Drawable circle = Graphics.drawCircleAndImage(icon.argb(), R.dimen.place_page_icon_size,
app.organicmaps.sdk.R.drawable.ic_bookmark_none,
Drawable circle = Graphics.drawCircleAndImage(icon.argb(), R.dimen.place_page_icon_size, icon.getResId(),
R.dimen.place_page_icon_mark_size, requireContext());
mColorIcon.setImageDrawable(circle);
mTvCategory.setText(BookmarkManager.INSTANCE.getCategoryById(bookmark.getCategoryId()).getName());
@@ -521,10 +520,10 @@ public class PlacePageView extends Fragment
Drawable circle = Graphics.drawCircle(to, R.dimen.place_page_icon_size, requireContext().getResources());
mColorIcon.setImageDrawable(circle);
});
dialogFragment.show(requireActivity().getSupportFragmentManager(), null);
}
else if (mMapObject.isBookmark())
{
dialogFragment.show(requireActivity().getSupportFragmentManager(), null);
final Bookmark bookmark = (Bookmark) mMapObject;
args.putInt(BookmarkColorDialogFragment.ICON_COLOR, bookmark.getIcon().getColor());
args.putInt(BookmarkColorDialogFragment.ICON_RES, bookmark.getIcon().getResId());
@@ -534,8 +533,7 @@ public class PlacePageView extends Fragment
if (from == to)
return;
bookmark.setIconColor(to);
Drawable circle = Graphics.drawCircleAndImage(to, R.dimen.place_page_icon_size,
app.organicmaps.sdk.R.drawable.ic_bookmark_none,
Drawable circle = Graphics.drawCircleAndImage(to, R.dimen.place_page_icon_size, bookmark.getIcon().getResId(),
R.dimen.place_page_icon_mark_size, requireContext());
mColorIcon.setImageDrawable(circle);
});

View File

@@ -186,35 +186,35 @@
android:layout_marginTop="@dimen/margin_half"
android:orientation="vertical">
<include layout="@layout/place_page_shadow_gap" />
<RelativeLayout
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?ppBackground">
android:background="?ppBackground"
android:orientation="horizontal">
<ImageView
android:id="@+id/item_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_width="@dimen/place_page_icon_size"
android:layout_height="@dimen/place_page_icon_size"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/margin_half_plus"
android:layout_marginEnd="@dimen/margin_half"
android:layout_marginStart="@dimen/margin_half_plus"
android:layout_marginTop="@dimen/margin_half_plus"
android:background="?clickableBackground"
android:layout_centerVertical="true"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="8dp"
android:paddingVertical="5dp" />
tools:src="@drawable/ic_bookmark_none"
tools:tint="@color/base_red" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/tv__category"
style="@style/PlacePageMetadataText.Button"
android:layout_alignParentTop="true"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/edit_Bookmark"
android:layout_toEndOf="@id/item_icon"
android:layout_width="0dp"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/margin_quarter"
android:layout_marginStart="@dimen/margin_quarter"
android:layout_weight="1"
android:background="?clickableBackground"
android:paddingStart="@dimen/margin_quarter"
android:paddingEnd="@dimen/margin_quarter"
android:textAllCaps="false"
tools:text="@string/categories" />
<ImageView
@@ -222,15 +222,13 @@
style="@style/MwmWidget.Editor.MetadataIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_gravity="center"
android:layout_margin="@dimen/margin_base"
android:background="?clickableBackground"
android:clickable="true"
android:focusable="true"
android:src="@drawable/ic_edit" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<androidx.fragment.app.FragmentContainerView
android:id="@+id/place_page_track_fragment"