Skip to content

Commit

Permalink
ANDROID-14117 Using containers context as others methods (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
dagonco authored Dec 28, 2023
1 parent 1bbb215 commit 2d26365
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/src/main/java/com/telefonica/mistica/sheet/Sheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private fun Children.toView(context: Context, onSheetTapped: InternalOnSheetTapp
is ListSingleSelection -> this.toView(context, onSheetTapped)
is ListActions -> this.toView(context, onSheetTapped)
is ListInformative -> this.toView(context)
is BottomActions -> this.toView(context, onSheetTapped, container)
is BottomActions -> this.toView(onSheetTapped, container)
}

private fun ListSingleSelection.toView(context: Context, onSheetTapped: InternalOnSheetTapped): View =
Expand All @@ -246,8 +246,8 @@ private fun ListInformative.toView(context: Context): View =
it.adapter = InformativeListAdapter(this.elements.mapToInformativeViewData())
}

private fun BottomActions.toView(context: Context, onSheetTapped: InternalOnSheetTapped, container: ViewGroup): View {
return LayoutInflater.from(context).inflate(R.layout.sheet_bottom_actions, container, false)
private fun BottomActions.toView(onSheetTapped: InternalOnSheetTapped, container: ViewGroup): View {
return LayoutInflater.from(container.context).inflate(R.layout.sheet_bottom_actions, container, false)
.also { view ->
setBottomActionsContent(view, onSheetTapped)
}
Expand Down

0 comments on commit 2d26365

Please sign in to comment.