From 87da284be46b12ffbf7bb5ef41beaac6f4a0bf0d Mon Sep 17 00:00:00 2001 From: Tommaso Berlose Date: Mon, 18 May 2020 11:49:57 +0200 Subject: [PATCH] Update strings --- .gitignore | 4 +--- .idea/caches/build_file_checksums.ser | Bin 537 -> 537 bytes README.md | 7 ++++++ app/build.gradle | 6 ------ .../ui/fragments/GlanceTabFragment.kt | 20 ++++++++++++++++-- app/src/main/res/values/strings.xml | 2 +- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 2ad2dc8..363f48a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,10 @@ *.iml .gradle /local.properties -/.idea/workspace.xml -/.idea/libraries +/.idea/* .DS_Store /build /captures .externalNativeBuild /tasksintegration/build -apikey.properties /app/google-services.json diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index cd92a57c1a75162caad084413341ce1044e7e4e5..9d8ff53186803c6aae4786fac907874017d1b2be 100644 GIT binary patch delta 33 rcmV++0N($Z1epYom;@&qm&CE0YylBy^>A*CFUhWmOn1uipqE#8>7EZs delta 33 rcmV++0N($Z1epYom;@qV&zG^BYylA`J4&pZ=cf7d)5S7 + +Help with translations +------- + +Hey! You could view the file strings.xml ([here](https://github.com/tommasoberlose/another-widget/blob/master/app/src/main/res/values/strings.xml)) that contains the English version of the app strings. +You have to copy the file, create a copy of it inside the folder values-[LANGUAGE-SUFFIX] with the translated strings and create a pull request to submit your changes. + License ------- Copyright (C) 2017-2020 Tommaso Berlose (http://tommasoberlose.com) diff --git a/app/build.gradle b/app/build.gradle index 018377d..be84d4f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,10 +10,6 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'realm-android' -def apiKeyPropertiesFile = rootProject.file("apikey.properties") -def apiKeyProperties = new Properties() -apiKeyProperties.load(new FileInputStream(apiKeyPropertiesFile)) - android { compileSdkVersion 29 buildToolsVersion "29.0.3" @@ -26,8 +22,6 @@ android { versionName "2.0.9" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - - manifestPlaceholders = [ "AWARENESS_API_KEY": apiKeyProperties['AWARENESS_API_KEY']] } buildTypes { diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt index 8b2bf32..d05cb57 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GlanceTabFragment.kt @@ -44,6 +44,7 @@ import com.tommasoberlose.anotherwidget.ui.activities.MainActivity import com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission import com.tommasoberlose.anotherwidget.utils.checkIfFitInstalled +import com.tommasoberlose.anotherwidget.utils.toast import kotlinx.android.synthetic.main.fragment_calendar_settings.* import kotlinx.android.synthetic.main.fragment_glance_settings.* import kotlinx.android.synthetic.main.fragment_glance_settings.scrollView @@ -177,6 +178,22 @@ class GlanceTabFragment : Fragment() { } } + action_show_next_alarm.setOnLongClickListener { + with(requireContext().getSystemService(Context.ALARM_SERVICE) as AlarmManager) { + val alarm = nextAlarmClock + if (alarm != null && alarm.showIntent != null) { + val pm = requireContext().packageManager as PackageManager + val appNameOrPackage = try { + pm.getApplicationLabel(pm.getApplicationInfo(alarm.showIntent?.creatorPackage ?: "", 0)) + } catch (e: Exception) { + alarm.showIntent?.creatorPackage ?: "" + } + activity?.toast(getString(R.string.next_alarm_warning).format(appNameOrPackage), long = true) + } + } + true + } + action_show_low_battery_level_warning.setOnClickListener { if (Preferences.showGlance) { BottomSheetMenu( @@ -232,8 +249,7 @@ class GlanceTabFragment : Fragment() { } catch (e: Exception) { alarm.showIntent?.creatorPackage ?: "" } - show_next_alarm_warning.text = - getString(R.string.next_alarm_warning).format(appNameOrPackage) + show_next_alarm_warning.text = getString(R.string.next_alarm_warning).format(appNameOrPackage) } else { show_next_alarm_label?.text = if (Preferences.showNextAlarm) getString(R.string.settings_visible) else getString( R.string.settings_not_visible) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5afc6e4..bf498f9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -65,7 +65,7 @@ soon now Time left update frequency - High frequency causes more battery consume + High frequency causes more battery consumption Low Default High