Jun 29 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jun 29 | 9:00 AM |
Dimitris K. | has entered the room |
Dimitris K. |
Hello Mark how is life ?
|
Mark M. |
hello, Dimitris!
|
Mark M. |
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?
|
Mark M. |
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)
|
Dimitris K. |
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
|
Jun 29 | 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
|
Dimitris K. |
just overriding the onKeyDown should be enough right ?
|
Mark M. |
well, that depends
|
Mark M. |
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
|
Mark M. |
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
|
Dimitris K. |
it in an edittext
|
Dimitris K. |
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
|
Dimitris K. |
oh
|
Jun 29 | 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
|
Mark M. |
basically, the IME is part of an app
|
Mark M. |
it can do whatever it wants
|
Mark M. |
its job is to provide keyboard input to other apps via the input method framework
|
Mark M. |
but, it can have its own settings screens or whatever else it wants
|
Mark M. |
sometimes, that stuff is only reachable through a separate activity
|
Mark M. |
sometimes, the IME has a button or gesture or something to get to this extra functionality
|
Mark M. |
there's very little that you can do about that, other than impose greater control on what IME gets used
|
Mark M. |
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
|
Mark M. |
if you're doing your own kiosk implementation... ¯\_(ツ)_/¯
|
Dimitris K. |
yep Im doing my own since the device owner version is kinda meh
|
Dimitris K. |
actually only the keyboard issue is left
|
Dimitris K. |
everything else works fine
|
Dimitris K. |
So one more question regarding the IMEs
|
Jun 29 | 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
|
Mark M. |
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
|
Mark M. |
I haven't looked into it specifically
|
Mark M. |
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
|
Dimitris K. |
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
|
Dimitris K. |
paste*
|
Dimitris K. |
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
|
Dimitris K. |
thank you, I will check it out
|
Jun 29 | 9:20 AM |
Dimitris K. |
One last question for today
|
Dimitris K. |
have you ever tried to animate viewpager transitions
|
Mark M. |
I haven't customized from the stock transition
|
Mark M. |
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
|
Jun 29 | 9:25 AM |
Mark M. |
oh, then ViewPager probably wasn't the best choice anyway
|
Dimitris K. |
yep
|
Mark M. |
ViewFlipper or something
|
Mark M. |
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
|
Dimitris K. |
basically if the viewpager is videofriendly
|
Mark M. |
I have never tried putting a VideoView, SurfaceView, or TextureView in a ViewPager
|
Mark M. |
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
|
Dimitris K. |
thats all I got for today!
|
Dimitris K. |
thanks for your time
|
Dimitris K. |
have a great day :)
|
Mark M. |
you too!
|
Jun 29 | 9:30 AM |
Dimitris K. | has left the room |
Jun 29 | 10:00 AM |
Mark M. | turned off guest access |