mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-06-05 22:19:17 +02:00
adding a Timer tab
This commit is contained in:
@ -7,6 +7,7 @@ import android.view.ViewGroup
|
||||
import com.simplemobiletools.clock.fragments.AlarmFragment
|
||||
import com.simplemobiletools.clock.fragments.ClockFragment
|
||||
import com.simplemobiletools.clock.fragments.StopwatchFragment
|
||||
import com.simplemobiletools.clock.fragments.TimerFragment
|
||||
import com.simplemobiletools.clock.helpers.TABS_COUNT
|
||||
|
||||
class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
|
||||
@ -29,6 +30,7 @@ class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
|
||||
0 -> ClockFragment()
|
||||
1 -> AlarmFragment()
|
||||
2 -> StopwatchFragment()
|
||||
3 -> TimerFragment()
|
||||
else -> throw RuntimeException("Trying to fetch unknown fragment id $position")
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,34 @@
|
||||
package com.simplemobiletools.clock.fragments
|
||||
|
||||
import android.os.Bundle
|
||||
import android.support.v4.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.simplemobiletools.clock.R
|
||||
import com.simplemobiletools.commons.extensions.updateTextColors
|
||||
import kotlinx.android.synthetic.main.fragment_timer.*
|
||||
|
||||
class TimerFragment : Fragment() {
|
||||
lateinit var view: ViewGroup
|
||||
|
||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
|
||||
view = inflater.inflate(R.layout.fragment_timer, container, false) as ViewGroup
|
||||
return view
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
setupViews()
|
||||
}
|
||||
|
||||
private fun setupViews() {
|
||||
view.apply {
|
||||
context!!.updateTextColors(timer_fragment)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupTimer() {
|
||||
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@ const val DISPLAY_OTHER_TIME_ZONES = "display_other_time_zones"
|
||||
const val SELECTED_TIME_ZONES = "selected_time_zones"
|
||||
const val EDITED_TIME_ZONE_TITLES = "edited_time_zone_titles"
|
||||
|
||||
const val TABS_COUNT = 3
|
||||
const val TABS_COUNT = 4
|
||||
const val EDITED_TIME_ZONE_SEPARATOR = ":"
|
||||
const val ALARM_ID = "alarm_id"
|
||||
const val DEFAULT_ALARM_MINUTES = 480
|
||||
|
Reference in New Issue
Block a user