diff --git a/flutter_local_notifications/CHANGELOG.md b/flutter_local_notifications/CHANGELOG.md index 62e038740..3e66ef7ca 100644 --- a/flutter_local_notifications/CHANGELOG.md +++ b/flutter_local_notifications/CHANGELOG.md @@ -1,3 +1,87 @@ +# 17.2.6 + +## [17.2.6] + +* [Android] Added font scale compensation for custom notification layouts. + +When the user increases the system font size (Settings → Display → Font size), text in custom +`RemoteViews`-based notification layouts can overflow because Android scales `sp` values before +rendering and `autoSizeTextType` is not supported in `RemoteViews`. + +The plugin now detects `fontScale > 1.0` at notification creation time and programmatically +overrides text sizes using `RemoteViews.setTextViewTextSize()` with compensated pixel values, +keeping text at a fixed visual size regardless of the system font scale. +When `fontScale == 1.0` (default), no overrides are applied. + +### How to use + +**1. Define dimen resources** in `android/app/src/main/res/values/dimens.xml` that match the +`textSize` values in your custom notification layout XML. The naming convention is +`{view_id}_text_size`: + +```xml + + + 14sp + 12sp + + + 15sp + 15sp + +``` + +For example, if your layout has: + +```xml + + + + +