Skip to content

Commit

Permalink
Fix bottom margin when editing table from drawer
Browse files Browse the repository at this point in the history
Signed-off-by: saulhdev <[email protected]>
  • Loading branch information
saulhdev committed Nov 18, 2024
1 parent c8ed226 commit 83cd939
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
7 changes: 6 additions & 1 deletion Omega/src/com/saggitt/omega/allapps/AllAppsTabItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.HorizontalScrollView
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.ui.unit.dp
import com.android.launcher3.AbstractFloatingView
import com.android.launcher3.Launcher
import com.android.launcher3.R
Expand Down Expand Up @@ -204,7 +206,10 @@ class AllAppsTabItem(context: Context, attrs: AttributeSet) :
button.refreshColor()
button.text = tab.name
button.setOnLongClickListener { v: View ->
ComposeBottomSheet.show(v.context) {
ComposeBottomSheet.show(
context = v.context,
paddings = PaddingValues(all = 0.dp),
) {
EditGroupBottomSheet(
category = prefs.drawerGroupsType!!,
group = tab.drawerTab,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ class ComposeBottomSheet(context: Context, attrs: AttributeSet? = null) :

fun setContent(
content: @Composable ComposeBottomSheet.() -> Unit,
contentPaddings: PaddingValues = PaddingValues(
top = 0.dp,
bottom = 50.dp,
start = 0.dp,
end = 0.dp
),
contentPaddings: PaddingValues
) {
container.setContent {
OmegaAppTheme {
Expand Down Expand Up @@ -186,11 +181,17 @@ class ComposeBottomSheet(context: Context, attrs: AttributeSet? = null) :

fun show(
context: Context,
paddings: PaddingValues = PaddingValues(
top = 0.dp,
bottom = 50.dp,
start = 0.dp,
end = 0.dp
),
content: @Composable (ComposeBottomSheet.() -> Unit),
) {
val bottomSheet = ComposeBottomSheet(context)
bottomSheet.show()
bottomSheet.setContent(content)
bottomSheet.setContent(content, paddings)
}
}
}

0 comments on commit 83cd939

Please sign in to comment.