本文整理汇总了Java中android.provider.CalendarContract.Calendars方法的典型用法代码示例。如果您正苦于以下问题:Java CalendarContract.Calendars方法的具体用法?Java CalendarContract.Calendars怎么用?Java CalendarContract.Calendars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.provider.CalendarContract
的用法示例。
在下文中一共展示了CalendarContract.Calendars方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSelection
import android.provider.CalendarContract; //导入方法依赖的package包/类
@Test
public void testSelection() throws Exception
{
TransactionContext mockTc = failingMock(TransactionContext.class);
SoftRowReference<CalendarContract.Calendars> dummyReference = dummy(SoftRowReference.class);
RowSnapshot<CalendarContract.Calendars> mockCalendarRow = failingMock(RowSnapshot.class);
doReturn(dummyReference).when(mockCalendarRow).reference();
doReturn(new BackReference<>(dummy(Uri.class), 12)).when(mockTc).resolved(dummyReference);
assertThat(new CalendarScoped(mockCalendarRow, new EqArg("x", "y")),
predicateWith(
selection(mockTc, "( x = ? ) and ( calendar_id = ? )"),
argumentValues(mockTc, "y", "-1"),
backReferences(mockTc, AbsentMatcher.<Integer>isAbsent(), isPresent(12))
));
}
示例2: addLocalCalendar
import android.provider.CalendarContract; //导入方法依赖的package包/类
public void addLocalCalendar(View view) throws RemoteException, OperationApplicationException
{
if (!ensureCalendarPermissions())
{
return;
}
RowSnapshot<CalendarContract.Calendars> calendar = new VirtualRowSnapshot<>(mCalendars);
// create a table for events of this calendar only
Table<CalendarContract.Events> calendarEvents = new CalendarScoped(calendar, mEvents);
// create a new event rows in the scoped events table
RowSnapshot<CalendarContract.Events> event1 = new VirtualRowSnapshot<>(calendarEvents);
RowSnapshot<CalendarContract.Events> event2 = new VirtualRowSnapshot<>(calendarEvents);
mCalendarQueue.enqueue(
new Seq<>(
// put the calendar
new Put<>(calendar, new Synced(new Visible(new Colored(0x00ff00, new CalendarData("Cal1"))))),
// add event1 now
new Put<>(event1,
new Composite<>(
new Organized("[email protected]"),
new Described("Event Description"),
new Located("Some Location"),
new SingleEventData(
"Event #1",
DateTime.now(),
DateTime.now().addDuration(Duration.parse("PT1H"))))),
// add an attendee to event1
new EventRelated<>(event1, new Insert<>(new Attendees(), new AttendeeData("[email protected]"))),
// add event2 tomorrow same time
new Put<>(event2,
// alternative decoration structure
new Organized("[email protected]",
new Described("Event Description",
new Located("Some Location",
new SingleEventData(
"Event #2",
DateTime.now().addDuration(Duration.parse("P1D")),
DateTime.now().addDuration(Duration.parse("P1DT1H"))))))),
// add an attendee to event2
new EventRelated<>(event2, new Insert<>(new Attendees(), new Named("Me", new AttendeeData("[email protected]")))),
// add a reminder to event2, one day in advance
new EventRelated<>(event2, new Insert<>(new Reminders(), new ReminderData((int) TimeUnit.DAYS.toMinutes(1))))
//new Put<>(new VirtualRowSnapshot<>(calendarEvents), new )
));
mCalendarQueue.flush();
// demonstrate how to update an event which was inserted in the previous transaction
mCalendarQueue.enqueue(
new Seq<>(
// add a reminder to event1 as well
new EventRelated<>(event1, new Insert<>(new Reminders(), new ReminderData((int) TimeUnit.HOURS.toMinutes(1)))),
// update event2 - setting an event color and modifying description
new Put<>(event2, new org.dmfs.android.calendarpal.events.Colored(0x0ff0000, new Described("updated Description")))
));
mCalendarQueue.flush();
}
示例3: CalendarScoped
import android.provider.CalendarContract; //导入方法依赖的package包/类
public CalendarScoped(@NonNull RowSnapshot<CalendarContract.Calendars> calendarRow, @NonNull View<CalendarContract.Events> delegate)
{
mDelegate = delegate;
mCalendarRow = calendarRow;
}
示例4: Calendars
import android.provider.CalendarContract; //导入方法依赖的package包/类
public Calendars(@NonNull ContentProviderClient client)
{
super(new BaseView<CalendarContract.Calendars>(client, CalendarContract.Calendars.CONTENT_URI));
}
示例5: CalendarEvent
import android.provider.CalendarContract; //导入方法依赖的package包/类
public CalendarEvent(@NonNull RowSnapshot<CalendarContract.Calendars> calendar, @NonNull Table<CalendarContract.Events> eventsTable)
{
this(calendar, new Insert<>(eventsTable));
}
示例6: CalendarScoped
import android.provider.CalendarContract; //导入方法依赖的package包/类
public CalendarScoped(@NonNull RowSnapshot<CalendarContract.Calendars> calendarRow, @NonNull Predicate predicate)
{
super(new AllOf(predicate, new ReferringTo<>(CalendarContract.Events.CALENDAR_ID, calendarRow)));
}
示例7: CalendarScoped
import android.provider.CalendarContract; //导入方法依赖的package包/类
public CalendarScoped(@NonNull RowSnapshot<CalendarContract.Calendars> calendarRow)
{
this(calendarRow, Events.INSTANCE);
}
示例8: Calendars
import android.provider.CalendarContract; //导入方法依赖的package包/类
public Calendars()
{
super(new BaseTable<CalendarContract.Calendars>(CalendarContract.Calendars.CONTENT_URI));
}