-1

I need to create a view as shown in the image attached, How can I achieve the same, or if there is any view or library for the same can anyone would tell me its name. enter image description here

**Note:**Its a Calander which can be scrolled right and left. which looks like a tab. On clicking on each Date it shows an Activity/Fragment with that date's appointment details. Thanks in Advance.

Pravinsingh Waghela
  • 2,516
  • 4
  • 32
  • 50

1 Answers1

1

There are a couple of ways in which you can accomplish this:

  1. Create a custom view for the calendar item (i.e, the blue square box in the picture). Then have a layout like below and dynamically add all your calendar items (custom view) as child to the LinearLayout. On click of a child, you could show the Fragment below the horizontal scroll view. More info on this here: How to implement HorizontalScrollView like Gallery?

    <HorizontalScrollView>
         <LinearLayout>
               <!-- Add your custom view as children to this layout -->
         </LinearLayout>
    </HorizontalScrollView>
    
  2. You need to create a horizontal ListView. You can now get this done using RecyclerView. Here you need to create a layout of the calendar item and then inflate this in the RecylerView for each row (column here). OnItemClick you can show the Fragment below the RecyclerView. More info here: How to build a Horizontal ListView with RecyclerView?

Community
  • 1
  • 1
Henry
  • 17,490
  • 7
  • 63
  • 98