mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-25 14:26:13 +03:00
reformat code
This commit is contained in:
parent
2405959324
commit
988ce872cc
2 changed files with 6 additions and 5 deletions
|
@ -141,7 +141,7 @@ public class NoteEditFragment extends SearchableBaseNoteFragment {
|
|||
super.onResume();
|
||||
binding.editContent.addTextChangedListener(textWatcher);
|
||||
|
||||
if(keyboardShown){
|
||||
if (keyboardShown) {
|
||||
openSoftKeyboard();
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public class NoteEditFragment extends SearchableBaseNoteFragment {
|
|||
}
|
||||
}
|
||||
|
||||
private void openSoftKeyboard(){
|
||||
private void openSoftKeyboard() {
|
||||
binding.editContent.postDelayed(() -> {
|
||||
binding.editContent.requestFocus();
|
||||
|
||||
|
@ -174,7 +174,7 @@ public class NoteEditFragment extends SearchableBaseNoteFragment {
|
|||
Log.e(TAG, InputMethodManager.class.getSimpleName() + " is null.");
|
||||
}
|
||||
//Without a small delay the keyboard does not show reliably
|
||||
},100);
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -58,11 +58,12 @@ public class DisplayUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Android does not provide a way to get keyboard visibility prior to API 30 so we use a workaround
|
||||
* Android does not provide a way to get keyboard visibility prior to API 30 so we use a workaround
|
||||
*
|
||||
* @param parentView View
|
||||
* @return keyboardVisibility Boolean
|
||||
*/
|
||||
public static boolean isSoftKeyboardVisible(View parentView){
|
||||
public static boolean isSoftKeyboardVisible(View parentView) {
|
||||
//Arbitrary keyboard height
|
||||
final int defaultKeyboardHeightDP = 100;
|
||||
final int EstimatedKeyboardDP = defaultKeyboardHeightDP + (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? 48 : 0);
|
||||
|
|
Loading…
Reference in a new issue