本文整理汇总了Java中com.prolificinteractive.materialcalendarview.CalendarDay.today方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarDay.today方法的具体用法?Java CalendarDay.today怎么用?Java CalendarDay.today使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.prolificinteractive.materialcalendarview.CalendarDay
的用法示例。
在下文中一共展示了CalendarDay.today方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setCalendarData
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public void setCalendarData(TreeSet<EventFlexibleItem> calendarData) {
this.calendarData = calendarData;
List<EventFlexibleItem> itemsToAdd = new ArrayList<>();
final int numCalendarItems = preferenceValues[EVENTS_PREFERENCE_VALUES_INDEX];
Iterator<EventFlexibleItem> calendarDataIterator = this.calendarData.iterator();
CalendarDay today = CalendarDay.today();
while (calendarDataIterator.hasNext() && itemsToAdd.size() < numCalendarItems) {
EventFlexibleItem currentItem = calendarDataIterator.next();
if (!currentItem.getCalendarDay().isBefore(today)) {
itemsToAdd.add(currentItem);
}
}
if (homeCalendarEventAdapter.getItemCount() != 0)
homeCalendarEventAdapter.clear();
homeCalendarEventAdapter.updateDataSet(new ArrayList<>(itemsToAdd), true);
updatePinnedContent();
}
示例2: updatePinnedContent
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
private void updatePinnedContent() {
if (pinnedUIDs.size() == 0)
homePinnedHeader.setVisibility(View.GONE);
else if (preferenceValues[PINNED_PREFERENCE_VALUES_INDEX] != 0)
homePinnedHeader.setVisibility(View.VISIBLE);
//There is definitely stuff to display now
List<EventFlexibleItem> items = new ArrayList<>(calendarData);
final CalendarDay today = CalendarDay.today();
//noinspection ResultOfMethodCallIgnored
Iterators.removeIf(items.iterator(), input ->
input == null
|| !pinnedUIDs.contains(input.vEvent.getUid().getValue())
|| input.getCalendarDay().isBefore(today));
homeCalendarPinnedAdapter.updateDataSet(
new ArrayList<FlexibleHasCalendarDay>(items)
.subList(0, Math.min(items.size(), preferenceValues[PINNED_PREFERENCE_VALUES_INDEX])),
true);
}
示例3: showDatePickerDialog
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public static void showDatePickerDialog(Context context, CalendarDay day,
DatePickerDialog.OnDateSetListener callback) {
if (day == null) {
day = CalendarDay.today();
}
DatePickerDialog dialog = new DatePickerDialog(
context, 0, callback, day.getYear(), day.getMonth(), day.getDay()
);
dialog.show();
}
示例4: onCreateView
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
final View rootView = View.inflate(getContext(),R.layout.fragment_agenda, null );
ButterKnife.bind(this, rootView);
setTabGone();
removeMenuItems();
boolean fromReminder = (getArguments() != null) ? getArguments().getBoolean("now", false) : false;
if(Events.isThereAnyEvents(getContext())){
populateCalendar(Events.getSavedEvents(getContext()));
}else{
mCaller = new ClassevivaCaller(this, getContext());
mCaller.getAgenda();
}
mCalendar.setOnDateChangedListener(this);
if(fromReminder){
CalendarDay day = CalendarDay.today();
onDateSelected(mCalendar, day, true);
if(dialog == null) {
new TTS(getContext())
.talk("Nessun evento pianificato per oggi");
}
}
mCalendar.setDateSelected(CalendarDay.today(), true);
return rootView;
}
示例5: TodayDecorator
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public TodayDecorator(Context context) {
date = CalendarDay.today();
drawable = (Drawable) context.getResources().getDrawable(R.drawable.shape);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && color != null) {
drawable.setTint(Color.parseColor(color));
}
}
示例6: OneDayDecorator
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public OneDayDecorator() {
date = CalendarDay.today();
}
示例7: onCreateView
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) {
Log.d(TAG, "onCreateView called");
// Inflate the layout for this fragment
View rootLayout = inflater.inflate(R.layout.fragment_calendar_month, container, false);
//rootLayout.getLayoutTransition().enableTransitionType(LayoutTransition.CHANGING);
//rootLayout.getLayoutTransition().setDuration(LayoutTransition.CHANGING, 200);
fixedMaterialCalendarView = (FixedMaterialCalendarView) rootLayout.findViewById(R.id.calendar_calendar);
setUpMaterialCalendarView();
eventRecyclerView = (RecyclerView) rootLayout.findViewById(R.id.event_recycler_view);
eventRecyclerView.setNestedScrollingEnabled(false);
eventAdapter = new EventAdapter(null);
eventRecyclerView.setAdapter(eventAdapter);
eventRecyclerView.setLayoutManager(new SmoothScrollLinearLayoutManager(getContext(), OrientationHelper.VERTICAL, false));
eventRecyclerView.getLayoutManager().setAutoMeasureEnabled(true);
DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(eventRecyclerView.getContext(), DividerItemDecoration.VERTICAL);
eventRecyclerView.addItemDecoration(dividerItemDecoration);
if (savedInstanceState != null)
currentDateSelected = savedInstanceState.getParcelable(KEY_DATE_SELECTED);
else
currentDateSelected = CalendarDay.today();
int spotlightPadding;
switch (getResources().getConfiguration().orientation) {
case Configuration.ORIENTATION_PORTRAIT:
spotlightPadding = 20;
nestedScrollView = (NestedScrollView) rootLayout;
nestedScrollView.setSmoothScrollingEnabled(true);
break;
case Configuration.ORIENTATION_LANDSCAPE:
spotlightPadding = -250;
nestedScrollView = null;
break;
case Configuration.ORIENTATION_UNDEFINED:
default:
throw new Error("Why would this ever happen?");
}
SpotlightHelper.showSpotlight(getActivity(), rootLayout, spotlightPadding, "CalendarMonthFragment_SelectedDayEventList", "Events occurring on the selected day are shown here.", "Events");
return rootLayout;
}
示例8: TodayDecorator
import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public TodayDecorator() {
today = CalendarDay.today();
backgroundDrawable = getResources().getDrawable(R.drawable.today_circle_background);
}