如何在Android CalendarView中显示json响应? [英] How to display json response in android CalendarView?

查看:265
本文介绍了如何在Android CalendarView中显示json响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在android应用中有一个MaterialCalendarView,并且我有一个像这样的json响应:

I have a MaterialCalendarView in a android app and I have a json response like this:

{"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}
]
}

如何在我的calendarView中的相应日期显示此JSON响应?

How to display this JSON response in my calendarView in their respective date?

推荐答案

对于水平滚动的全压延日历,您可以使用以下lib: MaterialCalenderView

For a fully feldged calender that scrolls horizonatlly u can use this lib: MaterialCalenderView

使用此lib可获得水平日历视图.您可以使用装饰器在日期下显示点,当您单击它时,可以使用recylerview或其他方式列出事件.

use this lib to get a horrizontal calendar view .U can use decorators to show dots under dates and when u click on it , u can use a recylerview or something to list the events.

搜索装饰器,您可以在该库中使用日期.

Search for decorator you can use wth dates in that library.

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

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>

这篇关于如何在Android CalendarView中显示json响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆