I am new to android, I want to develop some UI like any.do, I have two questions:
How to build a any.do like deletion gesture? When you finger sweep cross the item, it will add a line over the item?
What should the layout file look like, when you have titleA + some list items and TitleB+some list items on the same view?
I guess you mean that gray line that is "crossing" the task. It fairly simple actually, just create a a line shape, using a drawable xml, and animate it's size from 0 to the full width of the task.
Didn't quite understand the layout you are referring to? Is it the gray line layout? The list item layout?
Related
In my app i want to achieve some thing like this
I have tried a lot of libraries which provide a circular layout for example like this one:-
https://github.com/dmitry-zaitsev/CircleLayout
You can check the code for circlelayout there , not posting here as its too big.
I have also tried Circular List view as discussed in here:-
Circular ListView (Items on Half Circle)
But with both the approach i am able to achieve something like this :-
This looks something like Ferris wheel but its not what i want , where the elements are connected to each other and the scrolling is smooth.
You can try with https://github.com/xresco/CircularLayout and Circular Scrollable layout
A scrollable circular layout for android where you can add items, customize the radius, the number of items displayed at a time and the X and Y offset of the layout.
Moreover, you can control how the items are rendered when scrolling the layout.
There are two modes Pinned and Fixed. The two modes differ in the way the items rotate. Here are the samples:
you can try this
https://github.com/siyamed/android-satellite-menu/
or
https://github.com/Andrew0000/Circular-Layout
I wish anyone of 2 that will help you.
Does anyone know if it is possible to layer an image over the top of each item in a listview? To indicate that each list item is clickable, I'd like to add a small right-pointing arrow on the extreme right side of every item in the list. I'd like this image to scroll with the list.
I know that I can just create a horizontal linearlayout and put the image there, but this takes up some of the screen. I'd rather have it "floating" over the top of each item. Hopefully I'm making myself clear.
Thanks!
Short answer: don't do this, it directly contradicts Android UX guidelines, http://developer.android.com/design/patterns/pure-android.html
Long answer: post your xml/code for building the cell. It's probably enough to use a RelativeLayout and align an ImageView to its right side.
Again, this is completely unnecessary and an anti-pattern on Android. Don't do it.
I'm working on my first Android application and I have a pretty good idea of what I want my application to look like, I'm just not sure how to create the view.
I have a Listview with several items, I then want users to click on an item then get a detail page. I want my detail page to look like this.
I know how to get the background. What I'm trying to figure out is what's the best way to create that rounded, see-through table with a border. Any ideas?
The easiest way would be to create a linear layout with vertical orientation and define a drawable shape resource and set the corners to have a radius to match what you like. Then add your 2 text views and an image view and lines for the separators.
I have ListView. I would like to fill each row of ListView with a background from left to x% ...
So what I want is:
Item - 50% of background is colored
Item - 20% of background is colored
Item - 90% of background is colored
Is it possible to this?
Thanks for the answer!
As far as I know this is not possible out of the box. But I think you can archive is with a little trick.
You have to define a custom view for you rows. This view has a RelativeLayout as root element on which you can set the background color you want to have.
You then add another view element to the root element which covers a part of the root element. The background color of this element should be set to black and should be aligned to the right. The RelativeLayout provides many attributed you can use to arrange the elements.
Furthermore you have to write a custom adapter which handles the creation of the single list items views. When you override the getView() method where the view elements for each single row are created and inflated to the ListView, you calculate and set the width of the "cover"-element in such a ways that it covers a part of the root element.
The difficult part will be to calculate the width of the cover-element so that the rest of the root element which is not covered and still visible correspond to the percentage you want it to have.
Here you find a short tutorial about how to implement a custom Adapter with a custom view for the list items.
It is possible by the concept of custom layouts. This is a good article for to learn more. Also, I think you need to go through the NotePad tutorial in Android official site.
i was requested to make in android a view that groups several items like checkboxes or text views in vertical rows, separated by transparent dividers while the background is with a certain alpha level and the edges are round.
I thought of two solutions and i hope for some feedback on good\bad or other solutions if you got'em.
just use regualr linear layout but have a single style A that uses a 9 patch as background, includes padding,margins and whatever i need to make it look like what i want. i then create another style A.up and A.down that represents the upper most and lower most items that will use a different 9-path with round corners.
inherit from linear layout, in the onMeasure and layoutChildren add to all the children some kind of space between them, i can create new attribute for it that can be customized in a style. i can override the dispatchDraw to paint the background for each view before it draws so i can paint my round borders, my only demand will be that each View added to this layout will have to be with transparent background.
So what do you think ?
Eventually i decided to use a List with customized divider.
It looks good, however a list got a very nasty bug when it comes down to items with states like buttons and clickable textViews,
you get no focus for the item and don't see the ornage bar
you don't seem to get the evnets flowing to the children of the View in the list.
I'm notsure how to resolve that one, i've seen numerous mails about it in the developres mailing list and here, most saying don't put statefull objects in a list.
So it mist not be the solution for me.
Nest thing i'll try is extending the normal layouts to have a bar in their bottom and use regualr linear layout with round corners drawable.