I am looking for a custom component to design a circular remote control view like the image below with different button and background color.
Each button should be touchable with proper press effect. I did find a useful library with this I am able to create somewhat similar design but still there are lots of improvement required like Press effect/ Inner and outer circle padding radius etc. Please help me to find the better option for this.
I think tihs is your answer.
You can download here.
https://code.google.com/p/radial-menu-widget/
You could make your own class extending view. You will then be able to override onDraw() and draw whatever you want.
You could also use default android Button with a custom xml selector defined with a different image ressource for pressed/not pressed states.
Related
thank you for answering me
I just want to know how i can make the shadow below this card
I already tried several ways like Elevation... but it didn't work for me.
I searched a lot about it and I found that website :
Shadow generator
But i'm wondering if there is another way, using xml or anything else.
You are half right in that elevation is required for a shadow effect.But note this is only applicable to view that are not buttons. For buttonViews you can add a statelist animator that handles the properties of a button for all its states.Also if you are using something like a textView that does not have any margins you might as well use a background to show the shadow as follows:
android:elevation="30dp"
android:background="#000"
For other views, this means simply adding the elevation attribute as shown above and the background is not required
This link will help:
How to provide shadow to Button
So lets say I have a segmented circle image asset inside an 'ImageView' widget, and I want to use each segment of that circle as a clickable surface to bring up a fragment with an image and some info.
Is there any way to build transparent arrangeable borders that I can use to do this with?
I'm using android studio with the default NavigationDrawer activity if that helps.
Maybe adding some ImageViews with transparent images on top of each section and making them clickable? That's how I'd do it. Of course this won't cover perfectly the area but it may work for what you need it.
So I found this. In case it can be of help to anyone else:
https://github.com/anupcowkur/Android-Wheel-Menu
I'm trying to make a widget which is a togglebutton like the ones in the android control widget (the quicksettings for wlan, bluetooth etc.).
Here's how it looks (#Control Widgets)
Does anyone know if this layout is contained in the android sdk or if not how I can make a layout just like that one?
I've already tried some things but I don't know how do to the stroke at the bottom.
Regarding to your issue I searched a little bit deeper.
See: https://developer.android.com/guide/topics/appwidgets/index.html
These are the classes which you can use with an appwidget to implement in your layout there is no such thing like a toggle button, but an imagebutton which I think us exactly what Google is using for the "toggle buttons". Take a closer look on the imagebutton :
https://developer.android.com/reference/android/widget/ImageButton.html
Then you will find out it's exactly what you are looking for.
By default, an ImageButton looks like a regularButton, with the standard button background that changes color during different button states. The image on the surface of the button is defined either by the android:src attribute in the XML element or by thesetImageResource(int) method.
I can't imagine that such a complex layout is possible just using clean xml...
Hope it helps now!
Hey guys I am having trouble with placing my buttons in my XML layout. I already have a background and was just trying to put 3 buttons near the middle and thats where I'm having trouble. I know about center gravity and all that but could you help me? Also, If I made my own buttons can I just import them using the image button thing, or is that not right? Thanks for the help!
PS: Also, there is a big white box around my button. How do I get that to go away?
I posted this answer to your duplicate question, so I'll also post it here. :)
You can rearrange elements of your layout by editing the XML directly or by dragging and dropping in the outline view or the graphical layout view (I find the latter harder to do reliably).
To use your custom views, click on the "Custom & Library Views" button in the graphical layout palette, or just type in the fully qualified class name as the view tag in the XML.
If you use Image button you can set your custom Image to src property or background property. If youi chose src you should add android:background="#null".
But I would recommend to use background property while if you use 9-patch png (who knows maybe tomorow you will use 9-patch) they would not stretch if you set it in src.
I am trying to create one custom button which is circular and when i click that button i want that button FOCUS and COLOR change and i don't know how to do exactly so any one can help me or show me that code how to do?
You can use a regular Button and specify custom Drawable for it and then apply it to the Background property of the button. See the ApiDemos for examples of styling controls.
You can use two (or more) drawables for one Button and change the drawables in various states (focus, press, etc). Look at this: http://blog.androgames.net/40/custom-button-style-and-theme/