Merge pull request #10301 from osmandapp/Combine-use-elevation-data
Combine use elevation data
This commit is contained in:
commit
60862a7754
2 changed files with 14 additions and 4 deletions
|
@ -328,9 +328,9 @@ public class AndroidUtils {
|
||||||
new int[] {}
|
new int[] {}
|
||||||
},
|
},
|
||||||
new int[] {
|
new int[] {
|
||||||
Color.GRAY,
|
ContextCompat.getColor(ctx, night? R.color.text_color_secondary_dark : R.color.text_color_secondary_light),
|
||||||
ContextCompat.getColor(ctx, night? R.color.active_color_primary_dark : R.color.active_color_primary_light),
|
ContextCompat.getColor(ctx, night? R.color.active_color_primary_dark : R.color.active_color_primary_light),
|
||||||
Color.GRAY}
|
ContextCompat.getColor(ctx, night? R.color.text_color_secondary_dark : R.color.text_color_secondary_light)}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package net.osmand.plus.settings.bottomsheets;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
@ -60,6 +61,8 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment {
|
||||||
private String on;
|
private String on;
|
||||||
private String off;
|
private String off;
|
||||||
private int activeColor;
|
private int activeColor;
|
||||||
|
private int checkedColor;
|
||||||
|
private int uncheckedColor;
|
||||||
private int disabledColor;
|
private int disabledColor;
|
||||||
private int appModeColor;
|
private int appModeColor;
|
||||||
|
|
||||||
|
@ -95,6 +98,9 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment {
|
||||||
appModeColor = appMode.getIconColorInfo().getColor(nightMode);
|
appModeColor = appMode.getIconColorInfo().getColor(nightMode);
|
||||||
activeColor = AndroidUtils.resolveAttribute(themedCtx, R.attr.active_color_basic);
|
activeColor = AndroidUtils.resolveAttribute(themedCtx, R.attr.active_color_basic);
|
||||||
disabledColor = AndroidUtils.resolveAttribute(themedCtx, android.R.attr.textColorSecondary);
|
disabledColor = AndroidUtils.resolveAttribute(themedCtx, android.R.attr.textColorSecondary);
|
||||||
|
checkedColor = (nightMode ? app.getResources().getColor(R.color.text_color_primary_dark) : app.getResources().getColor(R.color.text_color_primary_light));
|
||||||
|
uncheckedColor = (nightMode ? app.getResources().getColor(R.color.text_color_secondary_dark) : app.getResources().getColor(R.color.text_color_secondary_light));
|
||||||
|
|
||||||
|
|
||||||
items.add(new TitleItem(getString(R.string.routing_attr_height_obstacles_name)));
|
items.add(new TitleItem(getString(R.string.routing_attr_height_obstacles_name)));
|
||||||
|
|
||||||
|
@ -213,8 +219,12 @@ public class ElevationDateBottomSheet extends MenuBottomSheetDialogFragment {
|
||||||
|
|
||||||
private void enableDisableReliefButtons(boolean enable) {
|
private void enableDisableReliefButtons(boolean enable) {
|
||||||
for (BaseBottomSheetItem item : reliefFactorButtons) {
|
for (BaseBottomSheetItem item : reliefFactorButtons) {
|
||||||
item.getView().setEnabled(enable);
|
View view = item.getView();
|
||||||
item.getView().findViewById(R.id.compound_button).setEnabled(enable);
|
view.setEnabled(enable);
|
||||||
|
view.findViewById(R.id.compound_button).setEnabled(enable);
|
||||||
|
|
||||||
|
TextView titleField = view.findViewById(R.id.title);
|
||||||
|
titleField.setTextColor(enable ? checkedColor : uncheckedColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue