adding a Timer tab

This commit is contained in:
tibbi
2018-03-08 18:29:40 +01:00
parent 60071e2cdc
commit c995e79a1a
12 changed files with 59 additions and 7 deletions

View File

@ -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")
}
}

View File

@ -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() {
}
}

View File

@ -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