Compare commits

..

7 Commits

Author SHA1 Message Date
3fba50fd2c Fix #265 2021-01-11 09:49:00 +01:00
06583197c7 Fix widget refresh intent 2021-01-11 09:42:55 +01:00
5176331e84 Version 2.2.2-beta5 2021-01-11 01:34:38 +01:00
65f83caeb5 Merge pull request #267 from Moutony/patch-27
French v2.2.2 (120)
2021-01-11 01:33:22 +01:00
60e8c267bf Version 2.2.2-beta4 2021-01-11 01:32:29 +01:00
10a3204808 Fix #263 2021-01-11 01:30:31 +01:00
98c509ef27 French v2.2.2 (120) 2021-01-10 19:06:20 +01:00
9 changed files with 94 additions and 59 deletions

Binary file not shown.

View File

@ -22,7 +22,7 @@ android {
applicationId "com.tommasoberlose.anotherwidget" applicationId "com.tommasoberlose.anotherwidget"
minSdkVersion 23 minSdkVersion 23
targetSdkVersion 30 targetSdkVersion 30
versionCode 121 versionCode 125
versionName "2.2.2" versionName "2.2.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -2,7 +2,6 @@ package com.tommasoberlose.anotherwidget.global
object Actions { object Actions {
const val ACTION_EXTRA_OPEN_WEATHER_PROVIDER = "ACTION_EXTRA_OPEN_WEATHER_PROVIDER" const val ACTION_EXTRA_OPEN_WEATHER_PROVIDER = "ACTION_EXTRA_OPEN_WEATHER_PROVIDER"
const val ACTION_EXTRA_DISABLE_GPS_NOTIFICATION = "ACTION_EXTRA_DISABLE_GPS_NOTIFICATION"
const val ACTION_TIME_UPDATE = "com.tommasoberlose.anotherwidget.action.TIME_UPDATE" const val ACTION_TIME_UPDATE = "com.tommasoberlose.anotherwidget.action.TIME_UPDATE"
const val ACTION_ALARM_UPDATE = "com.tommasoberlose.anotherwidget.action.ALARM_UPDATE" const val ACTION_ALARM_UPDATE = "com.tommasoberlose.anotherwidget.action.ALARM_UPDATE"
@ -14,4 +13,6 @@ object Actions {
const val ACTION_REPORT_CRASH = "com.tommasoberlose.anotherwidget.action.REPORT_CRASH" const val ACTION_REPORT_CRASH = "com.tommasoberlose.anotherwidget.action.REPORT_CRASH"
const val ACTION_CLEAR_NOTIFICATION = "com.tommasoberlose.anotherwidget.action.CLEAR_NOTIFICATION" const val ACTION_CLEAR_NOTIFICATION = "com.tommasoberlose.anotherwidget.action.CLEAR_NOTIFICATION"
const val ACTION_UPDATE_GREETINGS = "com.tommasoberlose.anotherwidget.action.UPDATE_GREETINGS" const val ACTION_UPDATE_GREETINGS = "com.tommasoberlose.anotherwidget.action.UPDATE_GREETINGS"
const val ACTION_REFRESH = "com.tommasoberlose.anotherwidget.action.REFRESH"
} }

View File

@ -12,8 +12,10 @@ import android.provider.CalendarContract
import android.provider.CalendarContract.Events import android.provider.CalendarContract.Events
import android.util.Log import android.util.Log
import com.tommasoberlose.anotherwidget.R import com.tommasoberlose.anotherwidget.R
import com.tommasoberlose.anotherwidget.global.Actions
import com.tommasoberlose.anotherwidget.global.Preferences import com.tommasoberlose.anotherwidget.global.Preferences
import com.tommasoberlose.anotherwidget.models.Event import com.tommasoberlose.anotherwidget.models.Event
import com.tommasoberlose.anotherwidget.receivers.UpdatesReceiver
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
import com.tommasoberlose.anotherwidget.utils.toast import com.tommasoberlose.anotherwidget.utils.toast
import java.util.* import java.util.*
@ -35,6 +37,12 @@ object IntentHelper {
} }
} }
private fun getWidgetRefreshIntent(context: Context): Intent {
return Intent(context, UpdatesReceiver::class.java).apply {
action = Actions.ACTION_REFRESH
}
}
fun getGoogleMapsIntentFromAddress(context: Context, address: String): Intent { fun getGoogleMapsIntentFromAddress(context: Context, address: String): Intent {
val gmmIntentUri: Uri = Uri.parse("geo:0,0?q=$address") val gmmIntentUri: Uri = Uri.parse("geo:0,0?q=$address")
val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri) val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
@ -63,7 +71,7 @@ object IntentHelper {
Intent() Intent()
} }
REFRESH_WIDGET_OPTION -> { REFRESH_WIDGET_OPTION -> {
getWidgetUpdateIntent(context) getWidgetRefreshIntent(context)
} }
else -> { else -> {
val pm: PackageManager = context.packageManager val pm: PackageManager = context.packageManager
@ -95,7 +103,7 @@ object IntentHelper {
Intent() Intent()
} }
REFRESH_WIDGET_OPTION -> { REFRESH_WIDGET_OPTION -> {
getWidgetUpdateIntent(context) getWidgetRefreshIntent(context)
} }
else -> { else -> {
val pm: PackageManager = context.packageManager val pm: PackageManager = context.packageManager
@ -183,7 +191,7 @@ object IntentHelper {
Intent() Intent()
} }
REFRESH_WIDGET_OPTION -> { REFRESH_WIDGET_OPTION -> {
getWidgetUpdateIntent(context) getWidgetRefreshIntent(context)
} }
else -> { else -> {
val pm: PackageManager = context.packageManager val pm: PackageManager = context.packageManager

View File

@ -12,12 +12,12 @@ import com.tommasoberlose.anotherwidget.db.EventRepository
import com.tommasoberlose.anotherwidget.global.Actions import com.tommasoberlose.anotherwidget.global.Actions
import com.tommasoberlose.anotherwidget.global.Constants import com.tommasoberlose.anotherwidget.global.Constants
import com.tommasoberlose.anotherwidget.global.Preferences import com.tommasoberlose.anotherwidget.global.Preferences
import com.tommasoberlose.anotherwidget.helpers.ActiveNotificationsHelper import com.tommasoberlose.anotherwidget.helpers.*
import com.tommasoberlose.anotherwidget.helpers.BatteryHelper
import com.tommasoberlose.anotherwidget.helpers.CalendarHelper
import com.tommasoberlose.anotherwidget.helpers.MediaPlayerHelper
import com.tommasoberlose.anotherwidget.models.Event import com.tommasoberlose.anotherwidget.models.Event
import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget import com.tommasoberlose.anotherwidget.ui.widgets.MainWidget
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import org.joda.time.Period import org.joda.time.Period
import java.util.* import java.util.*
@ -55,6 +55,16 @@ class UpdatesReceiver : BroadcastReceiver() {
Actions.ACTION_UPDATE_GREETINGS -> { Actions.ACTION_UPDATE_GREETINGS -> {
MainWidget.updateWidget(context) MainWidget.updateWidget(context)
} }
Actions.ACTION_REFRESH -> {
ActiveNotificationsHelper.clearLastNotification(context)
GlobalScope.launch(Dispatchers.IO) {
CalendarHelper.updateEventList(context)
MediaPlayerHelper.updatePlayingMediaInfo(context)
WeatherHelper.updateWeather(context)
}
}
} }
} }

View File

@ -33,7 +33,7 @@ import kotlin.collections.ArrayList
class UpdateCalendarService : Service() { class UpdateCalendarService : Service() {
companion object { companion object {
const val CALENDAR_SYNC_NOTIFICATION_ID = 28466 const val CALENDAR_SYNC_NOTIFICATION_ID = 28468
fun enqueueWork(context: Context) { fun enqueueWork(context: Context) {
context.startService(Intent(context, UpdateCalendarService::class.java)) context.startService(Intent(context, UpdateCalendarService::class.java))
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {

View File

@ -17,6 +17,7 @@ import android.util.Log
import android.util.TypedValue import android.util.TypedValue
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import android.widget.RemoteViews import android.widget.RemoteViews
import android.widget.TextView import android.widget.TextView
@ -34,6 +35,7 @@ import com.tommasoberlose.anotherwidget.helpers.ColorHelper.toIntValue
import com.tommasoberlose.anotherwidget.helpers.ImageHelper.applyShadow import com.tommasoberlose.anotherwidget.helpers.ImageHelper.applyShadow
import com.tommasoberlose.anotherwidget.receivers.* import com.tommasoberlose.anotherwidget.receivers.*
import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission import com.tommasoberlose.anotherwidget.utils.checkGrantedPermission
import com.tommasoberlose.anotherwidget.utils.convertDpToPixel
import com.tommasoberlose.anotherwidget.utils.isDarkTheme import com.tommasoberlose.anotherwidget.utils.isDarkTheme
import com.tommasoberlose.anotherwidget.utils.toPixel import com.tommasoberlose.anotherwidget.utils.toPixel
import java.text.DateFormat import java.text.DateFormat
@ -1072,7 +1074,10 @@ class MainWidget : AppWidgetProvider() {
// Dividers // Dividers
arrayOf(bindingView.divider1, bindingView.divider2, bindingView.divider3).forEach { arrayOf(bindingView.divider1, bindingView.divider2, bindingView.divider3).forEach {
it.isVisible = Preferences.showDividers it.visibility = if (Preferences.showDividers) View.VISIBLE else View.INVISIBLE
it.layoutParams = (it.layoutParams as ViewGroup.MarginLayoutParams).apply {
this.marginEnd = if (Preferences.showDividers) 8f.convertDpToPixel(context).toInt() else 0
}
} }
eventRepository.close() eventRepository.close()

View File

@ -21,51 +21,6 @@
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingBottom="48dp" android:paddingBottom="48dp"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/settings_custom_font_title"
android:paddingTop="16dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:textAppearance="@style/AnotherWidget.Settings.Header" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_custom_font"
android:orientation="horizontal">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:src="@drawable/round_font_download_24"
app:tint="@color/colorPrimaryText"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/font_family_settings_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/custom_font_label"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -283,6 +238,43 @@
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingRight="20dp" android:paddingRight="20dp"
android:textAppearance="@style/AnotherWidget.Settings.Header" /> android:textAppearance="@style/AnotherWidget.Settings.Header" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:id="@+id/action_custom_font"
android:orientation="horizontal">
<ImageView
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
android:src="@drawable/round_font_download_24"
app:tint="@color/colorPrimaryText"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/AnotherWidget.Settings.Title"
android:text="@string/settings_custom_font_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/custom_font_label"
style="@style/AnotherWidget.Settings.Subtitle"/>
</LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -80,6 +80,11 @@
<string name="attendee_status_accepted">Événements acceptés</string> <string name="attendee_status_accepted">Événements acceptés</string>
<string name="attendee_status_invited">Invitations à des évmts</string> <string name="attendee_status_invited">Invitations à des évmts</string>
<string name="attendee_status_declined">Événements refusés</string> <string name="attendee_status_declined">Événements refusés</string>
<string name="calendar_sync_notification_channel_id" translatable="false">calendar-sync</string>
<string name="calendar_sync_notification_channel_name">Service de synchronisation du calendrier</string>
<string name="calendar_sync_notification_channel_description">Service utilisé pour synchroniser les événements du calendrier.</string>
<string name="calendar_sync_notification_title">Synchronisation du calendrier...</string>
<!-- Weather --> <!-- Weather -->
<string name="settings_weather_title">Météo</string> <string name="settings_weather_title">Météo</string>
@ -140,7 +145,7 @@
<string name="weather_provider_activity_subtitle">Sélectionnez un fournisseur météo dans la liste.\nCertains fournisseurs ont besoin d\'un\ncompte personnel gratuit pour fonctionner,\nmais ils sont généralement plus précis.</string> <string name="weather_provider_activity_subtitle">Sélectionnez un fournisseur météo dans la liste.\nCertains fournisseurs ont besoin d\'un\ncompte personnel gratuit pour fonctionner,\nmais ils sont généralement plus précis.</string>
<string name="location_access_notification_channel_id" translatable="false">location-access</string> <string name="location_access_notification_channel_id" translatable="false">location-access</string>
<string name="location_access_notification_channel_name">Arrière-plan</string> <string name="location_access_notification_channel_name">Service en arrière-plan</string>
<string name="location_access_notification_channel_description">Service utilisé pour actualiser la météo en fonction de l\'emplacement actuel de l\'utilisateur.</string> <string name="location_access_notification_channel_description">Service utilisé pour actualiser la météo en fonction de l\'emplacement actuel de l\'utilisateur.</string>
<string name="location_access_notification_title">Actualisation de la météo...</string> <string name="location_access_notification_title">Actualisation de la météo...</string>
<string name="location_access_notification_subtitle">Nous actualisons la météo en fonction de votre emplacement actuel.</string> <string name="location_access_notification_subtitle">Nous actualisons la météo en fonction de votre emplacement actuel.</string>
@ -158,7 +163,7 @@
<string name="settings_clock_bottom_margin_subtitle_small">Petite</string> <string name="settings_clock_bottom_margin_subtitle_small">Petite</string>
<string name="settings_clock_bottom_margin_subtitle_medium">Moyenne</string> <string name="settings_clock_bottom_margin_subtitle_medium">Moyenne</string>
<string name="settings_clock_bottom_margin_subtitle_large">Grande</string> <string name="settings_clock_bottom_margin_subtitle_large">Grande</string>
<string name="clock_warning">En raison de limitations technologiques, l\'horloge n\'aura pas la police personnalisée et les ombres de texte sélectionnées dans l\'onglet <b>Affichage</b>.</string> <string name="clock_warning">En raison de limitations technologiques, l\'horloge n\'aura pas la police personnalisée et les ombres de texte sélectionnées dans le menu <b>Typographie</b>.</string>
<string name="settings_clock_text_color_title">Couleur du texte</string> <string name="settings_clock_text_color_title">Couleur du texte</string>
<string name="settings_ampm_indicator_title">Afficher l\'indicateur AM/PM</string> <string name="settings_ampm_indicator_title">Afficher l\'indicateur AM/PM</string>
<string name="clock_text_header">Style du texte</string> <string name="clock_text_header">Style du texte</string>
@ -239,7 +244,7 @@
<string name="settings_show_events_as_glance_provider_title">Événements</string> <string name="settings_show_events_as_glance_provider_title">Événements</string>
<string name="settings_show_events_as_glance_provider_subtitle">Affiche un petit aperçu des événements de votre calendrier, tout en affichant toujours la date actuelle.</string> <string name="settings_show_events_as_glance_provider_subtitle">Affiche un petit aperçu des événements de votre calendrier, tout en affichant toujours la date actuelle.</string>
<string name="settings_show_events_as_glance_provider_error">Veuillez activer l\'affichage des événements dans l\'onglet <b>Calendrier</b> et accorder l\'autorisation requise.</string> <string name="settings_show_events_as_glance_provider_error">Veuillez activer l\'affichage des événements dans le menu <b>Calendrier</b> et accorder l\'autorisation requise.</string>
<string name="events_glance_provider_format">%1$s %2$s</string> <string name="events_glance_provider_format">%1$s %2$s</string>
<!-- Settings --> <!-- Settings -->
@ -305,4 +310,18 @@
<string name="nothing">Rien</string> <string name="nothing">Rien</string>
<string name="action_dismiss">REFUSER</string> <string name="action_dismiss">REFUSER</string>
<string name="action_accept">ACCEPTER</string> <string name="action_accept">ACCEPTER</string>
<!-- More -->
<string name="look_and_feel_header"><![CDATA[Apparence du widget]]></string>
<string name="typography_settings_title">Typographie</string>
<string name="typography_settings_subtitle">Définir la police, la taille et la couleur du texte</string>
<string name="layout_settings_title">Mise en page</string>
<string name="gestures_settings_subtitle">Actions, comportements et raccourcis</string>
<string name="gestures_settings_title">Gestes</string>
<string name="gestures_amp_input_header"><![CDATA[Gestes et saisie]]></string>
<string name="clock_settings_subtitle">Définir la taille, la couleur et le fuseau horaire</string>
<string name="layout_settings_subtitle">Espacement et ajustements du widget</string>
<string name="smart_content_header">Contenu intelligent</string>
<string name="font_family_settings_title">Famille de polices</string>
</resources> </resources>