It may be broken.  I don't know the state of the code you are working with.

On Fri, Mar 27, 2009 at 12:23 AM, Paranoia <zheny...@gmail.com> wrote:

>
> Thank you for such a quick reply!
> please see my comments in line.
>
> On Mar 27, 3:14 pm, Dianne Hackborn <hack...@android.com> wrote:
> > On Fri, Mar 27, 2009 at 12:04 AM, Paranoia <zheny...@gmail.com> wrote:
> > > 1. why InputMethodService force the ime developer to follow the fixed
> > > layout - extracted text, candidate view and input view. i want to
> > > layout them by myself. can i do this via derive the
> > > AbstractInputMethodService? if yes, can android team keep this
> > > abstract class always open and stable?
> >
> > I would strongly recommend against using that directly.  Using
> > InputMethodService isn't really going to limit what you can do, and it
> takes
> > care of a lot of the details of interacting correctly with the
> application.
> >
> > There is a lot of default functionality in InputMethodService for
> providing
> > the correct standard behavior for an IME.  If you want to force
> particular
> > behavior, there are various methods you can override to impact that.
>  Just
> > go through the methods and see what you want to do.
> >
> > For example, if you want to do your own candidate view, just do that.
>  Don't
> > call the method to show the candidate view.  Likewise if you want to
> always
> > run in fullscreen/extract mode, then implement the method that decides
> when
> > to be in that mode and just always do it.
> >
> > > BTW: InputMethodService is
> > > really hard to use.
> >
> > Well writing a well behaving input method is a little harder than writing
> a
> > regular application. :)
> >
> > > 2. what's the correct behavior of the InputConnection.commitText?
> > > i write the following code. but it can not satisfy me.
> > > ...
> > > InputConnection ic = getInputConnection();
> > > ic.commitText(textA, 1);
> > > ic.commitText(textB, 0);
> >
> > > i want the cursor to before the textB and after the textA. but it
> > > always be present after textB.
> >
> > Use -1 for the second param; I am pretty sure the doc explains how the
> > cursor position argument works.
>
> i tried this the cursor is moved before textA....
> let me summarize the test result.  (i use "|" to represent the cursor)
>
> ic.commitText(textA, 1);
> ic.commitText(textB, 0);
> result: textA textB |
>
> ic.commitText(textA, 1);
> ic.commitText(textB, -1);
> result: | textA textB
>
> I want this:
> result: textA | textB
>
> actually, i found that the results are same whatever the
> newCursorPosition is 0 or 1. seems it's not so consistent with the
> comment.
>
>
>
> >
> > Also please note...  there is not yet an SDK for cupcake, these are all
> new
> > APIs, I have no idea of what build you are working against, and depending
> on
> > which that is various things may or may not be broken, or have changed,
> or
> > whatever else.
>
> Thank you for you advice. I have been following the code changes for a
> long time. :-)
>
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support.  All such questions should be posted on public
> > forums, where I and others can see and answer them.
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to