Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3943cba authored by Chaohui Wang's avatar Chaohui Wang Committed by Android Build Cherrypicker Worker
Browse files

Make MoreOptionsScope abstract class

Instead of interface to fix the following error: overridable Composable
functions with default values are not currently supported.

Fix: 321724969
Test: unit test
Merged-In: I8399bd486b0001749af76b3393898d930bd2b7af
Change-Id: I8399bd486b0001749af76b3393898d930bd2b7af
parent ed2395aa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@ import androidx.compose.ui.res.stringResource
/**
 * Scope for the children of [MoreOptionsAction].
 */
interface MoreOptionsScope {
    fun dismiss()
abstract class MoreOptionsScope {
    abstract fun dismiss()

    @Composable
    fun MenuItem(text: String, enabled: Boolean = true, onClick: () -> Unit) {
@@ -60,7 +60,7 @@ fun MoreOptionsAction(
    val onDismiss = { expanded = false }
    DropdownMenu(expanded = expanded, onDismissRequest = onDismiss) {
        val moreOptionsScope = remember(this) {
            object : MoreOptionsScope {
            object : MoreOptionsScope() {
                override fun dismiss() {
                    onDismiss()
                }
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ class RestrictedMenuItemTest {
    }

    private fun setContent(restrictions: Restrictions) {
        val fakeMoreOptionsScope = object : MoreOptionsScope {
        val fakeMoreOptionsScope = object : MoreOptionsScope() {
            override fun dismiss() {}
        }
        composeTestRule.setContent {