Material 时间选取器 - 未检测到 supportFragmentManager

Material Time Picker - supportFragmentManager not detected

我正在尝试使用 material 日期和时间选择器,并设法参考并整理了下面的代码,以便在单击按钮时显示日期和时间选择器。还使用了最新的 alpha 版本 Material design 1.3.0-alpha03。但是,虽然 supportFragmentManager 正在为 MaterialDatePicker 工作 - 它被标记为 MaterialTimePicker 未解决。似乎无法理解为什么会这样......有人可以解释和指导解决这个问题吗?我的代码如下

        editEventEndDate.setOnClickListener {
        // Create the date picker builder and set the title
        val builder = MaterialDatePicker.Builder.datePicker()
            .also {
                title = "Pick Date"
            }
        // create the date picker
        val materialDatePicker = builder.build()
        // set listener when date is selected
        materialDatePicker.addOnPositiveButtonClickListener {
            // Create calendar object and set the date to be that returned from selection
            val calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"))
            calendar.time = Date(it)
            val endDate = Calendar.DATE
            val endYear = Calendar.YEAR
            val endDay = Calendar.DAY_OF_WEEK
            val endMonth = Calendar.MONTH
            val endResult =  "$endDay, $endDate $endMonth $endYear"
            editEventStartDate.text = endResult
        }
        materialDatePicker.show(supportFragmentManager, "MyTAG")
    }

    //Add time on click
    editEventStartTime.setOnClickListener {
        val materialTimePicker = MaterialTimePicker.Builder()
            .setTimeFormat(clockFormat)
            .setHour(hour)
            .setMinute(minute)
            .also {
                title = "Pick Time"
            }
            .build()
        materialTimePicker.show(**supportFragmentManager()**, "fragment_tag")
        materialTimePicker.addOnPositiveButtonClickListener {
            val newHour = materialTimePicker.hour
            val newMinute = materialTimePicker.minute
            this@AddEvent.onTimeSet(newHour, newMinute)
        }
    }

supportFragmentManager() 不是一个函数,错误是正确的。 使用 supportFragmentManager