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.
Related
I want to know how is possible to achieve a arrow-based layout like this :
Any idea about what Layout is using this app in order to achieve that layout ? It seems like a kind of Staggered Grid Layout maybe ? Or maybe is using a library or a custom layout ? How can I achieve something similar ?
so here is how I would do something like this.
I make a bunch of custom views.
custom view #1:
PokemonView.
This is a regular Constraint Layout or CardView that contains all the items to show the pokemon, and its name, and all the other stuff.
custom view #2
EvolutionPokeminView.
this is a custom constraint layout that contains a PokemonView, and The Arrow ImageView (and TextView below), and helper methods to place the arrow in different directions.
for example:
setArrowDirection(int direction) \direction is some kind of enum for all directions (top, topLeft, topRight.. etc
another helper method is setArrorPosition,
setArrowPosition(int direction)
then you use the arrow direction method to set the correct arrow image into the arrowImageView, and you use the arrow position method to use ConstraintSet to programmatically set the correct position of the arrow in relation to the pokemon image.
after that, you prepare a few common layouts to use with different sets of data and populate them accordingly.
Things you'd need to know to make this approach work.
How to Make a Custom View in Android.
How to use ConstraintLayout effectively.
How to use ConstraintSet to programmatically edit ConstraintLayout constraints.
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.
I have absolutely no idea on how to implement this design as listview in android. Can anyonee help me or suggest me? I just need to know how to implement that blue arrow part.
If I would have to implement this, I would create this blue arrows as PNG images, because it looks like you just have a certain amount of them. Then I would add the images to the right of the list element.
This link could help for my described solution:
http://www.learn2crack.com/2013/10/android-custom-listview-images-text-example.html
More Detail: Like Bubu said, the picture need to be in a ImageView. Use GIMP for the creation of Icons or ImageButtons. That's how I do it, and GIMP helps me a lot for this purpose (Resizing, Pasting, Cutting etc.).
Add an ImageView in your ListView item layout and set this ImageView in your ListView adapter in terms of the kind of item. You can set the ImageView background with the blue arrow in your xml file and the ImageView source with the correct drawable in your adapter.
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?
I'm trying to build an Android app where I would like to display some Buttons in various places, as in the demo image attached.
The challenge here is creating the custom buttons and arranging them.
As for the custom Buttons, I guess I could achieve that using CustomViews or a simple button with a Custom Drawable as Background.
Are these the right points to start, any other ideas?
On arranging them, I have no clue how to achieve that.
As Android_Crazy and Closeratio have already said, a RelativeLayout is the most suitable option for custom placement of buttons in general. However, for the exact placement of buttons pictured in your example, a LinearLayout would work just fine.
In a LinearLayout you may place views under or above eachother (with android:orientation = "vertical", relevant for your example) or next to each other (android:orientation = "horizontal"). You can also add margin to your views to alter the horizontal position (layout_marginLeft or layout_marginRight) or the vertical position (layout_marginTop or layout_marginBottom).
As for the buttons' appearance, I always use custom background drawables, usually with a custom xml to add a different drawable for when the button is being pressed or selected.