Search code examples
androidimageandroid-recyclerviewpicasso

How to create a view like this


I'm new in android design. I want to create a view like this:

enter image description here

In fact, I want to create two things:

  1. A header like this image header that has an image with a transparent overlay.
  2. 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.


Solution

  • 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.