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 736c374604..53b883f7c4 100644 --- a/android/app/src/main/java/app/organicmaps/editor/EditorFragment.java +++ b/android/app/src/main/java/app/organicmaps/editor/EditorFragment.java @@ -50,6 +50,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe private View mCardName; private View mCardAddress; private View mCardDetails; + private View mCardSocialMedia; + private View mCardBuilding; private RecyclerView mNamesView; @@ -93,7 +95,6 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe private TextView mStreet; private TextInputEditText mHouseNumber; - private View mBlockLevels; private TextInputEditText mBuildingLevels; // Define Metadata entries, that have more tricky logic, separately. @@ -135,6 +136,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe private View mEditOpeningHours; private TextInputEditText mDescription; private final Map mDetailsBlocks = new HashMap<>(); + private final Map mSocialMediaBlocks = new HashMap<>(); private TextView mReset; private EditorHostFragment mParent; @@ -300,29 +302,29 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe { UiUtils.showIf(Editor.nativeIsNameEditable(), mCardName); UiUtils.showIf(Editor.nativeIsAddressEditable(), mCardAddress); - UiUtils.showIf(Editor.nativeIsBuilding() && !Editor.nativeIsPointType(), mBlockLevels); + UiUtils.showIf(Editor.nativeIsBuilding() && !Editor.nativeIsPointType(), mCardBuilding); final int[] editableDetails = Editor.nativeGetEditableProperties(); - if (editableDetails.length == 0) - { - UiUtils.hide(mCardDetails); - return; - } - for (var e : mDetailsBlocks.entrySet()) + setCardVisibility(mCardDetails, mDetailsBlocks, editableDetails); + setCardVisibility(mCardSocialMedia, mSocialMediaBlocks, editableDetails); + } + + private void setCardVisibility(View card, Map blocks, int[] editableDetails) { + for (var e : blocks.entrySet()) UiUtils.hide(e.getValue()); - boolean anyEditableDetails = false; + boolean anyBlockElement = false; for (int type : editableDetails) { - final View detailsBlock = mDetailsBlocks.get(Metadata.MetadataType.fromInt(type)); - if (detailsBlock == null) + final View blockElement = blocks.get(Metadata.MetadataType.fromInt(type)); + if (blockElement == null) continue; - anyEditableDetails = true; - UiUtils.show(detailsBlock); + anyBlockElement = true; + UiUtils.show(blockElement); } - UiUtils.showIf(anyEditableDetails, mCardDetails); + UiUtils.showIf(anyBlockElement, card); } private void refreshOpeningTime() @@ -412,6 +414,8 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe mCardName = view.findViewById(R.id.cv__name); mCardAddress = view.findViewById(R.id.cv__address); mCardDetails = view.findViewById(R.id.cv__details); + mCardSocialMedia = view.findViewById(R.id.cv__social_media); + mCardBuilding = view.findViewById(R.id.cv__building); initNamesView(view); // Address @@ -424,7 +428,7 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe initBlock(view, Metadata.MetadataType.FMD_POSTCODE, R.id.block_zipcode, 0, R.string.editor_zip_code, 0); // Details - mBlockLevels = view.findViewById(R.id.block_levels); + View mBlockLevels = view.findViewById(R.id.block_levels); mBuildingLevels = findInputAndInitBlock(mBlockLevels, 0, getString(R.string.editor_storey_number, Editor.nativeGetMaxEditableBuildingLevels())); mBuildingLevels.setInputType(InputType.TYPE_CLASS_NUMBER); @@ -493,12 +497,13 @@ public class EditorFragment extends BaseMwmFragment implements View.OnClickListe mDetailsBlocks.put(Metadata.MetadataType.FMD_WEBSITE, websiteBlock); mDetailsBlocks.put(Metadata.MetadataType.FMD_WEBSITE_MENU, websiteMenuBlock); mDetailsBlocks.put(Metadata.MetadataType.FMD_EMAIL, emailBlock); - mDetailsBlocks.put(Metadata.MetadataType.FMD_CONTACT_FACEBOOK, facebookContactBlock); - mDetailsBlocks.put(Metadata.MetadataType.FMD_CONTACT_INSTAGRAM, instagramContactBlock); - mDetailsBlocks.put(Metadata.MetadataType.FMD_CONTACT_TWITTER, twitterContactBlock); - mDetailsBlocks.put(Metadata.MetadataType.FMD_CONTACT_VK, vkContactBlock); - mDetailsBlocks.put(Metadata.MetadataType.FMD_CONTACT_LINE, lineContactBlock); mDetailsBlocks.put(Metadata.MetadataType.FMD_OPERATOR, operatorBlock); + + 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); } private static TextInputEditText findInput(View blockWithInput) diff --git a/android/app/src/main/res/layout/fragment_editor.xml b/android/app/src/main/res/layout/fragment_editor.xml index d5603d7490..92f53510ef 100644 --- a/android/app/src/main/res/layout/fragment_editor.xml +++ b/android/app/src/main/res/layout/fragment_editor.xml @@ -123,9 +123,6 @@ - + + + + @@ -219,13 +225,11 @@ - - + + @@ -305,12 +309,28 @@ android:layout_alignParentEnd="true" android:layout_centerVertical="true"/> + + - + + + - @@ -328,6 +348,33 @@ layout="@layout/item_editor_input"/> + + + + + + + + + + diff --git a/data/strings/strings.txt b/data/strings/strings.txt index 48539786be..71da9485fe 100644 --- a/data/strings/strings.txt +++ b/data/strings/strings.txt @@ -14827,6 +14827,96 @@ zh-Hans = 详细信息 zh-Hant = 詳細資訊 + [social_media] + tags = android + en = Social Media + af = Sosiale media + ar = وسائل التواصل الاجتماعي + az = Sosial Media + be = Сацыяльныя сеткі + bg = Социални медии + ca = Mitjans Socials + cs = Sociální média + da = Sociale medier + de = Social Media + el = Μέσα κοινωνικής δικτύωσης + es = Redes sociales + et = Sotsiaalmeedia + eu = Sare sozialak + fa = رسانه های اجتماعی + fi = Sosiaalinen media + fr = Réseaux sociaux + he = מדיה חברתית + hi = सोशल मीडिया + hu = Közösségi média + id = Media Sosial + it = I social media + ja = ソーシャルメディア + ko = 소셜 미디어 + lt = Socialinė žiniasklaida + lv = Sociālie tīkli + mr = सोशल मीडिया + nb = Sosiale medier + nl = Sociale media + pl = Media społecznościowe + pt = Redes sociais + ro = Social Media + ru = Социальные сети + sk = Sociálne médiá + sv = Sociala medier + sw = Mitandao ya Kijamii + th = โซเชียลมีเดีย + tr = Sosyal Medya + uk = Соціальні мережі + vi = Truyền thông xã hội + zh-Hans = 社交媒体 + zh-Hant = 社群媒體 + + [building] + tags = android + en = Building + af = Gebou + ar = البناء + az = bina + be = Будынак + bg = Сграда + ca = Edifici + cs = Budova + da = Bygning + de = Gebäude + el = Κτίριο + es = Edificio + et = Hoone + eu = Eraikina + fa = ساختمان + fi = Rakennus + fr = Bâtiment + he = בִּניָן + hi = इमारत + hu = Épület + id = Bangunan + it = Edificio + ja = 建物 + ko = 빌딩 + lt = Pastatas + lv = Ēka + mr = इमारत + nb = Bygning + nl = Gebouw + pl = Budynek + pt = Edifício + ro = Clădire + ru = Здание + sk = Budova + sv = Byggnad + sw = Jengo + th = อาคาร + tr = Bina + uk = Будівля + vi = Xây dựng + zh-Hans = 建筑 + zh-Hant = 大樓 + [add_street] comment = Text field to enter non-existing street name, below list of known streets around tags = android,ios