1

I want to built a landing page like grofers. I started with slider but I got different one using viewpager. Like i want this type of Slider

but I end with this using viewpagermy slider

and below slider of grofers there is a menu. I tried to make same view using gridview and put condition on button to show other components on click. Correct me if I am wrong and also suggest me for slider.

for the grid, I tried like this..gridviewimages

2 Answers2

2

What are you asking exactly? There is no question.

Using a ViewPager for the slide's in the top is a good approach. If you need to have it wrap-around take a look at the infinite ViewPager: https://github.com/antonyt/InfiniteViewPager

For the bottom part, the grid, you can use a GridView. However I recommend taking a look at the RecyclerView with a GridLayoutManager: https://developer.android.com/reference/android/support/v7/widget/GridLayoutManager.html

Ruben Weerts
  • 313
  • 1
  • 6
  • i want a slider where current pic should be shown in middle and next and previous part are shown like top one. but i got only current pic on screen. how to get view like top slider? – Virendra Singh Aug 26 '16 at 08:53
  • For the `ViewPager` please take a look at: http://stackoverflow.com/questions/13914609/viewpager-with-previous-and-next-page-boundaries. Also please post the stuff you are actually having troubles with. We are here to help, but won't code the app for you – Ruben Weerts Aug 26 '16 at 08:56
  • i did code and not asking for whole code. I also posted a slider image that i made. thanks for the link. – Virendra Singh Aug 26 '16 at 09:28
  • What is the problem you are facing? Is it the styling/design, is it the choice to use `ViewPager` or something else? To me it looks you are using a `ViewPager` but set the padding/margins on the views inside the `ViewPager`instead of on the `ViewPager` itself. Also for the grid, it doens't look like you've tried something yet. What did you try? What problems are you running into? – Ruben Weerts Aug 26 '16 at 09:31
  • I was facing a problem with design in slider that is solved now. thanks to you.. I also edited my question with grid view that i have tried. on more categories button click i am showing remaining grid to get grofers like functionality. I want to know is it right way of doing? – Virendra Singh Aug 26 '16 at 09:51
  • That sounds about right. There isn't really a good or bad when developing your apps. Every developer has their own way of doing stuff. As long as you respect the language's/platform's coding guidelines, you can do nothing wrong. If you have doubts about your implementation search for best practices on that topic. There are always people that had this problem. Personally I'd make the grid to load more items when you scroll down. But that might not be possible when you need to show another view if that action happens. It's all up to the design of the app. Looks like you're doing a great job – Ruben Weerts Aug 26 '16 at 11:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/121927/discussion-between-ruben-weerts-and-virendra-singh). – Ruben Weerts Aug 26 '16 at 12:18
0

You can implement this by using TwowayGridView

Jinesh Francis
  • 3,377
  • 3
  • 22
  • 37
Avinash Mishra
  • 281
  • 3
  • 21