Marked in red, ie the rectangle, the title text, here "ANTEIL DER AUFRUFE" as well as the divider between the title text and the pie chart. I need
the description
library names
It's pretty unclear what you're asking. I'll guess that you want to know how to replicate parts of the image, so I'll explain what each looks like to me.
The red rectangle appears to be some sort of take on a CardView.
Inside I'd guess that it's composed of a vertical LinearLayout containing firstly the title TextView and below that, a horizontal LinearLayout that contains a PieChart view and another vertical LinearLayout to the right with the appropriate data. (It could well be that the data is part of the PieChart view, like a legend and not actually a LinearLayout.)
You can actually learn to make a PieChart with Google's (awesome) custom view guide here but you may want to find a library that does it for you.
Related
Looking for your help. I am using constrain layout. On top of blue rectangle, I have other elements too, but not sure how to achieve the layout that I have shown in the image.
I tried using card view and text view and button inside it. Please let me know if I miss any details or some information is required. Just looking for better approach.
I tried using card view and text view and button inside it
This is fine. And you will need another layout inside CardView because CardView can only hold one child. You can use ConstraintLayout,LinearLayout, RelativeLayout... to hold your TextView and Button.
I'm new in android design.
I want to create a view like this:
In fact, I want to create two things:
A header like this image header that has an image with a transparent overlay.
Like my header, I want to create recyclerview items, with image and transparent overlay too.
It is necessary to mention that, I want to use Picasso library to show my images.
How to I create this.
Thanks a lot.
For grid element you can use RelativeLayout. On the first layer put ImageView with your image, above this you can put View with overlay background (for example semi-transparent black color), and then you can add your text. If you want to create text like on your image (two TextViews above center) you can put empty View element with some height (this height will be like margin between two TextViews) and in top text add layoutAbove="centerViewId" and in bottom text: layoutBelow="centerViewId". I can paste xml code if you want, but I think in this way will teach you more.
In an Android app I have a background image and two buttons on it.
This is a partial screenshot:
I ask you for the best approach to click on the sinopsis button to show an overlay text, like this:
and also to click the fotos button to show an image slider, like this:
I don't want you to show me any code. I only need recommendations to know what kind of layouts or overlay views I should use to obtain the shown behaviours.
Thank you.
A simple TextView is enough. A TextView can have a background, translucent as in your case, or gradients, etc., and padding. You can fill it with Spanned Text so you could use hyperlinks, bold, colors, etc.. If you need scrolling, TextView also supports scrolling out of the box, but it'd be better to put it inside a ScrollView because the scroll will be smoother. In any case you don't need additional layouts.
You can just use a container layout (like LinearLayout. RelativeLayout, ScrollView, etc.. depending on what you want) and specify that to have a background image and then specify your drawable. You can then use TextView to display text. Don't forget though that you will have to create custom TextViews to achieve your design.
TextView can have transparent background and so, you can get the overlay effect.
I would like show my text messages like this in picture that i have attached. Please give me some hints on that...
Sample text that i like to have:
First, I would create a small empty speech balloon as a 9-patch. This will be used as your TextView background and will expand as necessary to encompass the text. I guess you'll need to create one for every color you intend to use unless someone can tell me how to add color to such a thing.
Next, I would create a layout.xml file that contains some sort of container widget (LinearLayout or RelativeLayout probably) that holds a single TextView that occupies the left half of the container. Make another that puts the TextView in the right half.
Inside the container, put a TextView that uses the above-mentioned 9-patch image as the background.
Then, I would use a ListView for the overall container for your text messages. Construct an Adapter subclass that manages your list of text messages and uses a LayoutInflator to expand the above-mentioned layout.xml files to return the Views to be displayed by the ListView.
That's how I would do it anyway. Implementation details are left as an exercise for the reader.
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.