Skip to content

Commit 35fd041

Browse files
committed
back button support on advance list activity
1 parent 04c3429 commit 35fd041

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

app/src/main/java/com/guru/composecookbook/ui/advancelists/AdvanceListsActivity.kt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import android.content.Context
44
import android.content.Intent
55
import android.os.Bundle
66
import androidx.appcompat.app.AppCompatActivity
7+
import androidx.compose.foundation.Icon
78
import androidx.compose.foundation.Text
89
import androidx.compose.foundation.layout.Column
9-
import androidx.compose.material.Scaffold
10-
import androidx.compose.material.ScrollableTabRow
11-
import androidx.compose.material.Tab
12-
import androidx.compose.material.TopAppBar
10+
import androidx.compose.material.*
11+
import androidx.compose.material.icons.Icons
12+
import androidx.compose.material.icons.filled.ArrowBack
1313
import androidx.compose.runtime.Composable
1414
import androidx.compose.runtime.getValue
1515
import androidx.compose.runtime.mutableStateOf
@@ -39,7 +39,14 @@ class AdvanceListsActivity : AppCompatActivity() {
3939
// A surface container using the 'background' color from the theme
4040
Scaffold(
4141
topBar = {
42-
TopAppBar(title = { Text(text = "Advance Lists(In Progress)") })
42+
TopAppBar(
43+
title = { Text(text = "Advance Lists(In Progress)") },
44+
navigationIcon = {
45+
IconButton(onClick = { onBackPressed() }) {
46+
Icon(Icons.Filled.ArrowBack)
47+
}
48+
}
49+
)
4350
}
4451
) {
4552
AdvanceListContent()

0 commit comments

Comments
 (0)