-
Notifications
You must be signed in to change notification settings - Fork 45
feat: add the ability to complete tasks directly from the widget. #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…d a circular dependency bug with background refresh
android/app/src/main/kotlin/io/vikunja/flutteringvikunja/widget/AppWidget.kt
Outdated
Show resolved
Hide resolved
android/app/src/main/kotlin/io/vikunja/flutteringvikunja/widget/AppWidget.kt
Outdated
Show resolved
Hide resolved
|
@leschbenedikt @kolaente The above check is failing because now dart is saying that it wants to format 157 files? I dont think we want to touch so many files on this mr. |
|
@brokoli18 it said only one was changed: |
| var title: String, | ||
| var dueDate: Date, | ||
| var today: Boolean, | ||
| var overdue: Boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is used when the widget pulls tasks from shared storage. I don't need most of the values from the default Task class for the widget so it was easier to create a new one
android/app/src/main/kotlin/io/vikunja/flutteringvikunja/widget/AppWidget.kt
Show resolved
Hide resolved
android/app/src/main/kotlin/io/vikunja/flutteringvikunja/widget/AppWidget.kt
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @Composable | ||
| private fun GlanceContent(context: Context, currentState: HomeWidgetGlanceState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The size and position of the widget changes depending of the number of task.
I think this should always be the same.
| Text("Today:") | ||
| } | ||
| items(todayTasks.sortedBy { it.dueDate }) { task -> | ||
| RenderRow(context, task, prefs, "HH:mm") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern shouldn't be hardcoded, the should depend on the locale.
You can just pick some of the predefined ones from flutter
| Text("OverDue") | ||
| } | ||
| items(otherTasks.sortedBy { it.dueDate }) { task -> | ||
| RenderRow(context, task, prefs, "dd MMM HH:mm") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
| Future<void> widgetCallback(Uri? uri) async { | ||
| if (uri?.host == "completetask") { | ||
| String? taskID = uri?.queryParameters['taskID']; | ||
| completeTask(taskID!); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If taskID is null just do nothing
Otherwise it will crash
Also fixed a circular dependency bug with background refresh.
Resolves #152