add save for USE_OSMAND_KEYBOARD

This commit is contained in:
Chumva 2018-03-29 18:00:26 +03:00
parent 7966df89dd
commit 81eda40f4f
3 changed files with 6 additions and 9 deletions

View file

@ -721,6 +721,7 @@ public class OsmandSettings {
public final CommonPreference<Boolean> COORDS_INPUT_USE_RIGHT_SIDE = new BooleanPreference("coords_input_use_right_side", true).makeGlobal();
public final CommonPreference<Integer> COORDS_INPUT_FORMAT = new IntPreference("coords_input_format", CoordinateInputFormats.DD_MM_MMM);
public final OsmandPreference<Boolean> COORDS_USE_OSMAND_KEYBOARD = new BooleanPreference("coords_use_osmand_keyboard", true).makeGlobal();
public final CommonPreference<Boolean> USE_MAPILLARY_FILTER = new BooleanPreference("use_mapillary_filters", false).makeGlobal();
public final CommonPreference<String> MAPILLARY_FILTER_USER_KEY = new StringPreference("mapillary_filter_user_key", "").makeGlobal();

View file

@ -37,14 +37,7 @@ public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDia
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
Bundle args = getArguments();
if (args != null) {
useOsmandKeyboard = args.getBoolean(USE_OSMAND_KEYBOARD);
}
} else {
useOsmandKeyboard = savedInstanceState.getBoolean(USE_OSMAND_KEYBOARD);
}
useOsmandKeyboard = getMyApplication().getSettings().COORDS_USE_OSMAND_KEYBOARD.get();
}
@Override
@ -65,6 +58,7 @@ public class CoordinateInputBottomSheetDialogFragment extends MenuBottomSheetDia
if (listener != null) {
listener.onKeyboardChanged(!useOsmandKeyboard);
}
settings.COORDS_USE_OSMAND_KEYBOARD.set(!useOsmandKeyboard);
dismiss();
}
})

View file

@ -182,7 +182,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
});
registerMainView();
// changeKeyboard(getMyApplication().getSettings().COORDS_USE_OSMAND_KEYBOARD.get());
return mainView;
}
@ -351,6 +351,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
boolean isCurrentlyVisible = isOsmandKeyboardCurrentlyVisible();
if (!isCurrentlyVisible && !useOsmandKeyboard) {
changeKeyboard(true);
getMyApplication().getSettings().COORDS_USE_OSMAND_KEYBOARD.set(true);
} else {
changeOsmandKeyboardVisibility(!isCurrentlyVisible);
}
@ -454,6 +455,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
super.onResume();
adapter.setScreenOrientation(DashLocationFragment.getScreenOrientation(getActivity()));
startLocationUpdate();
changeKeyboard(getMyApplication().getSettings().COORDS_USE_OSMAND_KEYBOARD.get());
}
@Override