Office Hours — Today, June 29

Yesterday, June 28

Jun 29
8:55 AM
Mark M.
has entered the room
Mark M.
turned on guest access
9:00 AM
Dimitris K.
has entered the room
Dimitris K.
Hello Mark how is life ?
Mark M.
hello, Dimitris!
how can I help you today?
Dimitris K.
I am wondering if there is a way of deactivating a button on the AOSP soft keyboard
Mark M.
are you forking it to create your own IME?
or do you mean as an app developer running on a device that happens to use that IME?
Dimitris K.
no I would like to know if I can somehow get the key event and disable it (I know that this normally only works with hardware keyboards)
the 2nd
Mark M.
for your own activities/views, you might be able to do that by consuming the key in onKeyDown()
Dimitris K.
basically that IME can get the user out of my kiosk mode and get him stack there
Mark M.
but you can't do that across the whole device
Dimitris K.
so onKeyDown will get triggered from the AOSP key presses
Mark M.
well, it gets triggered from any standard key event
9:05 AM
Dimitris K.
I will check it thx
Mark M.
it's not tied to the AOSP keyboard specifically
Dimitris K.
sadly it doesnt trigger it
Mark M.
what button are you referring to?
Dimitris K.
actually I cant see any button click triggering it from the soft keyboard
just overriding the onKeyDown should be enough right ?
Mark M.
well, that depends
for example, if the IME is displayed because the focus is on the EditText, you would need to create a custom subclass of EditText/AppCompatEditText and consume the event there
onKeyDown in the activity will get all key events not consumed by the focused widget and its parents up the view hierarchy
Dimitris K.
I see ! well if that can work I will do that since I only have
it in an edittext
and it sounds very reasonable I dont know why I didnt think of that
Mark M.
the only thing in an IME that might not trigger a key event would be any sort of button that opens up some sort of settings screen (e.g., to configure the IME)
Dimitris K.
One more question related with IMEs
oh
9:10 AM
Dimitris K.
anyway of getting that button clicks?
Mark M.
write your own IME
Dimitris K.
worst case option I guess
Mark M.
or, switch to some IME that does not have that sort of button
basically, the IME is part of an app
it can do whatever it wants
its job is to provide keyboard input to other apps via the input method framework
but, it can have its own settings screens or whatever else it wants
sometimes, that stuff is only reachable through a separate activity
sometimes, the IME has a button or gesture or something to get to this extra functionality
there's very little that you can do about that, other than impose greater control on what IME gets used
that, in turn, can be a pain for dealing with multiple languages
Dimitris K.
I will search for an IME without settings and if none exists I will have to make my own
Mark M.
if you're using standard Android 5.0+ kiosk stuff, I would assume that there is a standard solution for this
if you're doing your own kiosk implementation... ¯\_(ツ)_/¯
Dimitris K.
yep Im doing my own since the device owner version is kinda meh
actually only the keyboard issue is left
everything else works fine
So one more question regarding the IMEs
9:15 AM
Dimitris K.
do you know if its possible to have a non keyboard app that acts like an IME (basically gets a call when the user focuses an editable field)
Mark M.
well, an accessibility service finds out about focus changes
IIRC, anyway
Dimitris K.
can I also check if the focused thing is editable and paste something inside ?
Mark M.
presumably, as AFAIK some password managers do that sort of thing
I haven't looked into it specifically
Android 8.0 offers autofill, but that's still as the Android O preview at the moment
Dimitris K.
well im on 4.4 and 5.1 :P
basically I saw an app on a tablet that had a floating button and you could click it to past in the focused editable field
paste*
and the same time the keyboard appeared
Mark M.
my guess is that it is using an accessibility service
Dimitris K.
so I kinda need to implement something like that
thank you, I will check it out
9:20 AM
Dimitris K.
One last question for today
have you ever tried to animate viewpager transitions
Mark M.
I haven't customized from the stock transition
as I haven't really had the need
Dimitris K.
well I was asked for a fade out to black and fade in from black animation per transition
Mark M.
that feels awkward from a UX standpoint
Dimitris K.
and it was kinda getting messy so just didnt use a viewpager but animated the imageviews
Mark M.
the user swipes, and all of a sudden the screen goes dark?
Dimitris K.
no it wasnt made to swipe
9:25 AM
Mark M.
oh, then ViewPager probably wasn't the best choice anyway
Dimitris K.
yep
Mark M.
ViewFlipper or something
or, as you did, direct animations on the views
Dimitris K.
does it get fancy to have the viewpager with videos images and generally different content
Mark M.
sorry, I do not understand that question
Dimitris K.
well case I need to have video content as a page do I have to worry about performance or so ? Or do I just have a thumbnail until the animation stops and the video playback starts
basically if the viewpager is videofriendly
Mark M.
I have never tried putting a VideoView, SurfaceView, or TextureView in a ViewPager
or a ViewFlipper for that matter
Dimitris K.
me too
Mark M.
so, I have no idea, sorry
Dimitris K.
I guess we will know next week
thats all I got for today!
thanks for your time
have a great day :)
Mark M.
you too!
9:30 AM
Dimitris K.
has left the room
10:00 AM
Mark M.
turned off guest access

Yesterday, June 28

 

Office Hours

People in this transcript

  • Dimitris Kirakosian
  • Mark Murphy