Skip to content

feat(TaskManager): implement mark-as-done toggle and delete task #72

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions TaskManager/.idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions TaskManager/.idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions TaskManager/.idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions TaskManager/.idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions TaskManager/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

133 changes: 74 additions & 59 deletions TaskManager/app/src/main/java/com/example/taskmanager/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,70 +1,85 @@
package com.example.taskmanager
package com.example.taskmanager

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.taskmanager.ui.theme.TaskManagerTheme
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.taskmanager.ui.theme.TaskManagerTheme
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.Button
import androidx.compose.material.Card
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
import androidx.compose.material.TextField
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Check
import androidx.compose.runtime.*
import com.example.taskmanager.ui.TaskManagerScreenPreview

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
TaskManagerTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {
TaskManagerScreen()
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
TaskManagerTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {
TaskManagerScreenPreview()
// TaskManagerScreen()
}
}
}
}
}
}

@Composable
fun TaskManagerScreen() {
Column(
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
val image = painterResource(R.drawable.task_completed)
Image(painter = image, contentDescription = null)
Text(
text = stringResource(R.string.task_completed),
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(top = 24.dp, bottom = 8.dp)
)
Text(
text = stringResource(R.string.comment_text),
fontSize = 16.sp
)
@Composable
fun TaskManagerScreen() {
Column(
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
val image = painterResource(R.drawable.task_completed)
Image(painter = image, contentDescription = null)
Text(
text = stringResource(R.string.task_completed),
fontWeight = FontWeight.Bold,
modifier = Modifier.padding(top = 24.dp, bottom = 8.dp)
)
Text(
text = stringResource(R.string.comment_text),
fontSize = 16.sp
)
}
}
}

@Preview(showBackground = true)
@Composable
fun TaskCompletedPreview() {
TaskManagerTheme {
Surface {
TaskManagerScreen()
@Preview(showBackground = true)
@Composable
fun TaskCompletedPreview() {
TaskManagerTheme {
Surface {
TaskManagerScreen()
}
}
}
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package com.example.taskmanager.ui