Add custom interval days support for task frequency
- Add customIntervalDays field to Kotlin models (TaskResponse, TaskCreateRequest, TaskUpdateRequest) - Update Android AddTaskDialog to show interval field only for "Custom" frequency - Update Android EditTaskScreen for custom frequency support - Update iOS TaskFormView for custom frequency support - Fix preview data in TaskCard and TasksSection to include new field - Add customIntervalDays to OnboardingFirstTaskView 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -219,6 +219,14 @@ class MainActivity : ComponentActivity(), SingletonImageLoader.Factory {
|
||||
lifecycleScope.launch {
|
||||
Log.d("MainActivity", "🔄 App resumed, checking for lookup updates...")
|
||||
APILayer.refreshLookupsIfChanged()
|
||||
|
||||
// Check if widget completed a task - refresh data if dirty
|
||||
if (TaskCacheStorage.areTasksDirty()) {
|
||||
Log.d("MainActivity", "🔄 Tasks marked dirty by widget, refreshing...")
|
||||
TaskCacheStorage.clearDirtyFlag()
|
||||
// Force refresh tasks from API
|
||||
APILayer.getTasks(forceRefresh = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,32 @@ actual class TaskCacheManager(private val context: Context) {
|
||||
prefs.edit().remove(KEY_TASKS).apply()
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if tasks need refresh due to widget interactions.
|
||||
*/
|
||||
actual fun areTasksDirty(): Boolean {
|
||||
return prefs.getBoolean(KEY_DIRTY_FLAG, false)
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark tasks as dirty (needs refresh).
|
||||
* Called when widget modifies task data.
|
||||
*/
|
||||
actual fun markTasksDirty() {
|
||||
prefs.edit().putBoolean(KEY_DIRTY_FLAG, true).apply()
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the dirty flag after tasks have been refreshed.
|
||||
*/
|
||||
actual fun clearDirtyFlag() {
|
||||
prefs.edit().putBoolean(KEY_DIRTY_FLAG, false).apply()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val PREFS_NAME = "mycrib_cache"
|
||||
private const val KEY_TASKS = "cached_tasks"
|
||||
private const val KEY_DIRTY_FLAG = "tasks_dirty"
|
||||
|
||||
@Volatile
|
||||
private var instance: TaskCacheManager? = null
|
||||
|
||||
Reference in New Issue
Block a user