13.10 添加日程事件

现在我们点击添加日程的浮层按钮中,添加切换到 “日程添加编辑” TodoEditFragment的逻辑。

  1. // 添加日程事件
  2. fab?.setOnClickListener { _ ->
  3. // Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG).setAction("Action", null).show()
  4. val todoEditFragment = TodoEditFragment()
  5. getSupportFragmentManager()
  6. .beginTransaction()
  7. .replace(R.id.content_main, todoEditFragment, todoEditFragment.javaClass.getSimpleName())
  8. .addToBackStack(todoEditFragment.javaClass.getSimpleName())
  9. .commit()
  10. hideFab()
  11. }