From c995e79a1a1ccc25edc173c2e9a6492f0f19360d Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 8 Mar 2018 18:29:40 +0100 Subject: [PATCH] adding a Timer tab --- .../clock/adapters/ViewPagerAdapter.kt | 2 ++ .../clock/fragments/TimerFragment.kt | 34 ++++++++++++++++++ .../clock/helpers/Constants.kt | 2 +- app/src/main/res/drawable-hdpi/ic_timer.png | Bin 0 -> 527 bytes app/src/main/res/drawable-xhdpi/ic_timer.png | Bin 0 -> 401 bytes app/src/main/res/drawable-xxhdpi/ic_timer.png | Bin 0 -> 847 bytes .../main/res/drawable-xxxhdpi/ic_timer.png | Bin 0 -> 773 bytes app/src/main/res/layout/activity_main.xml | 5 +++ app/src/main/res/layout/fragment_timer.xml | 8 +++++ app/src/main/res/values-pt/strings.xml | 5 +-- app/src/main/res/values-sk/strings.xml | 5 +-- app/src/main/res/values/strings.xml | 5 +-- 12 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt create mode 100644 app/src/main/res/drawable-hdpi/ic_timer.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_timer.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_timer.png create mode 100644 app/src/main/res/drawable-xxxhdpi/ic_timer.png create mode 100644 app/src/main/res/layout/fragment_timer.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt index 2afa765c..9fd0415a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt @@ -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") } } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt new file mode 100644 index 00000000..035dada4 --- /dev/null +++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt @@ -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() { + + } +} diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt index 92c0efce..98b5218a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt @@ -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 diff --git a/app/src/main/res/drawable-hdpi/ic_timer.png b/app/src/main/res/drawable-hdpi/ic_timer.png new file mode 100644 index 0000000000000000000000000000000000000000..b23601069af1ce7c701427a633b3cbb68dfa1d18 GIT binary patch literal 527 zcmV+q0`UEbP)nYRyoS#utMrKmDivBiD?n@eka$uqv4 zM8+z*1$y$)We_TPan>lGPMlttQctZjCW-iE{r_F5gPeeLuvW RN$LOq002ovPDHLkV1ns*=hOfI literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/ic_timer.png b/app/src/main/res/drawable-xhdpi/ic_timer.png new file mode 100644 index 0000000000000000000000000000000000000000..621fb4d42796ac5fbafb156887b67950bf6b3a11 GIT binary patch literal 401 zcmV;C0dD?@P)%8Vvp$(hLG{_ZG4T5k1XC0NfGB;f1@H9R{N@@bVU6p{55O%xUhpmh1BQ=0!v| zW9<(B3X{{~RCjKrT{GFKRjRA_Wx`olF{&mNYWXhNl8FX2OmS2r{PZdTq2f0pPMHwC z=ac&bF&w*MQi)##%~}(}*pT}yjj&QPCKMqWML3^B{EB3PIUbXH4k0G_#jhw$#5U~_ zkRO0@<(`Ady^HvsPh{7$+26uk{ojbtLH=`_K;1H$YbB}_zmlgPAm=`}34?ebx*yPH z*Dl5c&gGt?ZdxZZ vn}F@l>MU)dgz<{Wm+Y^YBIh0q20eHK@-M~JfK5(r00000NkvXXu0mjfU@on* literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_timer.png b/app/src/main/res/drawable-xxhdpi/ic_timer.png new file mode 100644 index 0000000000000000000000000000000000000000..d662b66e99cb9f18f83875934ae31062205bcb7c GIT binary patch literal 847 zcmV-V1F-ywP)x`vlt;BJs^kZh225~UM3 zoj~pc%>@4X1No_+rZT7F5JKVo9mMegcie#kR4SE9rBW(R(}?5(z|z)~>Y#{SRFWNqY z+yYn!{^kw9SLfXK#J2o}qH2# zG46LE5U0&5&V{j!K%gh%KJNwMm`;isk}HxYfk+RA{k4I<^7x%Tghro8-W&82nv8?h zxJ+Sq*^|ngsQdm#FbV4KCxR?g5cpWPpg0`&()a_$k0@u>zmSARs^>G^;3Rv?Rp zw(lBS&S@o4{=i|VNae32%I>qYlwESAyowk@xusW*^PW0seL6`l#_lEqz!;A77QmJz zQF$ahawBhVXwqp=-haD=yg5ZeE|ut9mhoqrkXe=3zqrBbQP Znm=m5m4lcfIX?gZ002ovPDHLkV1iQBjlKW? literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/ic_timer.png b/app/src/main/res/drawable-xxxhdpi/ic_timer.png new file mode 100644 index 0000000000000000000000000000000000000000..1c68403a70a695594bf253d802c0afc7f3190ed2 GIT binary patch literal 773 zcmV+g1N!`lP)`#(#OBi4u)^)xdn+IhZ(F1vq$o%$)|fzS>Ky|d z$p?WV-lF4-kYZ=>q4q$m0{3A0v!5csDQIZS{0BaqB1)D~4~0G{RGHY)k#+X9*M4Y( zOvjIV;C{%B9-EQuTRIaz6Jtby6(fMyz?xO6wi zL4X4IHgeoI0;}H&ZP_P|P=ICxD1tVT*)9`v%T_GBxqt{hkndAC0=xES0t8qpIcf=@ zIGeWrL2Y7|nU`u4_Zx)_{;!!C0@!l7%4eU+<1j5cL|QY)cm0skriumP;M!u($y-9W z2lazPaGzlEb{ajr70*4LLk1iIZIddq;PLt?DHtFz5a8oy)aL&)g72CqIBSr#*kMBA zszQH8foo($V@I$T7pz*e0FG0h4gxFGKd%_m)9cs|-^I*xMu%IGcD}T)Ou0MRh|I)W z#bY}DclZT}IU1OX&emH@`8Dz8TTF=~XQy0<3m$kn={{c{%h%jEJkq?1CFSAu>EYGK za&Qn4c-A6{G!Fd;JatudnPbV)m9J{|#*G^{ZVciZP}J6JoV+Nv00000NkvXXu0mjf Dkj+og literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 35ade104..c2944fb3 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -34,6 +34,11 @@ android:layout_height="wrap_content" android:icon="@drawable/ic_stopwatch"/> + + + + diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 5545851f..e2b6bc91 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -12,6 +12,7 @@ Relógio Alarme Cronómetro + Timer tab Mostrar segundos Mostrar outros fusos horários @@ -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. diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 736279ff..734a5d2e 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -12,6 +12,7 @@ Okno s časom Okno s budíkom Okno so stopkami + Okno s časovačom Zobraziť sekundy Povoliť zobrazenie dodatočných časových pásiem @@ -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. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f83e0129..250fe2fc 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -12,6 +12,7 @@ Clock tab Alarm tab Stopwatch tab + Timer tab Show seconds Allow displaying other time zones @@ -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.