I'm trying to do an Accessibility Service where the purpose it's to create some "layer" between the user when he touches the screen and the tap.
For example : when I touch the screen I when to double tap at this precise position I touch the Screen.
I think, but I'm really open to suggestion, that I will have to create an invisible layout that will cover all the screen where a would be able to activate an onTouchListener to get the position and use my accessibility service to create gesture and transfer the touch behind the layout to click anywhere.
As far I only found a solution for Android 4.1 or less.
I also want to use a kind of cursor, the app Open Sesame do it well and the cursor can go over the navigation bar and interact with.
I also found the open source project Eva facial mouse but they don't perform complex gesture and don't go over the navigation bar.
So my big question is, I am in the right way by wanting to create an invisible layout to detect touch even on the navigation bar and is there someone would help me to enlighten my search in the right direction.
I succeed in putting an overlay layout over the status bar, just add the right Flags to your LayoutParams.
For my case I use: FLAG_FULLSCREEN, FLAG_LAYOUT_IN_SCREEN and FLAG_LAYOUT_NO_LIMITS.
Related
I am working on Floating Action Bar on top of keyboard if user clicks on one of the EditText. I couldn't start on it and that's why not have any code to present.
I am confused on how to approach this problem. I am considering to use bottom sheet but I am still not getting confidence on it (I think android should have something better to use as base for this view).
I don't need any code snippet but need a direction. I am new to Android and before jumping to implementation, I needed a direction to start with.
Any suggestions? I am implementing
something similar to Outlook app.
So this floating toolbar is just a view that contains icons to press. This view should be located as the bottommost view on the screen. If you're using a ConstraintLayout use app:layout_constraintBottom_toBottomOf="parent".
And the android:windowSoftInputMode for hosting activity can be set to adjustResize (doc).
So when the keyboard opens it pushes this bottommost view up (and now this view is right above the keyboard).
I need to build a menu in android that starts as a half circle and once tapped, exposes menu options drawn in an arc around the half circle.
I have experimented with canvas drawing and while it achieves the desired result, there isn't a way to add touch events easily and allow me to animate the menu as i would like.
Is there a library or a better way that will allow me to achieve this.
The background needs to have an overlay and the menu positioned above the overlay to simulate general menu opening as it works on web.
Screenshot of current menu screen:
I need to be able to add touch events to each individual menu item and allow it to open close as well as bring it to the front of the text as even though i have drawn the menu last, the text stays above.
I'm using drawArc, drawCircle and drawText to do it all.
Anything better I can use?
Any help will be appreciated.
It is called a Radial Menu. You can use this widget to get what you are looking for - Radial-Menu-Widget-Android.
I'm trying to make an extra effect to menu that will come down from the top of the screen
I want to make it enter the screen while swiping it from the top and if the user left it, it should continue to the end
this is the figure that demonstrate what I want to do:
I tried to do it with animation but the animation will not go on while swiping and it will go to the end without touching
any other ideas to move the view down with finger ?
Check this out for a sliding Drawer http://developer.android.com/reference/android/widget/SlidingDrawer.html
it sound like you kind of want the same thing as the pulldown menu at the top of all android phones except you want it customized, the link will show you that.
OK
It works for me now
I used SlidingTray.java class from this API
API Website
btw : this api open source
I implemented a SlidingDrawer in my app and everything works fine so far.
Then I made an invisible handle, just like the one in the Android main window.
Now I want, that it is possible to grab the handle (and make it visible) just by moving the finger over the handle. I mean the same behaviour like the one in the Android main window.
But i donĀ“t know how to mange that.
(At the moment it only works when you tap at the handle, and not if you tap somewhere else and move the finger above the handle)
Sounds like a bad idea. There will be no way to distinquish between the system's drawer and your app's drawer.
You want to detect a swipe motion that starts on the top bezel.
You want to use MotionEvent's getEdgeFlags() to detect whether a swipe gesture starts on the bezel.
I'm implementing a sliding from top drawer custom widget from some source code (AFAIR, from sephiroth). It works well as is, but I need a small layout (i.e. 3 buttons) in the handle of the drawer. So, I had to modify the code a little. I'm using dispatchTouchEvent in the main onTouchEvent of the widget, to propagate the necessary events down to the children of the handle view.
It works well when the drawer is closed (the handle and its buttons are on the top of the screen), but when it is open all the way down handle buttons stop working. I have a proper response on touch from the handle layout frame (its color changing and I can close the drawer) though.
By an accident I've realized that handle buttons can be triggered by touching their old locations near the top of the screen! But their images are properly shown at the bottom, and react to the setText() properly. What's happening? And how to fix that?