Reputation: 157
I'm currently experimenting with the sample SoftKeyboard on my tablet (Android 3.2). When I open the Google mail app and set the focus to the recipient field, the textfield is expanded to fill the available space above the keyboard.
This looks very much like the fullscreen or extract mode as described in Onscreen Input Methods in the documentation. From what I gathered there, this is set by the activity, which uses the SoftKeyboard.
What bugs me is
So my question is: What do I have to change to get a similar behaviour in the example SoftKeyboard?
Thanks & all the best
Andreas
Upvotes: 2
Views: 2068
Reputation: 983
I had a similar question as I created my own keyboard and this blog post pretty much answered what I needed to know:
http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html
Maybe it will help you too.
Upvotes: 0
Reputation: 2854
The sample soft keyboard is very out-dated -- it uses a layout that hasn't been seen since Froyo/Eclair.
The sample soft keyboard is just that: a sample, not to be confused with a fully-fledged android keyboard. If you are looking for a full implementation of an Android keyboard, check out AnySoftKeyboard's source code or the AOSP source code.
To get rid of fullscreen, I know part of the issue lies in the onComputeInsets()
function. Like I said though, I'd base your code off full Android keyboard (i.e. AOSP or Cyanogenmod) rather than trying to get the sample to work. I tried that for months, and there's just too many problems you'll run in to (multitouch and theming, just to name a couple).
Send me an email if you have any questions.
Upvotes: 1
Reputation: 1277
you can design your desired softkeyboard layout using buttons, textview whatever you want to display on keyboard.
and setOnclickListener to all Buttons of your keyboard
Override onCreateInputView() like this
@Override
public View onCreateInputView() {
View mInputView = getLayoutInflater().inflate(
R.layout.yourkeyboardlayout, null);
Button btn1 = mInputView.findViewById(R.id.btn1);
btn1 .setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
// append text in selected TextField
String buttonLabel = ((Button)v).getText().toString();
getCurrentInputConnection().commitText(buttonLabel, 1);
}
});
return mInputView;
}
Upvotes: 0