展会信息港展会大全

代码片段 支持周、天视图的日历控件
来源:互联网   发布日期:2016-01-14 11:29:02   浏览:1813次  

导读:compile 'com.github.alamkanak:android-week-view:1.2.3' com.alamkanak.weekview.WeekView android:id=@+id/weekView android:layout_width=match_parent android:layout_height=match_parent app:eventTextColor=@android:color/white app:textSize=12sp...

compile 'com.github.alamkanak:android-week-view:1.2.3'

<com.alamkanak.weekview.WeekView

android:id="@+id/weekView"

android:layout_width="match_parent"

android:layout_height="match_parent"

app:eventTextColor="@android:color/white"

app:textSize="12sp"

app:hourHeight="60dp"

app:headerColumnPadding="8dp"

app:headerColumnTextColor="#8f000000"

app:headerRowPadding="12dp"

app:columnGap="8dp"

app:noOfVisibleDays="3"

app:headerRowBackgroundColor="#ffefefef"

app:dayBackgroundColor="#05000000"

app:todayBackgroundColor="#1848adff"

app:headerColumnBackground="#ffffffff"/>

mWeekView = (WeekView) findViewById(R.id.weekView);

mWeekView.setOnEventClickListener(mEventClickListener);

mWeekView.setMonthChangeListener(mMonthChangeListener);

mWeekView.setEventLongPressListener(mEventLongPressListener);

WeekView.MonthChangeListener mMonthChangeListener = new WeekView.MonthChangeListener() {

@Override

public List<WeekViewEvent> onMonthChange(int newYear, int newMonth) {

// Populate the week view with some events.

List<WeekViewEvent> events = getEvents(newYear, newMonth);

return events;

}

};

赞助本站

人工智能实验室

相关热词: android开发 android教程

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港