Monday, February 17, 2014

NDK know how "down to hide" button is pressed some input?


http://img.my.csdn.net/uploads/201311/14/1384440677_8134.jpg

http://img.my.csdn.net/uploads/201311/14 / 1384440677_8134.jpg

That figure is framed in red button, when clicked, the input method will be hidden, how the program know that? Input method or determine the status (whether in reality) can be.

Judgment is always found with IMM.isActive True (IMM is INPUT_METHOD_SERVICE)

View Add setOnVKStateChangeListener also intercept less (only intercept program initiative to show / hide the action)

AKeyEvent_getKeyCode key message did not take this (receive only a carriage return / return / menu button, etc.)
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Nor with addOnLayoutChangeListener always get the size of 800 * 480
Reply:
I have encountered this problem, but it seems there is no good solution. As I understand it, the hidden buttons are set up their own input method, not the system requirements, so it will not be a triggering event system response.
My approach:
1 If the response is to hide the close button EditText, EditText that can be displayed on the screen, allowing the user to turn off EditText
2 can monitor the return key to determine whether to close the input method.
Both methods are detours around and was not able to solve the problem of hidden buttons to listen directly.

Reply:
I'd listen back key and Log, but no button is hidden, no back button nor the Enter key (may achieve different different input methods)

I found an open source input source view, and it seems click to hide when the input method window just canceled his own, and did not do anything else
https://codeload.github.com/hilarycheng/another_android_cangjie/zip/master
(CloseButton.java)

I mainly want to click the hide button down, let the program exits the input state. Just click "Finish", as "return" when the effect,
Currently is not achieved, the point once again only allows users to edit box, and then point to complete or return. (For example, in the lower half of the screen to draw a prompt text)

In addition, I found addOnLayoutChangeListener actually is possible, provided that the program is not in full-screen mode, in full-screen mode, the callback
procedure onLayoutChange (v: JView; left: Integer; top: Integer; right: Integer; bottom: Integer; oldLeft: Integer; oldTop: Integer; oldRight: Integer; oldBottom: Integer); cdecl;
The parameters to be right, but once set to full screen on the silly

QQ Landlords such as joy, it is inside the input method (it should be used cocos2d-x), should be to create a Cocos2dxEditText (extends EditText) then referred to the foreground, is the creation of Java's Edit control, and then open input method.

At this time a non-full-screen mode, if a finger pull down from the top, you can see the status bar out, while Edit is compressed smaller, after a while, the status bar will automatically hide, then Edit and automatically expanded, I think, It should be wrap_content option to use, and it should be is by onLayout / onSize kind of input method to determine whether the closed off when the input method when, onLayout / onSize parameter becomes large, this time to know: input method is closed, and then exit edit mode and return to. .

I do not know if it's the status bar will automatically hide is how to do?
Reply:
If you can do: non-full-screen mode, but the status bar will automatically hide, it is tantamount to full-screen mode while to get the right OnLayout,
You can also

No comments:

Post a Comment