I was looking for animation which is like a spinning wheel which has circles and they are clickable. So two Actions one is Touch and fling to rotate the wheel second to click the circle. Circle values need to be dynamically assigned.
Please have a look at attached Click to view the sample image to help you visualize
Related
Please refer to the screenshot images attached, The below image shows Google Pay app.There is only 1 axis and the circle button can slide along that axis only.
What I require is 3 axes( as T or Y as seen in the second image) and a circle button that can slide along all those axes.
I understand this can be done using Custom View in Android.
However, I need help in writing a custom algorithm to define the motion of the circle button along those axes.`
Second image - hand drawn mockup
I am experimenting with Views in Android and am trying to create a custom 'widget'. What I want to do is create a portion of a circle with an indicator at 12'o clock. I'd then like to to swipe over the circle and when I do, I'd like to see the indicator move to left or right corresponding to a swipe to the left or the right.
I have looked up a number of sources however I am unsure of how to draw an 'indicator' within the arc. In addtion, what needs to be done to animate the arc ? Can this be achieved without OpenGL ?
I am aware of the circlular progress bar and I believe the problem is quite similar, however I didn't have to add a marker inside the circle.
Here is an image of the screen shot of the View I would like to recreate:
This approach would work,Creating a View with rounded corners and position it to bottom to make it seem like arc
I dont know how to achieve this effect on long click. Long click on image in pinterest android app. Three buttons sliding from red ring to left.
Edit: like this https://github.com/GnosisHub/GHContextMenu
Put 3 invisible ImageViews in the layout (these are the buttons). Set an onLongCLickListener on the larger ImageView. When the long click occurs, make the three buttons visible and animate them into position with ObjectAnimator or ViewPropertyAnimator. When you want to dismiss the buttons, animate them back to where they started and make them invisible again.
You will have to do some math and figure out how far to translate (move) the buttons in the X and Y directions, and it will be different for each button. I suggest placing the buttons where you want them to be when they are visible. When you want to animate them, calculate the difference between their current position and the center of the larger image (or from the touch location). Then you set translation X and translation Y to those values and animate them back to 0.
I am interested in implementing a user interface navigation control mechanism based on a wheel shaped device (or pie chart shaped or circle shaped) in my Android app.
I would like only half of the wheel to be visible at any time. That is, only the top half of the wheel should be visible since the bottom half should be below the border of the screen. The user can then turn the 'half wheel' to show options hidden by the screen border. The visible top half should then be divided into three parts like a pie chart, so the user can press either one of them to invoke some action. The following pic should explain (it is an example with seven (A-G) options).
http://imgur.com/lNu1F
The rotation itself should not be hard, but I am having a hard time understanding how to position the wheel so that half of it is outside the actual screen. I am thinking that loading the entire wheel (but hiding half of it) is best, since that is that graphics I have and it will also allow a smooth animation when the user swipes to show some other options. How can I make Android show the wheel in this way?
Also. Any comment on how to implement the 'swipe along the wheel shape' would be appreciated.
Thank you.
So for the wheel - you are hving trouble knowing how to position the wheel because you are using XML to align you objects and would like to use something like "Align Object Center To Bottom" which does not exist.
Here is one approach that might work fine: Mask the wheel view.
Is it possible to mask a View in android?
As for swipe the wheel along, I would register the wheel to take touche events, and use only the horizontal componenet of move events to apply to the rotation of the wheel. This setup is common in audio software that uses knobs.
However if you want to have it stick to the users finger in a more realistic fashion, you will need to do the following:
When the user first touches the wheel, calculate the angle from the wheel center to the finger.
Every time the finger moves, check the angle from the wheel center to the finger - and rotate the wheel the amount that the angle has changed from the last touch event.
The formula for getting the angle between two points is this:
Float angleInRadians = Math.atan2(point1.y-point2.y, point1.x-point2.x);
Hey I was wondering if there is any way to do this without going insane with lil buttons built up to make it but basically what I want to do is make two curved buttons around a circle one, is there any way of doing this?
Hers an example of what I kinda want, sorry for how crude the drawing is.
There are two parts in answering this question : how to have buttons looking like this, and getting the touch on the areas you draw.
For the first part, you can use a FrameLayout or a Relative Layout to draw your buttons exactly where you want, and custom images as background (maybe for the circle you can make a ShapeDrawable).
For the second part, it can be very simple : if the Circle (biggest button) is on top of the other two, then this can be ok. But I guess the touchable area on each button will be a rectangle.
Another way to do this is create a custom view, handle the Touch events yourself and based on the X and Y, detect which part has been touched