Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bottom sheet dialog
package com.aqua30.testingproject.curved_background
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.appcompat.app.AppCompatActivity
import com.aqua30.testingproject.R
import com.aqua30.testingproject.databinding.BottomCurvedBinding
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
/**
* Created by Saurabh
*/
class BottomSheetContainer: BottomSheetDialogFragment() {
lateinit var binding : BottomCurvedBinding
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
binding = BottomCurvedBinding.inflate(layoutInflater,container,false)
return binding.root
}
companion object {
fun show (activity: AppCompatActivity): BottomSheetContainer {
val fragment = BottomSheetContainer()
fragment.show(activity.supportFragmentManager,"")
return fragment
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment