diff --git a/OsmAnd/res/drawable/btn_border_left_inactive.xml b/OsmAnd/res/drawable/btn_bg_border_inactive.xml similarity index 81% rename from OsmAnd/res/drawable/btn_border_left_inactive.xml rename to OsmAnd/res/drawable/btn_bg_border_inactive.xml index a893ccb591..844747ac35 100644 --- a/OsmAnd/res/drawable/btn_border_left_inactive.xml +++ b/OsmAnd/res/drawable/btn_bg_border_inactive.xml @@ -3,7 +3,7 @@ - + diff --git a/OsmAnd/res/drawable/btn_border_left_active.xml b/OsmAnd/res/drawable/btn_border_left_active.xml deleted file mode 100644 index 61d2fcfcdb..0000000000 --- a/OsmAnd/res/drawable/btn_border_left_active.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/drawable/btn_border_right_active.xml b/OsmAnd/res/drawable/btn_border_right_active.xml deleted file mode 100644 index ec50a9a386..0000000000 --- a/OsmAnd/res/drawable/btn_border_right_active.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/drawable/btn_border_right_inactive.xml b/OsmAnd/res/drawable/btn_border_right_inactive.xml deleted file mode 100644 index 80db8f1230..0000000000 --- a/OsmAnd/res/drawable/btn_border_right_inactive.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/layout/fragment_terrain.xml b/OsmAnd/res/layout/fragment_terrain.xml index 62f496c314..5663070efa 100644 --- a/OsmAnd/res/layout/fragment_terrain.xml +++ b/OsmAnd/res/layout/fragment_terrain.xml @@ -1,11 +1,11 @@ - - + android:scaleType="fitXY" + android:src="@drawable/bg_shadow_onmap" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:orientation="horizontal"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - + tools:src="@drawable/ic_action_hillshade_dark" /> + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:gravity="center_vertical" + android:orientation="vertical" + android:paddingStart="@dimen/content_padding" + android:paddingEnd="@dimen/content_padding"> - + - - - - - - - - - + - + - + + + + + android:orientation="vertical"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - \ No newline at end of file + \ No newline at end of file diff --git a/OsmAnd/res/layout/list_item_icon_and_download.xml b/OsmAnd/res/layout/list_item_icon_and_download.xml index 3f797e2ad4..c4297147ce 100644 --- a/OsmAnd/res/layout/list_item_icon_and_download.xml +++ b/OsmAnd/res/layout/list_item_icon_and_download.xml @@ -1,19 +1,17 @@ - + android:minHeight="@dimen/setting_list_item_large_height" + android:gravity="center_vertical"> - - 160dp 1.2 + 5dp \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 7fd6aa397f..cfc57b3cb0 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,7 @@ Thx - Hardy --> + Min Square Rhomb Circle diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainFragment.java b/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainFragment.java index 6e742ee19f..f923f4e416 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainFragment.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/TerrainFragment.java @@ -3,10 +3,13 @@ package net.osmand.plus.srtmplugin; import android.app.Activity; import android.content.Intent; import android.content.res.ColorStateList; +import android.graphics.Color; +import android.graphics.drawable.GradientDrawable; import android.net.Uri; import android.os.Bundle; import android.text.SpannableString; import android.text.Spanned; +import android.text.TextPaint; import android.text.method.LinkMovementMethod; import android.text.style.ClickableSpan; import android.view.LayoutInflater; @@ -43,6 +46,8 @@ import net.osmand.plus.download.DownloadIndexesThread; import net.osmand.plus.download.DownloadResources; import net.osmand.plus.download.DownloadValidationManager; import net.osmand.plus.download.IndexItem; +import net.osmand.plus.helpers.FontCache; +import net.osmand.plus.widgets.style.CustomTypefaceSpan; import org.apache.commons.logging.Log; @@ -161,8 +166,8 @@ public class TerrainFragment extends BaseOsmAndFragment implements View.OnClickL getString(R.string.terrain_empty_state_text), PLUGIN_URL ); - setupClickableText(slopeReadMoreTv, readMoreText, wikiString, SLOPES_WIKI_URL); - setupClickableText(emptyStateDescriptionTv, emptyStateText, PLUGIN_URL, PLUGIN_URL); + setupClickableText(slopeReadMoreTv, readMoreText, wikiString, SLOPES_WIKI_URL, false); + setupClickableText(emptyStateDescriptionTv, emptyStateText, PLUGIN_URL, PLUGIN_URL, true); switchCompat.setChecked(terrainEnabled); hillshadeBtn.setOnClickListener(this); @@ -305,42 +310,60 @@ public class TerrainFragment extends BaseOsmAndFragment implements View.OnClickL } private void adjustModeButtons(TerrainMode mode) { + int activeColor = ContextCompat.getColor(app, nightMode + ? R.color.active_color_primary_dark + : R.color.active_color_primary_light); + int textColor = ContextCompat.getColor(app, nightMode + ? R.color.text_color_primary_dark + : R.color.text_color_primary_light); + int radius = AndroidUtils.dpToPx(app, 4); + + GradientDrawable background = new GradientDrawable(); + background.setColor(UiUtilities.getColorWithAlpha(activeColor, 0.1f)); + background.setStroke(AndroidUtils.dpToPx(app, 1), UiUtilities.getColorWithAlpha(activeColor, 0.5f)); + if (mode == SLOPE) { - slopeBtnContainer.setBackgroundResource(R.drawable.btn_border_right_active); - slopeBtn.setTextColor(nightMode - ? getResources().getColor(R.color.text_color_primary_dark) - : getResources().getColor(R.color.text_color_primary_light)); - hillshadeBtnContainer.setBackgroundResource(R.drawable.btn_border_left_inactive); - hillshadeBtn.setTextColor(nightMode - ? getResources().getColor(R.color.active_color_primary_dark) - : getResources().getColor(R.color.active_color_primary_light)); + background.setCornerRadii(new float[]{0, 0, radius, radius, radius, radius, 0, 0}); + slopeBtnContainer.setBackgroundDrawable(background); + slopeBtn.setTextColor(textColor); + hillshadeBtnContainer.setBackgroundColor(Color.TRANSPARENT); + hillshadeBtn.setTextColor(activeColor); } else { - slopeBtnContainer.setBackgroundResource(R.drawable.btn_border_right_inactive); - slopeBtn.setTextColor(nightMode - ? getResources().getColor(R.color.active_color_primary_dark) - : getResources().getColor(R.color.active_color_primary_light)); - hillshadeBtnContainer.setBackgroundResource(R.drawable.btn_border_left_active); - hillshadeBtn.setTextColor(nightMode - ? getResources().getColor(R.color.text_color_primary_dark) - : getResources().getColor(R.color.text_color_primary_light)); + background.setCornerRadii(new float[]{radius, radius, 0, 0, 0, 0, radius, radius}); + slopeBtnContainer.setBackgroundColor(Color.TRANSPARENT); + slopeBtn.setTextColor(activeColor); + hillshadeBtnContainer.setBackgroundDrawable(background); + hillshadeBtn.setTextColor(textColor); } } private void setupClickableText(TextView textView, - String text, - String clickableText, - final String url) { + String text, + String clickableText, + final String url, + final boolean medium) { SpannableString spannableString = new SpannableString(text); ClickableSpan clickableSpan = new ClickableSpan() { @Override public void onClick(@NonNull View view) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); - startActivity(i); + if (AndroidUtils.isIntentSafe(app, i)) { + startActivity(i); + } + } + + @Override + public void updateDrawState(@NonNull TextPaint ds) { + super.updateDrawState(ds); + ds.setUnderlineText(false); } }; try { int startIndex = text.indexOf(clickableText); + if (medium) { + spannableString.setSpan(new CustomTypefaceSpan(FontCache.getRobotoMedium(app)), startIndex, startIndex + clickableText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } spannableString.setSpan(clickableSpan, startIndex, startIndex + clickableText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); textView.setText(spannableString); textView.setMovementMethod(LinkMovementMethod.getInstance()); @@ -533,7 +556,7 @@ public class TerrainFragment extends BaseOsmAndFragment implements View.OnClickL } private void setupBottomEmptySpace() { - int h = terrainEnabled ? AndroidUtils.dpToPx(app, 48) : AndroidUtils.getScreenHeight(requireActivity()) / 3; + int h = terrainEnabled ? AndroidUtils.dpToPx(app, 120) : AndroidUtils.getScreenHeight(requireActivity()) / 3; ViewGroup.LayoutParams params = bottomEmptySpace.getLayoutParams(); params.height = h; bottomEmptySpace.setLayoutParams(params);