Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf564f01 authored by Gary Mai's avatar Gary Mai
Browse files

Hide the keyboard on saving a contact

Test: Verified after editing a contact or saving a new one,
the keyboard is hidden.

Bug: 129235549
Change-Id: I5344a584ee49ffd99625d86b9960d65e5390dbda
parent 66967329
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -928,7 +928,7 @@ public class ContactEditorFragment extends Fragment implements
        }
        }


        setEnabled(false);
        setEnabled(false);

        hideSoftKeyboard();
        return doSaveAction(saveMode, /* joinContactId */ null);
        return doSaveAction(saveMode, /* joinContactId */ null);
    }
    }


@@ -1837,4 +1837,12 @@ public class ContactEditorFragment extends Fragment implements
            RESTORE_FOCUS_DELAY_MILLIS);
            RESTORE_FOCUS_DELAY_MILLIS);
    }
    }


    private void hideSoftKeyboard() {
        InputMethodManager imm = (InputMethodManager) mContext.getSystemService(
            Context.INPUT_METHOD_SERVICE);
        if (imm != null && mContent != null) {
            imm.hideSoftInputFromWindow(
                mContent.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
        }
    }
}
}