Custom Shape Button Android - android

I have to address this type of views which has buttons below example.
http://www.planet1107.net/blog/custom-shape-uibutton-tutorial/
It is in the iOS. so is there any way to make it in Android.
I also have to give click events on all of those buttons.

I would recommend just exporting these custom images to pngs. Then adding the pngs to your Android project and simply referencing them in the code or XML. Then on a click event you can simply change the icon to indicate that it has been clicked and if the user clicks on it one more time change it back.
This will also ensure that the Android images look identical to the iOS ones.

Related

How to listen onClick events on complex Images on Android

I have the following image:
I need to change the color of the circles once it is clicked.
The image is a SVG
Should work on Android API 17+ and if possible for tablets as well
What is a smart/effective way to achieve that?
The possible solution I have until now are:
Break it in small clickable parts(Not good, there will be lots of images, other body parts will be required to do the same)
Use a Webview with Javascript to change the colors.
Any other suggestions?
One option is to use WebView and handle with these click events you need using javascript or even JQuery. You just need to put ID or classes.
$("#cicleButton1").click(function() {
});

iOS equivalent to androids colors.xml

I'm developing an app with different brandings that do share the same codebase for most parts. In my android project, I got a xml file for every branding containing the colors. Every view used the color codes defined within these xml files instead of using 'hard coded' color codes.
I would like to achieve the same thing within iOS. How can I do this? I would prefer a solution that does not involve dragging all references into the view controller and set colors via code. Is this possible with Xcode?
Please click on a view and check for Background.Click on dropdown and check
other... is present , click on that now follow the screenshot attached.

Android Contextual menu (similar to music app)

I would like to create a contextual menu for a listview similar to the one used by the google play music app in the listviews. (see screenshot. The triangle buttons open the menu for the album. and then one can select different options depending on the selected item.) But I've also seen this element in other apps.
https://lh5.ggpht.com/IvSpTcmdyUOC9GoX-x528xAzy9jEPjWCLcNcru4CBEcUNZ-YHo0y2TQHcGmuvOQ2zg
The Problem is that I neither know how to implement the triangle button correctly (is that just a normal imagebutton?) nor do I know how to open that popup window for each entry.
One approach I tried was using a spinner. But the problem is that the spinner always was as wide as the longest element in it and not just the triangle. Otherwise this would be a good solution. Is there a way to set the spinner to a smaller size and hide the horizontal line beneath it?
Or would a spinner be the complete wrong approach and I should solve this problem differently?
You should be using a Button or an ImageButton to trigger the PopupMenu. You could use Android Holo Colors to create the background image. Alternatively the Holo default spinner background should do the trick, too.
When the Button is clicked you should trigger a PopupMenu. The Android PopupMenu is for Android SDK API 11+. So if you're about to support lower versions you should consider external libraries like HoloEverywhere.
The Spinner Widget is not suitable for your purpose.
I have not really used the Music app before, but I would try to answer the question from what I understand from the screenshot. It seems to me that options that come up are presented in a simple Dialog. This dialog has a list that can be easily implemented as given here.
SO, what you can do is include a Button, or ImageView, or ImageButton or any other View in the list item and clicking on that will display the dialog.

How to design a iPhone like menu/button in android at the bottom?

I have googled this, most of the solutions are using:
1.TabHost with customized style which would cover the separate line between each tab to archive the requirement.
2.On the android developers website, there is a article is using Merge layout to put 2 buttons on top of the background image kind of archive what I want.(http://developer.android.com/resources/articles/layout-tricks-merge.html)
3.What about using button but style the looking like the example below? I don't need the selection, cause each item in the menu will be a button, which takes the user to another page.
I am wondering is there any other solutions apart from these two?
This is something want:
I don't need the menu likes a tab which has selected and unselected, they are better like a button always displaying in certain screen(activity).
Thank you.
You can use simple buttons, and provide any custom background for it. For such simple form as on your screenshot look for this link.
But #Janne write right thing - you should be very careful with transplanting controls from another platforms.

how do I change the style of a button in android?

I want to change the style of a button in an android app. here is a picture that has both kinds of buttons, the one that I have now, and the one that I want to switch to:
the kinds of buttons that I am using now, look like any of the letters on that keyboard. the ones that I want to use like like the arrows. I would I go about changing this. I prefer to do it in xml but I can do it in java if that is the only way. Thanks
change the background of the Button to a png image with arrows!
in XML use android:background="#drawable/yourimage"
To get more sophisticated control check here,
Standard Android Button with a different color

Categories

Resources