rename two methods
This commit is contained in:
parent
76b89c5346
commit
fb2fc6d1fc
1 changed files with 11 additions and 11 deletions
|
@ -247,8 +247,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
pointNameKeyboardBtn.setOnClickListener(new View.OnClickListener() {
|
pointNameKeyboardBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (getOsmandKeyboard()) {
|
if (isOsmandKeyboardOn()) {
|
||||||
changeOsmandKeyboard();
|
changeOsmandKeyboardSetting();
|
||||||
changeKeyboard();
|
changeKeyboard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
View.OnClickListener onClickListener = new View.OnClickListener() {
|
View.OnClickListener onClickListener = new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (getOsmandKeyboard()) {
|
if (isOsmandKeyboardOn()) {
|
||||||
View focusedView = getDialog().getCurrentFocus();
|
View focusedView = getDialog().getCurrentFocus();
|
||||||
if (focusedView != null && focusedView instanceof EditText) {
|
if (focusedView != null && focusedView instanceof EditText) {
|
||||||
EditText focusedEditText = (EditText) focusedView;
|
EditText focusedEditText = (EditText) focusedView;
|
||||||
|
@ -335,7 +335,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
R.id.keyboard_item_next_field,
|
R.id.keyboard_item_next_field,
|
||||||
R.id.keyboard_item_backspace);
|
R.id.keyboard_item_backspace);
|
||||||
|
|
||||||
if (!getOsmandKeyboard() && isOsmandKeyboardCurrentlyVisible()) {
|
if (!isOsmandKeyboardOn() && isOsmandKeyboardCurrentlyVisible()) {
|
||||||
changeOsmandKeyboardVisibility(false);
|
changeOsmandKeyboardVisibility(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,8 +344,8 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
boolean isCurrentlyVisible = isOsmandKeyboardCurrentlyVisible();
|
boolean isCurrentlyVisible = isOsmandKeyboardCurrentlyVisible();
|
||||||
if (!isCurrentlyVisible && !getOsmandKeyboard()) {
|
if (!isCurrentlyVisible && !isOsmandKeyboardOn()) {
|
||||||
changeOsmandKeyboard();
|
changeOsmandKeyboardSetting();
|
||||||
changeKeyboard();
|
changeKeyboard();
|
||||||
} else {
|
} else {
|
||||||
changeOsmandKeyboardVisibility(!isCurrentlyVisible);
|
changeOsmandKeyboardVisibility(!isCurrentlyVisible);
|
||||||
|
@ -586,7 +586,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
View.OnTouchListener inputEditTextOnTouchListener = new View.OnTouchListener() {
|
View.OnTouchListener inputEditTextOnTouchListener = new View.OnTouchListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||||
if (getOsmandKeyboard()) {
|
if (isOsmandKeyboardOn()) {
|
||||||
if (!isOsmandKeyboardCurrentlyVisible()) {
|
if (!isOsmandKeyboardCurrentlyVisible()) {
|
||||||
changeOsmandKeyboardVisibility(true);
|
changeOsmandKeyboardVisibility(true);
|
||||||
}
|
}
|
||||||
|
@ -612,7 +612,7 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
View.OnLongClickListener inputEditTextOnLongClickListener = new View.OnLongClickListener() {
|
View.OnLongClickListener inputEditTextOnLongClickListener = new View.OnLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onLongClick(final View view) {
|
public boolean onLongClick(final View view) {
|
||||||
if (getOsmandKeyboard()) {
|
if (isOsmandKeyboardOn()) {
|
||||||
final EditText inputEditText = (EditText) view;
|
final EditText inputEditText = (EditText) view;
|
||||||
PopupMenu popupMenu = new PopupMenu(getContext(), inputEditText);
|
PopupMenu popupMenu = new PopupMenu(getContext(), inputEditText);
|
||||||
Menu menu = popupMenu.getMenu();
|
Menu menu = popupMenu.getMenu();
|
||||||
|
@ -735,17 +735,17 @@ public class CoordinateInputDialogFragment extends DialogFragment implements Osm
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean getOsmandKeyboard() {
|
private boolean isOsmandKeyboardOn() {
|
||||||
return getMyApplication().getSettings().COORDS_INPUT_USE_OSMAND_KEYBOARD.get();
|
return getMyApplication().getSettings().COORDS_INPUT_USE_OSMAND_KEYBOARD.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeOsmandKeyboard() {
|
private void changeOsmandKeyboardSetting() {
|
||||||
OsmandSettings.OsmandPreference<Boolean> pref = getMyApplication().getSettings().COORDS_INPUT_USE_OSMAND_KEYBOARD;
|
OsmandSettings.OsmandPreference<Boolean> pref = getMyApplication().getSettings().COORDS_INPUT_USE_OSMAND_KEYBOARD;
|
||||||
pref.set(!pref.get());
|
pref.set(!pref.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeKeyboard() {
|
private void changeKeyboard() {
|
||||||
boolean useOsmandKeyboard = getOsmandKeyboard();
|
boolean useOsmandKeyboard = isOsmandKeyboardOn();
|
||||||
changeOsmandKeyboardVisibility(useOsmandKeyboard);
|
changeOsmandKeyboardVisibility(useOsmandKeyboard);
|
||||||
final View focusedView = getDialog().getCurrentFocus();
|
final View focusedView = getDialog().getCurrentFocus();
|
||||||
if (focusedView != null) {
|
if (focusedView != null) {
|
||||||
|
|
Loading…
Reference in a new issue