Creating android popup keyboard -
Creating android popup keyboard -
i've followed examples on developer.android.com regarding input methods , played softkeyboard sample application. these give more plenty info regarding creation of simple keyboard.
i made popup keyboard using "android:popupkeyboard".
<row android:keyheight="@dimen/key_height" android:id="@+id/label" > <key android:codes="97" android:keylabel="a" android:horizontalgap="@dimen/horizontal_border_gap" android:keyedgeflags="left" android:keybackground="@drawable/key_btn_l" android:popupkeyboard="@xml/popup"/> <key android:codes="115" android:keylabel="s" android:keybackground="@drawable/key_btn_l"/> <key android:codes="100" android:keylabel="d" android:keybackground="@drawable/key_btn_l"/> <key android:codes="102" android:keylabel="f" android:keybackground="@drawable/key_btn_a"/> <key android:codes="103" android:keylabel="g" android:keybackground="@drawable/key_btn_l" android:popupkeyboard="@xml/popup"/> <key android:codes="104" android:keylabel="h" android:keybackground="@drawable/key_btn_a"/> <key android:codes="106" android:keylabel="j" android:keybackground="@drawable/key_btn_a"/> <key android:codes="107" android:keylabel="k" android:keybackground="@drawable/key_btn_a"/> <key android:codes="108" android:keylabel="l" android:keybackground="@drawable/key_btn_l"/> <key android:codes="45" android:keylabel="-" android:keyedgeflags="right" android:keybackground="@drawable/key_btn_a"/> </row>
i have question popup.
i wish show popup center of keyboard. popup shown near pressed key. there thought showing popup @ center of keyboard?
when long press key, popup shown. wish show popup when short press. there idea?
if knows solution, please help me.
the default popup low customizable, can create own popup keyboard , customize want. think can dialog , popupwindow, popupwindow best in case.
create own keyboardview, can utilize method onlongpress, or ontouchevent, if utilize ontouchevent can count time key pressed , show popupwindow.
to create popupwindow:
view view = layoutinflater.from(context) .inflate(r.layout.popup_layout, new framelayout(context)); popup = new popupwindow(context); popup.setcontentview(view); popup.setwidth(windowmanager.layoutparams.wrap_content); popup.setheight(windowmanager.layoutparams.wrap_content); popup.showatlocation(this, gravity.center, x, y);
create variables x , y , based on touch position.
android keyboard popup ime
Comments
Post a Comment