Merge pull request #9489 from osmandapp/Fix_9422

Fix #9422
This commit is contained in:
Vitaliy 2020-07-20 19:29:42 +03:00 committed by GitHub
commit b1d6f66b44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,7 @@ import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemTwoChoicesButton; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemTwoChoicesButton;
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemTwoChoicesButton.OnBottomBtnClickListener; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemTwoChoicesButton.OnBottomBtnClickListener;
@ -124,6 +125,7 @@ public class DetailsBottomSheet extends BasePreferenceBottomSheet {
for (int i = 0; i < properties.size(); i++) { for (int i = 0; i < properties.size(); i++) {
RenderingRuleProperty property = properties.get(i); RenderingRuleProperty property = properties.get(i);
final CommonPreference<Boolean> pref = preferences.get(i); final CommonPreference<Boolean> pref = preferences.get(i);
final String propertyName = SettingsActivity.getStringPropertyName(app, property.getAttrName(), property.getName());
if (STREET_LIGHTING.equals(property.getAttrName()) && streetLightNightProp != null) { if (STREET_LIGHTING.equals(property.getAttrName()) && streetLightNightProp != null) {
final CommonPreference<Boolean> streetLightsNightPref = preferences.get(properties.indexOf(streetLightNightProp)); final CommonPreference<Boolean> streetLightsNightPref = preferences.get(properties.indexOf(streetLightNightProp));
final BottomSheetItemTwoChoicesButton[] item = new BottomSheetItemTwoChoicesButton[1]; final BottomSheetItemTwoChoicesButton[] item = new BottomSheetItemTwoChoicesButton[1];
@ -139,7 +141,7 @@ public class DetailsBottomSheet extends BasePreferenceBottomSheet {
}) })
.setCompoundButtonColorId(selectedProfileColorRes) .setCompoundButtonColorId(selectedProfileColorRes)
.setChecked(pref.get()) .setChecked(pref.get())
.setTitle(property.getName()) .setTitle(propertyName)
.setIconHidden(true) .setIconHidden(true)
.setLayoutId(R.layout.bottom_sheet_item_two_choices) .setLayoutId(R.layout.bottom_sheet_item_two_choices)
.setOnClickListener(new View.OnClickListener() { .setOnClickListener(new View.OnClickListener() {
@ -160,7 +162,7 @@ public class DetailsBottomSheet extends BasePreferenceBottomSheet {
item[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder() item[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder()
.setCompoundButtonColorId(selectedProfileColorRes) .setCompoundButtonColorId(selectedProfileColorRes)
.setChecked(pref.get()) .setChecked(pref.get())
.setTitle(property.getName()) .setTitle(propertyName)
.setIconHidden(true) .setIconHidden(true)
.setLayoutId(R.layout.bottom_sheet_item_with_switch) .setLayoutId(R.layout.bottom_sheet_item_with_switch)
.setOnClickListener(new View.OnClickListener() { .setOnClickListener(new View.OnClickListener() {