From cbe7d9a73a2d4917cc55f593115e5357351009d7 Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 8 May 2018 10:54:40 +0300 Subject: [PATCH 1/9] moved rtlLanguages to super class --- .../plus/wikipedia/WikiArticleBaseDialogFragment.java | 4 ++++ .../net/osmand/plus/wikipedia/WikipediaDialogFragment.java | 6 +----- .../article/WikivoyageArticleDialogFragment.java | 7 +------ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleBaseDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleBaseDialogFragment.java index 9bf4103a5a..29edf65af9 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleBaseDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikiArticleBaseDialogFragment.java @@ -20,6 +20,9 @@ import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; public abstract class WikiArticleBaseDialogFragment extends WikiBaseDialogFragment { @@ -82,6 +85,7 @@ public abstract class WikiArticleBaseDialogFragment extends WikiBaseDialogFragme " }" + "}" + ""; + protected static final Set rtlLanguages = new HashSet<>(Arrays.asList("ar","dv","he","iw","fa","nqo","ps","sd","ug","ur","yi")); protected WebView contentWebView; protected TextView selectedLangTv; diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java index fc7a4b6382..b763d60fc6 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaDialogFragment.java @@ -38,9 +38,7 @@ import net.osmand.plus.helpers.FileNameTranslationHelper; import net.osmand.util.Algorithms; import java.io.File; -import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeSet; @@ -134,9 +132,7 @@ public class WikipediaDialogFragment extends WikiArticleBaseDialogFragment { @NonNull protected String createHtmlContent() { StringBuilder sb = new StringBuilder(HEADER_INNER); - String[] rtlLanguages = new String[]{"ar", "dv", "he", "iw", "fa", "nqo", "ps", "sd", "ug", "ur", "yi"}; - Set rtls = new HashSet<>(Arrays.asList(rtlLanguages)); - String bodyTag = rtls.contains(langSelected) ? "\n" : "\n"; + String bodyTag = rtlLanguages.contains(langSelected) ? "\n" : "\n"; sb.append(bodyTag); String nightModeClass = nightMode ? " nightmode" : ""; sb.append("
rtls = new HashSet<>(Arrays.asList(rtlLanguages)); - String bodyTag = rtls.contains(article.getLang()) ? "\n" : "\n"; + String bodyTag = rtlLanguages.contains(article.getLang()) ? "\n" : "\n"; sb.append(bodyTag); String nightModeClass = nightMode ? " nightmode" : ""; String imageTitle = article.getImageTitle(); From 17727397a87d07388cbd5fa41df9999514fd6a2c Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 8 May 2018 11:59:10 +0300 Subject: [PATCH 2/9] added WikipediaArticleWikiLinkFragment and custom xml for it --- .../bottom_sheet_item_title_with_descr.xml | 53 +++++++++++++++++++ .../layout/bottom_sheet_item_with_descr.xml | 47 ++++++++++++++++ OsmAnd/res/values-large/sizes.xml | 2 + OsmAnd/res/values/sizes.xml | 2 + OsmAnd/res/values/strings.xml | 5 ++ 5 files changed, 109 insertions(+) create mode 100644 OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml create mode 100644 OsmAnd/res/layout/bottom_sheet_item_with_descr.xml diff --git a/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml b/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml new file mode 100644 index 0000000000..422bda20fa --- /dev/null +++ b/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/bottom_sheet_item_with_descr.xml b/OsmAnd/res/layout/bottom_sheet_item_with_descr.xml new file mode 100644 index 0000000000..ce67db4d8d --- /dev/null +++ b/OsmAnd/res/layout/bottom_sheet_item_with_descr.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/values-large/sizes.xml b/OsmAnd/res/values-large/sizes.xml index 5492af1bed..fa0a2417eb 100644 --- a/OsmAnd/res/values-large/sizes.xml +++ b/OsmAnd/res/values-large/sizes.xml @@ -212,4 +212,6 @@ 60dp 66dp + 21dp + \ No newline at end of file diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index bcdb406302..f27d83c02e 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -299,6 +299,8 @@ 144dp + 14dp + 0.01 1.2 \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index e88a6eb24d..0670c56cf6 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,11 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + Open wikipedia link online + OsmAnd will redirect you to the browser and open the link online. + Get OsmAnd Live subscription to read Wikipedia and Wikivoyage articles offline. + How to open link? + Read Wikipedia offline Download all Restart Show images From dd1a19b8f82063dc95e1e7ab1340f8ed7d828cfa Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 8 May 2018 12:03:28 +0300 Subject: [PATCH 3/9] added WikipediaArticleWikiLinkFragment --- .../WikipediaArticleWikiLinkFragment.java | 130 ++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java new file mode 100644 index 0000000000..d53492f750 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java @@ -0,0 +1,130 @@ +package net.osmand.plus.wikipedia; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.net.Uri; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.v4.app.FragmentManager; +import android.view.View; + +import net.osmand.plus.R; +import net.osmand.plus.base.MenuBottomSheetDialogFragment; +import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; +import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription; +import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerHalfItem; +import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleDividerItem; +import net.osmand.plus.chooseplan.ChoosePlanDialogFragment; +import net.osmand.plus.wikivoyage.article.WikivoyageArticleWikiLinkFragment; + + +public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragment { + + public static final String TAG = WikivoyageArticleWikiLinkFragment.class.getSimpleName(); + + public static final String ARTICLE_URL_KEY = "article_url"; + private static final String WIKI_REGION = "region"; + + private String articleUrl; + private String wikiRegion; + + @Override + public void createMenuItems(Bundle savedInstanceState) { + Context ctx = getContext(); + if (ctx == null) { + return; + } + if (savedInstanceState != null) { + articleUrl = savedInstanceState.getString(ARTICLE_URL_KEY); + wikiRegion = savedInstanceState.getString(WIKI_REGION); + } else { + Bundle args = getArguments(); + if (args != null) { + articleUrl = args.getString(ARTICLE_URL_KEY); + wikiRegion = args.getString(WIKI_REGION); + } + } + + BaseBottomSheetItem wikiLinkitem = new BottomSheetItemWithDescription.Builder() + .setDescription(articleUrl) + .setTitle(getString(R.string.how_to_open_link)) + .setLayoutId(R.layout.bottom_sheet_item_with_descr) + .create(); + items.add(wikiLinkitem); + items.add(new TitleDividerItem(getContext())); + + Drawable osmandLiveIcon = getIcon(R.drawable.ic_action_subscription_osmand_live, 0); + + Drawable viewOnlineIcon = getIcon(R.drawable.ic_world_globe_dark, nightMode + ? R.color.wikivoyage_contents_parent_icon_dark : R.color.wikivoyage_contents_parent_icon_light); + + BaseBottomSheetItem wikiArticleOnlineItem = new BottomSheetItemWithDescription.Builder() + .setDescription(getString(R.string.open_wikipedia_link_online_description)) + .setIcon(viewOnlineIcon) + .setTitle(getString(R.string.open_wikipedia_link_online)) + .setLayoutId(R.layout.bottom_sheet_item_title_with_descr) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + WikipediaDialogFragment.showFullArticle(getContext(), Uri.parse(articleUrl), nightMode); + dismiss(); + } + }) + .create(); + items.add(wikiArticleOnlineItem); + + items.add(new DividerHalfItem(getContext())); + + BaseBottomSheetItem wikiArticleOfflineItem = new BottomSheetItemWithDescription.Builder() + .setDescription(getString(R.string.read_wikipedia_offline_description)) + .setIcon(osmandLiveIcon) + .setTitle(getString(R.string.read_wikipedia_offline)) + .setLayoutId(R.layout.bottom_sheet_item_title_with_descr) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + FragmentManager fm = getFragmentManager(); + if (fm != null) { + ChoosePlanDialogFragment.showWikivoyageInstance(fm); + } + dismiss(); + } + }) + .create(); + items.add(wikiArticleOfflineItem); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(ARTICLE_URL_KEY, articleUrl); + outState.putString(WIKI_REGION, wikiRegion); + } + + @Override + protected int getDismissButtonTextId() { + return R.string.shared_string_close; + } + + @Override + protected int getBgColorId() { + return nightMode ? R.color.wikivoyage_bottom_bar_bg_dark : R.color.bg_color_light; + } + + public static boolean showInstance(@NonNull FragmentManager fm, + @NonNull String region, + @NonNull String articleUrl) { + try { + Bundle args = new Bundle(); + args.putString(ARTICLE_URL_KEY, articleUrl); + args.putString(WIKI_REGION, region); + WikipediaArticleWikiLinkFragment fragment = new WikipediaArticleWikiLinkFragment(); + + fragment.setArguments(args); + fragment.show(fm, TAG); + return true; + } catch (RuntimeException e) { + return false; + } + } +} \ No newline at end of file From 89a591133d0c6fff1206bf49b0548139eabc7944 Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 8 May 2018 12:59:03 +0300 Subject: [PATCH 4/9] improved wikilinkbottomsheets ui --- .../bottom_sheet_item_title_with_descr.xml | 48 ++++++++--------- .../layout/bottom_sheet_item_with_descr.xml | 47 ---------------- .../bottom_sheet_item_with_descr_and_icon.xml | 54 +++++++++++++++++++ .../WikipediaArticleWikiLinkFragment.java | 13 ++--- .../WikivoyageArticleWikiLinkFragment.java | 14 ++--- 5 files changed, 85 insertions(+), 91 deletions(-) delete mode 100644 OsmAnd/res/layout/bottom_sheet_item_with_descr.xml create mode 100644 OsmAnd/res/layout/bottom_sheet_item_with_descr_and_icon.xml diff --git a/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml b/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml index 422bda20fa..ce67db4d8d 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml @@ -1,53 +1,47 @@ - - - + android:paddingBottom="@dimen/content_padding" + android:paddingLeft="@dimen/content_padding" + android:paddingRight="@dimen/content_padding" + android:paddingTop="@dimen/wikilink_bottom_sheet_padding"> + android:layout_weight="1" + android:orientation="vertical"> - - - \ No newline at end of file + \ No newline at end of file diff --git a/OsmAnd/res/layout/bottom_sheet_item_with_descr.xml b/OsmAnd/res/layout/bottom_sheet_item_with_descr.xml deleted file mode 100644 index ce67db4d8d..0000000000 --- a/OsmAnd/res/layout/bottom_sheet_item_with_descr.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_icon.xml b/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_icon.xml new file mode 100644 index 0000000000..a4748728f0 --- /dev/null +++ b/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_icon.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java index d53492f750..43c6270fd9 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java @@ -23,10 +23,8 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm public static final String TAG = WikivoyageArticleWikiLinkFragment.class.getSimpleName(); public static final String ARTICLE_URL_KEY = "article_url"; - private static final String WIKI_REGION = "region"; private String articleUrl; - private String wikiRegion; @Override public void createMenuItems(Bundle savedInstanceState) { @@ -36,19 +34,17 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm } if (savedInstanceState != null) { articleUrl = savedInstanceState.getString(ARTICLE_URL_KEY); - wikiRegion = savedInstanceState.getString(WIKI_REGION); } else { Bundle args = getArguments(); if (args != null) { articleUrl = args.getString(ARTICLE_URL_KEY); - wikiRegion = args.getString(WIKI_REGION); } } BaseBottomSheetItem wikiLinkitem = new BottomSheetItemWithDescription.Builder() .setDescription(articleUrl) .setTitle(getString(R.string.how_to_open_link)) - .setLayoutId(R.layout.bottom_sheet_item_with_descr) + .setLayoutId(R.layout.bottom_sheet_item_title_with_descr) .create(); items.add(wikiLinkitem); items.add(new TitleDividerItem(getContext())); @@ -62,7 +58,7 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm .setDescription(getString(R.string.open_wikipedia_link_online_description)) .setIcon(viewOnlineIcon) .setTitle(getString(R.string.open_wikipedia_link_online)) - .setLayoutId(R.layout.bottom_sheet_item_title_with_descr) + .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -79,7 +75,7 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm .setDescription(getString(R.string.read_wikipedia_offline_description)) .setIcon(osmandLiveIcon) .setTitle(getString(R.string.read_wikipedia_offline)) - .setLayoutId(R.layout.bottom_sheet_item_title_with_descr) + .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -98,7 +94,6 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(ARTICLE_URL_KEY, articleUrl); - outState.putString(WIKI_REGION, wikiRegion); } @Override @@ -112,12 +107,10 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm } public static boolean showInstance(@NonNull FragmentManager fm, - @NonNull String region, @NonNull String articleUrl) { try { Bundle args = new Bundle(); args.putString(ARTICLE_URL_KEY, articleUrl); - args.putString(WIKI_REGION, region); WikipediaArticleWikiLinkFragment fragment = new WikipediaArticleWikiLinkFragment(); fragment.setArguments(args); diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java index e53b346086..4842a8d580 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java @@ -16,7 +16,6 @@ import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription; import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerHalfItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleDividerItem; -import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.wikipedia.WikipediaDialogFragment; @@ -48,12 +47,13 @@ public class WikivoyageArticleWikiLinkFragment extends MenuBottomSheetDialogFrag wikiRegion = args.getString(WIKI_REGION); } } - items.add(new TitleItem(getString(R.string.how_to_open_wiki_title))); - BaseBottomSheetItem wikiLinkitem = new TitleItem.Builder().setTitle(articleUrl) - .setTitleColorId(nightMode + BaseBottomSheetItem wikiLinkitem = new BottomSheetItemWithDescription.Builder() + .setDescription(articleUrl) + .setDescriptionColorId(nightMode ? R.color.wikivoyage_contents_parent_icon_dark : R.color.wikivoyage_contents_parent_icon_light) - .setLayoutId(R.layout.bottom_sheet_item_title) + .setTitle(getString(R.string.how_to_open_wiki_title)) + .setLayoutId(R.layout.bottom_sheet_item_title_with_descr) .create(); items.add(wikiLinkitem); items.add(new TitleDividerItem(getContext())); @@ -69,7 +69,7 @@ public class WikivoyageArticleWikiLinkFragment extends MenuBottomSheetDialogFrag getString(R.string.download_wiki_region_placeholder) : wikiRegion)) .setIcon(downloadIcon) .setTitle(getString(R.string.download_wikipedia_label)) - .setLayoutId(R.layout.bottom_sheet_item_with_descr_56dp) + .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -92,7 +92,7 @@ public class WikivoyageArticleWikiLinkFragment extends MenuBottomSheetDialogFrag .setDescription(getString(R.string.open_in_browser_wiki_description)) .setIcon(viewOnlineIcon) .setTitle(getString(R.string.open_in_browser_wiki)) - .setLayoutId(R.layout.bottom_sheet_item_with_descr_56dp) + .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { From 5967558f570a6fac352415b10311dfea26d8b5e7 Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 8 May 2018 13:13:57 +0300 Subject: [PATCH 5/9] add padding to bottom_sheet_menu_base --- OsmAnd/res/layout/bottom_sheet_menu_base.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/OsmAnd/res/layout/bottom_sheet_menu_base.xml b/OsmAnd/res/layout/bottom_sheet_menu_base.xml index 7e98ba5ca1..f79b16d55b 100644 --- a/OsmAnd/res/layout/bottom_sheet_menu_base.xml +++ b/OsmAnd/res/layout/bottom_sheet_menu_base.xml @@ -27,6 +27,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" + android:paddingBottom="@dimen/bottom_sheet_content_padding_small" android:visibility="gone"/> Date: Tue, 8 May 2018 13:15:04 +0300 Subject: [PATCH 6/9] removed unnecessary method --- .../article/WikivoyageArticleWikiLinkFragment.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java index 4842a8d580..d81a577702 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java @@ -111,11 +111,6 @@ public class WikivoyageArticleWikiLinkFragment extends MenuBottomSheetDialogFrag outState.putString(WIKI_REGION, wikiRegion); } - @Override - protected boolean useScrollableItemsContainer() { - return false; - } - @Override protected int getBgColorId() { return nightMode ? R.color.wikivoyage_bottom_bar_bg_dark : R.color.bg_color_light; From 6866288068423524b3329fe72609c5864f13798d Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 8 May 2018 13:36:39 +0300 Subject: [PATCH 7/9] removed unnecessary LinearLayout --- .../layout/bottom_sheet_item_title_with_descr.xml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml b/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml index ce67db4d8d..11544cea1e 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_title_with_descr.xml @@ -9,14 +9,8 @@ android:paddingBottom="@dimen/content_padding" android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" - android:paddingTop="@dimen/wikilink_bottom_sheet_padding"> - - + android:paddingTop="@dimen/wikilink_bottom_sheet_padding" + android:orientation="vertical"> - - \ No newline at end of file From 88e13ebe115ab5f86bd74d2fed0c1defa48e43f8 Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 8 May 2018 13:53:58 +0300 Subject: [PATCH 8/9] removed saveinstanceState and padding in bottom_sheet_menu_base --- OsmAnd/res/layout/bottom_sheet_menu_base.xml | 1 - .../WikipediaArticleWikiLinkFragment.java | 24 ++++++------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_menu_base.xml b/OsmAnd/res/layout/bottom_sheet_menu_base.xml index f79b16d55b..7e98ba5ca1 100644 --- a/OsmAnd/res/layout/bottom_sheet_menu_base.xml +++ b/OsmAnd/res/layout/bottom_sheet_menu_base.xml @@ -27,7 +27,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingBottom="@dimen/bottom_sheet_content_padding_small" android:visibility="gone"/> Date: Tue, 8 May 2018 13:58:22 +0300 Subject: [PATCH 9/9] rename xml bottom_sheet_item_in_frame_with_descr_and_icon --- ...xml => bottom_sheet_item_in_frame_with_descr_and_icon.xml} | 0 .../plus/wikipedia/WikipediaArticleWikiLinkFragment.java | 4 ++-- .../wikivoyage/article/WikivoyageArticleWikiLinkFragment.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename OsmAnd/res/layout/{bottom_sheet_item_with_descr_and_icon.xml => bottom_sheet_item_in_frame_with_descr_and_icon.xml} (100%) diff --git a/OsmAnd/res/layout/bottom_sheet_item_with_descr_and_icon.xml b/OsmAnd/res/layout/bottom_sheet_item_in_frame_with_descr_and_icon.xml similarity index 100% rename from OsmAnd/res/layout/bottom_sheet_item_with_descr_and_icon.xml rename to OsmAnd/res/layout/bottom_sheet_item_in_frame_with_descr_and_icon.xml diff --git a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java index 6ad00ec385..71fac1e1e4 100644 --- a/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikipedia/WikipediaArticleWikiLinkFragment.java @@ -54,7 +54,7 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm .setDescription(getString(R.string.open_wikipedia_link_online_description)) .setIcon(viewOnlineIcon) .setTitle(getString(R.string.open_wikipedia_link_online)) - .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) + .setLayoutId(R.layout.bottom_sheet_item_in_frame_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -71,7 +71,7 @@ public class WikipediaArticleWikiLinkFragment extends MenuBottomSheetDialogFragm .setDescription(getString(R.string.read_wikipedia_offline_description)) .setIcon(osmandLiveIcon) .setTitle(getString(R.string.read_wikipedia_offline)) - .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) + .setLayoutId(R.layout.bottom_sheet_item_in_frame_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java index d81a577702..8ea4c9938b 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/article/WikivoyageArticleWikiLinkFragment.java @@ -69,7 +69,7 @@ public class WikivoyageArticleWikiLinkFragment extends MenuBottomSheetDialogFrag getString(R.string.download_wiki_region_placeholder) : wikiRegion)) .setIcon(downloadIcon) .setTitle(getString(R.string.download_wikipedia_label)) - .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) + .setLayoutId(R.layout.bottom_sheet_item_in_frame_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -92,7 +92,7 @@ public class WikivoyageArticleWikiLinkFragment extends MenuBottomSheetDialogFrag .setDescription(getString(R.string.open_in_browser_wiki_description)) .setIcon(viewOnlineIcon) .setTitle(getString(R.string.open_in_browser_wiki)) - .setLayoutId(R.layout.bottom_sheet_item_with_descr_and_icon) + .setLayoutId(R.layout.bottom_sheet_item_in_frame_with_descr_and_icon) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {