From 8b6ed12f83cd76101f0dc4716f7de57fd0f5d458 Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Tue, 3 Nov 2015 16:39:13 +0200 Subject: [PATCH] Help fixes --- OsmAnd/build.gradle | 60 +++++++-------- OsmAnd/res/layout/help_to_improve_item.xml | 4 +- OsmAnd/res/values-be/strings.xml | 2 +- OsmAnd/res/values-cs/strings.xml | 2 +- OsmAnd/res/values-da/strings.xml | 2 +- OsmAnd/res/values-es-rAR/strings.xml | 2 +- OsmAnd/res/values-es/strings.xml | 2 +- OsmAnd/res/values-fr/strings.xml | 2 +- OsmAnd/res/values-hu/strings.xml | 2 +- OsmAnd/res/values-lt/strings.xml | 2 +- OsmAnd/res/values-ru/strings.xml | 2 +- OsmAnd/res/values-sc/strings.xml | 2 +- OsmAnd/res/values-sk/strings.xml | 2 +- OsmAnd/res/values-sl/strings.xml | 2 +- OsmAnd/res/values-zh-rTW/strings.xml | 2 +- OsmAnd/res/values/strings.xml | 2 +- .../src/net/osmand/plus/AppInitializer.java | 2 +- .../helpscreen/HelpArticleDialogFragment.java | 48 ++++++++++-- .../{MyMenuItem.java => HelpMenuItem.java} | 20 ++--- .../helpscreen/HelpScreenDialogFragment.java | 77 +++++++++---------- 20 files changed, 135 insertions(+), 104 deletions(-) rename OsmAnd/src/net/osmand/plus/dialogs/helpscreen/{MyMenuItem.java => HelpMenuItem.java} (76%) diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index c29fae8c7c..9fdd4846f0 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -140,15 +140,15 @@ android { buildTypes { debug { - // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' - // minifyEnabled true - // proguardFiles 'proguard-project.txt' + // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' + // minifyEnabled true + // proguardFiles 'proguard-project.txt' signingConfig signingConfigs.development } release { - // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' - // minifyEnabled true - //proguardFiles 'proguard-project.txt' + // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' + // minifyEnabled true + //proguardFiles 'proguard-project.txt' signingConfig signingConfigs.publishing } } @@ -198,24 +198,24 @@ task collectFonts(type: Copy) { include "*.ttf" } -task collectHelpContentsAssets(type: Sync) { - from "../../help/help" - into "assets/help" - include "*.html" - include "images/**/*.png" +task collectHelpContentsAssets(type: Copy) { + from("assets/") { +// include "style.css" + } + from("../../help/help-online") { + include "TechnicalArticles.html" + include "about.html" + } + from("../../help/help") { + include "faq.html" + include "osmo-plugin.html" + include "changes.html" + } + from("../../help/website/feature_articles"){ + include "*.html" + } - from "assets/" - into "assets/help" - include "style.css" - - from "../../help/website/feature_articles" into "assets/feature_articles" - include "*.html" - - from "../../help/help_online" - into "assets/feature_articles" - include "TechnicalArticles.html" - include "about.html" } task collectRoutingResources(type: Sync) { @@ -225,13 +225,13 @@ task collectRoutingResources(type: Sync) { } task collectMiscResources(type: Copy) { - into "src/net/osmand/osm" - from("../../resources/obf_creation") { - include "rendering_types.xml" - } - from("../../resources/poi") { - include "poi_types.xml" - } + into "src/net/osmand/osm" + from("../../resources/obf_creation") { + include "rendering_types.xml" + } + from("../../resources/poi") { + include "poi_types.xml" + } } task collectRenderingStylesResources(type: Sync) { @@ -302,7 +302,7 @@ tasks.withType(JavaCompile) { clean.dependsOn 'cleanNoTranslate' task cleanNoTranslate() { - delete ('res/values/no_translate.xml') + delete('res/values/no_translate.xml') } repositories { diff --git a/OsmAnd/res/layout/help_to_improve_item.xml b/OsmAnd/res/layout/help_to_improve_item.xml index 53e2aa5359..63c78e73ad 100644 --- a/OsmAnd/res/layout/help_to_improve_item.xml +++ b/OsmAnd/res/layout/help_to_improve_item.xml @@ -8,12 +8,12 @@ android:paddingBottom="16dp"> Імітаваць першы старт праграмы QR-код Мапа сьцягнутая - галасаваньне + галасаваньне \ No newline at end of file diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index f2f6f7f888..6ef7fef425 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1979,7 +1979,7 @@ Instalace a řešení problémů Technické články Verze - Anketa + Anketa Kontaktujte nás Vytvořen OSM POI Vytvořena OSM chyba diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 5a4f947bee..c355b16c01 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1998,7 +1998,7 @@ Installation og fejlfinding Tekniske artikler Versioner - Meningsmåling + Meningsmåling Kontakt os Oprettede OSM IP Oprettede OSM fejlregistrering diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index ea9028b22e..a97767b1fd 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -2011,7 +2011,7 @@ Instalación y solución de problemas Artículos técnicos Versiones - Encuesta + Encuesta Contáctenos PDI de OSM creado Reporte de OSM creado diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 97ccf9dfdc..526226d080 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -2131,7 +2131,7 @@ Instalación y solución de problemas Artículos técnicos Versiones - Encuesta + Encuesta Contáctenos PDI de OSM creado Nota de OSM creada diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index eccdfc2f3d..f4ede10d17 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -2071,7 +2071,7 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et Installation et débogage Articles techniques Versions - Sondage + Sondage Nous contacter PI créés sur OSM diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 4f6630fccf..2b59af19a8 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -1982,6 +1982,6 @@ Telepítés és hibaelhárítás Technikai cikkek Verziók - szavazás + szavazás Kapcsolat \ No newline at end of file diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml index 13919e26fd..54d0046fed 100644 --- a/OsmAnd/res/values-lt/strings.xml +++ b/OsmAnd/res/values-lt/strings.xml @@ -1976,5 +1976,5 @@ Garso/vaizdo pastabos Techniniai straipsniai - apklausa + apklausa \ No newline at end of file diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 2058d7bfd8..09a9541111 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -1986,7 +1986,7 @@ Карта %1$s загружена. Вернитесь к карте, чтобы начать её использовать. Имитировать первый запуск Устанавливает признак первого запуска приложения, не изменяет других настроек - Опрос + Опрос Связаться с нами Версии Технические статьи diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 324927256b..4decd06496 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -1971,7 +1971,7 @@ Installatzione e solutziones a sos problemas Artìculos tècnicos Versiones - Sondàggiu + Sondàggiu Cuntata·nos PDI de OSM creadu Nota de errore de OSM creada diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 3e0ebe2f1c..a02075bf58 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -2139,6 +2139,6 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Inštalácia a riešenie problémov Technické články Verzie - Anketa + Anketa Kontaktujte nás \ No newline at end of file diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml index 22a8b67ea5..8a839319d7 100644 --- a/OsmAnd/res/values-sl/strings.xml +++ b/OsmAnd/res/values-sl/strings.xml @@ -1971,7 +1971,7 @@ Namestitev in odpravljanje napak Tehnični članki Različice - Anketa + Anketa Stik z nami Osnovni svetovni zemljevid (zemljevid sveta pri oddaljenem pogledu) je zastarel, ali pa ni nameščen. Brez tega zemljevida prikaz ni popoln. Nastavi zastavico, ki določa prvi zagon programa, ostale nastavitve pa ostanejo nespremenjene. diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 3343e8a39c..2f31d33185 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -1956,7 +1956,7 @@ 安裝和疑難排除 技術文章 版本 - 投票 + 投票 聯絡我們 建立 OSM 的興趣點 建立 OSM 的錯誤 diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index a50fb57248..aeb6bab185 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -2050,7 +2050,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A Installation and troubleshooting Technical articles Versions - Poll + Feedback Contact us Map legend diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index 414dd52292..ca278e52e8 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -65,7 +65,7 @@ public class AppInitializer implements IProgress { private static final String VERSION_INSTALLED = "VERSION_INSTALLED"; //$NON-NLS-1$ private static final String EXCEPTION_FILE_SIZE = "EXCEPTION_FS"; //$NON-NLS-1$ - public static final String LATEST_CHANGES_URL = "http://osmand.net/changes-2.1.html"; + public static final String LATEST_CHANGES_URL = "http://osmand.net/help/changes-2.1.html"; public static final int APP_EXIT_CODE = 4; public static final String APP_EXIT_KEY = "APP_EXIT_KEY"; private OsmandApplication app; diff --git a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java index 8d56b37849..025562098b 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpArticleDialogFragment.java @@ -9,6 +9,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; +import android.webkit.WebViewClient; import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; @@ -25,7 +26,8 @@ import java.io.InputStreamReader; public class HelpArticleDialogFragment extends DialogFragment { private static final Log LOG = PlatformUtil.getLog(HelpArticleDialogFragment.class); - public static final String FILE_NAME = "url"; + private static final String ASSET_NAME = "asset_name"; + private static final String URL = "url"; private WebView webView; @Override @@ -51,12 +53,36 @@ public class HelpArticleDialogFragment extends DialogFragment { } }); - String fileContents = getAssetAsString(getArguments().getString(FILE_NAME), getActivity()); + String assetName = getArguments().getString(ASSET_NAME); + String url = getArguments().getString(URL); webView = (WebView) view.findViewById(R.id.webView); - if (savedInstanceState != null) { - webView.restoreState(savedInstanceState); + if (assetName != null) { + if (savedInstanceState != null) { + webView.restoreState(savedInstanceState); + } else { + String fileContents = getAssetAsString(assetName, getActivity()); +// fileContents = "" +// + fileContents; + + webView.loadDataWithBaseURL("http://osmand.net", fileContents, null, "utf-8", null); + } + } else if (url != null) { + if (savedInstanceState != null) { + webView.restoreState(savedInstanceState); + } else { + webView.setWebViewClient(new WebViewClient() { + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + view.loadUrl(url); + return true; + } + }); + webView.loadUrl(url); + } } else { - webView.loadDataWithBaseURL("http://osmand.net", fileContents, null, "utf-8", null); + throw new IllegalArgumentException("HelpArticleDialogFragment should be " + + "instantiated either with ASSET_NAME or with URL"); } return view; } @@ -70,9 +96,17 @@ public class HelpArticleDialogFragment extends DialogFragment { return (OsmandApplication) getActivity().getApplication(); } - public static HelpArticleDialogFragment createInstance(String fileName) { + public static HelpArticleDialogFragment instantiateWithAsset(String assetName) { Bundle args = new Bundle(); - args.putString(FILE_NAME, fileName); + args.putString(ASSET_NAME, assetName); + final HelpArticleDialogFragment helpArticleDialogFragment = new HelpArticleDialogFragment(); + helpArticleDialogFragment.setArguments(args); + return helpArticleDialogFragment; + } + + public static HelpArticleDialogFragment instantiateWithUrl(String url) { + Bundle args = new Bundle(); + args.putString(URL, url); final HelpArticleDialogFragment helpArticleDialogFragment = new HelpArticleDialogFragment(); helpArticleDialogFragment.setArguments(args); return helpArticleDialogFragment; diff --git a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/MyMenuItem.java b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpMenuItem.java similarity index 76% rename from OsmAnd/src/net/osmand/plus/dialogs/helpscreen/MyMenuItem.java rename to OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpMenuItem.java index deaa60ff6a..6a4de19ef8 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/MyMenuItem.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpMenuItem.java @@ -5,32 +5,32 @@ import android.support.annotation.DrawableRes; import android.support.annotation.StringRes; import android.view.View.OnClickListener; -public class MyMenuItem { +public class HelpMenuItem { private final String title; private final String desription; @DrawableRes private final int icon; private final OnClickListener onClickListener; - public MyMenuItem(String title) { + public HelpMenuItem(String title) { this(title, null); } - public MyMenuItem(@StringRes int title, Context context) { + public HelpMenuItem(@StringRes int title, Context context) { this(context.getString(title)); } - public MyMenuItem(String title, OnClickListener onClickListener) { + public HelpMenuItem(String title, OnClickListener onClickListener) { this(title, null, -1, onClickListener); } - private MyMenuItem(String title, @StringRes int desription, @DrawableRes int icon, - Context context, OnClickListener onClickListener) { + private HelpMenuItem(String title, @StringRes int desription, @DrawableRes int icon, + Context context, OnClickListener onClickListener) { this(title, context.getString(desription), icon, onClickListener); } - private MyMenuItem(String title, String desription, @DrawableRes int icon, - OnClickListener onClickListener) { + private HelpMenuItem(String title, String desription, @DrawableRes int icon, + OnClickListener onClickListener) { this.title = title; this.desription = desription; this.icon = icon; @@ -97,8 +97,8 @@ public class MyMenuItem { return this; } - public MyMenuItem create() { - return new MyMenuItem(title, description, icon, listener); + public HelpMenuItem create() { + return new HelpMenuItem(title, description, icon, listener); } } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java index 43d24c2f96..cc98232c27 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/helpscreen/HelpScreenDialogFragment.java @@ -1,6 +1,5 @@ package net.osmand.plus.dialogs.helpscreen; -import android.app.Activity; import android.content.Intent; import android.content.res.Resources; import android.graphics.drawable.Drawable; @@ -92,15 +91,15 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab public static class HelpAdapter extends OsmandBaseExpandableListAdapter { private final OsmandApplication ctx; - private final Activity activity; + private final FragmentActivity activity; - public HelpAdapter(Activity activity) { + public HelpAdapter(FragmentActivity activity) { this.ctx = (OsmandApplication) activity.getApplication(); this.activity = activity; } @Override - public MyMenuItem getChild(int groupPosition, int childPosition) { + public HelpMenuItem getChild(int groupPosition, int childPosition) { if (categories[groupPosition] != MenuCategory.HELP_US_TO_IMPROVE) { return categories[groupPosition].getItem(childPosition); } else { @@ -119,15 +118,14 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab if (categories[groupPosition] == MenuCategory.HELP_US_TO_IMPROVE) { convertView = LayoutInflater.from(parent.getContext()).inflate( R.layout.help_to_improve_item, parent, false); - TextView pollButton = (TextView) convertView.findViewById(R.id.pollButton); + TextView feedbackButton = (TextView) convertView.findViewById(R.id.feedbackButton); Drawable pollIcon = ctx.getIconsCache().getContentIcon(R.drawable.ic_action_message); - pollButton.setCompoundDrawablesWithIntrinsicBounds(null, pollIcon, null, null); - pollButton.setOnClickListener(new View.OnClickListener() { + feedbackButton.setCompoundDrawablesWithIntrinsicBounds(null, pollIcon, null, null); + feedbackButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse(OSMAND_POLL_HTML)); - activity.startActivity(i); + HelpArticleDialogFragment.instantiateWithUrl(OSMAND_POLL_HTML) + .show(activity.getSupportFragmentManager(), null); } }); TextView contactUsButton = (TextView) convertView.findViewById(R.id.contactUsButton); @@ -149,7 +147,7 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab }); return convertView; } else { - final MyMenuItem child = getChild(groupPosition, childPosition); + final HelpMenuItem child = getChild(groupPosition, childPosition); MenuItemViewHolder viewHolder; if (convertView == null || convertView.getTag() == null) { convertView = LayoutInflater.from(parent.getContext()).inflate( @@ -235,7 +233,7 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab nameTextView = (TextView) view.findViewById(R.id.name); } - public void bindMenuItem(MyMenuItem menuItem) { + public void bindMenuItem(HelpMenuItem menuItem) { nameTextView.setText(menuItem.getTitle()); if (menuItem.getDesription() != null) { descrTextView.setVisibility(View.VISIBLE); @@ -260,7 +258,7 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab HELP_US_TO_IMPROVE(R.string.help_us_to_improve_menu_group), OTHER(R.string.other_menu_group); - private List items; + private List items; @StringRes private final int title; @@ -276,34 +274,34 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab return items.size(); } - public MyMenuItem getItem(int position) { + public HelpMenuItem getItem(int position) { return items.get(position); } - public void initItems(List items) { + public void initItems(List items) { this.items = items; } } - private List createBeginWithOsmandItems() { - ArrayList arrayList = new ArrayList<>(); + private List createBeginWithOsmandItems() { + ArrayList arrayList = new ArrayList<>(); ShowArticleOnTouchListener listener = new ShowArticleOnTouchListener( "feature_articles/start.html", getActivity()); - MyMenuItem.Builder builder = new MyMenuItem.Builder() + HelpMenuItem.Builder builder = new HelpMenuItem.Builder() .setTitle(R.string.first_usage_item, getActivity()) .setDescription(R.string.first_usage_item_description, getActivity()) .setListener(listener); arrayList.add(builder.create()); listener = new ShowArticleOnTouchListener( "feature_articles/navigation.html", getActivity()); - builder = new MyMenuItem.Builder() + builder = new HelpMenuItem.Builder() .setTitle(R.string.shared_string_navigation, getActivity()) .setDescription(R.string.navigation_item_description, getActivity()) .setListener(listener); arrayList.add(builder.create()); listener = new ShowArticleOnTouchListener("feature_articles/faq.html", getActivity()); - builder = new MyMenuItem.Builder() + builder = new HelpMenuItem.Builder() .setTitle(R.string.faq_item, getActivity()) .setDescription(R.string.faq_item_description, getActivity()) .setListener(listener); @@ -311,36 +309,35 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab return arrayList; } - private List createFeaturesItems() { - ArrayList arrayList = new ArrayList<>(); + private List createFeaturesItems() { + ArrayList arrayList = new ArrayList<>(); String name = getActivity().getString(R.string.map_viewing_item); ShowArticleOnTouchListener listener = new ShowArticleOnTouchListener( "feature_articles/map-viewing.html", getActivity()); - arrayList.add(new MyMenuItem(name, listener)); + arrayList.add(new HelpMenuItem(name, listener)); name = getActivity().getString(R.string.search_on_the_map_item); listener = new ShowArticleOnTouchListener( "feature_articles/find-something-on-map.html", getActivity()); - arrayList.add(new MyMenuItem(name, listener)); + arrayList.add(new HelpMenuItem(name, listener)); name = getActivity().getString(R.string.planning_trip_item); listener = new ShowArticleOnTouchListener( "feature_articles/trip-planning.html", getActivity()); - arrayList.add(new MyMenuItem(name, listener)); + arrayList.add(new HelpMenuItem(name, listener)); name = getActivity().getString(R.string.map_legend); - View.OnClickListener onClickListener = new View.OnClickListener(){ + View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { - Intent i = new Intent(Intent.ACTION_VIEW); - i.setData(Uri.parse(OSMAND_MAP_LEGEND)); - getActivity().startActivity(i); + HelpArticleDialogFragment.instantiateWithUrl(OSMAND_MAP_LEGEND) + .show(getFragmentManager(), null); } }; - arrayList.add(new MyMenuItem(name, onClickListener)); + arrayList.add(new HelpMenuItem(name, onClickListener)); return arrayList; } - private List createPluginsItems() { - ArrayList arrayList = new ArrayList<>(); - MyMenuItem.Builder builder = new MyMenuItem.Builder(); + private List createPluginsItems() { + ArrayList arrayList = new ArrayList<>(); + HelpMenuItem.Builder builder = new HelpMenuItem.Builder(); for (final OsmandPlugin osmandPlugin : OsmandPlugin.getAvailablePlugins()) { builder.reset(); builder.setTitle(osmandPlugin.getName()) @@ -354,21 +351,21 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab return arrayList; } - private List createOtherItems() { - ArrayList arrayList = new ArrayList<>(); + private List createOtherItems() { + ArrayList arrayList = new ArrayList<>(); String name = getActivity().getString(R.string.instalation_troubleshooting_item); ShowArticleOnTouchListener listener = new ShowArticleOnTouchListener( "feature_articles/installation-and-troubleshooting.html", getActivity()); - arrayList.add(new MyMenuItem(name, listener)); + arrayList.add(new HelpMenuItem(name, listener)); name = getActivity().getString(R.string.techical_articles_item); listener = new ShowArticleOnTouchListener( "feature_articles/TechnicalArticles.html", getActivity()); - arrayList.add(new MyMenuItem(name, listener)); + arrayList.add(new HelpMenuItem(name, listener)); name = getActivity().getString(R.string.versions_item); listener = new ShowArticleOnTouchListener( "feature_articles/changes.html", getActivity()); - arrayList.add(new MyMenuItem(name, listener)); + arrayList.add(new HelpMenuItem(name, listener)); String releasedate = ""; if (!this.getString(R.string.app_edition).equals("")) { @@ -377,7 +374,7 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab String version = Version.getFullVersion(getOsmandApplication()) + " " + releasedate; listener = new ShowArticleOnTouchListener( "feature_articles/about.html", getActivity()); - MyMenuItem.Builder builder = new MyMenuItem.Builder() + HelpMenuItem.Builder builder = new HelpMenuItem.Builder() .setTitle(R.string.shared_string_about, getActivity()) .setDescription(version) .setListener(listener); @@ -397,7 +394,7 @@ public class HelpScreenDialogFragment extends DialogFragment implements Expandab @Override public void onClick(View v) { - HelpArticleDialogFragment.createInstance(filename) + HelpArticleDialogFragment.instantiateWithAsset(filename) .show(ctx.getSupportFragmentManager(), null); } }