diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleContentsFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleContentsFragment.java index 3d8e1df10a..c9c92bbdf0 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleContentsFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleContentsFragment.java @@ -29,6 +29,7 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag public static final String CONTENTS_JSON_KEY = "contents_json"; public static final String CONTENTS_LINK_KEY = "contents_link"; + public static final String CONTENTS_TITLE_KEY = "title"; public static final int REQUEST_LINK_CODE = 0; @@ -70,8 +71,10 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag @Override public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { - String link = contentItem.getSubItems().get(groupPosition).getSubItems().get(childPosition).getLink(); - sendResult(link); + WikivoyageContentItem wikivoyageContentItem = contentItem.getSubItems().get(groupPosition); + String link = wikivoyageContentItem.getSubItems().get(childPosition).getLink(); + String name = wikivoyageContentItem.getLink().substring(1); + sendResults(link, name); dismiss(); return false; } @@ -79,8 +82,10 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag expListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { - String link = contentItem.getSubItems().get(groupPosition).getLink(); - sendResult(link); + WikivoyageContentItem wikivoyageContentItem = contentItem.getSubItems().get(groupPosition); + String link = wikivoyageContentItem.getLink(); + String name = wikivoyageContentItem.getLink().substring(1); + sendResults(link, name); dismiss(); return false; } @@ -91,9 +96,10 @@ public class WikivoyageArticleContentsFragment extends MenuBottomSheetDialogFrag items.add(new SimpleBottomSheetItem.Builder().setCustomView(container).create()); } - private void sendResult(String link) { + private void sendResults(String link, String name) { Intent intent = new Intent(); intent.putExtra(CONTENTS_LINK_KEY, link); + intent.putExtra(CONTENTS_TITLE_KEY, name); Fragment fragment = getTargetFragment(); if (fragment != null) { fragment.onActivityResult(getTargetRequestCode(), REQUEST_LINK_CODE, intent); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java index 216390f1db..093ace0b11 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleDialogFragment.java @@ -48,9 +48,29 @@ public class WikivoyageArticleDialogFragment extends WikivoyageBaseDialogFragmen "\n" + "\n" + "\n" + - "
\n" + ""; - private static final String FOOTER_INNER = "