@@ -8,8 +8,24 @@ import androidx.activity.compose.setContent
8
8
import androidx.activity.enableEdgeToEdge
9
9
import androidx.compose.foundation.layout.fillMaxSize
10
10
import androidx.compose.foundation.layout.padding
11
+ import androidx.compose.material.icons.Icons
12
+ import androidx.compose.material.icons.automirrored.filled.ArrowBack
13
+ import androidx.compose.material.icons.automirrored.filled.Redo
14
+ import androidx.compose.material.icons.automirrored.filled.Undo
15
+ import androidx.compose.material.icons.filled.MoreVert
16
+ import androidx.compose.material3.DropdownMenu
17
+ import androidx.compose.material3.DropdownMenuItem
18
+ import androidx.compose.material3.ExperimentalMaterial3Api
19
+ import androidx.compose.material3.Icon
20
+ import androidx.compose.material3.IconButton
11
21
import androidx.compose.material3.Scaffold
22
+ import androidx.compose.material3.Text
23
+ import androidx.compose.material3.TopAppBar
12
24
import androidx.compose.runtime.Composable
25
+ import androidx.compose.runtime.getValue
26
+ import androidx.compose.runtime.mutableStateOf
27
+ import androidx.compose.runtime.remember
28
+ import androidx.compose.runtime.setValue
13
29
import androidx.compose.ui.Modifier
14
30
import androidx.compose.ui.viewinterop.AndroidView
15
31
import org.wordpress.gutenberg.EditorConfiguration
@@ -45,13 +61,79 @@ class EditorActivity : ComponentActivity() {
45
61
}
46
62
}
47
63
64
+ @OptIn(ExperimentalMaterial3Api ::class )
48
65
@Composable
49
66
fun EditorScreen (
50
67
configuration : EditorConfiguration ,
51
68
onClose : () -> Unit
52
69
) {
70
+ var showMenu by remember { mutableStateOf(false ) }
71
+
53
72
Scaffold (
54
- modifier = Modifier .fillMaxSize()
73
+ modifier = Modifier .fillMaxSize(),
74
+ topBar = {
75
+ TopAppBar (
76
+ title = { },
77
+ navigationIcon = {
78
+ IconButton (onClick = onClose) {
79
+ Icon (
80
+ imageVector = Icons .AutoMirrored .Filled .ArrowBack ,
81
+ contentDescription = " Close"
82
+ )
83
+ }
84
+ },
85
+ actions = {
86
+ IconButton (onClick = { }, enabled = false ) {
87
+ Icon (
88
+ imageVector = Icons .AutoMirrored .Filled .Undo ,
89
+ contentDescription = " Undo"
90
+ )
91
+ }
92
+ IconButton (onClick = { }, enabled = false ) {
93
+ Icon (
94
+ imageVector = Icons .AutoMirrored .Filled .Redo ,
95
+ contentDescription = " Redo"
96
+ )
97
+ }
98
+ IconButton (onClick = { showMenu = true }) {
99
+ Icon (
100
+ imageVector = Icons .Default .MoreVert ,
101
+ contentDescription = " More options"
102
+ )
103
+ }
104
+ DropdownMenu (
105
+ expanded = showMenu,
106
+ onDismissRequest = { showMenu = false }
107
+ ) {
108
+ DropdownMenuItem (
109
+ text = { Text (" Save" ) },
110
+ onClick = { },
111
+ enabled = false
112
+ )
113
+ DropdownMenuItem (
114
+ text = { Text (" Preview" ) },
115
+ onClick = { },
116
+ enabled = false
117
+ )
118
+ DropdownMenuItem (
119
+ text = { Text (" Code Editor" ) },
120
+ onClick = { },
121
+ enabled = false
122
+ )
123
+ DropdownMenuItem (
124
+ text = { Text (" Post Settings" ) },
125
+ onClick = { },
126
+ enabled = false
127
+ )
128
+ DropdownMenuItem (
129
+ text = { Text (" Help" ) },
130
+ onClick = { },
131
+ enabled = false
132
+ )
133
+ }
134
+ }
135
+ )
136
+ }
55
137
) { innerPadding ->
56
138
AndroidView (
57
139
factory = { context ->
0 commit comments