Merge pull request #8790 from osmandapp/Fix_profile_appearance_scroll
Fix cursor at the end of profile name
This commit is contained in:
commit
ab6edbfcba
1 changed files with 13 additions and 2 deletions
|
@ -268,6 +268,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
|
|||
super.onScrollStateChanged(recyclerView, newState);
|
||||
if (newState != RecyclerView.SCROLL_STATE_IDLE) {
|
||||
hideKeyboard();
|
||||
if (profileName != null) {
|
||||
profileName.clearFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -359,13 +362,21 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
|
|||
}
|
||||
}
|
||||
});
|
||||
profileName.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||
@Override
|
||||
public void onFocusChange(View v, boolean hasFocus) {
|
||||
if(hasFocus){
|
||||
profileName.setSelection(profileName.getText().length());
|
||||
AndroidUtils.showSoftKeyboard(profileName);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (getSelectedAppMode().equals(ApplicationMode.DEFAULT) && !isNewProfile) {
|
||||
profileName.setFocusableInTouchMode(false);
|
||||
profileName.setFocusable(false);
|
||||
} else {
|
||||
profileName.requestFocus();
|
||||
}
|
||||
profileNameOtfb = (OsmandTextFieldBoxes) holder.findViewById(R.id.profile_name_otfb);
|
||||
updateProfileNameAppearance();
|
||||
} else if (MASTER_PROFILE.equals(preference.getKey())) {
|
||||
baseProfileName = (EditText) holder.findViewById(R.id.master_profile_et);
|
||||
baseProfileName.setFocusable(false);
|
||||
|
|
Loading…
Reference in a new issue