diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 15ec0f7..fc5ecf8 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index 66d5db6..267f529 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,7 +22,7 @@ android { applicationId "com.tommasoberlose.anotherwidget" minSdkVersion 23 targetSdkVersion 29 - versionCode 90 + versionCode 93 versionName "2.0.9" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/release/app-release.aab b/app/release/app-release.aab index 33949e0..9e27127 100644 Binary files a/app/release/app-release.aab and b/app/release/app-release.aab differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dfc784b..ab72527 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -17,7 +17,6 @@ - + @@ -116,6 +115,8 @@ + + @@ -131,6 +132,7 @@ + diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/db/EventRepository.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/db/EventRepository.kt index 55c1a31..5e63de8 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/db/EventRepository.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/db/EventRepository.kt @@ -22,6 +22,12 @@ class EventRepository(val context: Context) { } } + fun clearEvents() { + realm.executeTransaction { realm -> + realm.where(Event::class.java).findAll().deleteAllFromRealm() + } + } + fun resetNextEventData() { Preferences.bulk { remove(Preferences::nextEventId) diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/global/Preferences.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/global/Preferences.kt index e2a8182..033ad2d 100755 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/global/Preferences.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/global/Preferences.kt @@ -91,6 +91,7 @@ object Preferences : KotprefModel() { var showNextAlarm by booleanPref(default = true) var showBatteryCharging by booleanPref(default = false) var isBatteryLevelLow by booleanPref(default = false) + var isCharging by booleanPref(default = false) var googleFitSteps by longPref(default = -1) var showDailySteps by booleanPref(default = false) diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/BatteryHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/BatteryHelper.kt new file mode 100644 index 0000000..e75ad7c --- /dev/null +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/BatteryHelper.kt @@ -0,0 +1,23 @@ +package com.tommasoberlose.anotherwidget.helpers + +import android.content.Context +import android.content.Context.BATTERY_SERVICE +import android.os.BatteryManager +import androidx.core.content.ContextCompat.getSystemService +import com.tommasoberlose.anotherwidget.global.Preferences + + +object BatteryHelper { + fun updateBatteryInfo(context: Context) { + with(context.getSystemService(BATTERY_SERVICE) as BatteryManager) { + Preferences.isBatteryLevelLow = getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY) <= 15 + Preferences.isCharging = isCharging + } + } + + fun getBatteryLevel(context: Context): Int { + with(context.getSystemService(BATTERY_SERVICE) as BatteryManager) { + return getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/CalendarHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/CalendarHelper.kt index b96f456..307381a 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/CalendarHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/CalendarHelper.kt @@ -102,6 +102,7 @@ object CalendarHelper { if (eventList.isEmpty()) { eventRepository.resetNextEventData() + eventRepository.clearEvents() } else { eventList.sortWith(Comparator { event: Event, event1: Event -> if (event.allDay && event1.allDay) { @@ -134,6 +135,7 @@ object CalendarHelper { MainWidget.updateWidget(context) EventBus.getDefault().post(MainFragment.UpdateUiMessageEvent()) + eventRepository.close() } fun getCalendarList(context: Context): List { diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/GlanceProviderHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/GlanceProviderHelper.kt index 84bbe2a..7306878 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/GlanceProviderHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/GlanceProviderHelper.kt @@ -14,7 +14,6 @@ object GlanceProviderHelper { val enabledProviders = Preferences.enabledGlanceProviderOrder.split(",").filter { it != "" } val providers = Constants.GlanceProviderId.values() - .filter { it != Constants.GlanceProviderId.BATTERY_LEVEL_LOW } .filter { context.checkIfFitInstalled() || it != Constants.GlanceProviderId.GOOGLE_FIT_STEPS }.toTypedArray() @@ -68,7 +67,7 @@ object GlanceProviderHelper { Constants.GlanceProviderId.GOOGLE_FIT_STEPS -> { GlanceProvider(providerId.id, context.getString(R.string.settings_daily_steps_title), - R.drawable.round_steps + R.drawable.round_directions_walk ) } } @@ -79,12 +78,16 @@ object GlanceProviderHelper { } fun showGlanceProviders(context: Context): Boolean { - return Preferences.showGlance && EventRepository(context).getEventsCount() == 0 && ( + val eventRepository = EventRepository(context) + BatteryHelper.updateBatteryInfo(context) + val showGlance = Preferences.showGlance && eventRepository.getEventsCount() == 0 && ( (Preferences.showNextAlarm && AlarmHelper.getNextAlarm(context) != "") || (MediaPlayerHelper.isSomeonePlaying(context)) || - (Preferences.isBatteryLevelLow) || + (Preferences.showBatteryCharging && Preferences.isCharging || Preferences.isBatteryLevelLow) || (Preferences.customNotes.isNotEmpty()) || (Preferences.showDailySteps && Preferences.googleFitSteps > 0) ) + eventRepository.close() + return showGlance } } \ No newline at end of file diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt index d122242..8b00585 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/IntentHelper.kt @@ -182,6 +182,10 @@ object IntentHelper { } } + fun getBatteryIntent(context: Context): Intent { + return Intent(Intent.ACTION_POWER_USAGE_SUMMARY) + } + fun getMusicIntent(context: Context): Intent { return when (Preferences.mediaPlayerPackage) { "" -> { diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/SettingsStringHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/SettingsStringHelper.kt index 130060d..e9b1148 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/SettingsStringHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/SettingsStringHelper.kt @@ -86,7 +86,22 @@ object SettingsStringHelper { return context.getString(R.string.now) } TimeUnit.MILLISECONDS.toHours(difference) < 12 -> { - return DateUtils.getRelativeTimeSpanString(start, now, DateUtils.HOUR_IN_MILLIS, DateUtils.FORMAT_ABBREV_RELATIVE).toString() + val minutes = TimeUnit.MILLISECONDS.toMinutes(difference) - 60 * TimeUnit.MILLISECONDS.toHours(difference) + return if (minutes < 1 || minutes > 30) { + DateUtils.getRelativeTimeSpanString( + start, + now - 1000 * 60 * 40, + DateUtils.HOUR_IN_MILLIS, + DateUtils.FORMAT_ABBREV_RELATIVE + ).toString() + } else { + DateUtils.getRelativeTimeSpanString( + start, + now, + DateUtils.HOUR_IN_MILLIS, + DateUtils.FORMAT_ABBREV_RELATIVE + ).toString() + } } eventDate.dayOfYear == nowDate.plusDays(1).dayOfYear -> { return String.format("%s", context.getString(R.string.tomorrow)) diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WeatherHelper.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WeatherHelper.kt index dcbbe3d..ffb15fc 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WeatherHelper.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/helpers/WeatherHelper.kt @@ -5,7 +5,6 @@ import android.content.Context import android.os.Build import com.google.android.gms.location.LocationServices import com.tommasoberlose.anotherwidget.R -import com.tommasoberlose.anotherwidget.db.EventRepository import com.tommasoberlose.anotherwidget.global.Constants import com.tommasoberlose.anotherwidget.global.Preferences import com.tommasoberlose.anotherwidget.network.WeatherNetworkApi diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/BatteryLevelReceiver.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/BatteryLevelReceiver.kt index 9acba62..51802d9 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/BatteryLevelReceiver.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/BatteryLevelReceiver.kt @@ -7,12 +7,15 @@ import android.os.BatteryManager import android.util.Log import com.tommasoberlose.anotherwidget.global.Preferences import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget +import com.tommasoberlose.anotherwidget.utils.toast class BatteryLevelReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { when(intent.action) { Intent.ACTION_BATTERY_LOW -> Preferences.isBatteryLevelLow = true Intent.ACTION_BATTERY_OKAY -> Preferences.isBatteryLevelLow = false + Intent.ACTION_POWER_CONNECTED -> Preferences.isCharging = true + Intent.ACTION_POWER_DISCONNECTED -> Preferences.isCharging = false } MainWidget.updateWidget(context) } diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/NewCalendarEventReceiver.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/NewCalendarEventReceiver.kt index 9567036..3ff5e57 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/NewCalendarEventReceiver.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/NewCalendarEventReceiver.kt @@ -24,5 +24,6 @@ class NewCalendarEventReceiver : BroadcastReceiver() { eventRepository.goToPreviousEvent() } } + eventRepository.close() } } diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/UpdatesReceiver.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/UpdatesReceiver.kt index e6577b4..acfe878 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/UpdatesReceiver.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/receivers/UpdatesReceiver.kt @@ -12,6 +12,7 @@ import com.tommasoberlose.anotherwidget.db.EventRepository import com.tommasoberlose.anotherwidget.global.Actions import com.tommasoberlose.anotherwidget.global.Constants import com.tommasoberlose.anotherwidget.global.Preferences +import com.tommasoberlose.anotherwidget.helpers.BatteryHelper import com.tommasoberlose.anotherwidget.helpers.CalendarHelper import com.tommasoberlose.anotherwidget.models.Event import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget @@ -28,7 +29,9 @@ class UpdatesReceiver : BroadcastReceiver() { Intent.ACTION_TIME_CHANGED, Intent.ACTION_TIMEZONE_CHANGED, Intent.ACTION_LOCALE_CHANGED, - Actions.ACTION_CALENDAR_UPDATE -> CalendarHelper.updateEventList(context) + Actions.ACTION_CALENDAR_UPDATE -> { + CalendarHelper.updateEventList(context) + } "com.sec.android.widgetapp.APPWIDGET_RESIZE", Intent.ACTION_DATE_CHANGED, @@ -59,6 +62,7 @@ class UpdatesReceiver : BroadcastReceiver() { setEventUpdate(context, event) } } + eventRepository.close() } private fun setEventUpdate(context: Context, event: Event) { @@ -101,7 +105,7 @@ class UpdatesReceiver : BroadcastReceiver() { } else { setExact( AlarmManager.RTC, - event.startDate - diff.hours * 1000 * 60 * 60, + event.startDate - diff.hours * 1000 * 60 * 60 + if (diff.minutes > 30) (- 30) else (+ 30), PendingIntent.getBroadcast( context, event.eventID.toInt(), @@ -135,9 +139,11 @@ class UpdatesReceiver : BroadcastReceiver() { fun removeUpdates(context: Context) { with(context.getSystemService(Context.ALARM_SERVICE) as AlarmManager) { - EventRepository(context).getEvents().forEach { + val eventRepository = EventRepository(context) + eventRepository.getEvents().forEach { cancel(PendingIntent.getBroadcast(context, it.eventID.toInt(), Intent(context, UpdatesReceiver::class.java), 0)) } + eventRepository.close() } } } diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/services/BatteryListenerJob.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/services/BatteryListenerJob.kt new file mode 100644 index 0000000..a726a99 --- /dev/null +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/services/BatteryListenerJob.kt @@ -0,0 +1,61 @@ +package com.tommasoberlose.anotherwidget.services + +import android.app.job.JobInfo +import android.app.job.JobParameters +import android.app.job.JobScheduler +import android.app.job.JobService +import android.content.ComponentName +import android.content.Context +import android.os.Build +import android.provider.CalendarContract +import com.tommasoberlose.anotherwidget.helpers.CalendarHelper +import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget + +class BatteryListenerJob : JobService() { + override fun onStartJob(params: JobParameters): Boolean { + MainWidget.updateWidget(this) + schedule( + this + ) + return false + } + + @Synchronized + override fun onStopJob(params: JobParameters): Boolean { + return false + } + + companion object { + private const val chargingJobId = 1006 + private const val notChargingJobId = 1007 + fun schedule(context: Context) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + remove(context) + val componentName = ComponentName( + context, + EventListenerJob::class.java + ) + with(context.getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler) { + schedule( + JobInfo.Builder(chargingJobId, componentName) + .setRequiresCharging(true) + .setPersisted(true) + .build() + ) + schedule( + JobInfo.Builder(notChargingJobId, componentName) + .setRequiresCharging(false) + .setPersisted(true) + .build() + ) + } + } + } + + fun remove(context: Context) { + val js = context.getSystemService(JobScheduler::class.java) + js?.cancel(chargingJobId) + js?.cancel(notChargingJobId) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/MainActivity.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/MainActivity.kt index 66ecb7f..2c833d5 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/MainActivity.kt @@ -76,7 +76,9 @@ class MainActivity : AppCompatActivity() { viewModel = ViewModelProvider(this).get(MainViewModel::class.java) controlExtras(intent) - requirePermission() + if (Preferences.showWallpaper) { + requirePermission() + } } override fun onBackPressed() { diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/SupportDevActivity.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/SupportDevActivity.kt index 58455fc..8b45e6e 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/SupportDevActivity.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/SupportDevActivity.kt @@ -45,8 +45,9 @@ class SupportDevActivity : AppCompatActivity(), PurchasesUpdatedListener { adapter = SlimAdapter.create() adapter .register(R.layout.inapp_product_layout) { item, injector -> + item.sku injector - .text(R.id.product_title, item.title.replace("(Another Widget)", "")) + .text(R.id.product_title, item.sku.replace("(Another Widget)", "")) .text(R.id.product_price, item.price) .clicked(R.id.item) { viewModel.purchase(this, item) diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/WeatherProviderActivity.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/WeatherProviderActivity.kt index 7907b5b..ba2450e 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/WeatherProviderActivity.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/activities/WeatherProviderActivity.kt @@ -32,11 +32,6 @@ class WeatherProviderActivity : AppCompatActivity() { openURI("https://home.openweathermap.org/users/sign_up") } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - last_info.text = Html.fromHtml(getString(R.string.api_key_info_all_set), Html.FROM_HTML_MODE_LEGACY) - } else { - last_info.text = Html.fromHtml(getString(R.string.api_key_info_all_set)) - } api_key.editText?.setText(Preferences.weatherProviderApi) } } diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/CalendarTabFragment.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/CalendarTabFragment.kt index 8fb7c8e..78273e5 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/CalendarTabFragment.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/CalendarTabFragment.kt @@ -99,7 +99,7 @@ class CalendarTabFragment : Fragment() { viewModel.calendarAllDay.observe(viewLifecycleOwner, Observer { maintainScrollPosition { all_day_label?.text = - if (it) getString(R.string.settings_all_day_subtitle_visible) else getString(R.string.settings_all_day_subtitle_gone) + if (it) getString(R.string.settings_visible) else getString(R.string.settings_not_visible) } checkReadEventsPermission() }) @@ -215,7 +215,7 @@ class CalendarTabFragment : Fragment() { } dialog.addItem( - if (calendarSelectorList[index].name == calendarSelectorList[index].accountName) getString(R.string.account_events) else calendarSelectorList[index].name, + if (calendarSelectorList[index].name == calendarSelectorList[index].accountName) getString(R.string.main_calendar) else calendarSelectorList[index].name, calendarSelectorList[index].id ) } @@ -232,8 +232,8 @@ class CalendarTabFragment : Fragment() { action_show_all_day.setOnClickListener { if (Preferences.showEvents) { BottomSheetMenu(requireContext(), header = getString(R.string.settings_all_day_title)).setSelectedValue(Preferences.calendarAllDay) - .addItem(getString(R.string.settings_all_day_subtitle_visible), true) - .addItem(getString(R.string.settings_all_day_subtitle_gone), false) + .addItem(getString(R.string.settings_visible), true) + .addItem(getString(R.string.settings_not_visible), false) .addOnSelectItemListener { value -> Preferences.calendarAllDay = value }.show() diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GeneralTabFragment.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GeneralTabFragment.kt index 319382d..f79eea6 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GeneralTabFragment.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/GeneralTabFragment.kt @@ -321,7 +321,7 @@ class GeneralTabFragment : Fragment() { } action_show_dividers.setOnClickListener { - BottomSheetMenu(requireContext(), header = getString(R.string.settings_show_multiple_events_title)).setSelectedValue(Preferences.showDividers) + BottomSheetMenu(requireContext(), header = getString(R.string.settings_show_dividers_title)).setSelectedValue(Preferences.showDividers) .addItem(getString(R.string.settings_visible), true) .addItem(getString(R.string.settings_not_visible), false) .addOnSelectItemListener { value -> 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 e17612f..8b2bf32 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 @@ -97,6 +97,7 @@ class GlanceTabFragment : Fragment() { viewModel.showGlance.observe(viewLifecycleOwner, Observer { maintainScrollPosition { binding.isGlanceVisible = it + show_glance_label.text = if (it) getString(R.string.description_show_glance_visible) else getString(R.string.description_show_glance_not_visible) } }) diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/MainFragment.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/MainFragment.kt index 05b0f0c..463c639 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/MainFragment.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/fragments/MainFragment.kt @@ -36,6 +36,7 @@ import com.tommasoberlose.anotherwidget.helpers.BitmapHelper import com.tommasoberlose.anotherwidget.helpers.ColorHelper import com.tommasoberlose.anotherwidget.helpers.ColorHelper.isColorDark import com.tommasoberlose.anotherwidget.ui.activities.MainActivity +import com.tommasoberlose.anotherwidget.ui.activities.SupportDevActivity import com.tommasoberlose.anotherwidget.ui.adapters.ViewPagerAdapter import com.tommasoberlose.anotherwidget.ui.viewmodels.MainViewModel import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget @@ -145,7 +146,7 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList ColorHelper.getBackgroundColor() ) ) - uiJob = viewLifecycleOwner.lifecycleScope.launch(Dispatchers.IO) { + uiJob = lifecycleScope.launch(Dispatchers.IO) { val generatedView = MainWidget.generateWidgetView(requireContext()) withContext(Dispatchers.Main) { @@ -186,7 +187,7 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList clock_bottom_margin_large?.isVisible = Preferences.showClock && Preferences.clockBottomMargin == Constants.ClockBottomMargin.LARGE.value - if ((Preferences.showClock && time_container?.isVisible == false) || (!Preferences.showClock && time_container?.isVisible == true)) { + if ((Preferences.showClock && (time?.alpha ?: 1f < 1f)) || (!Preferences.showClock && (time?.alpha ?: 0f > 0f))) { if (Preferences.showClock) { time_container?.layoutParams = time_container.layoutParams.apply { height = RelativeLayout.LayoutParams.WRAP_CONTENT @@ -230,10 +231,12 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList ).apply { duration = 500L addUpdateListener { - val animatedValue = animatedValue as Int - val layoutParams = preview.layoutParams - layoutParams.height = animatedValue - preview.layoutParams = layoutParams + if (preview != null) { + val animatedValue = animatedValue as Int + val layoutParams = preview.layoutParams + layoutParams.height = animatedValue + preview.layoutParams = layoutParams + } } }.start() } @@ -253,10 +256,12 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList ).apply { duration = 300L addUpdateListener { - val animatedValue = animatedValue as Int - val layoutParams = preview.layoutParams - layoutParams.height = animatedValue - preview?.layoutParams = layoutParams + if (preview != null) { + val animatedValue = animatedValue as Int + val layoutParams = preview.layoutParams + layoutParams.height = animatedValue + preview?.layoutParams = layoutParams + } } }.start() } @@ -278,10 +283,12 @@ class MainFragment : Fragment(), SharedPreferences.OnSharedPreferenceChangeList ).apply { duration = 300L addUpdateListener { - val animatedValue = animatedValue as Int - val layoutParams = preview.layoutParams - layoutParams.height = animatedValue - preview.layoutParams = layoutParams + if (preview != null) { + val animatedValue = animatedValue as Int + val layoutParams = preview.layoutParams + layoutParams.height = animatedValue + preview.layoutParams = layoutParams + } } }.start() } diff --git a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/MainWidget.kt b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/MainWidget.kt index 487896f..803b698 100644 --- a/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/MainWidget.kt +++ b/app/src/main/java/com/tommasoberlose/anotherwidget/ui/widgets/MainWidget.kt @@ -36,6 +36,7 @@ import java.text.DateFormat import java.util.* import java.util.concurrent.TimeUnit import kotlin.math.min +import kotlin.math.roundToInt class MainWidget : AppWidgetProvider() { @@ -140,9 +141,8 @@ class MainWidget : AppWidgetProvider() { } private fun updateCalendarView(context: Context, v: View, views: RemoteViews, widgetID: Int): RemoteViews { + val eventRepository = EventRepository(context) try { - val eventRepository = EventRepository(context) - views.setImageViewBitmap( R.id.empty_date_rect, BitmapHelper.getBitmapFromView(v.empty_date, draw = false) @@ -291,15 +291,18 @@ class MainWidget : AppWidgetProvider() { } } Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> { - if (Preferences.isBatteryLevelLow) { - val alarmIntent = PendingIntent.getActivity( - context, - widgetID, - IntentHelper.getClockIntent(context), - 0 - ) - views.setOnClickPendingIntent(R.id.second_row_rect, alarmIntent) - break@loop + if (Preferences.showBatteryCharging) { + BatteryHelper.updateBatteryInfo(context) + if (Preferences.isCharging || Preferences.isBatteryLevelLow) { + val batteryIntent = PendingIntent.getActivity( + context, + widgetID, + IntentHelper.getBatteryIntent(context), + 0 + ) + views.setOnClickPendingIntent(R.id.second_row_rect, batteryIntent) + break@loop + } } } Constants.GlanceProviderId.CUSTOM_INFO -> { @@ -340,6 +343,8 @@ class MainWidget : AppWidgetProvider() { } catch (ex: Exception) { ex.printStackTrace() CrashlyticsReceiver.sendCrash(context, ex) + } finally { + eventRepository.close() } return views @@ -560,33 +565,37 @@ class MainWidget : AppWidgetProvider() { } } Constants.GlanceProviderId.BATTERY_LEVEL_LOW -> { - if (Preferences.isBatteryLevelLow) { - v.second_row_icon.setImageDrawable( - ContextCompat.getDrawable( - context, - R.drawable.round_battery_charging_full - ) - ) - v.next_event_date.text = context.getString(R.string.battery_low_warning) - break@loop + if (Preferences.showBatteryCharging) { + BatteryHelper.updateBatteryInfo(context) + if (Preferences.isCharging) { + v.second_row_icon.isVisible = false + val batteryLevel = BatteryHelper.getBatteryLevel(context) + if (batteryLevel == 100) { + v.next_event_date.text = "%s - %d%%".format(context.getString(R.string.charging), batteryLevel) + } else { + v.next_event_date.text = context.getString(R.string.charging) + } + break@loop + } else if (Preferences.isBatteryLevelLow) { + v.second_row_icon.isVisible = false + v.next_event_date.text = + context.getString(R.string.battery_low_warning) + break@loop + } } } Constants.GlanceProviderId.CUSTOM_INFO -> { if (Preferences.customNotes.isNotEmpty()) { v.second_row_icon.isVisible = false v.next_event_date.text = Preferences.customNotes + v.next_event_date.gravity v.next_event_date.maxLines = 2 break@loop } } Constants.GlanceProviderId.GOOGLE_FIT_STEPS -> { if (Preferences.showDailySteps && Preferences.googleFitSteps > 0) { - v.second_row_icon.setImageDrawable( - ContextCompat.getDrawable( - context, - R.drawable.round_steps - ) - ) + v.second_row_icon.isVisible = false v.next_event_date.text = context.getString(R.string.daily_steps_counter).format(Preferences.googleFitSteps) break@loop } @@ -698,7 +707,7 @@ class MainWidget : AppWidgetProvider() { v.weather.visibility = View.VISIBLE v.calendar_weather.visibility = View.VISIBLE v.special_weather.visibility = View.VISIBLE - val currentTemp = String.format(Locale.getDefault(), "%.0f °%s", Preferences.weatherTemp, Preferences.weatherRealTempUnit) + val currentTemp = String.format(Locale.getDefault(), "%d °%s", Preferences.weatherTemp.roundToInt(), Preferences.weatherRealTempUnit) val icon: String = Preferences.weatherIcon if (icon == "") { @@ -734,6 +743,8 @@ class MainWidget : AppWidgetProvider() { it.isVisible = Preferences.showDividers } + eventRepository.close() + return v } } diff --git a/app/src/main/res/layout/activity_weather_provider.xml b/app/src/main/res/layout/activity_weather_provider.xml index a9494b7..850f9e9 100644 --- a/app/src/main/res/layout/activity_weather_provider.xml +++ b/app/src/main/res/layout/activity_weather_provider.xml @@ -155,7 +155,7 @@ android:textSize="16sp" android:gravity="start" android:textAlignment="viewStart" - android:id="@+id/last_info"/> + android:text="@string/api_key_info_all_set"/> + + + + + + - - - + android:id="@+id/small_clock_warning" + android:orientation="vertical"> + + diff --git a/app/src/main/res/layout/fragment_general_settings.xml b/app/src/main/res/layout/fragment_general_settings.xml index ff70941..728c692 100644 --- a/app/src/main/res/layout/fragment_general_settings.xml +++ b/app/src/main/res/layout/fragment_general_settings.xml @@ -18,6 +18,18 @@ android:paddingTop="8dp" android:paddingBottom="8dp" android:orientation="vertical"> + + + - - - - - - - - - + android:paddingRight="8dp" + android:orientation="vertical"> - + style="@style/AnotherWidget.Settings.Title" + android:text="@string/settings_date_format_title"/> + android:layout_height="wrap_content" + android:id="@+id/date_format_label" + style="@style/AnotherWidget.Settings.Subtitle"/> + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_glance_settings.xml b/app/src/main/res/layout/fragment_glance_settings.xml index 4b6474b..83d4d11 100644 --- a/app/src/main/res/layout/fragment_glance_settings.xml +++ b/app/src/main/res/layout/fragment_glance_settings.xml @@ -38,8 +38,8 @@ + + + + + - - + - - - + style="@style/AnotherWidget.Settings.Title" + android:text="@string/settings_sort_glance_providers_title"/> + diff --git a/app/src/main/res/layout/fragment_weather_settings.xml b/app/src/main/res/layout/fragment_weather_settings.xml index 694f74e..39e1571 100644 --- a/app/src/main/res/layout/fragment_weather_settings.xml +++ b/app/src/main/res/layout/fragment_weather_settings.xml @@ -112,6 +112,18 @@ android:id="@+id/weather_settings" android:alpha="@{isWeatherVisible ? 1f : 0.2f, default=1}" android:orientation="vertical"> + - - - - - - - + + + + + + + + + - - Widget hinzufügen - Rechte erteilen - Sehen Sie Ihre Termine - Kontrolliere das Wetter - Gewähren Sie Zugriff auf Ihren Kalender, um Ereignisse in Ihrem - Widget anzuzeigen.\n\t - - Gewähren Sie Zugriff auf Ihren Ort, um das Wetter in Ihrem Widget - anzuzeigen.\n\t - - Veranstaltungen filtern - Teilen - App bewertern - Ünterstützten Sie mich - Gut gemacht! - Sehen Sie sich Ihre Ereignisse und das Wetter in einem anderen Widget an. - - Holen Sie mehr aus Ihrem Widget heraus - Sie haben die Konfiguration abgeschlossen. Achten Sie auf Updates. - Bleiben Sie aktuell - Über - Std - " Min" - in - Projekt - Messeinheit - Wählen Sie die Einheit der Temperaturmessung - Sichtbarkeit der Kalender - Ganztag-Veranstaltungen - Sichtbar - Nicht sichtbar - Kalender-Account - Kalender-Einstellungen - Wetter-Einstellungen - Allgemeine Einstellungen - Fehler beim Laden der Kalenderliste - Stundenformat - 12 Stunden AM/PM - 24 Stunden - Ganztag-Veranstaltung - Datumsformat - Aktualisierungszeitraum - 30 Minuten - 1 Stunde - 3 Stunden - 6 Stunden - 12 Stunden - 24 Stunden - " Benutzerdefinierte Position" - Geo-Lokalisierung - Widget erneuern - Veranstaltungen sind sichtbar - Veranstaltungen sind nicht sichtbar - Wetterinfos sind sichtbar - Wetterinfos sind nicht sichtbar - 3 Stunden später - 6 Stunden später - 12 Stunden später - 24 Stunden später - 3 Tage später - 7 Tage später - Sehen Sie die Ereignisse höchstens bis - T - Fehler beim Öffnen der URL: Link in die Zwischenablage kopiert. - Daten werden geladen... - Fehler beim Öffnen der App. - Standard Kalender-App - Beim Klick auf\'s Wetter öffnet sich - Standardapp - App wählen - Wetter-Anbieter - Der Wetteranbieter ist korrekt konfiguriert - - Der Wetteranbieter muss konfiguriert werden - - GPS einschalten - Google Awareness benötigt aktives GPS zum Arbeiten. - Rückmeldung - AW Rückmeldung - E-Mail senden... - Fehler beim Senden der E-Mail. - OpenWeather API Key - Speichern - Keine Kalender gefunden - Was ist zu tun - -
Aufgrund seines großen Erfolges, der sicherlich meine Erwartungen übertrifft, unterstützt der Wetteranbieter nicht alle ankommenden Anfragen (einfach, weil es kostenlos und daher begrenzt ist).

Ich muss jeden von Ihnen bitten, ein Konto bei OpenWeather persönlich zu registrieren. Der Vorgang dauert nur ein paar Minuten, und wenn der Schlüssel aktiviert ist, haben Sie keine Probleme mit dem Wetter.

Ich entschuldige mich für die Unannehmlichkeiten und stütze mich weiter!]]>
- Registrierung eines OpenWeather Kontos - Registrieren Sie ein kostenloses Konto bei OpenWeather. Es wird nur ein paar - Minuten dauern. - - API-Key kopieren - Greifen Sie über Ihre Kontoeinstellungen auf das API-Schlüsselmenü zu und kopieren - Sie den Standardschlüssel. - - Fügen Sie den Schlüssel zur App hinzu - Geben Sie den Schlüssel in diesem Abschnitt ein und speichern Sie ihn. Sobald der - Schlüssel aktiviert ist, ist das Wetter sichtbar. - - Hi zusammen! - Öffnen von OpenWeatherMap.com - - zehn Minuten dauern, bis der API-Schlüssel aktiviert wird.
Entspannen Sie! Das Wetter wird aktualisiert, sobald es verfügbar ist !!]]>
- Gut gemacht! - Std - Morgen - Heute - Klick auf die Veranstaltung öffnet - Informationen der zweiten Reihe - Textfarbe - Schriftgröße erste Reihe - Schriftgröße zweite Reihe - Einstellung der Uhr - Zeige Ereignisadresse anstelle von Zeit - Zeige Ereignisszeit - Zeige nächste Erinnerung - Klick der Uhr öffnet - Uhr anzeigen - Zeigt die Zeit über Ereignisse und Wetter an - Uhr ist sichtbar - Uhr ist nicht sichtbar - Schriftgrößte der Uhr - Schatten des Textes - Keins - Niedrig - Hoch - Erweiterte Einstellungen - Product Sans Font - Durch die Verwendung von Product Sans wurde die Möglichkeit zum - Antippen von Widget-Elementen deaktiviert. Ich arbeite dran. - - Zeit für die Veranstaltung - Sichtbar - Nicht sichtbar - Abgelehnte Ereignisse - Google Wetter - Veranstalungsdetails - Standard Kalender-App - Standard Uhr-App - 1 Stunde später - 30 Minuten später - Default - Deaktiviert - Widget Schriftart - Geräte Schriftart - Produkt Schriftart - Zeige nächste Veranstaltung - Zähler für mehrere Ereignisse - Unterstütze den Entwickler mit - Bei der Übersetzung helfen - Öffne einen pull request auf GitHub - Schauen Sie sich meine anderen Projekte an - Selber Entwickler, mehr Möglichkeiten - Ops, da ist etwas falsch gelaufen! - Danke für Ihre Unterstützung - Einen italenischen Kaffee - Einige glasierte Donuts - Ein teueres Abendessen - Ein englischen Frühstück - Ein schnelles Mittagsessen - Another Widget läuft - AW läuft im Hintergrund - Zeige die Widget Vorschau - Verstecke die Widget Vorschau - GPS ist aus - GPS wieder aktivieren, damit ein Another Widget - Wetterinformationen mit der Google Awareness API aktualisieren kann. - - - - The provider is not configured correctly, do you still want to go back? - Show next alarm when possible - Location settings - Change provider - Disable notification - Theme - Devs always need a lot of coffee - Light - Dark - Set by Battery Saver - Follow the system theme - Default - Search - Show wallpaper - Force the restart of the widget service - Account events - Due to technological limitations, the clock won\'t have the custom font and the text shadows selected in the typography section. - Google Awareness weather has been deprecated. It\'s now required an OpenWeather API key to show the weather in the widget. - Custom date format - App version - This is a single developer project,\nso thank you for the support! - This is an open-source project, feel free to help. - Feedback and feature requests - Clock bottom margin - None - Small - Medium - Large - Xiaomi Devices - Enable the permission to display pop-up windows when running in the background inside the "Other permission" section of the app settings. Otherwise, you will not able to open any applications tapping on the widget. - Ignore - Grant permission - Alpha - Background color - Transparent - The next alarm clock seems to be wrong.\nIt has been set by %s. - Settings - Clock text color - Music - Show current playing song - Playing song info visible - Playing song info hidden - Song info format - We need the notification access permission to check the current playing song. - At a Glance - Integrations - %d installed integrations - Show at a glance info - Show multiple provider data when there are no events displayed. - Show text dividers - Show the next clock alarm - Data source priority - Change the data provider importance - Custom notes - Battery level - Daily steps - Low battery level - We need a few permissions to get your daily steps from Google Fit. - Show AM/PM Indicator - %d steps today - Second row text color - soon - now - Time left update frequency - High frequency causes more battery consume - Low - Default - High - Icon pack - Default - Minimal -
\ 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 deleted file mode 100644 index 09229d4..0000000 --- a/app/src/main/res/values-fr/strings.xml +++ /dev/null @@ -1,224 +0,0 @@ - - Ajouter - Donner la permission - Afficher vos événements - Afficher la météo - Accorder l\'accès à votre calendrier\npour voir les événements dans votre widget. - Accorder l\'accès à votre localisation\npour voir la météo dans votre widget. - Obtenez plus de la part de votre widget - Voir vos événements et la météo dans Another Widget. - Partager - Noter l\'app - Soutenez-moi - Bon travail ! - Vous avez fini la configuration.\nDes mises à jour sont à venir. - Restez à jour - À propos - h - " min" - dans - Projet - Unité de mesure - Choisir l\'unité de mesure de température - Filtrer les événements - Changer la visibilité du calendrier - Événements toute la journée - Visible - Non visible - Calendrier du compte - Calendrier - Météo - Typographie - Erreur de chargement du calendrier - Format d\'heure - 12 heures - 24 heures - Événement toute la journée - Format de date - Fréquence d\'actualisation - 30 minutes - 1 heure - 3 heures - 6 heures - 12 heures - 24 heures - Localisation - Utiliser le GPS - Actualisation forcée - Événements visibles - Événements non visibles - Infos météo visibles - Infos météo non visibles - 3 heures avant - 6 heures avant - 12 heures avant - 24 heures avant - 3 jours avant - 7 jours avant - Afficher les événements au moins - j - Erreur lors de l\'ouverture de l\'URL : Lien copié dans le presse-papiers. - Chargement des données… - Erreur lors de l\'ouverture de l\'app. - App calendrier par défaut - Taper sur la météo ouvre - App par défaut - Choisir une application - Clé API pour la méteo - Le fournisseur météo est correctement configuré - Le fournisseur de météo doit être configuré - Activer le GPS - Google Awareness a besoin d\'un GPS actif pour fonctionner. - Commentaires - Commentaires AW - Envoyer un email… - Erreur lors de l\'envoi de l\'email. - Clé API OpenWeather - Le fournisseur n\'est pas configuré correctement, voulez-vous toujours revenir en arrière ? - Sauvegarder - Aucun calendrier trouvé. - Instructions -
En raison de son grand succès, au-delà de toutes mes attentes, le fournisseur de météo ne peut prendre en charge toutes les demandes (tout simplement parce qu\'il est gratuit et donc limité).

Je dois demander à chacun d\'enregistrer personnellement un compte sur OpenWeather ; l\'opération ne prendra que quelques minutes, et lorsque votre clé sera activée, vous n\'aurez aucun problème avec la météo.

Je suis désolé pour le désagrément, continuez à me soutenir !]]>
- Inscrivez-vous sur OpenWeather - Créez un compte gratuit sur OpenWeather. Cela ne prendra que quelques minutes. - Copiez votre clé API - Recherchez la clé API dans vos paramètres du compte et copiez la clé par défaut. - Saisissez la clé dans l\'app - Collez la clé dans le champ ci-dessus et enregistrez-la. Une fois la clé activée, la météo deviendra visible. - Bonjour tout le monde ! - Aller sur le site d\'OpenWeatherMap - 10 minutes avant que votre clé API soit activée. La météo sera mise à jour dès qu\'elle sera disponible !]]> - Bien joué ! - h - demain - aujourd\'hui - Taper sur l\'événement ouvre - Information de la seconde ligne - Afficher l\'adresse de l\'événement au lieu de l\'heure - Afficher l\'heure de l\'événement - Afficher l\'heure de la prochaine alarme - Couleur du texte - Taille du texte de la première ligne - Taille du texte de la seconde ligne - Horloge - Taper sur l\'horloge ouvre - Afficher l\'horloge - Voir l\'heure au-dessus des événements et la météo - Horloge visible - Horloge non visible - Taille du texte de l\'horloge - Afficher la prochaine alarme si possible - Ombre du texte - Aucune - Faible - Élevée - Avancé - Police Product Sans - Utiliser la police Product Sans désactive la possibilité de taper sur les événements. Je travaille dessus. - Temps restant jusqu\'à l\'événement - Visible - Non visible - Événements refusés - Google Weather - Détails de l\'événement - App calendrier par défaut - App horloge par défaut - 1 heure après - 30 minutes après - Par défaut - Désactivé - Police du widget - Police de l\'appareil - Product Sans - Afficher l\'événement\nsuivant - Sélecteur d\'événements multiples - Soutenir le développeur - Aider à traduire - Ouvrir une pull-request sur GitHub - Consulter mes autres projets - Un même développeur, plusieurs possibilités - Oups, quelque chose s\'est mal passé ! - Merci de m\'avoir soutenu ! - Un café italien - Quelques beignets glacés - Un dîner coûteux - Un petit-déjeuner anglais - Un déjeuner rapide - Another Widget est en cours d\'exécution - AW s\'exécute en arrière-plan - Afficher l\'aperçu du widget - Cacher l\'aperçu du widget - La localisation est désactivée - Réactivez le GPS pour qu\'Another Widget puisse mettre à jour les informations météo avec l\'API Google Awareness. - Paramètres de localisation - Changer de fournisseur - Désactiver les notifications - Thème - On a toujours besoin de beaucoup de café - Clair - Sombre - Défini par l\'économiseur de batterie - Selon le thème du système - Par défaut - Rechercher - Afficher le fond d\'écran - Forcer le redémarrage du service du widget - Événements du compte - En raison de limitations technologiques, l\'horloge n\'aura pas la police personnalisée et les ombres de texte sélectionnées dans la section Typographie. - La météo de Google Awareness est obsolète. Il faut maintenant une clé API OpenWeather pour afficher la météo dans le widget. - Format de date personalisé - Version de l\'app - Ceci est un projet de développeur unique,\ndonc merci pour le soutien! - Ceci est un projet open-source, n\'hésitez pas à aider. - Commentaires et suggestions - Marge inférieure de l\'horloge - Aucun - Petit - Moyen - Grand - - - Xiaomi Devices - Enable the permission to display pop-up windows when running in the background inside the "Other permission" section of the app settings. Otherwise, you will not able to open any applications tapping on the widget. - Ignore - Grant permission - Alpha - Background color - Transparent - The next alarm clock seems to be wrong.\nIt has been set by %s. - Settings - Clock text color - Music - Show current playing song - Playing song info visible - Playing song info hidden - Song info format - We need the notification access permission to check the current playing song. - At a Glance - Integrations - %d installed integrations - Show at a glance info - Show multiple provider data when there are no events displayed. - Show text dividers - Show the next clock alarm - Data source priority - Change the data provider importance - Custom notes - Battery level - Daily steps - Low battery level - We need a few permissions to get your daily steps from Google Fit. - Show AM/PM Indicator - %d steps today - Second row text color - soon - now - Time left update frequency - High frequency causes more battery consume - Low - Default - High - Icon pack - Default - Minimal -
\ No newline at end of file diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3985f48..0470d6a 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -1,223 +1,204 @@ - + Another Widget Aggiungi - Concedi Accesso - Rimani Aggiornato - Molto bene! - Supportami - Valuta App - Condividi - Ottieni di più dal tuo widget - Controlla il Meteo - Controlla i tuoi Impegni - Aggiungi gli eventi e il meteo al tuo widget. - Concedi l\'accesso al tuo calendario per vedere gli eventi. - Concedi l\'accesso alla tua posizione per vedere il meteo. - Hai completato la configurazione! Rimani aggiornato. - Info - " ora" - " min" - tra - Progetto - Unità di Misura - Modifica l\'unità di misura della temperatura - Filtra Eventi - Scegli quali calendari vedere - Eventi Giornalieri - Visibili - Non visibili - Calendario Account - Eventi - Meteo + + Display - Errore nel caricamento della lista dei calendari - Formato Ora - 12 ore AM/PM - 24 ore - Tutto il giorno - Formato Data - Intervallo Aggiornamento - 30 Minuti - 1 Ora - 3 Ore - 6 Ore - 12 Ore - 24 Ore - Località - Usa la geolocalizzazione - Riavvia Widget - Eventi visibili - Eventi non visibili - Meteo visibile - Meteo non Visibile - 3 Ore dopo - 6 Ore dopo - 12 Ore dopo - 24 Ore dopo - 3 Giorni dopo - 7 Giorni dopo - Vedi eventi al massimo fino a - g - Errore apertura URL: Link copiato negli appunti. - Caricamento… - Errore apertura App. - Applicazione predefinita calendario - Il meteo apre - App Predefinita - Scegli Applicazione - Chiave API Meteo - Il provider meteo è configurato correttamente - Il provider meteo deve essere configurato - Riattiva la localizzazione - Google Awareness ha bisogno del GPS attivo per funzionare. - Feedback - AW Feedback - Invia email… - Errore invio mail. - Chiave API OpenWeather - Il provider non è configurato correttamente, vuoi comunque uscire? - Salva - Nessun calendario trovato. - Cosa fare - Registrati su OpenWeather - Apri OpenWeatherMap.com - Registra un account gratuito su OpenWeatherMap.com in pochi minuti. - Accedi alle chiavi API nelle impostazioni e copia la chiave di default. - Aggiungi la chiave all\'applicazione in questa sezione e, una volta che la chiave sarà attivata, apparirà il meteo. - Copia la chiave API - Configura l\'App - Ciao a tutti. -
Però a causa del successo dell\'applicazione, sicuramente oltre ogni mia aspettativa, il provider del meteo non riesce a supportare il numero di richieste che arrivano (a causa dell\'utilizzo di un account gratuito).

Sono costretto a chiedervi di registrarvi su OpenWeather.com; l\'operazione richiederà solo alcuni minuti e dopo non avrete più problemi con la fruizione delle informazioni sul meteo!

Mi dispiace per l\'inconveniente ma continuate a supportarmi!!]]>
- Ben Fatto! - dieci minuti prima che la tua chiave sia attivata. Il meteo verrà aggiornato non appena sarà disponibile!]]> - " ore" - Domani - Oggi - Gli eventi aprono - Informazione Seconda Riga - Orario evento - Location evento - Mostra orario prossimo allarme - Colore testo prima riga - Colore testo seconda riga - Dimensione Testo Prima Riga - Dimensione Testo Seconda Riga - Orologio - L\'orologio apre - Mostra Orologio - Mostra l\'ora sopra eventi e meteo - Orologio visibile - Orologio non visibile - Dimensione Testo Orologio - Mostra prossimo allarme quando possibile - Ombra Testo + | + Colore testo + Colore testo + Colore sfondo + Dimensione testo + Dimensione testo + Ombra testo Nessuna Bassa Alta - Avanzate - Font Product Sans - L\'utilizzo del Product Sans disabilita i tap sugli elementi del widget. Ci sto attualmente lavorando. - Tempo rimanente all\'evento - Event Rifiutati - Visibile - Non Visibile - Dettagli evento - App Calendario di Default - Meteo Google - App Orologio di Default - 1 Ora dopo - 30 Minuti dopo - Predefinita - Disabilita - Font Dispositivo + Font + Font dispositivo Product Sans - Font Widget - Mostra Evento\nSuccessivo - Scorrimento Eventi Multipli - Supporta lo Sviluppatore - Aiuta con le Traduzioni - Apri una pull request su GitHub - Scopri i miei progetti - Stesso sviluppatore, più possibilità - Ops, sembra che qualcosa non abbia funzionato! - Grazie per il supporto! - Un Caffè Italiano - Qualche Ciambella - Una Cena Costosa - Una Colazione Inglese - Una Pranzo Veloce - Another Widget è attivo - AW è attivo in background - Mostra Anteprima Widget - Nascondi Anteprima Widget - GPS Disattivato - Riattiva il GPS così che Another Widget possa aggiornare il meteo con le API di Google Awareness. - Impostazioni GPS - Cambia Provider - Disabilita Notifica - Tema - Agli sviluppatori fa sempre bene un caffè - Chiaro - Scuro - In base al risparmio energetico - Tema di sistema - Default - Cerca - Mostra wallpaper - Forza il riavvio di tutti i servizi - Eventi account - A causa di limitazioni tecnologiche l\'orologio non rispetterà l\'ombra del test e il font custom selezionati nella sezione tipografia. - Il meteo di Google Awareness è stato deprecato. È ora necessaria una chiave API di OpenWeather per visualizzare il meteo. - Formato data personalizzato - Versione app - Grazie per supportare il progetto! - Contribuisci a questo progetto open source. - Feedback + Formato data + Alpha + Trasparente + Mostra divisori testo + Prima riga + Seconda riga + Widget + Data maiuscola + Formato data + + + Calendario + Mostra eventi + Concedi il permesso per la lettura degli eventi. + Filtra eventi + Cambia visibilità calendari + Eventi giornalieri + Calendario principale + Errore caricamento lista dei calendari + Eventi giornalieri + Eventi visibili + Eventi nascosti + dopo 30 minuti + dopo 1 ora + dopo 3 ore + dopo 6 ore + dopo 12 ore + dopo 24 ore + dopo 3 giorni + dopo 7 giorni + Mostra eventi al massimo + g + Applicazione calendario di default + Nessun calendario trovato + domani + oggi + Tap sull\'evento apre + Informazione evento + Indirizzo + Orario + Tempo mancante all\'evento + Eventi declinati + Dettaglio evento + App calendario + Scorrimento eventi + presto + ora + Frequenza aggiornamento tempo mancante + Un\'alta frequenza di aggiornamento causerà un consumo maggiore della batteria + Bassa + Default + Alta + Filtri + Dettagli evento + + + Meteo + Mostra il meteo + Concedi il permesso per la localizzazione per vedere le informazioni sul meteo + Unità di misura + Frequenza aggiornamento + 30 minuti + 1 ora + 3 ore + 6 ore + 12 ore + 24 ore + Location + Usa geolocalizzazione + Meteo visibile + Meteo nascosto + Tap sul meteo apre + Chiave API Meteo + Il provider meteo è configurato correttamente + Devi configurare il provider meteo + Chiave API OpenWeather + Meteo Google + Il meteo di Google Awareness è stato deprecato. È ora necessaria una chiave API OpenWeather per mostrare il meteo. + Registra un account su OpenWeather + Registra un account gratuito su OpenWeather, ci vorranno solo alcuni minuti. + Copia la chiave API + Trova la chiave API nelle impostazioni del tuo nuovo account e copia la chiave di default. + Inserisci la chiave nell\'app + Copia qui la chiave API e salva la nuova configurazione. + Apri OpenWeatherMap.com + La chiave API potrebbe aver bisogno di più di 20 minuti per diventare attiva, aggiorneremo il meteo non appena sarà possibile. + Stile icone + Default + Minimal + + + Orologio + Tap sull\'orologio apre + Mostra orologio + Orologio visibile + Orologio nascosto + Dimensione testo + App orologio di default Margine inferiore orologio Nessuno Piccolo Medio Grande + A causa di limitazioni tecnologiche l\'orologio non rispetterà il font e l\'ombra scelti nella sezione Display. + Colore testo + Mostra AM/PM + Stile orologio + + + Prossimo allarme + Il prossimo allarme non sembra corretto. È stato impostato dall\'app %s. + Glance + Canzone in riproduzione + È necessario l\'accesso alle notifiche per controllare la canzone in riproduzione. + Sono necessari i permessi per accedere ai passi di oggi su Google Fit. + Mostra At a Glance + Informazioni visibili + Informazioni non visibili + Priorità provider + Cambia ordine di importanza dei provider + Testo + Batteria + Passi fatti + Livello batteria basso + %d passi fatti finore + In carica + Providers + + + Condividi + Lascia una recensione + Dona + Feedback + Informazioni + Ricarica widget + Errore apertura url, link copiato negli appunti. + Caricamento… + Errore apertura app. + App di default + Salva + Visibile + Non visibile + Aiuta con le traduzioni + Apri una richiesta di modifica su GitHub + Guarda i miei altri progetti + Stesso sviluppatore, altre possibilità + Ops, qualcosa non ha funzionato! + Tema + Gli sviluppatore hanno sempre bisogno di caffè + Light + Dark + In base al risparmio energetico + In base al sistema + Default + Cerca + Versione app + Mostra wallpaper + Forza il riavvio del widget + Questo è un progetto open-source + Feedback e richieste Dispositivi Xiaomi - Concedi il permesso per mostrare finstre pop-up quando l\'applicazione è in background. Puoi trovare l\'impostazione nella sezione Altri permessi nei dettagli dell\'app. Nel caso non fosse attivata non sarà possibile aprire applicazioni cliccando sul widget. + Attiva il permesso per mostrare finestre pop-up quando l\'applicazione è in background, altrimenti non sarà possibile eserguire nessuna azione al tap del widget. Ignora Concedi permesso - Trasparenza - Colore background - Trasparente - La sveglia sembra impostata male.\nÈ stata impostata dall\'app %s. Impostazioni - Colore orologio - Musica - Mostra brano in riproduzione - Visibile - Non visibile - Formato informazioni brano - Concedi all\'app il permesso di monitorare le notifiche, è necessario per poter mostrare il brano in riproduzione. - Glance + Stile + Azioni + Setup + Stile + Preferenze + + + Scegli applicazione + Supporta lo sviluppatore + Grazie per il supporto! + Un caffè + Un gelato + Una cena + Una colazione abbondante + Un pranzo veloce + Mostra preview widget + Questo è un progetto sviluppato da una singola persona,\n grazie per il tuo supporto! Integrazioni %d integrazioni installate - Mostra notizie rapide - Mostra notizie rapide ottenute da diversi provider - Mostra la prossima sveglia - Mostra divisori testo - Ordine notizie rapide - Cambia l\'ordine di importanza delle notizie - Note - Livello batteria - Passi di oggi - Livello batteria basso - Abbiamo bisogno di alcuni permessi per leggere i tuoi passi di oggi da Google Fit. - Mostra AM/PM - %d passi - a breve - ora - Frequenza aggiornamento tempo rimanente - Maggiore è la frequenza maggiore sarà il consumo di batteria - Bassa - Default - Alta - Icon pack - Default - Minimal -
\ No newline at end of file + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cd9f5fd..5afc6e4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,45 +1,84 @@ Another Widget Add - Just - Grant permission - Show your events - Show the weather - Grant access to your calendar\nto view events in your widget. - Grant access to your location\nto view weather in your widget. - Get more from your widget - View your events and the weather in Another Widget. + + + Display | - Share - Rate app - Support me - Good job! - You have completed the configuration.\nWatch out for updates. - Stay up to date - About - h - " min" - in - Project - Unit of measure - Choose the unit of temperature measurement - °F - Fahrenheit - °C - Celsius + Text color + Text color + Background color + Text size + Text size + Text shadow + None + Low + High + Widget font + Device font + Product Sans + Custom date format + Alpha + Transparent + Show text dividers + First row + Second row + Widget + Capitalize the date + Date format + + + Calendar + Show your events + Grant access to your calendar\nto view events in your widget. Filter events Change calendar visibility All day events - Visible - Hidden Account calendar - Calendar - Weather - Display Error loading the calendar list - Hour format - 12 hour - 24 hour All day event - Date format + Events are visible + Events are hidden + 30 minutes later + 1 hour later + 3 hours later + 6 hours later + 12 hours later + 24 hours later + 3 days later + 7 days later + Show events at least + d + Calendar default application + No calendars found. + tomorrow + today + Tap on event opens + Event info + Event address + Event time + Time left to the event + Declined events + Event details + Default calendar app + Multiple events switcher + soon + now + Time left update frequency + High frequency causes more battery consume + Low + Default + High + Filters + Event detail + + + Weather + Show the weather + Grant access to your location\nto view weather in your widget. + Unit of measure + °F - Fahrenheit + °C - Celsius Refresh frequency 30 minutes 1 hour @@ -49,124 +88,85 @@ 24 hours Location Use geolocation - Refresh widget - Events are visible - Events are hidden - Weather info is visible - Weather info is hidden - 3 hours later - 6 hours later - 12 hours later - 24 hours later - 3 days later - 7 days later - Show events at least - d - toolbar - Error opening URL: Link copied to clipboard. - Loading Data… - Error opening app. - Calendar default application + Weather info are visible + Weather info are hidden Tap on weather opens - Default app - Choose application Weather API key The weather provider is configured correctly The weather provider must be configured - Turn location on - Google Awareness needs active GPS to work. - Feedback - AW Feedback - Send email… - Error sending email. OpenWeather API Key - The provider is not configured correctly, do you still want to go back? - Save - No calendars found. - Instructions - Toms -
Due to its great success, surely beyond all my expectations, the weather provider fails to support all the requests that arrive (simply because it is free and therefore limited).

I have to ask each of you to personally register an account on OpenWeather; the operation will take only a few minutes, and when your key has been activated, you will not have any problems with the weather.

I\'m sorry for the inconvenience, keep supporting me!]]>
+ Google Weather + Google Awareness weather has been deprecated. It\'s now required an OpenWeather API key to show the weather in the widget. Register for an OpenWeather Account Register a free account on OpenWeather. It will only take a few minutes. Copy your API Key Find the API keys menu from your account settings and copy the default key. Enter the key to the app Paste the key into the field above and save it. Once the key is activated the weather will become visible. - Hi Everyone! Go to OpenWeatherMap.com - ten minutes before your API key is activated. The weather will be updated as soon as it is available!]]> - Well Done! - h - tomorrow - today - Tap on event opens - Second row information - Event address - Event time - Show next alarm time - First row text color - Second row text color - Background color - First row text size - Second row text size - OpenWeather - Google Awareness + It may take up to ten minutes before your API key is activated. The weather will be updated as soon as it is available. + Icon pack + Default + Minimal + + Clock Tap on clock opens Show Clock - View the time over events and weather - Clock visibility + Clock is visible Clock is hidden - Clock text size - Next clock Alarm - Show the next clock alarm - Text shadow - None - Low - High - Advanced - Beta - Product Sans Font - Using Product Sans disabled the possibility to tap widget elements. I\'m working on it. - Time left to the event + Text size + Default clock app + Clock bottom margin + None + Small + Medium + Large + Due to technological limitations, the clock won\'t have the custom font and the text shadows selected in the Display section. + Text color + Show AM/PM Indicator + Clock text style + + + Next clock alarm + The next alarm clock seems to be wrong.\nIt has been set by %s. + Glance + Current playing song + We need the notification access permission to check the current playing song. + We need a few permissions to get your daily steps from Google Fit. + Show at a glance info + Service enabled + Service disabled + Data source priority + Change the data provider importance + Custom notes + Battery + Daily steps + Low battery level + %d steps so far + Charging + Providers + + + Share + Rate app + Support me + Feedback + About + Refresh widget + toolbar + Error opening URL: Link copied to clipboard. + Loading Data… + Error opening app. + Default app + Save Visible Hidden - Declined events - Google Weather - Event details - Default calendar app - Default clock app - 1 hour later - 30 minutes later - Default - Disabled - Widget font - Device font - Product Sans - Show next\nevent - Multiple events switcher - \"Another\" Developer - Support the developer Help with translations Open a pull request on GitHub Check my other projects Same developer, many possibilities Ooops, something went wrong! - Thanks for supporting me! - An italian coffee - Some glazed donuts - An expensive dinner - An english breakfast - A quick lunch - Another Widget is running - AW is running in the background - Show widget preview - Hide widget preview - Location is turned off - Turn Location back on so Another Widget can update weather information with Google Awareness API. - Location settings - Change provider - Disable notification Theme Devs always need a lot of coffee Light @@ -175,63 +175,34 @@ Follow the system theme Default Search + App version Show wallpaper Force the restart of the widget service - Account events - Due to technological limitations, the clock won\'t have the custom font and the text shadows selected in the typography section. - Google Awareness weather has been deprecated. It\'s now required an OpenWeather API key to show the weather in the widget. - Custom date format - App version - This is a single developer project,\nso thank you for the support! This is an open-source project, feel free to help. Feedback and feature requests - Google Tasks - Clock bottom margin - None - Small - Medium - Large xiaomi Xiaomi Devices Enable the permission to display pop-up windows when running in the background inside the "Other permission" section of the app settings. Otherwise, you will not able to open any applications tapping on the widget. Ignore Grant permission - Alpha - Transparent - The next alarm clock seems to be wrong.\nIt has been set by %s. Settings - Clock text color - Glance - Music - Current playing song - Show playing song info - Hide playing song info - Song info format - We need the notification access permission to check the current playing song. - We need a few permissions to get your daily steps from Google Fit. - Google Fit + Style + Actions + Setup + Appearance + Preferences + + + Choose application + Support the developer + Thanks for supporting me! + An italian coffee + Some glazed donuts + An expensive dinner + An english breakfast + A quick lunch + Show widget preview + This is a single developer project,\nso thank you for the support! Integrations %d installed integrations - Show at a glance info - Show multiple provider data when there are no events displayed. - Show text dividers - Data source priority - Change the data provider importance - Custom notes - Battery level - Daily steps - Low battery level - Show AM/PM Indicator - %d steps so far - soon - now - Time left update frequency - High frequency causes more battery consume - Low - Default - High - Icon pack - Default - Minimal - Capitalize the date
diff --git a/app/src/main/res/xml/backup_descriptor.xml b/app/src/main/res/xml/backup_descriptor.xml new file mode 100644 index 0000000..45845c3 --- /dev/null +++ b/app/src/main/res/xml/backup_descriptor.xml @@ -0,0 +1,4 @@ + + + + diff --git a/app/src/main/res/xml/my_backup_rules.xml b/app/src/main/res/xml/my_backup_rules.xml deleted file mode 100644 index 231c813..0000000 --- a/app/src/main/res/xml/my_backup_rules.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file