Made improvements in Measure Distance and changed colors of RenameMarkerBottomDialogFragment

This commit is contained in:
Chumva 2018-02-14 11:36:15 +02:00
parent 5b9639c58d
commit e39cb9fb17

View file

@ -3,6 +3,8 @@ package net.osmand.plus.mapmarkers;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v4.content.ContextCompat;
import android.text.format.DateFormat;
import android.view.ContextThemeWrapper;
import android.view.Gravity;
@ -59,6 +61,14 @@ public class SaveAsTrackBottomSheetDialogFragment extends BottomSheetDialogFragm
if (portrait) {
AndroidUtils.setBackground(getActivity(), mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
}
View textBox = mainView.findViewById(R.id.name_text_box);
if (nightMode) {
if (textBox instanceof TextInputLayout) {
((TextInputLayout) textBox).setHintTextAppearance(R.style.TextAppearance_App_DarkTextInputLayout);
} else if (textBox instanceof OsmandTextFieldBoxes) {
((OsmandTextFieldBoxes) textBox).setPrimaryColor(ContextCompat.getColor(mapActivity, R.color.color_dialog_buttons_dark));
}
}
final File dir = mapActivity.getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR + "/map markers");
if (!dir.exists()) {
@ -75,7 +85,6 @@ public class SaveAsTrackBottomSheetDialogFragment extends BottomSheetDialogFragm
}
final EditText nameEditText = (EditText) mainView.findViewById(R.id.name_edit_text);
nameEditText.setText(displayedName);
View textBox = mainView.findViewById(R.id.name_text_box);
if (textBox instanceof OsmandTextFieldBoxes) {
((OsmandTextFieldBoxes) textBox).activate(true);
}