Skip to content
Snippets Groups Projects
Commit b42e652d authored by Taras's avatar Taras
Browse files

Create TransparentBackgroundBottomSheetDialogFragment

parent e84c739d
No related branches found
No related tags found
No related merge requests found
package org.futo.circles.core.fragment
import android.app.Dialog
import android.content.DialogInterface
import android.graphics.Color
import android.os.Bundle
import android.view.View
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
abstract class TransparentBackgroundBottomSheetDialogFragment : BottomSheetDialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
dialog.setOnShowListener { setupBottomSheet(it) }
return dialog
}
private fun setupBottomSheet(dialogInterface: DialogInterface) {
val bottomSheetDialog = dialogInterface as BottomSheetDialog
val bottomSheet = bottomSheetDialog.findViewById<View>(
com.google.android.material.R.id.design_bottom_sheet
) ?: return
bottomSheet.setBackgroundColor(Color.TRANSPARENT)
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment