@@ -6,6 +6,7 @@ import android.content.pm.ApplicationInfo
6
6
import androidx.activity.ComponentActivity
7
7
import androidx.activity.compose.setContent
8
8
import androidx.activity.enableEdgeToEdge
9
+ import androidx.compose.foundation.layout.Box
9
10
import androidx.compose.foundation.layout.fillMaxSize
10
11
import androidx.compose.foundation.layout.padding
11
12
import androidx.compose.material.icons.Icons
@@ -20,6 +21,7 @@ import androidx.compose.material3.Icon
20
21
import androidx.compose.material3.IconButton
21
22
import androidx.compose.material3.Scaffold
22
23
import androidx.compose.material3.Text
24
+ import androidx.compose.material3.TextButton
23
25
import androidx.compose.material3.TopAppBar
24
26
import androidx.compose.runtime.Composable
25
27
import androidx.compose.runtime.getValue
@@ -95,41 +97,48 @@ fun EditorScreen(
95
97
contentDescription = " Redo"
96
98
)
97
99
}
98
- IconButton (onClick = { showMenu = true }) {
99
- Icon (
100
- imageVector = Icons .Default .MoreVert ,
101
- contentDescription = " More options"
102
- )
100
+ TextButton (onClick = { }, enabled = false ) {
101
+ Text (" PUBLISH" )
103
102
}
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
- )
103
+
104
+ // Overflow menu button and dropdown in Box for proper anchoring
105
+ Box {
106
+ IconButton (onClick = { showMenu = true }) {
107
+ Icon (
108
+ imageVector = Icons .Default .MoreVert ,
109
+ contentDescription = " More options"
110
+ )
111
+ }
112
+ DropdownMenu (
113
+ expanded = showMenu,
114
+ onDismissRequest = { showMenu = false }
115
+ ) {
116
+ DropdownMenuItem (
117
+ text = { Text (" Save" ) },
118
+ onClick = { },
119
+ enabled = false
120
+ )
121
+ DropdownMenuItem (
122
+ text = { Text (" Preview" ) },
123
+ onClick = { },
124
+ enabled = false
125
+ )
126
+ DropdownMenuItem (
127
+ text = { Text (" Code editor" ) },
128
+ onClick = { },
129
+ enabled = false
130
+ )
131
+ DropdownMenuItem (
132
+ text = { Text (" Post settings" ) },
133
+ onClick = { },
134
+ enabled = false
135
+ )
136
+ DropdownMenuItem (
137
+ text = { Text (" Help" ) },
138
+ onClick = { },
139
+ enabled = false
140
+ )
141
+ }
133
142
}
134
143
}
135
144
)
0 commit comments