From 0931066a5041116743c05c7285c23e8cc50f0ba2 Mon Sep 17 00:00:00 2001 From: Dmitry Yunitsky Date: Tue, 29 Mar 2016 12:24:30 +0300 Subject: [PATCH] [android] Set correct help text for timetable editor. --- android/assets/opening_hours_how_to_edit.html | 1 + android/res/layout/fragment_timetable_advanced.xml | 12 ++++-------- android/script/replace_links.bat | 1 + .../maps/editor/AdvancedTimetableFragment.java | 8 +++++--- android/src/com/mapswithme/util/Constants.java | 1 + 5 files changed, 12 insertions(+), 11 deletions(-) create mode 120000 android/assets/opening_hours_how_to_edit.html diff --git a/android/assets/opening_hours_how_to_edit.html b/android/assets/opening_hours_how_to_edit.html new file mode 120000 index 0000000000..67cdf700c8 --- /dev/null +++ b/android/assets/opening_hours_how_to_edit.html @@ -0,0 +1 @@ +../../data/opening_hours_how_to_edit.html \ No newline at end of file diff --git a/android/res/layout/fragment_timetable_advanced.xml b/android/res/layout/fragment_timetable_advanced.xml index 73361eda69..c17c58f8cb 100644 --- a/android/res/layout/fragment_timetable_advanced.xml +++ b/android/res/layout/fragment_timetable_advanced.xml @@ -46,7 +46,7 @@ - + android:padding="@dimen/margin_base"/> diff --git a/android/script/replace_links.bat b/android/script/replace_links.bat index 1050e15d98..b0bf4ce67e 100644 --- a/android/script/replace_links.bat +++ b/android/script/replace_links.bat @@ -22,6 +22,7 @@ cp ../data/packed_polygons_obsolete.bin assets/ cp ../data/patterns.txt assets/ cp ../data/types.txt assets/ cp ../data/unicode_blocks.txt assets/ +cp ../data/opening_hours_how_to_edit.html assets/ cp -r ../data/resources-hdpi_legacy/ assets/ cp -r ../data/resources-hdpi_dark/ assets/ diff --git a/android/src/com/mapswithme/maps/editor/AdvancedTimetableFragment.java b/android/src/com/mapswithme/maps/editor/AdvancedTimetableFragment.java index ea91418711..09cb541256 100644 --- a/android/src/com/mapswithme/maps/editor/AdvancedTimetableFragment.java +++ b/android/src/com/mapswithme/maps/editor/AdvancedTimetableFragment.java @@ -6,12 +6,14 @@ import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.webkit.WebView; import android.widget.EditText; import android.widget.TextView; import com.mapswithme.maps.R; import com.mapswithme.maps.base.BaseMwmFragment; import com.mapswithme.maps.editor.data.Timetable; +import com.mapswithme.util.Constants; import com.mapswithme.util.Graphics; import com.mapswithme.util.UiUtils; @@ -21,7 +23,7 @@ public class AdvancedTimetableFragment extends BaseMwmFragment { private boolean mIsExampleShown; private EditText mInput; - private TextView mExample; + private WebView mExample; private Timetable[] mInitTimetables; private TextView mExamplesTitle; @@ -52,8 +54,8 @@ public class AdvancedTimetableFragment extends BaseMwmFragment { view.findViewById(R.id.examples).setOnClickListener(this); mInput = (EditText) view.findViewById(R.id.et__timetable); - mExample = (TextView) view.findViewById(R.id.tv__examples); - // TODO set text of example from html stored in data/ + mExample = (WebView) view.findViewById(R.id.wv__examples); + mExample.loadUrl(Constants.Url.OPENING_HOURS_MANUAL); mExamplesTitle = (TextView) view.findViewById(R.id.tv__examples_title); setExampleDrawables(R.drawable.ic_type_text, R.drawable.ic_expand_more); } diff --git a/android/src/com/mapswithme/util/Constants.java b/android/src/com/mapswithme/util/Constants.java index 2a8cc2d037..7b6dc1dcef 100644 --- a/android/src/com/mapswithme/util/Constants.java +++ b/android/src/com/mapswithme/util/Constants.java @@ -30,6 +30,7 @@ public final class Constants public static final String COPYRIGHT = "file:///android_asset/copyright.html"; public static final String FAQ = "file:///android_asset/faq.html"; + public static final String OPENING_HOURS_MANUAL = "file:///android_asset/opening_hours_how_to_edit.html"; public static final String OSM_REGISTER = "https://www.openstreetmap.org/user/new"; public static final String OSM_RECOVER_PASSWORD = "https://www.openstreetmap.org/user/forgot-password";