Android Studio: Create a calendarView with listView for each day

Sindri Þór picture Sindri Þór · Jul 14, 2014 · Viewed 16.7k times · Source

I am very new to Android studio so just judge.

I want to create a Calendaring that has a list below it for each day. This is what I have:enter image description here

But I have been trying to get my head around how to write the functions for each. I had a few ideas like two fragments within one view with the help from fragmentManager. Or simply just add a SimpleAdapter to the FragmentA.java for list.

What Im trying to say, I really don't know what I want! I would appreciate some pointers/guidance or example?

I have my functionality code in Fragments. My activity is running a swipe function between FragmentA.java, B and C.

fragment_a.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clickable="true"
    android:focusable="true">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.5"
        android:clickable="true"
        android:focusable="true">

        <CalendarView
            android:id="@+id/calendarView1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:adjustViewBounds="true"
            android:clickable="true" />

    </RelativeLayout>
        <ListView
            android:id="@+id/dailyView1"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="0.5"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:layout_gravity="center_horizontal|center"
            android:clickable="true"
            android:focusable="true" />

</LinearLayout>

Would appreciate how you would do this. This calendar will, at the and, speak to an API.

Thank you!

Answer