private void init(AttributeSet attrs) { int weekTextStyle; TypedArray typedArray = null; // 获取所有的资源文件 if (attrs != null) { typedArray = mContext.obtainStyledAttributes(attrs, R.styleable.TtCalendar); // 星期是card weekTextStyle = typedArray.getResourceId( R.styleable.TtCalendar_weekTextStyle, R.style.textView_sp13_grey_bg_bold); } else { weekTextStyle = R.style.textView_sp13_grey_bg_bold; } inflate(mContext, R.layout.widget_calendar_pageview, this); setGravity(Gravity.CENTER_HORIZONTAL); setOrientation(LinearLayout.VERTICAL); LinearLayout weekdaysLl = (LinearLayout) this.findViewById(R.id.widget_calendar_card_weekdays); // 设置星期文字样式 for (int i = 0; i < weekdaysLl.getChildCount(); i++) { View child = weekdaysLl.getChildAt(i); if (child instanceof TextView) { ((TextView) child).setTextAppearance(mContext, weekTextStyle); } } mCalendarCardView = (CalendarCardView) this.findViewById(R.id.widget_calendar_pageview_card); mCalendarCardView.setTypedArray(typedArray); }
@Override public void downButtonClick(ClickNavigationEvent event) { Calendar calendarSelected = null; if (bsCalendar.getItemIds().size() > 0) { // get selected Organization calendarSelected = (Calendar) bsCalendar.getItemId(); // inject the locations data from organization in the detail Location View CalendarCardView calendarDetailViewView = (CalendarCardView) viewContainer.getNext(); calendarDetailViewView.setCalendar(calendarSelected); // roll to the detail Location View viewContainer.getSliderView().rollNext(); } }
public void setOnDaySelectListener(OnDaySelectedChangedListener onDaySelectListener) { mCalendarCardView.setOnDaySelectListener(onDaySelectListener); }
public void selectCal(Calendar selectedCal) { mCalendarCardView.selectCal(selectedCal); }
public void setCurrentMonth(Calendar currentMonth) { mCalendarCardView.setCurrentMonth(currentMonth); }