diff --git a/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java b/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java index e414cbb793..e2078103bc 100644 --- a/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java +++ b/android/app/src/main/java/app/organicmaps/bookmarks/data/Metadata.java @@ -67,7 +67,9 @@ public class Metadata implements Parcelable FMD_WEBSITE_MENU(46), FMD_SELF_SERVICE(47), FMD_OUTDOOR_SEATING(48), - FMD_NETWORK(49); + FMD_NETWORK(49), + FMD_CONTACT_FEDIVERSE(50), + FMD_CONTACT_BLUESKY(51); private final int mMetaType; MetadataType(int metadataType) diff --git a/android/app/src/main/java/app/organicmaps/editor/EditorFragment.java b/android/app/src/main/java/app/organicmaps/editor/EditorFragment.java index 86ab7b1e7d..0374e5d33a 100644 --- a/android/app/src/main/java/app/organicmaps/editor/EditorFragment.java +++ b/android/app/src/main/java/app/organicmaps/editor/EditorFragment.java @@ -189,11 +189,13 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe initMetadataEntry(Metadata.MetadataType.FMD_WEBSITE, R.string.error_enter_correct_web); initMetadataEntry(Metadata.MetadataType.FMD_WEBSITE_MENU, R.string.error_enter_correct_web); initMetadataEntry(Metadata.MetadataType.FMD_EMAIL, R.string.error_enter_correct_email); + initMetadataEntry(Metadata.MetadataType.FMD_CONTACT_FEDIVERSE, R.string.error_enter_correct_fediverse_page); initMetadataEntry(Metadata.MetadataType.FMD_CONTACT_FACEBOOK, R.string.error_enter_correct_facebook_page); initMetadataEntry(Metadata.MetadataType.FMD_CONTACT_INSTAGRAM, R.string.error_enter_correct_instagram_page); initMetadataEntry(Metadata.MetadataType.FMD_CONTACT_TWITTER, R.string.error_enter_correct_twitter_page); initMetadataEntry(Metadata.MetadataType.FMD_CONTACT_VK, R.string.error_enter_correct_vk_page); initMetadataEntry(Metadata.MetadataType.FMD_CONTACT_LINE, R.string.error_enter_correct_line_page); + initMetadataEntry(Metadata.MetadataType.FMD_CONTACT_BLUESKY, R.string.error_enter_correct_bluesky_page); mCuisine.setText(Editor.nativeGetFormattedCuisine()); String selfServiceMetadata = Editor.nativeGetMetadata(Metadata.MetadataType.FMD_SELF_SERVICE.toInt()); @@ -444,6 +446,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe R.drawable.ic_website_menu, R.string.website_menu, InputType.TYPE_TEXT_VARIATION_URI); View emailBlock = initBlock(view, Metadata.MetadataType.FMD_EMAIL, R.id.block_email, R.drawable.ic_email, R.string.email, InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); + View fediverseContactBlock = initBlock(view, Metadata.MetadataType.FMD_CONTACT_FEDIVERSE, R.id.block_fediverse, + R.drawable.ic_mastodon_white, R.string.mastodon, InputType.TYPE_TEXT_VARIATION_URI); View facebookContactBlock = initBlock(view, Metadata.MetadataType.FMD_CONTACT_FACEBOOK, R.id.block_facebook, R.drawable.ic_facebook_white, R.string.facebook, InputType.TYPE_TEXT_VARIATION_URI); View instagramContactBlock = initBlock(view, Metadata.MetadataType.FMD_CONTACT_INSTAGRAM, R.id.block_instagram, @@ -454,6 +458,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe R.drawable.ic_vk_white, R.string.vk, InputType.TYPE_TEXT_VARIATION_URI); View lineContactBlock = initBlock(view, Metadata.MetadataType.FMD_CONTACT_LINE, R.id.block_line, R.drawable.ic_line_white, R.string.editor_line_social_network, InputType.TYPE_TEXT_VARIATION_URI); + View blueskyContactBlock = initBlock(view, Metadata.MetadataType.FMD_CONTACT_BLUESKY, R.id.block_bluesky, + R.drawable.ic_bluesky_white, R.string.bluesky, InputType.TYPE_TEXT_VARIATION_URI); View operatorBlock = initBlock(view, Metadata.MetadataType.FMD_OPERATOR, R.id.block_operator, R.drawable.ic_operator, R.string.editor_operator, 0); @@ -499,11 +505,13 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe mDetailsBlocks.put(Metadata.MetadataType.FMD_EMAIL, emailBlock); mDetailsBlocks.put(Metadata.MetadataType.FMD_OPERATOR, operatorBlock); + mSocialMediaBlocks.put(Metadata.MetadataType.FMD_CONTACT_FEDIVERSE, fediverseContactBlock); mSocialMediaBlocks.put(Metadata.MetadataType.FMD_CONTACT_FACEBOOK, facebookContactBlock); mSocialMediaBlocks.put(Metadata.MetadataType.FMD_CONTACT_INSTAGRAM, instagramContactBlock); mSocialMediaBlocks.put(Metadata.MetadataType.FMD_CONTACT_TWITTER, twitterContactBlock); mSocialMediaBlocks.put(Metadata.MetadataType.FMD_CONTACT_VK, vkContactBlock); mSocialMediaBlocks.put(Metadata.MetadataType.FMD_CONTACT_LINE, lineContactBlock); + mSocialMediaBlocks.put(Metadata.MetadataType.FMD_CONTACT_BLUESKY, blueskyContactBlock); } private static TextInputEditText findInput(View blockWithInput) diff --git a/android/app/src/main/java/app/organicmaps/widget/placepage/sections/PlacePageLinksFragment.java b/android/app/src/main/java/app/organicmaps/widget/placepage/sections/PlacePageLinksFragment.java index b6754928f8..0cf56b9c19 100644 --- a/android/app/src/main/java/app/organicmaps/widget/placepage/sections/PlacePageLinksFragment.java +++ b/android/app/src/main/java/app/organicmaps/widget/placepage/sections/PlacePageLinksFragment.java @@ -41,6 +41,10 @@ public class PlacePageLinksFragment extends Fragment implements Observer mMapObject.getWebsiteUrl(false /* strip */, Metadata.MetadataType.FMD_WEBSITE_MENU); - case FMD_CONTACT_FACEBOOK, FMD_CONTACT_INSTAGRAM, FMD_CONTACT_TWITTER, FMD_CONTACT_VK, FMD_CONTACT_LINE -> + case FMD_CONTACT_FACEBOOK, FMD_CONTACT_INSTAGRAM, FMD_CONTACT_TWITTER, + FMD_CONTACT_FEDIVERSE, FMD_CONTACT_BLUESKY, FMD_CONTACT_VK, FMD_CONTACT_LINE -> { if (TextUtils.isEmpty(mMapObject.getMetadata(type))) yield ""; @@ -153,6 +158,16 @@ public class PlacePageLinksFragment extends Fragment implements Observer openUrl(Metadata.MetadataType.FMD_CONTACT_INSTAGRAM)); mInstagramPage.setOnLongClickListener((v) -> copyUrl(mInstagramPage, Metadata.MetadataType.FMD_CONTACT_INSTAGRAM)); + mFediversePage = mFrame.findViewById(R.id.ll__place_fediverse); + mTvFediversePage = mFrame.findViewById(R.id.tv__place_fediverse_page); + mFediversePage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_FEDIVERSE)); + mFediversePage.setOnLongClickListener((v) -> copyUrl(mFediversePage, Metadata.MetadataType.FMD_CONTACT_FEDIVERSE)); + + mBlueskyPage = mFrame.findViewById(R.id.ll__place_bluesky); + mTvBlueskyPage = mFrame.findViewById(R.id.tv__place_bluesky_page); + mBlueskyPage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_BLUESKY)); + mBlueskyPage.setOnLongClickListener((v) -> copyUrl(mBlueskyPage, Metadata.MetadataType.FMD_CONTACT_BLUESKY)); + mTwitterPage = mFrame.findViewById(R.id.ll__place_twitter); mTvTwitterPage = mFrame.findViewById(R.id.tv__place_twitter_page); mTwitterPage.setOnClickListener((v) -> openUrl(Metadata.MetadataType.FMD_CONTACT_TWITTER)); @@ -216,6 +231,12 @@ public class PlacePageLinksFragment extends Fragment implements Observer + + diff --git a/android/app/src/main/res/drawable/ic_mastodon_white.xml b/android/app/src/main/res/drawable/ic_mastodon_white.xml new file mode 100644 index 0000000000..d3dc1b2c61 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_mastodon_white.xml @@ -0,0 +1,10 @@ + + + diff --git a/android/app/src/main/res/layout/fragment_editor.xml b/android/app/src/main/res/layout/fragment_editor.xml index 9ea65f5cb9..7a2f818a3e 100644 --- a/android/app/src/main/res/layout/fragment_editor.xml +++ b/android/app/src/main/res/layout/fragment_editor.xml @@ -331,6 +331,9 @@ android:textAppearance="@style/MwmTextAppearance.Body3" tools:ignore="UnusedAttribute"/> + @@ -346,6 +349,9 @@ + diff --git a/android/app/src/main/res/layout/place_page_bluesky.xml b/android/app/src/main/res/layout/place_page_bluesky.xml new file mode 100644 index 0000000000..43f5219457 --- /dev/null +++ b/android/app/src/main/res/layout/place_page_bluesky.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/android/app/src/main/res/layout/place_page_fediverse.xml b/android/app/src/main/res/layout/place_page_fediverse.xml new file mode 100644 index 0000000000..c54d57fc1a --- /dev/null +++ b/android/app/src/main/res/layout/place_page_fediverse.xml @@ -0,0 +1,25 @@ + + + + + + + diff --git a/android/app/src/main/res/layout/place_page_links_fragment.xml b/android/app/src/main/res/layout/place_page_links_fragment.xml index d7f1f99647..0db6e7c254 100644 --- a/android/app/src/main/res/layout/place_page_links_fragment.xml +++ b/android/app/src/main/res/layout/place_page_links_fragment.xml @@ -13,11 +13,13 @@ android:layout_height="wrap_content" tools:layout="@layout/place_page_phone_fragment" /> + + \ No newline at end of file