From 36023ddb152a176b1e87bd669b0feb816ffbd747 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Tue, 26 Nov 2013 13:28:55 +0100 Subject: [PATCH] Add link to FAQ --- OsmAnd/res/values/strings.xml | 2 ++ .../activities/TipsAndTricksActivity.java | 25 +++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index d6c83693d2..6b8b63372a 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,8 @@ 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 --> + Please visit following to url https://code.google.com/p/osmand/wiki/FAQ to see frequently asked question. + Frequently Asked Questions You are going to delete %1$d osm changes. Are you sure? Delete All Please, calculate the route first diff --git a/OsmAnd/src/net/osmand/plus/activities/TipsAndTricksActivity.java b/OsmAnd/src/net/osmand/plus/activities/TipsAndTricksActivity.java index 0d5dd13bd5..ebdcf3c1af 100644 --- a/OsmAnd/src/net/osmand/plus/activities/TipsAndTricksActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/TipsAndTricksActivity.java @@ -8,7 +8,10 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import android.app.Dialog; import android.content.Context; +import android.text.SpannableString; +import android.text.method.LinkMovementMethod; import android.text.method.ScrollingMovementMethod; +import android.text.util.Linkify; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.Button; @@ -20,6 +23,7 @@ public class TipsAndTricksActivity { {R.string.tip_update_index,R.string.tip_update_index_t}, {R.string.tip_navigation,R.string.tip_navigation_t}, {R.string.tip_app_mode,R.string.tip_app_mode_t_v2}, + {R.string.tip_faq,R.string.tip_faq_t}, {R.string.tip_search,R.string.tip_search_t}, {R.string.tip_favorites,R.string.tip_favorites_t}, {R.string.tip_map_context_menu,R.string.tip_map_context_menu_t}, @@ -58,8 +62,9 @@ public class TipsAndTricksActivity { public int getNextRandomTipToShow() { int l = getNumberOfTips(); if (l != 0) { - int mod = (int) (System.currentTimeMillis() % l); - return getNextTipToShow(mod); + // no random + // int mod = (int) (System.currentTimeMillis() % l); + return getNextTipToShow(0); } return -1; } @@ -98,18 +103,24 @@ public class TipsAndTricksActivity { return ctx.getString(tipNamesAndDescriptions[ind][0]); } - public String getTipDescription(int ind){ - return ctx.getString(tipNamesAndDescriptions[ind][1]); + public CharSequence getTipDescription(int ind){ + String descr = ctx.getString(tipNamesAndDescriptions[ind][1]); + SpannableString spannable = new SpannableString(descr); + Linkify.addLinks(spannable, Linkify.ALL); + return spannable; } public Dialog getDialogToShowTips(boolean showFirst, boolean random){ final Dialog dlg = new Dialog(ctx); dlg.setContentView(R.layout.tips_and_tricks); - dlg.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); + dlg.getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); final TextView tipDescription = (TextView) dlg.findViewById(R.id.TipDescription); - if (!((OsmandApplication)ctx.getApplicationContext()).getInternalAPI().accessibilityExtensions()) - tipDescription.setMovementMethod(ScrollingMovementMethod.getInstance()); + if (!((OsmandApplication)ctx.getApplicationContext()).getInternalAPI().accessibilityExtensions()) { +// tipDescription.setMovementMethod(ScrollingMovementMethod.getInstance()); + tipDescription.setMovementMethod(LinkMovementMethod.getInstance()); + } + tipDescription.setLinksClickable(true); int nextInd = 0; final TIntArrayList toShow = new TIntArrayList(); final int[] historyInd = new int[1];