本文整理匯總了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));
}