From 7f0313f3e3788b2e45e76d6c1263f3d917b53c79 Mon Sep 17 00:00:00 2001 From: KBenMessaoud Date: Tue, 7 Nov 2023 15:31:52 +0100 Subject: [PATCH 1/5] Ajout du \ sur value-fr --- app/src/main/res/values-fr/strings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a1a4287d5..28c1cd7bc 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -1,5 +1,5 @@ - + Agenda simple Agenda Changer de vue @@ -159,7 +159,7 @@ Ajouter des jours fériés Jours fériés nationaux Jours fériés religieux - Les jours fériés ont été correctement importés dans le type d'évènement \'Jours fériés\' + Les jours fériés ont été correctement importés dans le type d\'évènement \'Jours fériés\' L\'importation de certains évènements a échoué L\'importation des jours fériés a échoué @@ -252,17 +252,17 @@ Aujourd\'hui seulement Au cours du prochain… - Au cours de la prochaine journée + Au cours de la prochaine journée Au cours des %d prochains jours Au cours des %d prochains jours - Au cours de la prochaine semaine + Au cours de la prochaine semaine Au cours des %d prochaines semaines Au cours des %d prochaines semaines - Au cours du prochain mois + Au cours du prochain mois Au cours des %d prochains mois Au cours des %d prochains mois From 8215ff8ea808e1272758a69812c110c76f545308 Mon Sep 17 00:00:00 2001 From: KBenMessaoud Date: Thu, 9 Nov 2023 18:36:26 +0100 Subject: [PATCH 2/5] =?UTF-8?q?ajout=20de=20la=20grille=20de=20zone=20cliq?= =?UTF-8?q?uable=20pour=20identifier=20la=20probl=C3=A9matique=20de=20d?= =?UTF-8?q?=C3=A9calage=20de=20clique?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pro/views/AutoGridLayoutManager.kt | 2 +- .../calendar/pro/views/MonthView.kt | 2 +- .../calendar/pro/views/MonthViewWrapper.kt | 29 ++++++++++++++----- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt index 2428a85d2..ca8001226 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt @@ -25,7 +25,7 @@ class AutoGridLayoutManager( val totalSpace = if (orientation == VERTICAL) { width - paddingRight - paddingLeft } else { - height - paddingTop - paddingBottom + height - paddingTop*20 - paddingBottom } spanCount = max(1, totalSpace / itemWidth) } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt index 3c9432024..b7d0a0177 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt @@ -276,7 +276,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con verticalOffset = max(verticalOffset, dayVerticalOffsets[event.startDayIndex + i]) } val xPos = event.startDayIndex % 7 * dayWidth + horizontalOffset - val yPos = (event.startDayIndex / 7) * dayHeight + val yPos = (event.startDayIndex / 10) * dayHeight val xPosCenter = xPos + dayWidth / 2 if (verticalOffset - eventTitleHeight * 2 > dayHeight) { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt index 76eabbc2d..468087849 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt @@ -4,6 +4,8 @@ import android.content.Context import android.util.AttributeSet import android.view.LayoutInflater import android.widget.FrameLayout +import com.simplemobiletools.calendar.pro.BuildConfig +import com.simplemobiletools.calendar.pro.R import com.simplemobiletools.calendar.pro.databinding.MonthViewBackgroundBinding import com.simplemobiletools.calendar.pro.databinding.MonthViewBinding import com.simplemobiletools.calendar.pro.extensions.config @@ -106,7 +108,7 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F } private fun measureSizes() { - dayWidth = (width - horizontalOffset) / 7f + dayWidth = (width ) / 7f dayHeight = (height - weekDaysLetterHeight) / 6f } @@ -119,7 +121,7 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F for (x in 0 until COLUMN_COUNT) { val day = days.getOrNull(curId) if (day != null) { - addViewBackground(x, y, day) + addViewBackground(x, y/2, day) } curId++ } @@ -128,17 +130,22 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F private fun addViewBackground(viewX: Int, viewY: Int, day: DayMonthly) { val xPos = viewX * dayWidth + horizontalOffset - val yPos = viewY * dayHeight + weekDaysLetterHeight + val yPos = viewY * dayHeight*10 + weekDaysLetterHeight MonthViewBackgroundBinding.inflate(inflater, this, false).root.apply { if (isMonthDayView) { background = null } - layoutParams.width = dayWidth.toInt() - layoutParams.height = dayHeight.toInt() - x = xPos - y = yPos + // Supposons que vous vouliez que la zone cliquable soit 80% de la largeur et de la hauteur du jour + val clickableWidth = (dayWidth * 0.8).toInt() + val clickableHeight = (dayHeight * 0.8).toInt() + + layoutParams = FrameLayout.LayoutParams(clickableWidth, clickableHeight).apply { + leftMargin = (xPos + ((dayWidth - clickableWidth) / 2).toInt()).toInt() + topMargin = (yPos + ((dayHeight - clickableHeight) /2 ).toInt()).toInt() + } + setOnClickListener { dayClickCallback?.invoke(day) @@ -147,10 +154,18 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F } } + // Set the debug background if in debug mode + if (BuildConfig.DEBUG) { + this.setBackgroundResource(R.drawable.debug_day_border) + } + addView(this) } } + + + fun togglePrintMode() { binding.monthView.togglePrintMode() } From 8c19eafc1e8222874d2430fcee83804a946e1082 Mon Sep 17 00:00:00 2001 From: KBenMessaoud Date: Wed, 22 Nov 2023 11:10:51 +0100 Subject: [PATCH 3/5] =?UTF-8?q?ajout=20de=20la=20grille=20de=20zone=20cliq?= =?UTF-8?q?uable=20pour=20identifier=20la=20probl=C3=A9matique=20de=20d?= =?UTF-8?q?=C3=A9calage=20de=20clique=20et=20diminution=20de=20la=20zone?= =?UTF-8?q?=20cliquable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pro/views/AutoGridLayoutManager.kt | 2 +- .../calendar/pro/views/MonthViewWrapper.kt | 54 +++++++++++-------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt index ca8001226..2428a85d2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/AutoGridLayoutManager.kt @@ -25,7 +25,7 @@ class AutoGridLayoutManager( val totalSpace = if (orientation == VERTICAL) { width - paddingRight - paddingLeft } else { - height - paddingTop*20 - paddingBottom + height - paddingTop - paddingBottom } spanCount = max(1, totalSpace / itemWidth) } diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt index 468087849..911c2efad 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt @@ -69,7 +69,7 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F val childLeft = x * dayWidth + horizontalOffset - child.translationX val childTop = y * dayHeight + weekDaysLetterHeight - child.translationY val childWidth = child.measuredWidth - val childHeight = child.measuredHeight + val childHeight = child.measuredHeight/2 val childRight = childLeft + childWidth val childBottom = childTop + childHeight @@ -108,10 +108,15 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F } private fun measureSizes() { - dayWidth = (width ) / 7f - dayHeight = (height - weekDaysLetterHeight) / 6f + // Supposons que vous avez 7 colonnes et 6 lignes + val columns = 7 + val rows = 6 + + dayWidth = ((width - horizontalOffset) / columns).toFloat() + dayHeight = ((height - weekDaysLetterHeight) / rows).toFloat() } + private fun addClickableBackgrounds() { removeAllViews() binding = MonthViewBinding.inflate(inflater, this, true) @@ -129,43 +134,46 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F } private fun addViewBackground(viewX: Int, viewY: Int, day: DayMonthly) { - val xPos = viewX * dayWidth + horizontalOffset - val yPos = viewY * dayHeight*10 + weekDaysLetterHeight + // Utilisez dayWidth et dayHeight pour définir la taille visuelle totale du jour + val totalDayWidth = dayWidth + val totalDayHeight = dayHeight - MonthViewBackgroundBinding.inflate(inflater, this, false).root.apply { - if (isMonthDayView) { - background = null - } + // Définissez la zone cliquable à un pourcentage de la taille totale du jour + val clickableWidth = (totalDayWidth * 0.7).toInt() // 70% de la largeur totale + val clickableHeight = (totalDayHeight * 0.7).toInt() // 70% de la hauteur totale + + // Calculez les positions x et y pour centrer la zone cliquable dans la cellule du jour + val xPos = viewX * totalDayWidth + (totalDayWidth - clickableWidth) / 2 + horizontalOffset + val yPos = viewY * totalDayHeight + (totalDayHeight - clickableHeight) / 2 + weekDaysLetterHeight - // Supposons que vous vouliez que la zone cliquable soit 80% de la largeur et de la hauteur du jour - val clickableWidth = (dayWidth * 0.8).toInt() - val clickableHeight = (dayHeight * 0.8).toInt() + // Créez les paramètres de disposition pour la vue cliquable + val clickableLayoutParams = FrameLayout.LayoutParams(clickableWidth, clickableHeight) + clickableLayoutParams.setMargins(xPos.toInt(), yPos.toInt(), 0, 0) - layoutParams = FrameLayout.LayoutParams(clickableWidth, clickableHeight).apply { - leftMargin = (xPos + ((dayWidth - clickableWidth) / 2).toInt()).toInt() - topMargin = (yPos + ((dayHeight - clickableHeight) /2 ).toInt()).toInt() + val dayView = MonthViewBackgroundBinding.inflate(inflater, this, false).root.apply { + this.layoutParams = clickableLayoutParams + if (BuildConfig.DEBUG) { + setBackgroundResource(R.drawable.debug_day_border) // Appliquez la bordure rouge si en mode débogage } setOnClickListener { + // Gérez le clic sur la zone cliquable ici dayClickCallback?.invoke(day) - if (isMonthDayView) { binding.monthView.updateCurrentlySelectedDay(viewX, viewY) } } - - // Set the debug background if in debug mode - if (BuildConfig.DEBUG) { - this.setBackgroundResource(R.drawable.debug_day_border) - } - - addView(this) } + + addView(dayView) // Ajoutez la vue cliquable à la hiérarchie de la vue parente } + + + fun togglePrintMode() { binding.monthView.togglePrintMode() } From bf9719beb47903fa3355ef980256b330f3b37448 Mon Sep 17 00:00:00 2001 From: KBenMessaoud Date: Wed, 22 Nov 2023 11:38:32 +0100 Subject: [PATCH 4/5] correction commentaires --- .../calendar/pro/views/MonthViewWrapper.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt index 911c2efad..5aec696a2 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt @@ -134,19 +134,19 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F } private fun addViewBackground(viewX: Int, viewY: Int, day: DayMonthly) { - // Utilisez dayWidth et dayHeight pour définir la taille visuelle totale du jour + // utilisation de dayWidth et dayHeight pour définir la taille visuelle totale du jour val totalDayWidth = dayWidth val totalDayHeight = dayHeight - // Définissez la zone cliquable à un pourcentage de la taille totale du jour + // la zone cliquable à un pourcentage de la taille totale du jour val clickableWidth = (totalDayWidth * 0.7).toInt() // 70% de la largeur totale val clickableHeight = (totalDayHeight * 0.7).toInt() // 70% de la hauteur totale - // Calculez les positions x et y pour centrer la zone cliquable dans la cellule du jour + // Calcule les positions x et y pour centrer la zone cliquable dans la cellule du jour val xPos = viewX * totalDayWidth + (totalDayWidth - clickableWidth) / 2 + horizontalOffset val yPos = viewY * totalDayHeight + (totalDayHeight - clickableHeight) / 2 + weekDaysLetterHeight - // Créez les paramètres de disposition pour la vue cliquable + // Création des paramètres de disposition pour la vue cliquable val clickableLayoutParams = FrameLayout.LayoutParams(clickableWidth, clickableHeight) clickableLayoutParams.setMargins(xPos.toInt(), yPos.toInt(), 0, 0) @@ -157,7 +157,7 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F } setOnClickListener { - // Gérez le clic sur la zone cliquable ici + // gestion de clic sur la zone cliquable dayClickCallback?.invoke(day) if (isMonthDayView) { binding.monthView.updateCurrentlySelectedDay(viewX, viewY) @@ -165,7 +165,7 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F } } - addView(dayView) // Ajoutez la vue cliquable à la hiérarchie de la vue parente + addView(dayView) // ajout de la vue cliquable à la hiérarchie de la vue parente } From 388a140212c2513eb5635527574a873e7f298432 Mon Sep 17 00:00:00 2001 From: KBenMessaoud Date: Tue, 28 Nov 2023 14:32:43 +0100 Subject: [PATCH 5/5] =?UTF-8?q?On=20a=20descendu=20les=20chiffres=20et=20d?= =?UTF-8?q?iminu=C3=A9=20la=20surface=20de=20la=20zone=20cliquable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/simplemobiletools/calendar/pro/views/MonthView.kt | 2 +- .../simplemobiletools/calendar/pro/views/MonthViewWrapper.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt index b7d0a0177..d86006d02 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthView.kt @@ -176,7 +176,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con dayVerticalOffsets.put(day.indexOnMonthView, dayVerticalOffsets[day.indexOnMonthView] + weekDaysLetterHeight) val verticalOffset = dayVerticalOffsets[day.indexOnMonthView] val xPos = x * dayWidth + horizontalOffset - val yPos = y * dayHeight + verticalOffset + val yPos = y * dayHeight + verticalOffset*1.055f val xPosCenter = xPos + dayWidth / 2 val dayNumber = day.value.toString() diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt index 5aec696a2..019fbf6a9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/views/MonthViewWrapper.kt @@ -69,7 +69,7 @@ class MonthViewWrapper(context: Context, attrs: AttributeSet, defStyle: Int) : F val childLeft = x * dayWidth + horizontalOffset - child.translationX val childTop = y * dayHeight + weekDaysLetterHeight - child.translationY val childWidth = child.measuredWidth - val childHeight = child.measuredHeight/2 + val childHeight = child.measuredHeight/1.05F val childRight = childLeft + childWidth val childBottom = childTop + childHeight