@@ -12,15 +12,19 @@ import androidx.appcompat.app.AppCompatActivity
1212import androidx.recyclerview.widget.LinearLayoutManager
1313import androidx.recyclerview.widget.PagerSnapHelper
1414import androidx.recyclerview.widget.RecyclerView
15+ import com.google.android.material.floatingactionbutton.FloatingActionButton
1516import me.alllexey123.itmowidgets.ItmoWidgetsApp
1617import me.alllexey123.itmowidgets.R
18+ import me.alllexey123.itmowidgets.ui.settings.SettingsActivity
1719import java.time.LocalDate
1820
1921class ScheduleActivity : AppCompatActivity () {
2022 private lateinit var outerRecyclerView: RecyclerView
2123 private lateinit var dayScheduleAdapter: DayScheduleAdapter
2224 private lateinit var progressBar: ProgressBar
2325
26+ private lateinit var fabSettings: FloatingActionButton
27+
2428 private val snapHelper = PagerSnapHelper ()
2529
2630 private val scheduleViewModel: ScheduleViewModel by viewModels {
@@ -33,13 +37,21 @@ class ScheduleActivity : AppCompatActivity() {
3337 setContentView(R .layout.activity_schedule)
3438
3539 setupRecyclerView()
40+ setupButtons()
3641 progressBar = findViewById(R .id.loadingProgressBar)
37-
3842 observeUiState()
3943
4044 scheduleViewModel.fetchScheduleData()
4145 }
4246
47+ private fun setupButtons () {
48+ fabSettings = findViewById(R .id.fab_settings)
49+ fabSettings.setOnClickListener { view ->
50+ val intent = Intent (this , SettingsActivity ::class .java)
51+ startActivity(intent)
52+ }
53+ }
54+
4355 private fun setupRecyclerView () {
4456 outerRecyclerView = findViewById(R .id.outerRecyclerView)
4557 outerRecyclerView.layoutManager =
0 commit comments