CalendarListview icon indicating copy to clipboard operation
CalendarListview copied to clipboard

Calendar not show. What i am doing wrong?

Open sweetie opened this issue 10 years ago • 3 comments

/Layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:calendar="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/login_background" tools:context="com.example.enny.agendando.ui.activities.SelectDateActivity">

<com.andexert.calendarlistview.library.DayPickerView
    android:id="@+id/pickerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    calendar:drawRoundRect="true" />

Activity Class:

package com.example.enny.agendando.ui.activities;

import android.app.Activity; import android.os.Bundle; import android.util.Log;

import com.andexert.calendarlistview.library.DayPickerView; import com.andexert.calendarlistview.library.SimpleMonthAdapter; import com.example.enny.agendando.R;

public class SelectDateActivity extends Activity implements com.andexert.calendarlistview.library.DatePickerController {

private DayPickerView dayPickerView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_select_date);
    dayPickerView = (DayPickerView) findViewById(R.id.pickerView);
    dayPickerView.setController(this);
}

@Override
public int getMaxYear() {
    return 2015;
}

@Override
public void onDayOfMonthSelected(int year, int month, int day) {
    Log.e("Day Selected", day + " / " + month + " / " + year);
}

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

    Log.e("Date range selected", selectedDays.getFirst().toString() + " --> " + selectedDays.getLast().toString());
}

}

sweetie avatar Nov 05 '15 16:11 sweetie

Try setting 2016 in getMaxYear() method. It should work

RiccardoFabozzi avatar Nov 10 '15 01:11 RiccardoFabozzi

RiccardoFabozzi 's method are correctly

uzumyam avatar Nov 27 '15 08:11 uzumyam

Modify the following location code:SimpleMonthAdapter > getItemCount > return Math.abs(itemCount);

yaoxin2017 avatar Dec 28 '17 15:12 yaoxin2017