Skip to content

Commit

Permalink
Revert name change
Browse files Browse the repository at this point in the history
  • Loading branch information
harshad1 committed Sep 27, 2023
1 parent 105e847 commit 43eb15c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
_hlEditor.getViewTreeObserver().addOnWindowFocusChangeListener(hasFocus -> {
if (hasFocus) {
_cu.showIme(getActivity(), defocusImeState, _hlEditor);
_cu.showSoftKeyboard(getActivity(), defocusImeState, _hlEditor);
defocusImeState = null;
} else {
defocusImeState = GsContextUtils.isImeOpen(_hlEditor);
Expand Down Expand Up @@ -760,9 +760,9 @@ public void setViewModeVisibility(boolean show) {
_format.getActions().recreateActionButtons(_textActionsBar, show ? ActionButtonBase.ActionItem.DisplayMode.VIEW : ActionButtonBase.ActionItem.DisplayMode.EDIT);
if (show) {
updateViewModeText();
_cu.showIme(activity, false, _hlEditor);
_cu.showSoftKeyboard(activity, false, _hlEditor);
_hlEditor.clearFocus();
_hlEditor.postDelayed(() -> _cu.showIme(activity, false, _hlEditor), 300);
_hlEditor.postDelayed(() -> _cu.showSoftKeyboard(activity, false, _hlEditor), 300);
fadeInOut(_webView, _primaryScrollView);
} else {
_webViewClient.setRestoreScrollY(_webView.getScrollY());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
Expand All @@ -44,7 +43,6 @@
import net.gsantner.opoc.frontend.filebrowser.GsFileBrowserFragment;
import net.gsantner.opoc.frontend.filebrowser.GsFileBrowserListAdapter;
import net.gsantner.opoc.frontend.filebrowser.GsFileBrowserOptions;
import net.gsantner.opoc.util.GsContextUtils;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -379,7 +377,7 @@ public void onViewPagerPageSelected(final int pos) {

if (pos == tabIdToPos(R.id.nav_notebook)) {
_fab.show();
_cu.showIme(this, false);
_cu.showSoftKeyboard(this, false);
} else {
_fab.hide();
restoreDefaultToolbar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void onViewCreated(View root, @Nullable Bundle savedInstanceState) {
_searchEdit.setTextColor(rcolor(_dopt.primaryTextColor));
_searchEdit.setHintTextColor(rcolor(_dopt.secondaryTextColor));
_searchEdit.setOnFocusChangeListener((v, isFocussed) -> {
GsContextUtils.instance.showIme(getActivity(), isFocussed, _searchEdit);
GsContextUtils.instance.showSoftKeyboard(getActivity(), isFocussed, _searchEdit);
});

root.setBackgroundColor(rcolor(_dopt.backgroundColor));
Expand Down Expand Up @@ -210,7 +210,7 @@ public void onClicked(View view) {
@Override
public void onDismiss(final DialogInterface dialog) {
super.onDismiss(dialog);
GsContextUtils.instance.showIme(getActivity(), false, _searchEdit);
GsContextUtils.instance.showSoftKeyboard(getActivity(), false, _searchEdit);
}

private void showNewDirDialog() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2498,7 +2498,7 @@ public void showSnackBar(final Activity context, @StringRes int stringResId, boo
.show();
}

public <T extends GsContextUtils> T showIme(final Activity activity, final boolean show, final View... view) {
public <T extends GsContextUtils> T showSoftKeyboard(final Activity activity, final boolean show, final View... view) {
if (activity != null) {
final InputMethodManager imm = (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
final View focus = (view != null && view.length > 0) ? view[0] : activity.getCurrentFocus();
Expand Down

0 comments on commit 43eb15c

Please sign in to comment.