当前位置: 首页>>代码示例>>Java>>正文


Java CalendarDay.today方法代码示例

本文整理汇总了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();
}
 
开发者ID:Pattonville-App-Development-Team,项目名称:Android-App,代码行数:21,代码来源:HomeFragment.java

示例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);
}
 
开发者ID:Pattonville-App-Development-Team,项目名称:Android-App,代码行数:21,代码来源:HomeFragment.java

示例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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:DynamicSettersActivity.java

示例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;
}
 
开发者ID:Marplex,项目名称:Schoolbook,代码行数:33,代码来源:Agenda.java

示例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));
    }
}
 
开发者ID:NuclleaR,项目名称:react-native-material-calendarview,代码行数:8,代码来源:TodayDecorator.java

示例6: OneDayDecorator

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public OneDayDecorator() {
    date = CalendarDay.today();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:OneDayDecorator.java

示例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;
}
 
开发者ID:Pattonville-App-Development-Team,项目名称:Android-App,代码行数:47,代码来源:CalendarMonthFragment.java

示例8: TodayDecorator

import com.prolificinteractive.materialcalendarview.CalendarDay; //导入方法依赖的package包/类
public TodayDecorator() {
  today = CalendarDay.today();
  backgroundDrawable = getResources().getDrawable(R.drawable.today_circle_background);
}
 
开发者ID:prolificinteractive,项目名称:material-calendarview,代码行数:5,代码来源:CustomTileDimensions.java


注:本文中的com.prolificinteractive.materialcalendarview.CalendarDay.today方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。