Arranging imagebuttons in 2d circle layout with no animation - android

I'm developing an android app and I need to have a dropdown button from which the user will change the layout bellow it to have N ImageButtons arranged in a circle (from 14 to 24 buttons) in which the buttons will touch each other. There won't be any animation just a standing buttons with a click listener to every one of them. Let me describe it as a bracelet
I've developed the app but not with a buttons arranged in circle, so I have the functionality. I've searched around and found CircleLayout of dimitry-zaitsev, but it has a minSDK = 18 . While I think that what I need could be achieved in less. I also found 3D Carousel but I need a simple 2d arrangement. I don't mind if the solution will be 10 layout files with the respective number of buttons from 14-24 or if the buttons are generated programatically.
Could someone suggest me a solution?

Take a look at the ArcLayout library. You will probably be able to do that with it.

I finally succeeded in building the solution of my problem. I did it by using parts of the ideas of this library: Android-CircleMenu I hope this will help others who struggle in building circle layout.

Related

Using certain elements of an image in the [ImageView] widget as buttons

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

The buttons on Google play cards (CardView & RecycleView)

I've just started working on CardView and RecycleView and I want to know what are the side buttons that looks like 3 dots on every card and how to implement it.
Cards like we see in Google Play Store app, where there are cards with buttons.
I don't have enough reputation to post a picture but I'm posting this link where you can see it and the buttons are marked in red circle.
I don't think adding a toolbar on every card is a good idea (as suggested in another answer). As you can see in the image itself, there is no space for a full-width toolbar due to images taking up width of layout. So the best way will be to implement it using an ImageButton. Just add an imageButton on top and configure it to open a drop down menu or dialog or whatever.
P.S. Yes, there can be multiple toolbars according to new material design guidelines but having one on every card is probably not a good idea. Especially when it can't even be a full-width component.
You are looking for Toolbar.
It's a new Android Pattern to generalize ActionBar to use in multiple enviroments, like Cards and others.
How to use it: http://android-developers.blogspot.com.es/2014/10/appcompat-v21-material-design-for-pre.html

iOS: How to achieve relative layout

I'm trying to make an iOS version of my Android app. It contains text that looks like this:
There are three labels: title, author, and publication year. I need to display the full title, which may be several lines long. However long the title is, I want the author label to be directly below the title, and the pub. year directly below that.
In Android, I just used relative layouts to achieve this effect. How can I do this in iOS? Can Auto Layout do this for me somehow? If not, do you have any suggestions for effectively displaying this information in iOS? Preferably I'd like to achieve this using the storyboard.
In iOS you use InterfaceBuilder IB for layouts - it's drag and drop - not like Android layouts.
Search for IB tutorials - it is really straight forward and you see what you get:-)
I also searched quite some time a way to achieve android-like layouts in iOS (without the hassle of computing every positions for each subviews).
I eventually gave up and coded a fast equivalent of VerticalLayout and HorizontalLayout. Here's the repo (it's ARC compliant) :
https://github.com/kirualex/iOS-Layout-helper
It's sketchy but it does the work !
Put simply relative layout organises items on the screen relative to something else. Like linear layout, relative layout is commonly used by android developers. I myself do like this layout and have used in the development of my applications before. See
http://developer.android.com/reference/android/widget/RelativeLayout.html and http://developer.android.com/guide/topics/ui/layout/relative.html for more information on relative layouts.

Dragging and Dropping a button from one Linear Layout to another Linear Layout

I have a linear linear layout with 10 buttons in it. I need to drag these buttons and add it into another linear layout(Horizontal) in the order they are dropped. Please help me in doing this?
I have some suggestions on how to do drag-drop in apps running on API level 8 up and beyond. I studied the source code for the Android Launcher module and learned about the drag-drop framework they put in place for that. I have found that is a good foundation on which to build. I have written up the details of the key classes (DragSource, DropTarget, DragLayer, DragController) in a series of articles on my blog. A solution is too long to post here, so I refer you to those notes:
(a) Moving Views In Android - Part 2, Drag and Drop - this describes the basic framework and includes a demo app. Since I was primarily concerned with learning about drag-drop, I used the now deprecated AbsoluteLayout class. The follow-on to this one (Part 3) is worth looking at too because it develops further the notion of DropTarget.
(b) Drag-Drop for an Android GridView - a demo app that shows how to use the drag-drop framework for grid views. Even better, it illustrates how to get by without AbsoluteLayout. In this case, the DragLayer and other classes know more about the kind of layouts they are working with.
The demo apps illustrate images and text views being dragged. The underlying code is perfectly general: any view can be dragged. A problem you will face with dragging buttons is making sure that the start of a drag operation will not be confused with the normal click handling that buttons do. Consider using a long click to initiate a drag sequence.

How do I create a panel of buttons with a simple divider line, or no dividers, in Android?

This seems like a really basic task, but after a lot of searching and research, still haven't found a clear answer. I found GridView, but not sure this is how you're supposed to do it.
I've found several apps that have UI elements similar to what I need, for example the top buttons of the android market.
That can easily be accomplished with a horizontal LinearLayout that contains a set of Buttons or ImageButtons. The rest is just styling.
See Hello Linear Layout to get started.

Categories

Resources