如何在 android CalendarView 中显示 json 响应?

How to display json response in android CalendarView?

我在 android 应用程序中有一个 MaterialCalendarView,并且我有一个 json 响应,如下所示:

{"Table":
[
{"userid":4,"eventname":"Aditya","eventdate":"\/Date(1479974400000-0800)\/","eventcolor":"5986FF","autoid":1011},
{"userid":4,"eventname":"dfgdgdgs","eventdate":"\/Date(1478678400000-0800)\/","eventcolor":"AD3D1F","autoid":1005},
{"userid":4,"eventname":"dfgdgdgs","eventdate":"\/Date(1478678400000-0800)\/","eventcolor":"AD3D1F","autoid":1006}
]
}

如何在各自的日期在我的日历视图中显示此 JSON 响应?

对于水平滚动的完整日历,您可以使用此库:MaterialCalenderView

使用这个库来获得水平日历视图。你可以使用装饰器在日期下显示点,当你点击它时,你可以使用 recylerview 或其他东西来列出事件。

在该库中搜索可以与日期一起使用的装饰器。

materialCalendarView.setDateTextAppearance()
materialCalendarView.addDecorator(new OpenSansDecorator(getActivity())); 
materialCalendarView.setHeaderTextAppearance(R.style.TextAppearance_ProfileCalenderHeader);
materialCalendarView.setDateTextAppearance(R.style.TextAppearance_ProfileCalenderCurrentDate);           
materialCalendarView.setWeekDayTextAppearance(R.style.TextAppearance_ProfileCalenderHeader);

styles.xml

<style name="TextAppearance.ProfileCalenderDate" parent="android:TextAppearance">
        <!--<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>-->
        <item name="android:textSize">@dimen/text_size_small</item>
        <item name="android:textColor">@drawable/calender_selection_drawable</item>
    </style>

    <style name="TextAppearance.ProfileCalenderCurrentDate" parent="android:TextAppearance">
        <!--<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>-->
        <item name="android:textSize">@dimen/text_size_small</item>
        <item name="android:textColor">@drawable/calendar_cur_slection_drawable</item>
    </style>