Skip to content

Added additional capibilities#3

Open
NateZ7 wants to merge 3 commits into
ravindu1024:masterfrom
NateZ7:master
Open

Added additional capibilities#3
NateZ7 wants to merge 3 commits into
ravindu1024:masterfrom
NateZ7:master

Conversation

@NateZ7
Copy link
Copy Markdown

@NateZ7 NateZ7 commented Jun 3, 2018

Hi, great library. Added a few things that will help me use the library directly.
Thanks alot !

private SoftKeyboardToggleListener mCallback;
private View mRootView;
private Boolean prevValue = null;
public static Boolean sPrevValue = null;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, why does this have to be public and static? This should not be accessed from outside.

}
}

/**
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can do it this way. What if there are multiple listeners? We don't want to share the same static variable that tracks the previous value for all of them, do we? I think the better way of doing this, would be to return a handle to the KeyBoardUtils object when adding the listener and then calling a non-static method on that object to get the current value.

@ravindu1024
Copy link
Copy Markdown
Owner

ravindu1024 commented Jun 4, 2018 via email

*/
public static void openSoftKeyboard(Context context) {
InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.SHOW_IMPLICIT);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we not using "InputhMethodManager.showSoftInput(View, int) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants