Add small changes

This commit is contained in:
Alex 2017-08-11 16:52:48 +03:00
parent 23e8dd701f
commit 4f85af5b10
2 changed files with 14 additions and 3 deletions

View file

@ -1,20 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<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="wrap_content"
android:background="?attr/bg_color"
android:orientation="vertical">
<TextView
<net.osmand.plus.widgets.TextViewEx
android:layout_width="match_parent"
android:layout_height="52dp"
android:gravity="center_vertical"
android:paddingEnd="16dp"
android:paddingStart="16dp"
android:text="@string/shared_string_options"
android:textAppearance="@style/TextAppearance.ListItemTitle"/>
android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_medium"/>
<RelativeLayout
android:id="@+id/snap_to_road_row"
@ -197,7 +199,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/shared_string_cancel"
android:text="@string/shared_string_close"
android:textAllCaps="true"
android:textColor="?attr/color_dialog_buttons"
android:textSize="14sp"

View file

@ -1,6 +1,8 @@
package net.osmand.plus.measurementtool;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.Nullable;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@ -8,6 +10,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import net.osmand.AndroidUtils;
import net.osmand.plus.R;
import net.osmand.plus.base.BottomSheetDialogFragment;
@ -33,6 +36,7 @@ public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment
final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
final View mainView = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_options_bottom_sheet_dialog, null);
AndroidUtils.setBackground(getActivity(), mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
((ImageView) mainView.findViewById(R.id.snap_to_road_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_snap_to_road));
((ImageView) mainView.findViewById(R.id.clear_all_icon)).setImageDrawable(getContentIcon(R.drawable.ic_action_reset_to_default_dark));
@ -104,6 +108,11 @@ public class OptionsBottomSheetDialogFragment extends BottomSheetDialogFragment
return mainView;
}
@Override
protected Drawable getContentIcon(@DrawableRes int id) {
return getIcon(id, getMyApplication().getSettings().isLightContent() ? R.color.on_map_icon_color : 0);
}
interface OptionsOnClickListener {
void snapToRoadOnCLick();