terrain ui fixes
This commit is contained in:
parent
f74b861827
commit
a8553f6ffe
9 changed files with 115 additions and 96 deletions
|
@ -3,7 +3,7 @@
|
|||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:bottomLeftRadius="4dp" android:topLeftRadius="4dp" />
|
||||
<corners android:radius="4dp" />
|
||||
<stroke android:width="1dp" android:color="?attr/secondary_icon_color" />
|
||||
</shape>
|
||||
</item>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/switch_button_active" />
|
||||
<corners android:bottomLeftRadius="4dp" android:topLeftRadius="4dp" />
|
||||
<stroke android:width="1dp" android:color="@color/switch_button_active_stroke" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/switch_button_active" />
|
||||
<corners android:bottomRightRadius="4dp" android:topRightRadius="4dp" />
|
||||
<stroke android:width="1dp" android:color="@color/switch_button_active_stroke" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@android:color/transparent" />
|
||||
<corners android:bottomRightRadius="4dp" android:topRightRadius="4dp" />
|
||||
<stroke android:width="1dp" android:color="?attr/secondary_icon_color" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -15,12 +16,10 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/setting_list_item_large_height"
|
||||
android:background="?attr/bg_color"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/content_padding_half"
|
||||
android:paddingBottom="@dimen/content_padding_half">
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_iv"
|
||||
|
@ -44,6 +43,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="Terrain" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
|
@ -83,18 +83,18 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bottom_sheet_list_item_height"
|
||||
android:layout_height="@dimen/dialog_button_height"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:background="@drawable/btn_bg_border_inactive"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/hillshade_btn_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
tools:background="@drawable/btn_border_left_active">
|
||||
android:layout_weight="1">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/hillshade_btn"
|
||||
|
@ -110,7 +110,7 @@
|
|||
|
||||
<FrameLayout
|
||||
android:id="@+id/slope_btn_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
|
@ -122,8 +122,7 @@
|
|||
android:gravity="center"
|
||||
android:text="@string/shared_string_slope"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:textStyle="bold"
|
||||
tools:background="@drawable/btn_border_right_inactive" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
|
@ -133,13 +132,20 @@
|
|||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_marginTop="@dimen/content_padding_small"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginBottom="@dimen/content_padding_small"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="Hillshade map using dark shades to show slopes, peaks and lowlands." />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/card_bottom_divider" />
|
||||
|
||||
<include layout="@layout/card_top_divider" />
|
||||
|
||||
<LinearLayout
|
||||
|
@ -160,16 +166,20 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:text="@string/shared_string_transparency"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size" />
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/transparency_value_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="25%" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -179,10 +189,11 @@
|
|||
style="@style/Widget.MaterialComponents.Slider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/list_header_settings_top_margin"
|
||||
android:paddingTop="@dimen/list_header_settings_top_margin"
|
||||
android:paddingBottom="@dimen/dialog_content_margin"
|
||||
android:stepSize="1"
|
||||
android:theme="@style/Theme.MaterialComponents"
|
||||
app:haloRadius="@dimen/slider_thumb_halo_size"
|
||||
app:haloRadius="@dimen/slider_thumb_size"
|
||||
app:thumbRadius="@dimen/slider_thumb_size"
|
||||
app:tickColor="@android:color/transparent"
|
||||
app:trackHeight="@dimen/slider_track_height" />
|
||||
|
@ -192,35 +203,36 @@
|
|||
android:layout_height="1dp"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:layout_marginTop="@dimen/content_padding_half"
|
||||
android:background="?attr/dashboard_divider"
|
||||
android:focusable="false" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:letterSpacing="@dimen/description_letter_spacing"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/list_header_settings_top_margin"
|
||||
android:paddingEnd="@dimen/content_padding"
|
||||
android:text="@string/shared_string_zoom_levels"
|
||||
android:textColor="@color/preference_category_title"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/content_padding"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingEnd="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_half">
|
||||
android:paddingTop="@dimen/content_padding"
|
||||
android:paddingEnd="@dimen/content_padding">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="start"
|
||||
android:text="Min"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:text="@string/shared_string_min"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size" />
|
||||
|
||||
|
@ -229,7 +241,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:text="Max"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:text="@string/shared_string_max"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size" />
|
||||
|
||||
|
@ -246,11 +259,12 @@
|
|||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/zoom_value_min"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/standard_icon_size"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:text="3" />
|
||||
|
||||
<com.google.android.material.slider.Slider
|
||||
|
@ -260,19 +274,20 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:stepSize="1"
|
||||
app:tickColor="@color/color_black"
|
||||
android:theme="@style/Theme.MaterialComponents"
|
||||
app:haloRadius="@dimen/slider_thumb_halo_size"
|
||||
app:haloRadius="@dimen/slider_thumb_size"
|
||||
app:thumbRadius="@dimen/slider_thumb_size"
|
||||
app:tickColor="@color/color_black"
|
||||
app:trackHeight="@dimen/slider_track_height" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/zoom_value_max"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="@dimen/standard_icon_size"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="end"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
tools:text="19" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@ -280,7 +295,10 @@
|
|||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginBottom="@dimen/content_padding"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:text="@string/terrain_slider_description"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
@ -303,13 +321,15 @@
|
|||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:letterSpacing="@dimen/description_letter_spacing"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/list_header_settings_top_margin"
|
||||
android:paddingBottom="@dimen/content_padding"
|
||||
android:paddingEnd="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding"
|
||||
android:text="@string/shared_string_legend"
|
||||
android:textColor="@color/preference_category_title"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -350,18 +370,23 @@
|
|||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:letterSpacing="@dimen/description_letter_spacing"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/list_header_settings_top_margin"
|
||||
android:paddingEnd="@dimen/content_padding"
|
||||
android:text="@string/welmode_download_maps"
|
||||
android:textColor="@color/preference_category_title"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/download_description_tv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_marginTop="@dimen/content_padding_half"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
tools:text="@string/hillshade_download_description" />
|
||||
|
@ -453,6 +478,7 @@
|
|||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginBottom="@dimen/content_padding"
|
||||
android:gravity="start"
|
||||
android:lineSpacingExtra="@dimen/line_spacing_extra_description"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
tools:text="@string/terrain_empty_state_text" />
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
android:background="?attr/bg_color"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="@dimen/list_item_height"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="@dimen/list_content_padding"
|
||||
android:paddingStart="@dimen/list_content_padding">
|
||||
android:minHeight="@dimen/setting_list_item_large_height"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
|
@ -21,6 +19,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="@dimen/list_content_padding"
|
||||
android:layout_marginEnd="@dimen/list_content_padding"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginStart="@dimen/list_content_padding"
|
||||
tools:src="@drawable/ic_map"/>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -30,26 +30,30 @@
|
|||
android:layout_weight="1"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:layout_marginLeft="@dimen/list_content_padding"
|
||||
android:layout_marginStart="@dimen/list_content_padding"
|
||||
android:layout_marginRight="@dimen/list_content_padding"
|
||||
android:layout_marginEnd="@dimen/list_content_padding"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="Germany"/>
|
||||
|
||||
<TextView
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="25"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_sub_text_size"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_regular"
|
||||
tools:text="Contour Lines"/>
|
||||
|
||||
<ProgressBar
|
||||
|
|
|
@ -15,5 +15,6 @@
|
|||
<dimen name="context_img_card_height">160dp</dimen>
|
||||
|
||||
<dimen name="line_spacing_multiplier_description">1.2</dimen>
|
||||
<dimen name="line_spacing_extra_description">5dp</dimen>
|
||||
|
||||
</resources>
|
|
@ -11,6 +11,7 @@
|
|||
Thx - Hardy
|
||||
|
||||
-->
|
||||
<string name="shared_string_min">Min</string>
|
||||
<string name="shared_string_square">Square</string>
|
||||
<string name="shared_string_rhomb">Rhomb</string>
|
||||
<string name="shared_string_circle">Circle</string>
|
||||
|
|
|
@ -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;
|
||||
|
@ -161,8 +164,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,31 +308,38 @@ 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 fakeBold) {
|
||||
SpannableString spannableString = new SpannableString(text);
|
||||
ClickableSpan clickableSpan = new ClickableSpan() {
|
||||
@Override
|
||||
|
@ -338,6 +348,13 @@ public class TerrainFragment extends BaseOsmAndFragment implements View.OnClickL
|
|||
i.setData(Uri.parse(url));
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDrawState(@NonNull TextPaint ds) {
|
||||
super.updateDrawState(ds);
|
||||
ds.setFakeBoldText(fakeBold);
|
||||
ds.setUnderlineText(false);
|
||||
}
|
||||
};
|
||||
try {
|
||||
int startIndex = text.indexOf(clickableText);
|
||||
|
@ -533,7 +550,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);
|
||||
|
|
Loading…
Reference in a new issue