mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
allow deleting events from both the Day or Event screens
This commit is contained in:
@@ -74,6 +74,19 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
return values;
|
||||
}
|
||||
|
||||
public void deleteEvent(int id) {
|
||||
final String selection = COL_ID + " = ?";
|
||||
final String[] selectionArgs = {String.valueOf(id)};
|
||||
mDb.delete(TABLE_NAME, selection, selectionArgs);
|
||||
mCallback.eventsDeleted();
|
||||
}
|
||||
|
||||
public void deleteEvents(String[] ids) {
|
||||
final String selection = COL_ID + " IN (?)";
|
||||
mDb.delete(TABLE_NAME, selection, ids);
|
||||
mCallback.eventsDeleted();
|
||||
}
|
||||
|
||||
public void getEvents(int fromTS, int toTS) {
|
||||
final String[] projection = {COL_ID, COL_START_TS, COL_END_TS, COL_TITLE, COL_DESCRIPTION};
|
||||
List<Event> events = new ArrayList<>();
|
||||
@@ -101,6 +114,8 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
|
||||
void eventUpdated();
|
||||
|
||||
void eventsDeleted();
|
||||
|
||||
void gotEvents(List<Event> events);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user