Potentiometer circle button - java

I have to make a volume button.
The button have to be used like in real life : Means that the user drag it in circle
The thing is i have no idea how to do it.
I already got through google and the only thing i found was how to do a circular seekbar, which is not good since i have only one image/button
How can i acheive that ?
EDIT 1 :
For now i found this :
http://code.tutsplus.com/tutorials/android-sdk-creating-a-rotating-dialer--mobile-8868
http://upload.wikimedia.org/wikipedia/commons/1/1a/Cartesian_coordinates_2D.svg

Best way is to create your own custom View
But if you don't want to do this.
Then just use this SeekArc around your image and customize its thumb and color to look like your view and change volume as you want.
if you need any assistant,ask me
Custom Rotatory knob

Related

Image carousel with circular scroll view

Actually i want to implement the following carousel.The idea is that as long as you spin the circular bar it displays images categorized with different colors.I don't know where to start from .I thought about mixing a circular scroll view with the carousel but i am not sure if it's right. Could you please share ideas or tutorials with me ? i will be grateful to that.
I think the best solution is to create a kind of circular seekbar with a custom style that will be modified on progress changed. You will be able the section you want by checking the progress of the seekbar.
A github project exist to make a circular seekbar :
https://github.com/RaghavSood/AndroidCircularSeekBar

Android: i need to do a menu like the image

i'm developing an application for android that is already done for IOS, is not big problem.
the thing is that my boss want it to be exactly the same, but one of the menus is the problem, is like a slide menu but with zoom and a background image, anyone have any idea how can i do this, i already google it but no results :(, a library would help.
here is a picture with the menu for IOS.
I don't think if it would be an effective solution but you can use a RelativeLayout.
Put the selection part behind in a LinearLayout then put a framelayout front to contain list fragments. This way you shouldn't use an action bar to have absolutely same looking with iOs version.
When someone clicks open button apply an animation to your framelayout. scale it by %75 and move it 25% in y coordinate and move it %50 in x coordinate. When buttons in your LinearLayout apply a reverse animation to your FrameLayout. If swap button clicked change your fragment with new one. You can also aply a transaction animation to your fragments.
I hope you know how to handle this stuff. If no I can do my best to code an example.
EDIT:
Don't forget to set your flame layout unclickable when you move it to right side.
https://github.com/SpecialCyCi/AndroidResideMenu
I think I found your answer. I came across this in a list of libraries it is 3.8 on the list https://github.com/Trinea/android-open-project/tree/master/English%20Version
Cheers!

Android app navigation | custom navigation

I think this could be a bit difficult.
I created an coordinate system, to build a game upon it. Since now your are able to move left and right by swiping. Is it possible to allow swipe up/down?
But I think its very annoying to swipe all the time, so I had the idea to add a system like google maps using it (move around by tap and hold).
Is there already a listener or something similar to include this, or does anybody know how to create something like that.
I've already searched around the web to find something... without success.
Thanks for your help.
I've got an awnser myself, just use the OnTouchListener and catch the MotionEvent.ACTION_DOWN and .ACTION_MOVE for example so you are able to always get the current touch position and calculate the difference between it and the start position and animate the map for this values.

How to change the style of an Android widget button programmatically?

I would like to change the style of an Android widget button (specifically the corners) completely programmatically. Meaning, I would like to do it without any xml files at all. From my research I am coming to the conclusion that this is not posible. Is my conclusion correct or does someone know how it might be done?
You should look at the inherited methods from TextView and View of Button:
setPadding(int left, int top, int right, int bottom)
to name one... you can also change the layoutparams of the button object, which gives you access to all the xml attributes normally accessible. In general, you can do everything programmatically that you can do in the xml.
If that isn't enough, you can extend the Button class and override the onDraw method to change how android draws your button
EDIT:
Maybe you can add an xml theme much like this thread suggests: How to programmatically setting style attribute in a view
and then in it set
and add the theme programmatically to the button?
I haven't done much work with themes, so I can't attest to whether this will definitely work
Why do you think this is the case? Taking one of your items as an example, here's a method to set padding.
For corners you can use a drawable with a shape with rounded corners. See the documentation for drawables. There are also many questions (with answers) on StackOverflow about this too. If you want to do it programmatically there is the RoundedRectShape.

What in Android would allow me to touch the edge of my screen while playing my game and slide over an Item screen?

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!

Categories

Resources