What I want is to have a listener when a certain element (like a button, an image, a view or anything else) became accessibility focused. I found stuff like mybutton.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED) but then I don't know what to do next, how to handle it.
My main purpose is to make a sound when an element became focused instead of reading his accessibility name.
Any suggestion?
Im not much of an Android developer, but i think the event you are using is sending information to the screen reader. You would need the opposite of that.
I think the answer to this question could help you
Google talkback API to get current focus item in android
Best of luck, sounds like a cool app for visually impaired children
Related
I don't know if this has been asked before. I am going to be building a calculator for my dad. He asked me if there is any way to have customization with the buttons.
I have not done any code yet. I plan on trying a few things. My research has come up with nothing.
This is what I am trying to accomplish, I have a feeling it breaks the android studio law of coding. This is the concept:
Imagine the calculator. You have 8 blank buttons above the numbers. Those buttons ordinarily have the functions such as percent and sqrt.,..etc.
I have been asked if it's possible can he just hold the button and change those functions at will.
So the question at hand is. Can I do if statements to change the symbol and the code for a particular button when long pressed?
The concept of the calculator would be in portrait mode he can customize the buttons to the functions he uses without having to turn the calculator in landscape mode?
So in theory you have a long press which would bring up a selector. He can select any math function and based on that function the symbol and code would change and the button will work properly to the new selection?
I was going to to build the calculator as a standard. But was also wondering myself if this is possible. I know the buttons serve as a one function but in coding anything is possible.
Any help or advice would be appreciated. If this can be done it opens new possibilities to app features to only show what you want and not a predefined controls.
*******once I try a few codes I will edit question to better see the issue and what I am trying to do.
OnLongPress show a dialog with the option you want and change the button text according to selected option.
On Onclick check the button text and call function according to the text
Apps like Floating Toucher or Link Bubble proves how useful a floating button can be. And no, I'm not talking about FABs as per Material Design guidelines here, I meant a literally 'floating' button that draw over any screen in the system that can be dragged around and clicked.
Take a look at these examples:
(source: boatmob.com)
Now, I tried to Google a way to do this but I'm afraid I'm still at lost here. How can these apps draw over screens outside their own?
I've come across this SO question which more or less asking about a similar question. But to be honest, I wasn't able to gain much information from it. Said question mainly addressed how to intercept a touch for a floating view; Not how to specifically make one.
I really hope that somebody out there could enlighten me on this. Thanks in advance for your time!
If you are talking about an activity's view (not Widgets), 'floating' on screen, like Facebook ChatHeads. Then you should create a background service and attach a view with it. Though it is not recommend by Android.
See below links
What APIs in Android is Facebook using to create Chat Heads?
http://www.piwai.info/chatheads-basics/
I keep seeing "focused" and hearing about "focusing" within the development of Android apps. My question is: What is focusing, and how is it applied within Android apps? Is it important? What can you do with it?
I'm sorry if this has been asked, I looked but didn't see anything that clearly explained it. I've looked the the Android development guide, but I couldn't find a decent explanation of what it is and how it works.
Focus is simply giving a specific view "focus", or attention.
One example of using focus is if you have an EditTextView and you want a user to be able to type into it as soon as it is displayed, you would give focus to that EditTextView and the keyboard would automatically be displayed in accordance to typing in that view.
If you've ever used a blackberry and browsed the web via that, you'll remember that whenever you scroll the wheel you sort of select random elements on the page until you find what you want, then click enter. You know what element you're selecting when the elements change colors, or become focused. That's essentially what's happening with 'focused' on ANdroid, except it's mostly used for when you're scrolling via some kind of buttons, or when you select a textbox or something and it's waiting for input.
It is just referring to the view that is active. For example, if you have a TextView and it is the active view then it would be in focus
Simply put, an object/item that has the user's attention for interaction is focused. It is a state an item can be in.
Android Dev UI Events
Android has many useful tools when coming to views and screens and layouts.
Description: While playing my game (running around as a zombie bear eating humans) I would like to allow the player to access an items menu via sliding a menu from the right side/edge of the screen. Or at the least be able to access a game options menu (not game settings which would be the menu button).
What would be the best fit for description?
P.S How would I make a question like this less like a discussion and more like a straight forward programming question when I don't really know what's available to do this.
Also, if this is the case, please point me to another location to ask a question that may require a discussion.
Thank You!
Try looking at the SlidingDrawer class.
PS I personally don't see a problem with how you have worded your question if you are looking for ideas of views/widgets you need to perform a specific function/effect.
My first thought, and for a simple approach (this wouldn't be animated or dragged really), would be using a RelativeLayout where the portion representing the menu was initially set so that it's visibility were GONE, except for a small tab or arrow or something. When that tab/arrow is touched, the visibility of the View for the menu could be toggled to VISIBLE.
With visibility set to GONE, a view is not drawn or considered in any part of the layout pass when the screen is drawn.
You could populate a listview with some icons and when an particular icon is selected, then figure out which one was selected and then execute some function and hide the sidebar using an animation. I've never developed a game, so I'm not too sure how far it deviates from the standard, but I wish you the best of luck :) ! If you post the source let me know would love to test your game and see how you work with the source!
i'm designing an android app atm and i wonder how it is possible to switch between views with a "sliding" animation as on the iphone.
what i mean is that i want to stay in an Activity and slide from left to right (or vice versa) and PART of the views slide in the respective direction, making room for another view. the rest of the ui stays where it is.
it is actually possible, since i've seen it in an actual working (not yet published) app. so - how do i do this?
Refer the answer given to this post