diff --git a/README.md b/README.md
index 346e52ef0..fe786653d 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,15 @@
+# EVIDENCE OF CHANGES IN THE APP REPOSITORY MOVILE APP DEVELOPMENT COURSE
+
+## ISSUE
+
+
+## PULL REQUEST
+
+
+
+
+
+
Astrid was a popular cross-platform productivity service that was [acquired](https://web.archive.org/web/20130811052500/http://blog.astrid.com/blog/2013/05/01/yahoo-acquires-astrid/) and [discontinued](https://techcrunch.com/2013/07/06/astrid-goes-dark-august-5-goodnight-sweet-squid/) in 2013. The source code from Astrid's open source Android app serves as the basis of Tasks.
[
{
- viewModel.setFilter(it.filter)
- scope.launch {
- drawerState.close()
- keyboard?.hide()
- }
+ TaskListDrawer(
+ arrangement = if (state.menuQuery.isBlank()) Arrangement.Top else Arrangement.Bottom,
+ filters = if (state.menuQuery.isNotEmpty()) state.searchItems else state.drawerItems,
+ onClick = {
+ when (it) {
+ is DrawerItem.Filter -> {
+ viewModel.setFilter(it.filter)
+ scope.launch {
+ drawerState.close()
+ keyboard?.hide()
}
+ }
- is DrawerItem.Header -> {
- viewModel.toggleCollapsed(it.header)
- }
+ is DrawerItem.Header -> {
+ viewModel.toggleCollapsed(it.header)
}
- },
- onAddClick = {
- scope.launch {
- drawerState.close()
- when (it.header.addIntentRc) {
- FilterProvider.REQUEST_NEW_FILTER ->
- showNewFilterDialog()
+ }
+ },
+ onAddClick = {
+ scope.launch {
+ drawerState.close()
+ when (it.header.addIntentRc) {
+ FilterProvider.REQUEST_NEW_FILTER ->
+ showNewFilterDialog()
- REQUEST_NEW_PLACE ->
- newList.launch(Intent(context, LocationPickerActivity::class.java))
+ REQUEST_NEW_PLACE ->
+ newList.launch(Intent(context, LocationPickerActivity::class.java))
- REQUEST_NEW_TAGS ->
- newList.launch(Intent(context, TagSettingsActivity::class.java))
+ REQUEST_NEW_TAGS ->
+ newList.launch(Intent(context, TagSettingsActivity::class.java))
- REQUEST_NEW_LIST ->
- when (it.header.subheaderType) {
- NavigationDrawerSubheader.SubheaderType.CALDAV,
- NavigationDrawerSubheader.SubheaderType.TASKS ->
- viewModel
- .getAccount(it.header.id.toLong())
- ?.let {
- newList.launch(
- Intent(context, it.listSettingsClass())
- .putExtra(EXTRA_CALDAV_ACCOUNT, it)
- )
- }
+ REQUEST_NEW_LIST ->
+ when (it.header.subheaderType) {
+ NavigationDrawerSubheader.SubheaderType.CALDAV,
+ NavigationDrawerSubheader.SubheaderType.TASKS ->
+ viewModel
+ .getAccount(it.header.id.toLong())
+ ?.let {
+ newList.launch(
+ Intent(context, it.listSettingsClass())
+ .putExtra(EXTRA_CALDAV_ACCOUNT, it)
+ )
+ }
- else -> {}
- }
+ else -> {}
+ }
- else -> Timber.e("Unhandled request code: $it")
- }
+ else -> Timber.e("Unhandled request code: $it")
}
- },
- onErrorClick = {
- context.startActivity(Intent(context, MainPreferences::class.java))
- },
- searchBar = {
- MenuSearchBar(
- begForMoney = state.begForMoney,
- onDrawerAction = {
- scope.launch {
- drawerState.close()
- when (it) {
- DrawerAction.PURCHASE ->
- if (TasksApplication.IS_GENERIC)
- context.openUri(R.string.url_donate)
- else
- context.startActivity(
- Intent(
- context,
- PurchaseActivity::class.java
- )
- )
-
- DrawerAction.HELP_AND_FEEDBACK ->
+ }
+ },
+ onErrorClick = {
+ context.startActivity(Intent(context, MainPreferences::class.java))
+ },
+ searchBar = {
+ MenuSearchBar(
+ begForMoney = state.begForMoney,
+ onDrawerAction = {
+ scope.launch {
+ drawerState.close()
+ when (it) {
+ DrawerAction.PURCHASE ->
+ if (TasksApplication.IS_GENERIC)
+ context.openUri(R.string.url_donate)
+ else
context.startActivity(
Intent(
context,
- HelpAndFeedback::class.java
+ PurchaseActivity::class.java
)
)
- }
- }
- },
- query = state.menuQuery,
- onQueryChange = { viewModel.queryMenu(it) },
- )
- },
- )
- SystemBarScrim(
- modifier = Modifier
- .windowInsetsTopHeight(WindowInsets.systemBars)
- .align(Alignment.TopCenter)
- )
- SystemBarScrim(
- modifier = Modifier
- .windowInsetsBottomHeight(WindowInsets.systemBars)
- .align(Alignment.BottomCenter),
- )
- }
+ DrawerAction.HELP_AND_FEEDBACK ->
+ context.startActivity(
+ Intent(
+ context,
+ HelpAndFeedback::class.java
+ )
+ )
+ }
+ }
+ },
+ query = state.menuQuery,
+ onQueryChange = { viewModel.queryMenu(it) },
+ )
+ },
+ )
}
}
) {
- Box(modifier = Modifier.fillMaxSize()) {
- val scope = rememberCoroutineScope()
- ListDetailPaneScaffold(
- directive = navigator.scaffoldDirective,
- value = navigator.scaffoldValue,
- listPane = {
- key (state.filter) {
- val fragment = remember { mutableStateOf(null) }
- val keyboardOpen = rememberImeState()
- AndroidFragment(
- fragmentState = rememberFragmentState(),
- arguments = remember(state.filter) {
- Bundle()
- .apply { putParcelable(EXTRA_FILTER, state.filter) }
- },
- modifier = Modifier
- .fillMaxSize()
- .imePadding(),
- ) { tlf ->
- fragment.value = tlf
- tlf.applyInsets(windowInsets.value)
- tlf.setNavigationClickListener {
- scope.launch { drawerState.open() }
- }
- }
- LaunchedEffect(fragment, windowInsets, keyboardOpen.value) {
- fragment.value?.applyInsets(
- if (keyboardOpen.value) {
- PaddingValues(
- top = windowInsets.value.calculateTopPadding(),
- )
- } else {
- windowInsets.value
- }
- )
- }
- }
- },
- detailPane = {
- val direction = LocalLayoutDirection.current
- Box(
+ val scope = rememberCoroutineScope()
+
+
+ ListDetailPaneScaffold(
+ directive = navigator.scaffoldDirective,
+ value = navigator.scaffoldValue,
+ listPane = {
+ key (state.filter) {
+ val fragment = remember { mutableStateOf(null) }
+ val keyboardOpen = rememberImeState()
+ AndroidFragment(
+ fragmentState = rememberFragmentState(),
+ arguments = remember(state.filter) {
+ Bundle()
+ .apply { putParcelable(EXTRA_FILTER, state.filter) }
+ },
modifier = Modifier
.fillMaxSize()
- .padding(
- top = windowInsets.value.calculateTopPadding(),
- start = windowInsets.value.calculateStartPadding(direction),
- end = windowInsets.value.calculateEndPadding(direction),
- bottom = if (rememberImeState().value)
- WindowInsets.ime.asPaddingValues().calculateBottomPadding()
- else
- windowInsets.value.calculateBottomPadding()
- ),
- contentAlignment = Alignment.Center,
- ) {
- if (state.task == null) {
- if (isListVisible && isDetailVisible) {
- Icon(
- painter = painterResource(org.tasks.kmp.R.drawable.ic_launcher_no_shadow_foreground),
- contentDescription = null,
- modifier = Modifier.size(192.dp),
- tint = MaterialTheme.colorScheme.onSurfaceVariant,
- )
- }
- } else {
- key(state.task) {
- AndroidFragment(
- fragmentState = rememberFragmentState(),
- arguments = remember(state.task) {
- Bundle()
- .apply { putParcelable(EXTRA_TASK, state.task) }
- },
- modifier = Modifier.fillMaxSize(),
+ .imePadding(),
+ ) { tlf ->
+ fragment.value = tlf
+ tlf.applyInsets(windowInsets.value)
+ tlf.setNavigationClickListener {
+ scope.launch { drawerState.open() }
+ }
+ }
+ LaunchedEffect(fragment, windowInsets, keyboardOpen.value) {
+ fragment.value?.applyInsets(
+ if (keyboardOpen.value) {
+ PaddingValues(
+ top = windowInsets.value.calculateTopPadding(),
)
+ } else {
+ windowInsets.value
}
- }
+ )
}
- },
- )
+ }
+ },
+ detailPane = {
+ val direction = LocalLayoutDirection.current
+ val imeOpen = rememberImeState().value
+ val insets = windowInsets.value
+ val topPad = insets.calculateTopPadding()
+ val startPad = insets.calculateStartPadding(direction)
+ val endPad = insets.calculateEndPadding(direction)
+ val bottomPad = if (imeOpen)
+ WindowInsets.ime.asPaddingValues().calculateBottomPadding()
+ else
+ insets.calculateBottomPadding()
- SystemBarScrim(
- modifier = Modifier
- .windowInsetsTopHeight(WindowInsets.systemBars)
- .align(Alignment.TopCenter),
- )
- }
+ Box(
+ modifier = Modifier
+ .fillMaxSize()
+
+ .padding(
+ top = topPad,
+ start = startPad,
+ end = endPad,
+ bottom = bottomPad
+ ),
+ contentAlignment = Alignment.Center,
+ ) {
+ if (state.task == null) {
+ if (isListVisible && isDetailVisible) {
+ Icon(
+ painter = painterResource(org.tasks.kmp.R.drawable.ic_launcher_no_shadow_foreground),
+ contentDescription = null,
+ modifier = Modifier.size(192.dp),
+ tint = MaterialTheme.colorScheme.onSurfaceVariant,
+ )
+ }
+ } else {
+ key(state.task) {
+ AndroidFragment(
+ fragmentState = rememberFragmentState(),
+ arguments = remember(state.task) {
+ Bundle()
+ .apply { putParcelable(EXTRA_TASK, state.task) }
+ },
+ modifier = Modifier.fillMaxSize(),
+ )
+ }
+ }
+ }
+ },
+ )
}
}
-}
+}
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_task_edit_empty.xml b/app/src/main/res/layout/fragment_task_edit_empty.xml
index 63b4ac546..b1017f72b 100644
--- a/app/src/main/res/layout/fragment_task_edit_empty.xml
+++ b/app/src/main/res/layout/fragment_task_edit_empty.xml
@@ -1,11 +1,14 @@
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+
+ android:background="?attr/colorSurface"
+
+ android:orientation="vertical">
+ android:id="@+id/toolbar"
+ layout="@layout/toolbar" />
-
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_task_list.xml b/app/src/main/res/layout/fragment_task_list.xml
index 807697c55..315c9e290 100644
--- a/app/src/main/res/layout/fragment_task_list.xml
+++ b/app/src/main/res/layout/fragment_task_list.xml
@@ -1,18 +1,18 @@
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/task_list_coordinator"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:descendantFocusability="beforeDescendants"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ android:orientation="vertical">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="100">
-
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/scrollable_widget.xml b/app/src/main/res/layout/scrollable_widget.xml
index 9f54a5f07..e6289cba7 100644
--- a/app/src/main/res/layout/scrollable_widget.xml
+++ b/app/src/main/res/layout/scrollable_widget.xml
@@ -27,12 +27,15 @@
tools:padding="@dimen/widget_padding"/>
+ android:id="@+id/widget_reconfigure"
+ style="@style/WidgetButton"
+ android:layout_toStartOf="@id/widget_button"
+ android:src="@drawable/ic_outline_settings_24px"
+ android:contentDescription="@string/widget_settings"
+ android:background="@android:color/transparent"
+ android:padding="@dimen/widget_padding"
+ />
+