From 9dc2c48df6a2d40caac649559c17b5ea555bfa8f Mon Sep 17 00:00:00 2001 From: MohitMali Date: Wed, 16 Nov 2022 19:07:48 +0530 Subject: [PATCH 01/12] Added app shortcut to start the stopwatch --- app/src/main/AndroidManifest.xml | 1 + .../kotlin/com/simplemobiletools/clock/App.kt | 25 ++++++++++++++++++- .../clock/activities/MainActivity.kt | 9 ++++++- .../clock/activities/SplashActivity.kt | 7 ++++++ .../clock/adapters/ViewPagerAdapter.kt | 5 ++++ .../clock/fragments/StopwatchFragment.kt | 11 ++++++++ .../simplemobiletools/clock/helpers/Config.kt | 4 +++ .../clock/helpers/Constants.kt | 1 + app/src/main/res/xml-v25/shortcuts.xml | 12 +++++++++ 9 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 app/src/main/res/xml-v25/shortcuts.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index aca6ff07..9c3af604 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -37,6 +37,7 @@ android:theme="@style/SplashTheme"> + diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt index e94f8560..c8406780 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt @@ -3,6 +3,11 @@ package com.simplemobiletools.clock import android.app.Application import android.app.NotificationManager import android.content.Context +import android.content.Intent +import android.content.pm.ShortcutInfo +import android.content.pm.ShortcutManager +import android.graphics.drawable.Icon +import android.os.Build import android.os.CountDownTimer import android.os.Handler import android.os.Looper @@ -11,8 +16,9 @@ import androidx.lifecycle.LifecycleObserver import androidx.lifecycle.OnLifecycleEvent import androidx.lifecycle.ProcessLifecycleOwner import com.facebook.stetho.Stetho +import com.simplemobiletools.clock.activities.SplashActivity import com.simplemobiletools.clock.extensions.* -import com.simplemobiletools.clock.helpers.Stopwatch +import com.simplemobiletools.clock.helpers.* import com.simplemobiletools.clock.helpers.Stopwatch.State import com.simplemobiletools.clock.models.TimerEvent import com.simplemobiletools.clock.models.TimerState @@ -40,6 +46,23 @@ class App : Application(), LifecycleObserver { } checkUseEnglish() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { + val shortcutManager = getSystemService(ShortcutManager::class.java) + val intent = Intent(this, SplashActivity::class.java).apply { + putExtra(OPEN_TAB, TAB_STOPWATCH) + putExtra(TOGGLE_STOPWATCH, true) + action = "android.intent.action.TOGGLE_STOPWATCH" + } + val shortcut = ShortcutInfo.Builder(this, "id1") + .setShortLabel("Stopwatch") + .setLongLabel("Start Stopwatch") + .setIcon(Icon.createWithResource(this, R.drawable.ic_stopwatch_vector)) + .setIntent( + intent + ) + .build() + shortcutManager.dynamicShortcuts = listOf(shortcut) + } } override fun onTerminate() { diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt index 8e9739a5..c5cdae54 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt @@ -106,6 +106,11 @@ class MainActivity : SimpleActivity() { val timerId = intent.getIntExtra(TIMER_ID, INVALID_TIMER_ID) (view_pager.adapter as ViewPagerAdapter).updateTimerPosition(timerId) } + if (tabToOpen == TAB_STOPWATCH) { + if (intent.getBooleanExtra(TOGGLE_STOPWATCH, false)) { + (view_pager.adapter as ViewPagerAdapter).startStopWatch() + } + } } super.onNewIntent(intent) } @@ -152,7 +157,9 @@ class MainActivity : SimpleActivity() { val timerId = intent.getIntExtra(TIMER_ID, INVALID_TIMER_ID) viewPagerAdapter.updateTimerPosition(timerId) } - + if (tabToOpen == TAB_STOPWATCH) { + config.toggleStopWatch = intent.getBooleanExtra(TOGGLE_STOPWATCH, false) + } view_pager.offscreenPageLimit = TABS_COUNT - 1 view_pager.currentItem = tabToOpen } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt index d2d8c736..ebd66be2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt @@ -13,6 +13,13 @@ class SplashActivity : BaseSplashActivity() { startActivity(this) } } + intent?.action == "android.intent.action.TOGGLE_STOPWATCH" -> { + Intent(this, MainActivity::class.java).apply { + putExtra(OPEN_TAB, TAB_STOPWATCH) + putExtra(TOGGLE_STOPWATCH, intent.getBooleanExtra(TOGGLE_STOPWATCH, false)) + startActivity(this) + } + } intent.extras?.containsKey(OPEN_TAB) == true -> { Intent(this, MainActivity::class.java).apply { putExtra(OPEN_TAB, intent.getIntExtra(OPEN_TAB, TAB_CLOCK)) 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 6f795b98..f5517f93 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/adapters/ViewPagerAdapter.kt @@ -12,6 +12,7 @@ import com.simplemobiletools.clock.helpers.TABS_COUNT import com.simplemobiletools.clock.helpers.TAB_ALARM import com.simplemobiletools.clock.helpers.TAB_CLOCK import com.simplemobiletools.clock.helpers.TAB_TIMER +import com.simplemobiletools.clock.helpers.TAB_STOPWATCH import com.simplemobiletools.commons.models.AlarmSound class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) { @@ -57,4 +58,8 @@ class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) { fun updateTimerPosition(timerId: Int) { (fragments[TAB_TIMER] as? TimerFragment)?.updatePosition(timerId) } + + fun startStopWatch() { + (fragments[TAB_STOPWATCH] as? StopwatchFragment)?.startStopWatch() + } } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt index c59cdcaa..af20b6de 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt @@ -91,6 +91,11 @@ class StopwatchFragment : Fragment() { if (Stopwatch.laps.isNotEmpty()) { updateSorting(Lap.sorting) } + + if (requireContext().config.toggleStopWatch) { + requireContext().config.toggleStopWatch = false + startStopWatch() + } } override fun onPause() { @@ -185,6 +190,12 @@ class StopwatchFragment : Fragment() { } } + fun startStopWatch() { + if (Stopwatch.state == Stopwatch.State.STOPPED) { + togglePlayPause() + } + } + private fun updateLaps() { stopwatchAdapter.updateItems(Stopwatch.laps) } diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt index e8abf2b8..6ecddafd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt @@ -49,6 +49,10 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getString(TIMER_LABEL, null) set(label) = prefs.edit().putString(TIMER_LABEL, label).apply() + var toggleStopWatch: Boolean + get() = prefs.getBoolean(TOGGLE_STOPWATCH, false) + set(label) = prefs.edit().putBoolean(TOGGLE_STOPWATCH, label).apply() + var alarmSort: Int get() = prefs.getInt(ALARMS_SORT_BY, SORT_BY_CREATION_ORDER) set(alarmSort) = prefs.edit().putInt(ALARMS_SORT_BY, alarmSort).apply() 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 57590f6e..0535f600 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt @@ -13,6 +13,7 @@ const val TIMER_SOUND_URI = "timer_sound_uri" const val TIMER_SOUND_TITLE = "timer_sound_title" const val TIMER_CHANNEL_ID = "timer_channel_id" const val TIMER_LABEL = "timer_label" +const val TOGGLE_STOPWATCH = "toggle_stopwatch" const val TIMER_MAX_REMINDER_SECS = "timer_max_reminder_secs" const val ALARM_MAX_REMINDER_SECS = "alarm_max_reminder_secs" const val ALARM_LAST_CONFIG = "alarm_last_config" diff --git a/app/src/main/res/xml-v25/shortcuts.xml b/app/src/main/res/xml-v25/shortcuts.xml new file mode 100644 index 00000000..faf80e14 --- /dev/null +++ b/app/src/main/res/xml-v25/shortcuts.xml @@ -0,0 +1,12 @@ + + + + + From 91031b07b060553d02a6f567ac85d4e7c2b0a800 Mon Sep 17 00:00:00 2001 From: MohitMaliDeveloper Date: Fri, 18 Nov 2022 14:34:40 +0530 Subject: [PATCH 02/12] Changes after review --- .../kotlin/com/simplemobiletools/clock/App.kt | 18 ++++++++++++------ .../clock/activities/SplashActivity.kt | 2 +- .../clock/helpers/Constants.kt | 4 ++++ app/src/main/res/values/strings.xml | 2 ++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt index c8406780..6631bb81 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt @@ -18,8 +18,13 @@ import androidx.lifecycle.ProcessLifecycleOwner import com.facebook.stetho.Stetho import com.simplemobiletools.clock.activities.SplashActivity import com.simplemobiletools.clock.extensions.* -import com.simplemobiletools.clock.helpers.* +import com.simplemobiletools.clock.helpers.OPEN_TAB +import com.simplemobiletools.clock.helpers.Stopwatch import com.simplemobiletools.clock.helpers.Stopwatch.State +import com.simplemobiletools.clock.helpers.TAB_STOPWATCH +import com.simplemobiletools.clock.helpers.TOGGLE_STOPWATCH +import com.simplemobiletools.clock.helpers.STOPWATCH_TOGGLE_ACTION +import com.simplemobiletools.clock.helpers.STOPWATCH_SHORTCUT_ID import com.simplemobiletools.clock.models.TimerEvent import com.simplemobiletools.clock.models.TimerState import com.simplemobiletools.clock.services.StopwatchStopService @@ -28,6 +33,7 @@ import com.simplemobiletools.clock.services.startStopwatchService import com.simplemobiletools.clock.services.startTimerService import com.simplemobiletools.commons.extensions.checkUseEnglish import com.simplemobiletools.commons.extensions.showErrorToast +import com.simplemobiletools.commons.helpers.isNougatMR1Plus import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode @@ -46,16 +52,16 @@ class App : Application(), LifecycleObserver { } checkUseEnglish() - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { + if (isNougatMR1Plus()) { val shortcutManager = getSystemService(ShortcutManager::class.java) val intent = Intent(this, SplashActivity::class.java).apply { putExtra(OPEN_TAB, TAB_STOPWATCH) putExtra(TOGGLE_STOPWATCH, true) - action = "android.intent.action.TOGGLE_STOPWATCH" + action = STOPWATCH_TOGGLE_ACTION } - val shortcut = ShortcutInfo.Builder(this, "id1") - .setShortLabel("Stopwatch") - .setLongLabel("Start Stopwatch") + val shortcut = ShortcutInfo.Builder(this, STOPWATCH_SHORTCUT_ID) + .setShortLabel(getString(R.string.stopwatch)) + .setLongLabel(getString(R.string.start_stopwatch)) .setIcon(Icon.createWithResource(this, R.drawable.ic_stopwatch_vector)) .setIntent( intent diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt index ebd66be2..cb96e549 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/SplashActivity.kt @@ -13,7 +13,7 @@ class SplashActivity : BaseSplashActivity() { startActivity(this) } } - intent?.action == "android.intent.action.TOGGLE_STOPWATCH" -> { + intent?.action == STOPWATCH_TOGGLE_ACTION -> { Intent(this, MainActivity::class.java).apply { putExtra(OPEN_TAB, TAB_STOPWATCH) putExtra(TOGGLE_STOPWATCH, intent.getBooleanExtra(TOGGLE_STOPWATCH, false)) 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 0535f600..f8890400 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt @@ -61,6 +61,10 @@ const val SORT_BY_DATE_AND_TIME = 2 const val TODAY_BIT = -1 const val TOMORROW_BIT = -2 +// stopwatch shortcut +const val STOPWATCH_SHORTCUT_ID = "stopwatch_shortcut_id" +const val STOPWATCH_TOGGLE_ACTION = "android.intent.action.TOGGLE_STOPWATCH" + fun getDefaultTimeZoneTitle(id: Int) = getAllTimeZones().firstOrNull { it.id == id }?.title ?: "" fun getPassedSeconds(): Int { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bfed2d96..4f8d87d8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -53,4 +53,6 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> + + Start Stopwatch From 260fb7061297fac1c922af945d8531d492863b72 Mon Sep 17 00:00:00 2001 From: MohitMali Date: Fri, 18 Nov 2022 17:55:31 +0530 Subject: [PATCH 03/12] Added start_stopwatch to all languages --- app/src/main/kotlin/com/simplemobiletools/clock/App.kt | 1 - app/src/main/res/values-ar/strings.xml | 3 ++- app/src/main/res/values-az/strings.xml | 1 + app/src/main/res/values-be/strings.xml | 3 ++- app/src/main/res/values-bg/strings.xml | 3 ++- app/src/main/res/values-ca/strings.xml | 3 ++- app/src/main/res/values-cs/strings.xml | 3 ++- app/src/main/res/values-cy/strings.xml | 3 ++- app/src/main/res/values-da/strings.xml | 1 + app/src/main/res/values-de/strings.xml | 3 ++- app/src/main/res/values-el/strings.xml | 1 + app/src/main/res/values-eo/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 3 ++- app/src/main/res/values-et/strings.xml | 3 ++- app/src/main/res/values-eu/strings.xml | 1 + app/src/main/res/values-fi/strings.xml | 3 ++- app/src/main/res/values-fr/strings.xml | 3 ++- app/src/main/res/values-gl/strings.xml | 3 ++- app/src/main/res/values-hr/strings.xml | 3 ++- app/src/main/res/values-hu/strings.xml | 3 ++- app/src/main/res/values-in/strings.xml | 1 + app/src/main/res/values-it/strings.xml | 3 ++- app/src/main/res/values-iw/strings.xml | 1 + app/src/main/res/values-ja/strings.xml | 3 ++- app/src/main/res/values-lt/strings.xml | 1 + app/src/main/res/values-ml/strings.xml | 1 + app/src/main/res/values-nb-rNO/strings.xml | 1 + app/src/main/res/values-nl/strings.xml | 1 + app/src/main/res/values-pa-rPK/strings.xml | 3 ++- app/src/main/res/values-pl/strings.xml | 3 ++- app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 1 + app/src/main/res/values-ro/strings.xml | 3 ++- app/src/main/res/values-ru/strings.xml | 3 ++- app/src/main/res/values-sk/strings.xml | 1 + app/src/main/res/values-sl/strings.xml | 3 ++- app/src/main/res/values-sr/strings.xml | 3 ++- app/src/main/res/values-sv/strings.xml | 3 ++- app/src/main/res/values-th/strings.xml | 1 + app/src/main/res/values-tr/strings.xml | 3 ++- app/src/main/res/values-uk/strings.xml | 1 + app/src/main/res/values-zh-rCN/strings.xml | 3 ++- app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values/strings.xml | 2 +- 44 files changed, 68 insertions(+), 27 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt index 6631bb81..7c2e4150 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt @@ -7,7 +7,6 @@ import android.content.Intent import android.content.pm.ShortcutInfo import android.content.pm.ShortcutManager import android.graphics.drawable.Icon -import android.os.Build import android.os.CountDownTimer import android.os.Handler import android.os.Looper diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index a96faf7b..1e11a821 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -8,6 +8,7 @@ Clock Timer ساعة التوقيف + Start Stopwatch اللفه تم إيقاف ساعة التوقيف تم إيقاف الموقت @@ -53,4 +54,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index ad12768f..24130d40 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -7,6 +7,7 @@ Clock Sayğac Stopwatch + Start Stopwatch Dövrə Saniyəölçən dayandı Sayğaç dayandı diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index f783fc80..cfa726a8 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -8,6 +8,7 @@ Гадзіннік Таймер Секундамер + Start Stopwatch Круг Секундамер спынены Таймер спынены @@ -51,4 +52,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 22c4300e..debdec27 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -8,6 +8,7 @@ Часовник Таймер Секундомер + Start Stopwatch Обиколка Секундомерът е спрян Таймерът е спрян @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 03211be9..11230c53 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -8,6 +8,7 @@ Clock Temporitzador Cronòmetre + Start Stopwatch Volta S\'ha aturat el cronòmetre S\'ha aturat el temporitzador @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index dd49e2c6..ed034ae1 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -8,6 +8,7 @@ Hodiny Časovač Stopky + Start Stopwatch Mezičas Stopky byly zastaveny Časovač byl zastaven @@ -50,4 +51,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml index 41a362f4..7f847bbe 100644 --- a/app/src/main/res/values-cy/strings.xml +++ b/app/src/main/res/values-cy/strings.xml @@ -8,6 +8,7 @@ Clock Amserydd Stopwatch + Start Stopwatch Lap Cafodd y stopwats ei stopio Cafodd yr amserydd ei stopio @@ -53,4 +54,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index b8b3c963..aaa93dc1 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -7,6 +7,7 @@ Clock Æggeur Stopwatch + Start Stopwatch Mellemtid Stopuret er standset Æggeuret er standset diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 7fe9142b..b1304807 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -8,6 +8,7 @@ Clock Timer Stoppuhr + Start Stopwatch Runde Die Stoppuhr wurde angehalten Der Timer wurde angehalten @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 0030957b..5daabda7 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -8,6 +8,7 @@ Ρολόι Χρονόμετρο Χρονομετρητής + Start Stopwatch Γύρος Ο χρονοδιακόπτης σταμάτησε Το χρονόμετρο σταμάτησε diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index 58fe0490..28cafcba 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -8,6 +8,7 @@ Clock Timer Stopwatch + Start Stopwatch Lap Stopwatch has been stopped Timer has been stopped diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 69cc1605..9db6a90e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -8,6 +8,7 @@ Reloj Temporizador Cronómetro + Start Stopwatch Vuelta El cronómetro se ha detenido El temporizador se ha detenido @@ -50,4 +51,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index b11d1a74..ac2dc3d1 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -8,6 +8,7 @@ Clock Taimer Stopper + Start Stopwatch Ringi aeg Stopper on kinni Taimer on peatunud @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index 83474f20..0b83f0d4 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -7,6 +7,7 @@ Clock Tenporizagailua Stopwatch + Start Stopwatch Bira Kronometroa gelditu da Tenporizagailua gelditu da diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 25315f6c..276460e0 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -8,6 +8,7 @@ Clock Ajastin Ajanotto + Start Stopwatch Kierrosaika Sekuntikello pysäytetty Ajastin on pysäytetty @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 9189f187..9a4a1f47 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -8,6 +8,7 @@ Clock Minuterie Chronomètre + Start Stopwatch Tour Chronomètre arrêté La minuterie a été arrêtée @@ -50,4 +51,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 578a8924..3911d87e 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -8,6 +8,7 @@ Reloxo Temporizador Cronómetro + Start Stopwatch Volta O cronómetro detívose O temporizador detívose @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 144bd41f..35b69a3d 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -8,6 +8,7 @@ Sat Brojač Štoperica + Start Stopwatch Runda Štoperica je zaustavljena Brojač je zaustavljen @@ -50,4 +51,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index fb09878a..5b66cadd 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -8,6 +8,7 @@ Clock Időzítő stopperóra + Start Stopwatch Kör A stopper leállt Az időzítő leállt @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 75885fa7..5b6b529a 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -7,6 +7,7 @@ Clock Timer Stopwatch + Start Stopwatch Putaran Stopwatch telah berhenti Timer telah berhenti diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index a7edacd7..69970632 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -8,6 +8,7 @@ Clock Contaminuti Cronometro + Start Stopwatch Parziale Il cronometro è stato fermato Il contaminuti è stato fermato @@ -50,4 +51,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index 2210b278..9e0df79b 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -8,6 +8,7 @@ Clock טיימר סטופר + Start Stopwatch הקפה שעון העצר הופסק הטיימר הופסק diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 19aecaa8..3853ac43 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -8,6 +8,7 @@ Clock タイマー Stopwatch + Start Stopwatch ラップ ストップウォッチが停止しました タイマーが停止しました @@ -48,4 +49,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index 7fe8c812..a288dab8 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -7,6 +7,7 @@ Clock Laikmatis Stopwatch + Start Stopwatch Etapas Chronometras buvo sustabdytas Laikmatis buvo sustabdytas diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml index 696f550e..29bddf06 100644 --- a/app/src/main/res/values-ml/strings.xml +++ b/app/src/main/res/values-ml/strings.xml @@ -8,6 +8,7 @@ ക്ലോക്ക് ടൈമർ സ്റ്റോപ്പ് വാച്ച് + Start Stopwatch ലാപ്‌ സ്റ്റോപ്പ് വാച്ച് നിർത്തിയിരിക്കുന്നു ടൈമർ നിർത്തിയിരിക്കുന്നു diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 2a8f8c82..6bfbe80f 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -7,6 +7,7 @@ Clock Timer Stopwatch + Start Stopwatch Runde Stoppeklokke er stoppet Timer er stoppet diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index fb7a785c..e8fccdd4 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -8,6 +8,7 @@ Klok Timer Stopwatch + Start Stopwatch Ronde Stopwatch is gestopt Timer is gestopt diff --git a/app/src/main/res/values-pa-rPK/strings.xml b/app/src/main/res/values-pa-rPK/strings.xml index 6ede5f60..65a2e45f 100644 --- a/app/src/main/res/values-pa-rPK/strings.xml +++ b/app/src/main/res/values-pa-rPK/strings.xml @@ -9,6 +9,7 @@ کوئی دن نہیں چݨے اے سماں والا Stopwatch + Start Stopwatch لیپ Stopwatch has been stopped Timer has been stopped @@ -42,4 +43,4 @@ ہولی ہولی آواز ودھاؤ How can I change lap sorting at the stopwatch tab\? Just click on any of the columns, that will make the laps be sorted by the given column. With additional clicks you can toggle between ascending and descending sorting. - \ No newline at end of file + diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index f515846b..20419f8c 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -8,6 +8,7 @@ Zegar Minutnik Stoper + Start Stopwatch Okrążenie Stoper został zatrzymany Minutnik został zatrzymany @@ -51,4 +52,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 1349d098..1ce00d12 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -8,6 +8,7 @@ Clock Temporizador Cronômetro + Start Stopwatch Volta O cronômetro foi parado O temporizador foi parado diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index a39a438a..ee14843b 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -7,6 +7,7 @@ Clock Temporizador Stopwatch + Start Stopwatch Volta Cronómetro parado Temporizador parado diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 4fca7637..f4ef4cc0 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -8,6 +8,7 @@ Ceas Temporizator Cronometru + Start Stopwatch Tură Cronometrul a fost oprit Temporizatorul a fost oprit @@ -50,4 +51,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 5399dd1f..4fc28b12 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -8,6 +8,7 @@ Часы Таймер Секундомер + Start Stopwatch Круг Секундомер остановлен Таймер остановлен @@ -51,4 +52,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index d00499b5..35308078 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -7,6 +7,7 @@ Hodinky Časovač Stopky + Start Stopwatch Okruh Stopky boli zastavené Časovač bol zastavený diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index 2934f5f0..76ff2519 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -9,6 +9,7 @@ Ura Časovnik Štoparica + Start Stopwatch Štoparica se je ustavila Časovnik je bil ustavljen Najdaljše trajanje opomnika @@ -44,4 +45,4 @@ Prikaži sekunde Povečajte postopno glasnost Kako spremenim razvrščanje krogov v zavihku štoparica\? - \ No newline at end of file + diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index 3cf74c55..a4c46f14 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -4,6 +4,7 @@ Сат Сат Штоперица + Start Stopwatch Круг Једноставан сат Сат @@ -43,4 +44,4 @@ Постепено повећавајте јачину звука Како могу да променим сортирање кругова на картици штоперице\? Само кликните на било коју колону, тако да ће кругови бити сортирани према датој колони. Додатним кликовима можете се пребацивати између растућег и опадајућег сортирања. - \ No newline at end of file + diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 42bdc510..3fc46699 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -8,6 +8,7 @@ Klocka Timer Stoppur + Start Stopwatch Varv Stoppuret har stoppats Timern har stoppats @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 58fe0490..28cafcba 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -8,6 +8,7 @@ Clock Timer Stopwatch + Start Stopwatch Lap Stopwatch has been stopped Timer has been stopped diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 68b5ad39..727eb522 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -8,6 +8,7 @@ Saat Zamanlayıcı Kronometre + Start Stopwatch Tur Kronometre durduruldu Zamanlayıcı durduruldu @@ -49,4 +50,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 56898705..66b219c4 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -8,6 +8,7 @@ Clock Таймер Секундомір + Start Stopwatch Інтервал Секундомір зупинено Таймер зупинено diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 10f1885c..52758b9c 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -8,6 +8,7 @@ 时钟 定时器 秒表 + Start Stopwatch 分段 秒表已停止 定时器已停止 @@ -48,4 +49,4 @@ Haven't found some strings? There's more at https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - \ No newline at end of file + diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index c40cb023..82f62037 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -7,6 +7,7 @@ Clock 計時器 Stopwatch + Start Stopwatch 分段 碼錶已停止 計時器已停止 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4f8d87d8..b712ad03 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -8,6 +8,7 @@ Clock Timer Stopwatch + Start Stopwatch Lap Stopwatch has been stopped Timer has been stopped @@ -54,5 +55,4 @@ https://github.com/SimpleMobileTools/Simple-Commons/tree/master/commons/src/main/res --> - Start Stopwatch From ea217b998892980b6e8daaaa81dfb86306873383 Mon Sep 17 00:00:00 2001 From: MohitMaliDeveloper Date: Mon, 21 Nov 2022 12:57:55 +0530 Subject: [PATCH 04/12] Removed shortcuts.xml, Changed shortcut icon, to lower case "Start stopwatch". --- .../kotlin/com/simplemobiletools/clock/App.kt | 17 -------- .../clock/activities/MainActivity.kt | 40 +++++++++++++++++++ .../main/res/drawable/shortcut_stopwatch.xml | 16 ++++++++ app/src/main/res/values-ar/strings.xml | 2 +- app/src/main/res/values-az/strings.xml | 2 +- app/src/main/res/values-be/strings.xml | 2 +- app/src/main/res/values-bg/strings.xml | 2 +- app/src/main/res/values-ca/strings.xml | 2 +- app/src/main/res/values-cs/strings.xml | 2 +- app/src/main/res/values-cy/strings.xml | 2 +- app/src/main/res/values-da/strings.xml | 2 +- app/src/main/res/values-de/strings.xml | 2 +- app/src/main/res/values-el/strings.xml | 2 +- app/src/main/res/values-eo/strings.xml | 2 +- app/src/main/res/values-es/strings.xml | 2 +- app/src/main/res/values-et/strings.xml | 2 +- app/src/main/res/values-eu/strings.xml | 2 +- app/src/main/res/values-fi/strings.xml | 2 +- app/src/main/res/values-fr/strings.xml | 2 +- app/src/main/res/values-gl/strings.xml | 2 +- app/src/main/res/values-hr/strings.xml | 2 +- app/src/main/res/values-hu/strings.xml | 2 +- app/src/main/res/values-in/strings.xml | 2 +- app/src/main/res/values-it/strings.xml | 2 +- app/src/main/res/values-iw/strings.xml | 2 +- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values-lt/strings.xml | 2 +- app/src/main/res/values-ml/strings.xml | 2 +- app/src/main/res/values-nb-rNO/strings.xml | 2 +- app/src/main/res/values-nl/strings.xml | 2 +- app/src/main/res/values-pa-rPK/strings.xml | 2 +- app/src/main/res/values-pl/strings.xml | 2 +- app/src/main/res/values-pt-rBR/strings.xml | 2 +- app/src/main/res/values-pt/strings.xml | 2 +- app/src/main/res/values-ro/strings.xml | 2 +- app/src/main/res/values-ru/strings.xml | 2 +- app/src/main/res/values-sk/strings.xml | 2 +- app/src/main/res/values-sl/strings.xml | 2 +- app/src/main/res/values-sr/strings.xml | 2 +- app/src/main/res/values-sv/strings.xml | 2 +- app/src/main/res/values-th/strings.xml | 2 +- app/src/main/res/values-tr/strings.xml | 2 +- app/src/main/res/values-uk/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- app/src/main/res/xml-v25/shortcuts.xml | 12 ------ 47 files changed, 99 insertions(+), 72 deletions(-) create mode 100644 app/src/main/res/drawable/shortcut_stopwatch.xml delete mode 100644 app/src/main/res/xml-v25/shortcuts.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt index 7c2e4150..14be3cdc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt @@ -51,23 +51,6 @@ class App : Application(), LifecycleObserver { } checkUseEnglish() - if (isNougatMR1Plus()) { - val shortcutManager = getSystemService(ShortcutManager::class.java) - val intent = Intent(this, SplashActivity::class.java).apply { - putExtra(OPEN_TAB, TAB_STOPWATCH) - putExtra(TOGGLE_STOPWATCH, true) - action = STOPWATCH_TOGGLE_ACTION - } - val shortcut = ShortcutInfo.Builder(this, STOPWATCH_SHORTCUT_ID) - .setShortLabel(getString(R.string.stopwatch)) - .setLongLabel(getString(R.string.start_stopwatch)) - .setIcon(Icon.createWithResource(this, R.drawable.ic_stopwatch_vector)) - .setIntent( - intent - ) - .build() - shortcutManager.dynamicShortcuts = listOf(shortcut) - } } override fun onTerminate() { diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt index c5cdae54..7ebb5d68 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/activities/MainActivity.kt @@ -1,7 +1,11 @@ package com.simplemobiletools.clock.activities +import android.annotation.SuppressLint import android.content.Intent +import android.content.pm.ShortcutInfo import android.graphics.drawable.ColorDrawable +import android.graphics.drawable.Icon +import android.graphics.drawable.LayerDrawable import android.os.Bundle import android.view.WindowManager import android.widget.ImageView @@ -69,8 +73,44 @@ class MainActivity : SimpleActivity() { } setupTabColors() + checkShortcuts() } + @SuppressLint("NewApi") + private fun checkShortcuts() { + val appIconColor = config.appIconColor + if (isNougatMR1Plus() && config.lastHandledShortcutColor != appIconColor) { + val launchDialpad = getLaunchStopwatchShortcut(appIconColor) + + try { + shortcutManager.dynamicShortcuts = listOf(launchDialpad) + config.lastHandledShortcutColor = appIconColor + } catch (ignored: Exception) { + } + } + } + + @SuppressLint("NewApi") + private fun getLaunchStopwatchShortcut(appIconColor: Int): ShortcutInfo { + val newEvent = getString(R.string.start_stopwatch) + val drawable = resources.getDrawable(R.drawable.shortcut_stopwatch) + (drawable as LayerDrawable).findDrawableByLayerId(R.id.shortcut_stopwatch_background).applyColorFilter(appIconColor) + val bmp = drawable.convertToBitmap() + + val intent = Intent(this, SplashActivity::class.java).apply { + putExtra(OPEN_TAB, TAB_STOPWATCH) + putExtra(TOGGLE_STOPWATCH, true) + action = STOPWATCH_TOGGLE_ACTION + } + return ShortcutInfo.Builder(this, STOPWATCH_SHORTCUT_ID) + .setShortLabel(newEvent) + .setLongLabel(newEvent) + .setIcon(Icon.createWithBitmap(bmp)) + .setIntent(intent) + .build() + } + + override fun onPause() { super.onPause() storeStateVariables() diff --git a/app/src/main/res/drawable/shortcut_stopwatch.xml b/app/src/main/res/drawable/shortcut_stopwatch.xml new file mode 100644 index 00000000..d1c4e8ec --- /dev/null +++ b/app/src/main/res/drawable/shortcut_stopwatch.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 1e11a821..f399032d 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -8,7 +8,7 @@ Clock Timer ساعة التوقيف - Start Stopwatch + Start stopwatch اللفه تم إيقاف ساعة التوقيف تم إيقاف الموقت diff --git a/app/src/main/res/values-az/strings.xml b/app/src/main/res/values-az/strings.xml index 24130d40..cdf2c1cb 100644 --- a/app/src/main/res/values-az/strings.xml +++ b/app/src/main/res/values-az/strings.xml @@ -7,7 +7,7 @@ Clock Sayğac Stopwatch - Start Stopwatch + Start stopwatch Dövrə Saniyəölçən dayandı Sayğaç dayandı diff --git a/app/src/main/res/values-be/strings.xml b/app/src/main/res/values-be/strings.xml index cfa726a8..ab9cf042 100644 --- a/app/src/main/res/values-be/strings.xml +++ b/app/src/main/res/values-be/strings.xml @@ -8,7 +8,7 @@ Гадзіннік Таймер Секундамер - Start Stopwatch + Start stopwatch Круг Секундамер спынены Таймер спынены diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index debdec27..5c830496 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -8,7 +8,7 @@ Часовник Таймер Секундомер - Start Stopwatch + Start stopwatch Обиколка Секундомерът е спрян Таймерът е спрян diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml index 11230c53..b82317cb 100644 --- a/app/src/main/res/values-ca/strings.xml +++ b/app/src/main/res/values-ca/strings.xml @@ -8,7 +8,7 @@ Clock Temporitzador Cronòmetre - Start Stopwatch + Start stopwatch Volta S\'ha aturat el cronòmetre S\'ha aturat el temporitzador diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index ed034ae1..9f7ba956 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -8,7 +8,7 @@ Hodiny Časovač Stopky - Start Stopwatch + Start stopwatch Mezičas Stopky byly zastaveny Časovač byl zastaven diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml index 7f847bbe..299123e9 100644 --- a/app/src/main/res/values-cy/strings.xml +++ b/app/src/main/res/values-cy/strings.xml @@ -8,7 +8,7 @@ Clock Amserydd Stopwatch - Start Stopwatch + Start stopwatch Lap Cafodd y stopwats ei stopio Cafodd yr amserydd ei stopio diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml index aaa93dc1..376a068d 100644 --- a/app/src/main/res/values-da/strings.xml +++ b/app/src/main/res/values-da/strings.xml @@ -7,7 +7,7 @@ Clock Æggeur Stopwatch - Start Stopwatch + Start stopwatch Mellemtid Stopuret er standset Æggeuret er standset diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index b1304807..b07eb2fa 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -8,7 +8,7 @@ Clock Timer Stoppuhr - Start Stopwatch + Start stopwatch Runde Die Stoppuhr wurde angehalten Der Timer wurde angehalten diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index 5daabda7..3cda5721 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -8,7 +8,7 @@ Ρολόι Χρονόμετρο Χρονομετρητής - Start Stopwatch + Start stopwatch Γύρος Ο χρονοδιακόπτης σταμάτησε Το χρονόμετρο σταμάτησε diff --git a/app/src/main/res/values-eo/strings.xml b/app/src/main/res/values-eo/strings.xml index 28cafcba..a000c644 100644 --- a/app/src/main/res/values-eo/strings.xml +++ b/app/src/main/res/values-eo/strings.xml @@ -8,7 +8,7 @@ Clock Timer Stopwatch - Start Stopwatch + Start stopwatch Lap Stopwatch has been stopped Timer has been stopped diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9db6a90e..5e3bb024 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -8,7 +8,7 @@ Reloj Temporizador Cronómetro - Start Stopwatch + Start stopwatch Vuelta El cronómetro se ha detenido El temporizador se ha detenido diff --git a/app/src/main/res/values-et/strings.xml b/app/src/main/res/values-et/strings.xml index ac2dc3d1..8aaab2eb 100644 --- a/app/src/main/res/values-et/strings.xml +++ b/app/src/main/res/values-et/strings.xml @@ -8,7 +8,7 @@ Clock Taimer Stopper - Start Stopwatch + Start stopwatch Ringi aeg Stopper on kinni Taimer on peatunud diff --git a/app/src/main/res/values-eu/strings.xml b/app/src/main/res/values-eu/strings.xml index 0b83f0d4..a25e1ca8 100644 --- a/app/src/main/res/values-eu/strings.xml +++ b/app/src/main/res/values-eu/strings.xml @@ -7,7 +7,7 @@ Clock Tenporizagailua Stopwatch - Start Stopwatch + Start stopwatch Bira Kronometroa gelditu da Tenporizagailua gelditu da diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 276460e0..bce15101 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -8,7 +8,7 @@ Clock Ajastin Ajanotto - Start Stopwatch + Start stopwatch Kierrosaika Sekuntikello pysäytetty Ajastin on pysäytetty diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 9a4a1f47..0564ae26 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -8,7 +8,7 @@ Clock Minuterie Chronomètre - Start Stopwatch + Start stopwatch Tour Chronomètre arrêté La minuterie a été arrêtée diff --git a/app/src/main/res/values-gl/strings.xml b/app/src/main/res/values-gl/strings.xml index 3911d87e..53600d7c 100644 --- a/app/src/main/res/values-gl/strings.xml +++ b/app/src/main/res/values-gl/strings.xml @@ -8,7 +8,7 @@ Reloxo Temporizador Cronómetro - Start Stopwatch + Start stopwatch Volta O cronómetro detívose O temporizador detívose diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 35b69a3d..5b99af89 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -8,7 +8,7 @@ Sat Brojač Štoperica - Start Stopwatch + Start stopwatch Runda Štoperica je zaustavljena Brojač je zaustavljen diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 5b66cadd..9717162b 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -8,7 +8,7 @@ Clock Időzítő stopperóra - Start Stopwatch + Start stopwatch Kör A stopper leállt Az időzítő leállt diff --git a/app/src/main/res/values-in/strings.xml b/app/src/main/res/values-in/strings.xml index 5b6b529a..7137be2c 100644 --- a/app/src/main/res/values-in/strings.xml +++ b/app/src/main/res/values-in/strings.xml @@ -7,7 +7,7 @@ Clock Timer Stopwatch - Start Stopwatch + Start stopwatch Putaran Stopwatch telah berhenti Timer telah berhenti diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 69970632..3463f23e 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -8,7 +8,7 @@ Clock Contaminuti Cronometro - Start Stopwatch + Start stopwatch Parziale Il cronometro è stato fermato Il contaminuti è stato fermato diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index 9e0df79b..1bd84713 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -8,7 +8,7 @@ Clock טיימר סטופר - Start Stopwatch + Start stopwatch הקפה שעון העצר הופסק הטיימר הופסק diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 3853ac43..ca4addac 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -8,7 +8,7 @@ Clock タイマー Stopwatch - Start Stopwatch + Start stopwatch ラップ ストップウォッチが停止しました タイマーが停止しました diff --git a/app/src/main/res/values-lt/strings.xml b/app/src/main/res/values-lt/strings.xml index a288dab8..d72ee60c 100644 --- a/app/src/main/res/values-lt/strings.xml +++ b/app/src/main/res/values-lt/strings.xml @@ -7,7 +7,7 @@ Clock Laikmatis Stopwatch - Start Stopwatch + Start stopwatch Etapas Chronometras buvo sustabdytas Laikmatis buvo sustabdytas diff --git a/app/src/main/res/values-ml/strings.xml b/app/src/main/res/values-ml/strings.xml index 29bddf06..176ec167 100644 --- a/app/src/main/res/values-ml/strings.xml +++ b/app/src/main/res/values-ml/strings.xml @@ -8,7 +8,7 @@ ക്ലോക്ക് ടൈമർ സ്റ്റോപ്പ് വാച്ച് - Start Stopwatch + Start stopwatch ലാപ്‌ സ്റ്റോപ്പ് വാച്ച് നിർത്തിയിരിക്കുന്നു ടൈമർ നിർത്തിയിരിക്കുന്നു diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index 6bfbe80f..737de172 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -7,7 +7,7 @@ Clock Timer Stopwatch - Start Stopwatch + Start stopwatch Runde Stoppeklokke er stoppet Timer er stoppet diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index e8fccdd4..7454a098 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -8,7 +8,7 @@ Klok Timer Stopwatch - Start Stopwatch + Start stopwatch Ronde Stopwatch is gestopt Timer is gestopt diff --git a/app/src/main/res/values-pa-rPK/strings.xml b/app/src/main/res/values-pa-rPK/strings.xml index 65a2e45f..46e5ba40 100644 --- a/app/src/main/res/values-pa-rPK/strings.xml +++ b/app/src/main/res/values-pa-rPK/strings.xml @@ -9,7 +9,7 @@ کوئی دن نہیں چݨے اے سماں والا Stopwatch - Start Stopwatch + Start stopwatch لیپ Stopwatch has been stopped Timer has been stopped diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 20419f8c..7c7ca5a5 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -8,7 +8,7 @@ Zegar Minutnik Stoper - Start Stopwatch + Start stopwatch Okrążenie Stoper został zatrzymany Minutnik został zatrzymany diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 1ce00d12..b0d24439 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -8,7 +8,7 @@ Clock Temporizador Cronômetro - Start Stopwatch + Start stopwatch Volta O cronômetro foi parado O temporizador foi parado diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index ee14843b..d7c816ea 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -7,7 +7,7 @@ Clock Temporizador Stopwatch - Start Stopwatch + Start stopwatch Volta Cronómetro parado Temporizador parado diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index f4ef4cc0..0922e77b 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -8,7 +8,7 @@ Ceas Temporizator Cronometru - Start Stopwatch + Start stopwatch Tură Cronometrul a fost oprit Temporizatorul a fost oprit diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 4fc28b12..61d84bd1 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -8,7 +8,7 @@ Часы Таймер Секундомер - Start Stopwatch + Start stopwatch Круг Секундомер остановлен Таймер остановлен diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 35308078..91893eb9 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -7,7 +7,7 @@ Hodinky Časovač Stopky - Start Stopwatch + Start stopwatch Okruh Stopky boli zastavené Časovač bol zastavený diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index 76ff2519..598822e0 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -9,7 +9,7 @@ Ura Časovnik Štoparica - Start Stopwatch + Start stopwatch Štoparica se je ustavila Časovnik je bil ustavljen Najdaljše trajanje opomnika diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml index a4c46f14..bf52249f 100644 --- a/app/src/main/res/values-sr/strings.xml +++ b/app/src/main/res/values-sr/strings.xml @@ -4,7 +4,7 @@ Сат Сат Штоперица - Start Stopwatch + Start stopwatch Круг Једноставан сат Сат diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 3fc46699..9759c289 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -8,7 +8,7 @@ Klocka Timer Stoppur - Start Stopwatch + Start stopwatch Varv Stoppuret har stoppats Timern har stoppats diff --git a/app/src/main/res/values-th/strings.xml b/app/src/main/res/values-th/strings.xml index 28cafcba..a000c644 100644 --- a/app/src/main/res/values-th/strings.xml +++ b/app/src/main/res/values-th/strings.xml @@ -8,7 +8,7 @@ Clock Timer Stopwatch - Start Stopwatch + Start stopwatch Lap Stopwatch has been stopped Timer has been stopped diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 727eb522..f72f3750 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -8,7 +8,7 @@ Saat Zamanlayıcı Kronometre - Start Stopwatch + Start stopwatch Tur Kronometre durduruldu Zamanlayıcı durduruldu diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 66b219c4..b5851659 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -8,7 +8,7 @@ Clock Таймер Секундомір - Start Stopwatch + Start stopwatch Інтервал Секундомір зупинено Таймер зупинено diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 52758b9c..77245351 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -8,7 +8,7 @@ 时钟 定时器 秒表 - Start Stopwatch + Start stopwatch 分段 秒表已停止 定时器已停止 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 82f62037..d84ed0c9 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -7,7 +7,7 @@ Clock 計時器 Stopwatch - Start Stopwatch + Start stopwatch 分段 碼錶已停止 計時器已停止 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b712ad03..7f4054a8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -8,7 +8,7 @@ Clock Timer Stopwatch - Start Stopwatch + Start stopwatch Lap Stopwatch has been stopped Timer has been stopped diff --git a/app/src/main/res/xml-v25/shortcuts.xml b/app/src/main/res/xml-v25/shortcuts.xml deleted file mode 100644 index faf80e14..00000000 --- a/app/src/main/res/xml-v25/shortcuts.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - From 5d55fe2c471de5b64a520b88a42172cd7695419d Mon Sep 17 00:00:00 2001 From: MohitMali Date: Tue, 22 Nov 2022 18:02:48 +0530 Subject: [PATCH 05/12] remove unused import --- .../main/kotlin/com/simplemobiletools/clock/App.kt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt index 14be3cdc..e94f8560 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/App.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/App.kt @@ -3,10 +3,6 @@ package com.simplemobiletools.clock import android.app.Application import android.app.NotificationManager import android.content.Context -import android.content.Intent -import android.content.pm.ShortcutInfo -import android.content.pm.ShortcutManager -import android.graphics.drawable.Icon import android.os.CountDownTimer import android.os.Handler import android.os.Looper @@ -15,15 +11,9 @@ import androidx.lifecycle.LifecycleObserver import androidx.lifecycle.OnLifecycleEvent import androidx.lifecycle.ProcessLifecycleOwner import com.facebook.stetho.Stetho -import com.simplemobiletools.clock.activities.SplashActivity import com.simplemobiletools.clock.extensions.* -import com.simplemobiletools.clock.helpers.OPEN_TAB import com.simplemobiletools.clock.helpers.Stopwatch import com.simplemobiletools.clock.helpers.Stopwatch.State -import com.simplemobiletools.clock.helpers.TAB_STOPWATCH -import com.simplemobiletools.clock.helpers.TOGGLE_STOPWATCH -import com.simplemobiletools.clock.helpers.STOPWATCH_TOGGLE_ACTION -import com.simplemobiletools.clock.helpers.STOPWATCH_SHORTCUT_ID import com.simplemobiletools.clock.models.TimerEvent import com.simplemobiletools.clock.models.TimerState import com.simplemobiletools.clock.services.StopwatchStopService @@ -32,7 +22,6 @@ import com.simplemobiletools.clock.services.startStopwatchService import com.simplemobiletools.clock.services.startTimerService import com.simplemobiletools.commons.extensions.checkUseEnglish import com.simplemobiletools.commons.extensions.showErrorToast -import com.simplemobiletools.commons.helpers.isNougatMR1Plus import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode From 9be41c69e4199d6dc344c5e6baa257220662cf04 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2022 18:50:07 +0100 Subject: [PATCH 06/12] Update Config.kt --- .../main/kotlin/com/simplemobiletools/clock/helpers/Config.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt index 6ecddafd..a09c903a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt @@ -51,7 +51,7 @@ class Config(context: Context) : BaseConfig(context) { var toggleStopWatch: Boolean get() = prefs.getBoolean(TOGGLE_STOPWATCH, false) - set(label) = prefs.edit().putBoolean(TOGGLE_STOPWATCH, label).apply() + set(toggleStopWatch) = prefs.edit().putBoolean(TOGGLE_STOPWATCH, toggleStopWatch).apply() var alarmSort: Int get() = prefs.getInt(ALARMS_SORT_BY, SORT_BY_CREATION_ORDER) From 529c448ae0754834bdda520009ac83447a034b06 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2022 18:54:52 +0100 Subject: [PATCH 07/12] correcting an intent action label --- app/src/main/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9c3af604..2b9d2881 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -37,7 +37,7 @@ android:theme="@style/SplashTheme"> - + From 1fee00d8a1b5b289907571acf752db6ba2f2224c Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2022 18:55:16 +0100 Subject: [PATCH 08/12] correcting an intent action label --- .../kotlin/com/simplemobiletools/clock/helpers/Constants.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f8890400..f4d5b713 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Constants.kt @@ -63,7 +63,7 @@ const val TOMORROW_BIT = -2 // stopwatch shortcut const val STOPWATCH_SHORTCUT_ID = "stopwatch_shortcut_id" -const val STOPWATCH_TOGGLE_ACTION = "android.intent.action.TOGGLE_STOPWATCH" +const val STOPWATCH_TOGGLE_ACTION = "com.simplemobiletools.clock.TOGGLE_STOPWATCH" fun getDefaultTimeZoneTitle(id: Int) = getAllTimeZones().firstOrNull { it.id == id }?.title ?: "" From aaf1be58b58fe09a5046e1cd7e4f44defe2360b5 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2022 18:56:00 +0100 Subject: [PATCH 09/12] updating the slovak translation --- app/src/main/res/values-sk/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values-sk/strings.xml b/app/src/main/res/values-sk/strings.xml index 91893eb9..49a07161 100644 --- a/app/src/main/res/values-sk/strings.xml +++ b/app/src/main/res/values-sk/strings.xml @@ -7,7 +7,7 @@ Hodinky Časovač Stopky - Start stopwatch + Spustiť stopky Okruh Stopky boli zastavené Časovač bol zastavený From 28fdcc12d5746cd4370cc20d30ed39c1888f60f5 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2022 18:58:02 +0100 Subject: [PATCH 10/12] correcting the strings order --- app/src/main/res/values-sl/strings.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/values-sl/strings.xml b/app/src/main/res/values-sl/strings.xml index 598822e0..40f8ec74 100644 --- a/app/src/main/res/values-sl/strings.xml +++ b/app/src/main/res/values-sl/strings.xml @@ -1,6 +1,5 @@ - Krog Enostavna ura Ura Časovne cone @@ -10,6 +9,7 @@ Časovnik Štoparica Start stopwatch + Krog Štoparica se je ustavila Časovnik je bil ustavljen Najdaljše trajanje opomnika @@ -28,8 +28,8 @@ Dodajte alarm Ni časovnikov Dodajte časovnik + Tečejo časovniki - Kliknite na izbrani stolpec, da se krogi razvrstijo stolpcu. Z dodatnimi kliki preklapljate med naraščajočim in padajočim razvrščanjem. Časovnik za %s teče Nov časovnik @@ -38,11 +38,14 @@ %d tečejo nekateri časovniki %d tečejo drugi časovniki + Zavihek ura Zavihek alarm Zavihek štoparice Zavihek časovnik Prikaži sekunde Povečajte postopno glasnost + Kako spremenim razvrščanje krogov v zavihku štoparica\? + Kliknite na izbrani stolpec, da se krogi razvrstijo stolpcu. Z dodatnimi kliki preklapljate med naraščajočim in padajočim razvrščanjem. From 358d4997888071b0eab195cae128c6607cc2d4cb Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2022 19:00:06 +0100 Subject: [PATCH 11/12] updating some configs --- .../kotlin/com/simplemobiletools/clock/helpers/Config.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt index a09c903a..3421917c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/helpers/Config.kt @@ -4,9 +4,7 @@ import android.content.Context import android.media.RingtoneManager import com.simplemobiletools.clock.extensions.gson.gson import com.simplemobiletools.clock.models.Alarm -import com.simplemobiletools.clock.models.StateWrapper import com.simplemobiletools.clock.models.Timer -import com.simplemobiletools.clock.models.TimerState import com.simplemobiletools.commons.extensions.getDefaultAlarmSound import com.simplemobiletools.commons.extensions.getDefaultAlarmTitle import com.simplemobiletools.commons.helpers.BaseConfig @@ -49,9 +47,9 @@ class Config(context: Context) : BaseConfig(context) { get() = prefs.getString(TIMER_LABEL, null) set(label) = prefs.edit().putString(TIMER_LABEL, label).apply() - var toggleStopWatch: Boolean + var toggleStopwatch: Boolean get() = prefs.getBoolean(TOGGLE_STOPWATCH, false) - set(toggleStopWatch) = prefs.edit().putBoolean(TOGGLE_STOPWATCH, toggleStopWatch).apply() + set(toggleStopwatch) = prefs.edit().putBoolean(TOGGLE_STOPWATCH, toggleStopwatch).apply() var alarmSort: Int get() = prefs.getInt(ALARMS_SORT_BY, SORT_BY_CREATION_ORDER) From 484496b5f4dde63c1ecaa8ab6c108b5a527d9d6c Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Tue, 22 Nov 2022 19:00:33 +0100 Subject: [PATCH 12/12] more config renaming --- .../simplemobiletools/clock/fragments/StopwatchFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt index af20b6de..8b16251f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/StopwatchFragment.kt @@ -92,8 +92,8 @@ class StopwatchFragment : Fragment() { updateSorting(Lap.sorting) } - if (requireContext().config.toggleStopWatch) { - requireContext().config.toggleStopWatch = false + if (requireContext().config.toggleStopwatch) { + requireContext().config.toggleStopwatch = false startStopWatch() } }