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

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 773 B

View file

@ -34,6 +34,11 @@
android:layout_height="wrap_content"
android:icon="@drawable/ic_stopwatch"/>
<android.support.design.widget.TabItem
android:id="@+id/tab_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_timer"/>
</android.support.design.widget.TabLayout>
<com.booking.rtlviewpager.RtlViewPager

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/timer_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.design.widget.CoordinatorLayout>

View file

@ -12,6 +12,7 @@
<string name="clock_tab">Relógio</string>
<string name="alarm_tab">Alarme</string>
<string name="stopwatch_tab">Cronómetro</string>
<string name="timer_tab">Timer tab</string>
<string name="show_seconds">Mostrar segundos</string>
<string name="display_other_time_zones">Mostrar outros fusos horários</string>
@ -27,12 +28,12 @@
At the clock you can enable displaying times from other timezones, or use the simple, but customizable clock widget. The text color of the widget can be customized, as well as the color and the alpha of the background.
You can easily setup a timer to be notified of some event. You can both change its ringtone, or toggle vibrations.
The alarm contains all the expected features as day selecting, vibration toggling, ringtone selecting, snooze or adding a custom label.
With the stopwatch you can easily measure a longer period of time, or individual laps. You can sort the laps by lap time, it contains optional vibrations on button presses too, just to let you know that the button was pressed, even if you cannot look at the device.
You can easily setup a timer to be notified of some event. You can both change its ringtone, or toggle vibrations.
Additional features include preventing the device from falling asleep while the app is in foreground, or displaying some tabs in fullscreen view.
Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors.

View file

@ -12,6 +12,7 @@
<string name="clock_tab">Okno s časom</string>
<string name="alarm_tab">Okno s budíkom</string>
<string name="stopwatch_tab">Okno so stopkami</string>
<string name="timer_tab">Okno s časovačom</string>
<string name="show_seconds">Zobraziť sekundy</string>
<string name="display_other_time_zones">Povoliť zobrazenie dodatočných časových pásiem</string>
@ -27,12 +28,12 @@
Hodinky vedia zobraziť aj čas iných časových pásiem, resp. ponúkajú jednoduchý, ale nastaviteľný widget. Farbu textu widgetu možno prispôsobiť, rovnako ako farbu a priehľadnosť pozadia.
Viete si jednoducho nastaviť aj časovač, aby vám nič neuniklo. Viete zmeniť jeho zvučku, alebo zapnúť vibrácie.
Budík obsahuje všetky očakávané funkcie ako výber dní, prepínanie vibrácií, výber melódie, odloženie, ako aj pridanie štítka.
So stopkami viete jednoducho zmerať nejaký časový interval, alebo jednotlivé okruhy. Okruhy viete zoradiť aj podľa ich času. Stopky obsahujú nastaviteľné vibrácie pri stlačení tlačidiel, aby vás to uistilo v ich stlačenie, aj keď sa neviete práve pozrieť na displej.
Viete si jednoducho nastaviť aj časovač, aby vám nič neuniklo. Viete zmeniť jeho zvučku, alebo zapnúť vibrácie.
Ďalšími funkciami sú predídenie uspania zariadenia kým je apka v popredí, alebo zobrazenie okien v celoobrazovkovom režime.
Neobsahuje žiadne reklamy a nepotrebné oprávnenia. Je opensource, poskytuje možnosť zmeny farieb.

View file

@ -12,6 +12,7 @@
<string name="clock_tab">Clock tab</string>
<string name="alarm_tab">Alarm tab</string>
<string name="stopwatch_tab">Stopwatch tab</string>
<string name="timer_tab">Timer tab</string>
<string name="show_seconds">Show seconds</string>
<string name="display_other_time_zones">Allow displaying other time zones</string>
@ -27,12 +28,12 @@
At the clock you can enable displaying times from other timezones, or use the simple, but customizable clock widget. The text color of the widget can be customized, as well as the color and the alpha of the background.
You can easily setup a timer to be notified of some event. You can both change its ringtone, or toggle vibrations.
The alarm contains all the expected features as day selecting, vibration toggling, ringtone selecting, snooze or adding a custom label.
With the stopwatch you can easily measure a longer period of time, or individual laps. You can sort the laps by lap time, it contains optional vibrations on button presses too, just to let you know that the button was pressed, even if you cannot look at the device.
You can easily setup a timer to be notified of some event. You can both change its ringtone, or toggle vibrations.
Additional features include preventing the device from falling asleep while the app is in foreground, or displaying some tabs in fullscreen view.
Contains no ads or unnecessary permissions. It is fully opensource, provides customizable colors.