Calendar ListView in HarmonyOS

Step by Step Implementation

implementation 'io.openharmony.tpc.thirdlib:CalendarListview:1.0.2'
<?xml version="1.0" encoding="utf-8"?>
<com.andexert.calendarlistview.library.DayPickerView
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:id="$+id:pickerView"
ohos:height="match_parent"
ohos:width="match_parent"
/>
dayPickerView = (DayPickerView) findComponentById(ResourceTable.Id_pickerView);
dayPickerView.setController(new DatePickerController() {
@Override
public int getMaxYear() {
return 2023;
}

@Override
public void onDayOfMonthSelected(int year, int month, int day) {
}

@Override
public void onDateRangeSelected(SimpleMonthAdapter.SelectedDays<SimpleMonthAdapter.CalendarDay> selectedDays) {

}
});

List of XML attributes supported for CalendarListview

<com.andexert.calendarlistview.library.DayPickerView
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:id="$+id:pickerView"
ohos:height="match_parent"
ohos:width="match_parent"
ohos:colorCurrentDay="#00ff04"/>
<com.andexert.calendarlistview.library.DayPickerView
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:id="$+id:pickerView"
ohos:height="match_parent"
ohos:width="match_parent"
ohos:colorCurrentDay="#00ff04"
ohos:colorSelectedDayText="#c300ff"
/>
<?xml version="1.0" encoding="utf-8"?>
<com.andexert.calendarlistview.library.DayPickerView
xmlns:ohos="http://schemas.huawei.com/res/ohos"
ohos:id="$+id:pickerView"
ohos:height="match_parent"
ohos:width="match_parent"
ohos:colorCurrentDay="#00ff04"
ohos:colorSelectedDayText="#c300ff"
ohos:colorMonthName="#89c940"
/>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store