这是一个简单的Android自定义视图,旨在为用户提供显示教学大纲视图的简单方法。
添加Gradle依赖项:
dependencies {
compile 'com.luolc.dev:litesyllabusview:1.0.5'
}
布局,通常由ScrollView包装:
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="false">
<com.luolc.litesyllabusview.view.LiteSyllabusView
android:id="@+id/lite_syllabus"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.luolc.litesyllabusview.view.LiteSyllabusView>
</ScrollView>
在onCreate方法中设置LiteSyllabusView:
mLiteSyllabusView = (LiteSyllabusView) findViewById(R.id.lite_syllabus);
mLiteSyllabusView.setCourses(getCourses()); // Implement your custom courses data get method.
mLiteSyllabusView.hideWeekendColumn(true);
mLiteSyllabusView.setOnBlankViewClickListener(new LiteSyllabusView.OnBlankViewClickListener() {
@Override
public void onClick(int weekday, int section) {
// TO-DO
}
@Override
public void onLongClick(int weekday, int section) {
// TO-DO
}
});
mLiteSyllabusView.show();
Android midSdkVersion 14。
LiteCourse.courseId
从INT到字符串。
热门源码