0

I am fairly new to android studio and I am trying to make a car rental app for a university project.

I designed an app which has a horizontal slider containing blocks of different cars however I am unsure on how I would do this, I understand how the slider works and how to add elements to it.

I have a linear layout within the horizontal slider which will contain all of the blocks but I am unsure how to make a block of elements. Within the block it should have two buttons, an image and some text. Here is a picture of the design. enter image description here As you can see the available blocks are surrounded by a square. this is what I want, a small container which surrounds my data. Sort of like a div box in html.

Is there a way to do this? Please just point me in the correct direction! Many thanks!

Polecalex
  • 323
  • 2
  • 12
  • 1
    Here are some articles which are apt for what you want -> [This](https://android-pratap.blogspot.com/2015/12/horizontal-recyclerview-in-vertical.html), [This](https://medium.com/@ashishkudale/android-list-inside-list-using-recyclerview-73cff2c4ea95) or [This](https://stackoverflow.com/questions/34549414/nested-recyclerview-like-google-play-store-app). You can just search `play store like RecylcerView` and you'll find many complete tutorials, even on YouTube. – Lalit Fauzdar Jun 02 '20 at 19:32
  • 1
    To further explain the elements, The top box is a `SearchView` or `EditText`, both works, Next to it is an `ImageButton` or an `ImageView`, both works, below these to the bottom bar is a `RecyclerView` which also contains Horizontal `RecyclerView`, bottom bar is a `BottomNavigationBar`. For SearchView using an EditText, you can check my answer [here](https://stackoverflow.com/a/61842291/8244632). – Lalit Fauzdar Jun 02 '20 at 19:37
  • 1
    I can recommend you to use constraintLayout. It allows you to create large and complex layouts with a flat view hierarchy (no nested view groups). Here is url to check documentation: https://developer.android.com/training/constraint-layout For lists use RecyclerView and as Anirudh suggested use CardView for list elements. – Apollo Jun 02 '20 at 19:16
  • Thank you all for your comments, I have gone with Apollo using the constrainLayout as I find it easier for the moment. But I will definitley look into RecylclerView! – Polecalex Jun 02 '20 at 19:56

1 Answers1

1

It seems like cardviews can handle most of the grouping you want to do. I would reccomend looking into them because they incorporate a lot of material design components right out of the box. https://developer.android.com/guide/topics/ui/layout/cardview

Anirudh
  • 2,648
  • 2
  • 13
  • 16