Skip to content

Commit

Permalink
fix:[ANDROAPP-6579] modify offset for dropdown menu in teiDashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
xavimolloy committed Dec 12, 2024
1 parent 4ff99ce commit 82adf9d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/src/main/java/org/dhis2/utils/customviews/MoreMenuView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
import org.hisp.dhis.mobile.ui.designsystem.component.IconButton
import org.hisp.dhis.mobile.ui.designsystem.component.menu.DropDownMenu
import org.hisp.dhis.mobile.ui.designsystem.component.menu.MenuItemData
import org.hisp.dhis.mobile.ui.designsystem.theme.Spacing
import org.hisp.dhis.mobile.ui.designsystem.theme.SurfaceColor

@Composable
Expand All @@ -32,16 +34,17 @@ fun <T> MoreOptionsWithDropDownMenuButton(
) {
onMenuToggle(!expanded)
}

DropDownMenu(
modifier = Modifier.widthIn(max = 0.7.dw),
items = dropDownMenuItems,
expanded = expanded,
offset = DpOffset(x = -Spacing.Spacing16, y = Spacing.Spacing0),
onDismissRequest = { onMenuToggle(false) },
) { itemId ->
onMenuToggle(false)
onItemClick(itemId)
}
onItemClick = { itemId ->
onMenuToggle(false)
onItemClick(itemId)
},
)
}

inline val Double.dw: Dp
Expand Down

0 comments on commit 82adf9d

Please sign in to comment.