2014-10-22 55 views
1

我想停用點擊當月不在當前週日期的日期。我使用caldroid日曆請幫助我謝謝你!如何禁用點擊日期

final CaldroidListener listenerq = new CaldroidListener() { 
    @Override 
    public void onSelectDate(Date date, View view) { 
       //Here all dates is being selected. 
       //I only want to enable click for the currentweekdays of the month. 

     } 

請看下圖。

http://i.stack.imgur.com/yCjzY.png

回答

0

看到這個https://github.com/roomorama/Caldroid

爲什麼你不使用此代碼?

public void setDisableDates(ArrayList<Date> disableDateList); 
public void setDisableDatesFromString(ArrayList<String> disableDateStrings); 
public void setDisableDatesFromString(ArrayList<String> disableDateStrings, String dateFormat); 
+0

當我嘗試過,它會禁用日期,但不是我想要的日期。你能給我一些建議嗎?我該如何禁用不在當前月份的日期?謝謝。 – 2014-10-22 13:22:36

+0

對不起。只需設置白色背景即可在適配器中查看。例如:在CaldroidGridAdapter中查看customizeTextView函數。 (dateTime.getMonth()!= month){cellView.setTextColor(resources.getColor(R.color.caldroid_darker_gray));這裏你應該設置Background並將其替換爲函數的結尾: if(dateTime.getMonth } – QArea 2014-10-23 11:01:01

+0

Thankyou它的工作原理。 :) – 2014-10-24 01:05:11