Merge branch 'master' of https://github.com/osmandapp/Osmand
This commit is contained in:
commit
e9d743450d
12 changed files with 40 additions and 288 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/filter_poi_label"
|
||||
android:textSize="@dimen/default_list_text_size_large"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="fill_parent"
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/Text"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dip"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_marginTop="12dip"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="@dimen/default_list_text_size_large"></TextView>
|
||||
|
||||
</LinearLayout>
|
|
@ -25,7 +25,7 @@
|
|||
android:layout_marginBottom="11dip"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/layer_poi"
|
||||
android:textSize="@dimen/default_list_text_size_large"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -3,12 +3,14 @@
|
|||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="3dp"
|
||||
android:paddingTop="3dp">
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="7dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/NameLabel"
|
||||
android:textSize="@dimen/default_list_text_size_large"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
</LinearLayout>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<TextView
|
||||
android:id="@+id/folder_label"
|
||||
android:textSize="@dimen/default_list_text_size_large"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:layout_width="0dp"
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/title"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:drawablePadding="24dp"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="16dp"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:drawableLeft="@drawable/ic_action_search_dark"
|
||||
tools:text="@string/layer_poi"/>
|
||||
android:layout_height="@dimen/list_item_height" >
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:drawablePadding="24dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="16dp"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:drawableLeft="@drawable/ic_action_search_dark"
|
||||
tools:text="@string/layer_poi" />
|
||||
|
||||
</LinearLayout>
|
|
@ -1,51 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<net.osmand.access.ExplorableTextView
|
||||
android:id="@+id/TipDescription"
|
||||
android:textSize="@dimen/default_list_text_size_large"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginLeft="4dp"
|
||||
android:layout_marginRight="4dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="fill_horizontal"
|
||||
android:scrollbars="vertical"
|
||||
android:text="" />
|
||||
|
||||
<!-- <TextView android:text="@string/poi_dialog_other_tags_message" android:id="@+id/TextView" android:layout_marginLeft="5dp"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content" /> -->
|
||||
<LinearLayout
|
||||
android:id="@+id/LinearLayout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:gravity="bottom|center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/PreviousButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="70dp"
|
||||
android:text="@string/shared_string_previous" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/NextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="70dp"
|
||||
android:text="@string/shared_string_next" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/CloseButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="70dp"
|
||||
android:text="@string/shared_string_close" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
|
@ -125,7 +125,7 @@
|
|||
<string name="cancel_navigation">Спыніць навігацыю</string>
|
||||
<string name="clear_destination">Сьцерці месца прызначэньня</string>
|
||||
<string name="download_using_mobile_internet">Зараз WiFi не падлучаны. Хочаце працягнуць сьцягваньне з бягучым падключэньнем да Інтэрнэту?</string>
|
||||
<string name="street_name">Вуліца</string>
|
||||
<string name="street_name">Назва вуліцы</string>
|
||||
<string name="hno">Нумар дома</string>
|
||||
<string name="website">Вэб-сайт</string>
|
||||
<string name="phone">Тэлефон</string>
|
||||
|
|
|
@ -2123,4 +2123,5 @@
|
|||
<string name="add_opening_hours">Tilføj åbningstider</string>
|
||||
<string name="poi_dialog_poi_type">IP type</string>
|
||||
<string name="number_of_rows_in_dash">Antal rækker %1$s</string>
|
||||
<string name="please_specify_poi_type">Angiv IP type.</string>
|
||||
</resources>
|
||||
|
|
|
@ -2171,11 +2171,11 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
|
|||
<string name="rendering_value_red_name">Czerwony</string>
|
||||
<string name="rendering_value_translucent_orange_name">Półprzezroczysty pomarańczowy</string>
|
||||
<string name="rendering_value_yellow_name">Żółty</string>
|
||||
<string name="rendering_value_translucent_yellow_name">Półprzezroczysty żółty</string>
|
||||
<string name="rendering_value_translucent_yellow_name">Przezroczysty żółty</string>
|
||||
<string name="rendering_value_lightgreen_name">Jasnozielony</string>
|
||||
<string name="rendering_value_translucent_lightgreen_name">Przezroczysty jasnozielony</string>
|
||||
<string name="rendering_value_green_name">Zielony</string>
|
||||
<string name="rendering_value_translucent_green_name">Półprzezroczysty zielony</string>
|
||||
<string name="rendering_value_translucent_green_name">Przezroczysty zielony</string>
|
||||
<string name="rendering_value_lightblue_name">Jasnoniebieski</string>
|
||||
<string name="rendering_value_translucent_lightblue_name">Przezroczysty jasnoniebieski</string>
|
||||
<string name="rendering_value_blue_name">Niebieski</string>
|
||||
|
@ -2198,4 +2198,9 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
|
|||
<string name="successfully_uploaded_pattern">Wysłano {0}/{1}</string>
|
||||
<string name="try_again">Spróbuj ponownie</string>
|
||||
<string name="error_message_pattern">Błąd: {0}</string>
|
||||
</resources>
|
||||
<string name="av_locations">Położenia</string>
|
||||
<string name="plugin_settings">Wtyczki</string>
|
||||
<string name="routing_attr_avoid_shuttle_train_name">Unikanie pociągów wahadłowych</string>
|
||||
<string name="routing_attr_avoid_shuttle_train_description">Unikanie pociągów wahadłowych</string>
|
||||
<string name="traffic_warning_hazard">Zagrożenie</string>
|
||||
</resources>
|
||||
|
|
|
@ -1105,7 +1105,7 @@
|
|||
<string name="cancel_navigation">Avbryt navigeringen</string>
|
||||
<string name="clear_destination">Ta bort destinationen</string>
|
||||
<string name="download_using_mobile_internet">Wi-Fi är för tillfället inte anslutet. Vill du ladda ned med din nuvarande anslutning till Internet?</string>
|
||||
<string name="street_name">Gata</string>
|
||||
<string name="street_name">Gatunamn</string>
|
||||
<string name="hno">Husnummer</string>
|
||||
|
||||
<string name="monitoring_settings_descr">Konfigurera inspelning av dina resor</string>
|
||||
|
@ -1987,4 +1987,6 @@
|
|||
<string name="dahboard_options_dialog_title">Alternativ för panelen</string>
|
||||
<string name="commit_poi">Skicka in POI</string>
|
||||
<string name="tag_poi_name">namn</string>
|
||||
</resources>
|
||||
<string name="tag_poi_amenity">service</string>
|
||||
<string name="number_of_rows_in_dash">Antal rader i panel %1$s</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,196 +0,0 @@
|
|||
package net.osmand.plus.activities;
|
||||
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
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.util.Linkify;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup.LayoutParams;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class TipsAndTricksActivity {
|
||||
private int[][] tipNamesAndDescriptions = new int[][] {
|
||||
{R.string.tip_recent_changes,R.string.tip_recent_changes_1_7_1_t},
|
||||
{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},
|
||||
{R.string.tip_rotation_switching,R.string.tip_rotation_switching_t_v2},
|
||||
{R.string.tip_day_night_mode,R.string.tip_day_night_mode_t_v2},
|
||||
{R.string.tip_map_styles,R.string.tip_map_styles_t},
|
||||
{R.string.tip_altitude_offset,R.string.tip_altitude_offset_t},
|
||||
{R.string.tip_map_switch,R.string.tip_map_switch_t_v2},
|
||||
{R.string.tip_location_sharing,R.string.tip_location_sharing_t},
|
||||
{R.string.tip_osm_improve,R.string.tip_osm_improve_t},
|
||||
};
|
||||
|
||||
private final Context ctx;
|
||||
private int numberOfShownTips = 0;
|
||||
private boolean[] shownTips = new boolean[tipNamesAndDescriptions.length];
|
||||
|
||||
public TipsAndTricksActivity(Context ctx){
|
||||
this.ctx = ctx;
|
||||
}
|
||||
|
||||
public boolean areAllTipsShown(){
|
||||
return numberOfShownTips == tipNamesAndDescriptions.length;
|
||||
}
|
||||
|
||||
public int getNumberOfTips(){
|
||||
return tipNamesAndDescriptions.length;
|
||||
}
|
||||
|
||||
public void markTipAsShown(int index) {
|
||||
if (!shownTips[index]) {
|
||||
shownTips[index] = true;
|
||||
numberOfShownTips++;
|
||||
}
|
||||
}
|
||||
|
||||
public int getNextRandomTipToShow() {
|
||||
int l = getNumberOfTips();
|
||||
if (l != 0) {
|
||||
// no random
|
||||
// int mod = (int) (System.currentTimeMillis() % l);
|
||||
return getNextTipToShow(0);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void clearShownInfo(){
|
||||
Arrays.fill(shownTips, false);
|
||||
numberOfShownTips = 0;
|
||||
}
|
||||
|
||||
public int getNextTipToShow(int suggest) {
|
||||
int l = getNumberOfTips();
|
||||
if(suggest >= l || suggest < 0){
|
||||
suggest = 0;
|
||||
}
|
||||
if (l > 0) {
|
||||
int it = suggest;
|
||||
do {
|
||||
if (!shownTips[it]) {
|
||||
markTipAsShown(it);
|
||||
return it;
|
||||
}
|
||||
it++;
|
||||
if (it == l) {
|
||||
it = 0;
|
||||
}
|
||||
} while (it != suggest);
|
||||
|
||||
clearShownInfo();
|
||||
markTipAsShown(suggest);
|
||||
return suggest;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public String getTipName(int ind){
|
||||
return ctx.getString(tipNamesAndDescriptions[ind][0]);
|
||||
}
|
||||
|
||||
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.MATCH_PARENT, LayoutParams.MATCH_PARENT);
|
||||
final TextView tipDescription = (TextView) dlg.findViewById(R.id.TipDescription);
|
||||
if (!((OsmandApplication)ctx.getApplicationContext()).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];
|
||||
if(showFirst){
|
||||
dlg.setTitle(R.string.shared_string_help);
|
||||
tipDescription.setText(R.string.tip_initial_t);
|
||||
historyInd[0] = -1;
|
||||
} else if(!random){
|
||||
nextInd = 0;
|
||||
dlg.setTitle(getTipName(nextInd));
|
||||
tipDescription.setText(getTipDescription(nextInd));
|
||||
toShow.add(nextInd);
|
||||
historyInd[0] = 0;
|
||||
} else {
|
||||
nextInd = getNextRandomTipToShow();
|
||||
dlg.setTitle(getTipName(nextInd));
|
||||
tipDescription.setText(getTipDescription(nextInd));
|
||||
toShow.add(nextInd);
|
||||
historyInd[0] = 0;
|
||||
}
|
||||
|
||||
final Button nextButton = ((Button)dlg.findViewById(R.id.NextButton));
|
||||
final Button prevButton = (Button)dlg.findViewById(R.id.PreviousButton);
|
||||
|
||||
prevButton.setEnabled(historyInd[0] > 0);
|
||||
nextButton.setEnabled(historyInd[0] < getNumberOfTips() - 1);
|
||||
|
||||
nextButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(historyInd[0] == toShow.size() - 1){
|
||||
int suggest = 0;
|
||||
if(historyInd[0] >= 0) {
|
||||
suggest = toShow.get(historyInd[0]) + 1;
|
||||
}
|
||||
toShow.add(getNextTipToShow(suggest));
|
||||
}
|
||||
historyInd[0] ++;
|
||||
dlg.setTitle(getTipName(toShow.get(historyInd[0])));
|
||||
tipDescription.setText(getTipDescription(toShow.get(historyInd[0])));
|
||||
tipDescription.scrollTo(0, 0);
|
||||
|
||||
prevButton.setEnabled(historyInd[0] > 0);
|
||||
nextButton.setEnabled(historyInd[0] < getNumberOfTips() - 1);
|
||||
}
|
||||
});
|
||||
|
||||
prevButton.setOnClickListener(new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(historyInd[0] > 0){
|
||||
historyInd[0] --;
|
||||
dlg.setTitle(getTipName(toShow.get(historyInd[0])));
|
||||
tipDescription.setText(getTipDescription(toShow.get(historyInd[0])));
|
||||
tipDescription.scrollTo(0, 0);
|
||||
}
|
||||
prevButton.setEnabled(historyInd[0] > 0);
|
||||
nextButton.setEnabled(historyInd[0] < getNumberOfTips() - 1);
|
||||
}
|
||||
});
|
||||
|
||||
((Button)dlg.findViewById(R.id.CloseButton)).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dlg.dismiss();
|
||||
}
|
||||
});
|
||||
return dlg;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue