Status Update
Comments
nj...@google.com <nj...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #2
This is a particularly hard device to come by - do you happen to have access to the device? If so could you provide us with the output of: adb shell dumpsys media.camera > info.txt
Thanks!
si...@google.com <si...@google.com> #3
Stacktrace:
Caused by: java.lang.IllegalArgumentException: Can not get supported output size under supported maximum for the format: 34
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes(SupportedSurfaceCombination.java:355)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions(SupportedSurfaceCombination.java:197)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions(Camera2DeviceSurfaceManager.java:198)
at androidx.camera.core.CameraX.calculateSuggestedResolutions(CameraX.java:943)
at androidx.camera.core.CameraX.bindToLifecycle(CameraX.java:293)
at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:227)
Below are some findings based on our debugging
When Dex is connected
previewConfig.getMaxResolution() is returning "731x411" as maxSize.
Inside Preview.Builder.build() -> Default_MAX_resolution is set to "CameraX.getSurfaceManager().getPreviewSize()" which is 731x411
this is being picked as maxSize.
While rendering maxSize is 731x411 and minSize is 640x480 and below are available outputSizes
0 = {Size@11860} "4032x3024"
1 = {Size@11861} "3984x2988"
2 = {Size@11862} "4032x2268"
3 = {Size@11863} "3024x3024"
4 = {Size@11864} "2976x2976"
5 = {Size@11865} "3840x2160"
6 = {Size@11866} "3264x2448"
7 = {Size@11867} "4032x1960"
8 = {Size@11868} "2880x2160"
9 = {Size@11869} "3264x1836"
10 = {Size@11870} "2160x2160"
11 = {Size@11871} "2560x1440"
12 = {Size@11872} "2224x1080"
13 = {Size@11873} "2048x1152"
14 = {Size@11874} "1920x1080"
15 = {Size@11875} "1440x1080"
16 = {Size@11876} "1088x1088"
17 = {Size@11877} "1280x720"
18 = {Size@11878} "1024x768"
19 = {Size@11879} "1056x704"
20 = {Size@11880} "960x720"
21 = {Size@11881} "960x540"
22 = {Size@11882} "720x720"
23 = {Size@11883} "800x450"
24 = {Size@11884} "720x480"
25 = {Size@11885} "640x480"
26 = {Size@11886} "352x288"
27 = {Size@11887} "320x240"
28 = {Size@11888} "256x144"
29 = {Size@11889} "176x144"
and couldn't find any size in this range.
When Dex not connected
minsize = 640x480
maxsize = 1920x1080
0 = {Size@11836} "4032x3024"
1 = {Size@11837} "3984x2988"
2 = {Size@11838} "4032x2268"
3 = {Size@11839} "3024x3024"
4 = {Size@11840} "2976x2976"
5 = {Size@11841} "3840x2160"
6 = {Size@11842} "3264x2448"
7 = {Size@11843} "4032x1960"
8 = {Size@11844} "2880x2160"
9 = {Size@11845} "3264x1836"
10 = {Size@11846} "2160x2160"
11 = {Size@11847} "2560x1440"
12 = {Size@11848} "2224x1080"
13 = {Size@11849} "2048x1152"
14 = {Size@11850} "1920x1080"
15 = {Size@11851} "1440x1080"
16 = {Size@11852} "1088x1088"
17 = {Size@11853} "1280x720"
18 = {Size@11854} "1024x768"
19 = {Size@11855} "1056x704"
20 = {Size@11856} "960x720"
21 = {Size@11857} "960x540"
22 = {Size@11858} "720x720"
23 = {Size@11859} "800x450"
24 = {Size@11860} "720x480"
25 = {Size@11861} "640x480"
26 = {Size@11862} "352x288"
27 = {Size@11863} "320x240"
28 = {Size@11864} "256x144"
29 = {Size@11865} "176x144"
and we have 12 available sizes in this range
Camera2DeviceSurfaceManager.java:: getPreviewSize()
mCameraSupportedSurfaceCombinationMap.get(cameraId).getSurfaceDefinition().getPreviewSize() = "1920x1080"
cameraId=0
si...@google.com <si...@google.com> #4
The issue root cause is that CameraX will default filter out sizes smaller than 640x480. For Preview, the max size will be limited to under display size. I checked the HW spec info for the issue related devices. Display size of FUJITSU F-04J/F-05J is 360x640. That will result int that no size exists in the conditions that is larger or equal to 640x480 and smaller or equal to 360x640.
A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
For device FUJITSU arrowsM04, I checked its HW spec info and its display size I found is 1280x720. It seems that the problem should not exist in the device.
Could you confirm that the problem exist on arrowsM04 device? What will be the returned value when using Display#getRealSize to obtain the display size?
pa...@gmail.com <pa...@gmail.com> #5
> A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
OK. I will try it.
> Could you confirm that the problem exist on arrowsM04 device?
We receive the crash report (Crashlytics) that this crash has occurred on arrowsM04.
We don't have this device so we can't confirm that the problem really exist on arrowsM04.
> What will be the returned value when using Display#getRealSize to obtain the display size?
We can't investigate it for the same reason.
Thank you.
1s...@gmail.com <1s...@gmail.com> #6
This issue happened on devices that the display size is smaller than 640x480. In original auto-resolution mechanism, supported sizes smaller than 640x480 will be default filter out.
The auto-resolution mechanism encodes the guaranteed configurations tables in CameraDevice#createCaptureSession(SessionConfiguration). It defines that the PREVIEW size is the small one of the device display size and 1080p. The PREVIEW size will be the maximal size limitation for Preview use case. The reason it limits the size to display size and 1080p is the stream output in display size or 1080p has been able to provide good enough preview quality. Therefore, auto-resolution mechanism will limit the selected size to be smaller than the small one of the device display size and 1080p.
With above two conditions, in this issue, all sizes smaller than 640x480 have been filter out, therefore, there is no size smaller than the display size 320x240 can be selected to use. And cause the exception.
Solution:
When the display size is smaller than 640x480, auto-resolution mechanism won't filter out those small sizes smaller than 640x480. This makes those small size be left and can be selected for the Preview use case on small display devices.
The solution has been merged and will be included in next CameraX release.
co...@protonmail.com <co...@protonmail.com> #7
Hello.
This crash still occurs.
- CAMERAX VERSION: 1.0.0-beta4
- ANDROID OS BUILD NUMBER: Android 7.1.1
- DEVICE NAME: FUJITSU F-02H
We receive following crash report from FUJITSU F-02H. So far We have received this crash report only from F-02H.
java.lang.IllegalArgumentException
Can not get supported output size under supported maximum for the format: 34
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes (SupportedSurfaceCombination.java:349)
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions (SupportedSurfaceCombination.java:197)
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions (Camera2DeviceSurfaceManager.java:198)
androidx.camera.core.CameraX.calculateSuggestedResolutions (CameraX.java:949)
androidx.camera.core.CameraX.bindToLifecycle (CameraX.java:351)
androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle (ProcessCameraProvider.java:230)
(our application's package name).CameraFragment.bindCameraUseCases (CameraFragment.java:174)
al...@gmail.com <al...@gmail.com> #8
Could you help to provide the following information to clarify the issue?
1. Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
2. Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
ma...@gmail.com <ma...@gmail.com> #9
- Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
Yes
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
Since we don't have this device, we'll try to collect this information in the next version of our app. The next version will be released later this month.
ka...@gmail.com <ka...@gmail.com> #10
Hello.
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
We have collected the output of the device where the crash occurs.
Device1
- Model : arrows Be F-05J
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Device2
- Model : Fujitsu arrows M04
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Additional Information
CameraX version : 1.0.0-beta04
We collect the supported output sizes by following code.
val errorString = buildString {
append("The supported output sizes of ImageFormat.PRIVATE: ")
(requireContext().getSystemService(Context.CAMERA_SERVICE) as CameraManager).apply {
cameraIdList.forEachIndexed { index, cameraId ->
val msg = if (VERSION.SDK_INT >= VERSION_CODES.M) {
val configurationMap =
getCameraCharacteristics(cameraId).get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)
val sizes = configurationMap?.getOutputSizes(ImageFormat.PRIVATE)
"CameraId $index: ${sizes?.joinToString(" ,")}"
} else {
"CameraId $index: This device version is under M."
}
append(msg)
}
}
}
to...@gmail.com <to...@gmail.com> #11
ci...@gmail.com <ci...@gmail.com> #12
I tried to find the device specs and both 720x1280
size display. For the camera id 0 device, it is a different case that the display size is larger than 640x480
but the device only supports a 480x480
size. The case also caused the same IllegalArgumentException and was also fixed by 1.0.0-beta04
release. Before 480x480
size would be filtered out and then caused the IllegalArgumentException. After it was merged, the 640x480
size threshold was removed and then the 480x480
size would be kept and selected to use.
It looks like 1.0.0-beta04
release had been used to collect the supported sizes information. But the issue should have been fixed by 1.0.0-beta04
release. Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
CameraX's 1.0.0-beta04
version. Maybe you can also consider to upgrade to the latest 1.0.0-rc01
version for your application. Thanks.
[Deleted User] <[Deleted User]> #13
Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
We collect informations only from the device on which IllegalArgumentException happened.
Our latest app uses CameraX version 1.0.0-beta10
and this issue still occurres.
However we don't receive crash report from Fujitsu arrows Be F-05J
or Fujitsu arrows M04
so far. (This doesn't mean this issue is fixed on these devices because our app is heavily rely on camera so these device's user wouldn't use our app anymore.)
Instead, we receive crash report from
- Model : Fujitsu F-03K
- Android Version : 7.1.2
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0 : 480x480
CameraId 1 : 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
dj...@gmail.com <dj...@gmail.com> #14
I missed some settings when I simulated the issue by robolectric test so that I was not able to reproduce it. Now, I can reproduce the issue if the device only supports one 480x480 resolution. I'm working on the solution and target to make it included in next release.
[Deleted User] <[Deleted User]> #15
kr...@gmail.com <kr...@gmail.com> #16
i....@getorca.app <i....@getorca.app> #17
+1
ha...@google.com <ha...@google.com>
sm...@gmail.com <sm...@gmail.com> #18
zh...@gmail.com <zh...@gmail.com> #19
ti...@soufan.com.br <ti...@soufan.com.br> #20
jr...@gmail.com <jr...@gmail.com> #21
su...@gmail.com <su...@gmail.com> #22
iv...@gmail.com <iv...@gmail.com> #23
ha...@google.com <ha...@google.com> #24
Updates: Currently we are studying the use cases for includeFontPadding == false. And it would be super helpful if you can share a little bit more about why you want to turned off includeFontPadding.
Here are some cases we are considering:
- Vertically align Text with another composable/widget
- Making 2 Text composable exactly the same as 2 lines of text.
- Vertically centering the text within another composable/widget.
Your suggestions are welcomed. Thanks a lot!
iv...@gmail.com <iv...@gmail.com> #25
ta...@gmail.com <ta...@gmail.com> #26
Originally, there was a problem with Android's handling of Noto Sans CJK Font, and I worked around it by setting "includeFontPaddings = false".
For related discussions, the following may be helpful.
iv...@gmail.com <iv...@gmail.com> #27
CustomFontWithBottomPadding.png - applying custom font adds a lot of bottom padding.
I don't need it, because distance from bottom of the Text to other elements are broken by this
[Deleted User] <[Deleted User]> #28
any workable workarounds for now?
jo...@pucp.pe <jo...@pucp.pe> #29
se...@gmail.com <se...@gmail.com> #30
Any update on this? This is really a dealbreaker for me. I could make a wrapper with TextView, but that really defeats the purpose of using the Jetpack Compose :(
fo...@gmail.com <fo...@gmail.com> #31
mx...@gmail.com <mx...@gmail.com> #32
A side note unrelated to the issue itself.
If you are using custom fonts and see too much padding due to Android's
- Install
. You can usefonttools pip3 install fonttools
. - Run
ttx -t head font.ttf
. - Open
font.ttx
with a text editor and modifyyMin
andyMax
values. It should be generally safe to change them to be the same as Roboto's values, which are-555
and2163
respectively. - Run
ttx -m font.ttf -b font.ttx
and you'll getfont#1.ttf
.
im...@gmail.com <im...@gmail.com> #33
[Deleted User] <[Deleted User]> #34
lc...@gmail.com <lc...@gmail.com> #35
Please just star the issue, adding a comment with +1 is just going to spam emails to everyone subscribed to this issue. Thank you for understanding.
f....@gmail.com <f....@gmail.com> #36
+1
bo...@gmail.com <bo...@gmail.com> #37
si...@google.com <si...@google.com>
jp...@spoton.com <jp...@spoton.com> #38
Workaround that works for my font, it cut's down bottom padding by looking at lines multiplied by lineHeight:
fun Modifier.removeFontPadding(
textStyle: TextStyle
) = layout { measurable, constraints ->
val placeable = measurable.measure(constraints)
val heightWithoutPadding = placeable.height - placeable.height.mod(textStyle.lineHeight.roundToPx())
layout(placeable.width, heightWithoutPadding) {
placeable.placeRelative(0, 0)
}
}
usage:
Text(
modifier = Modifier.removeFontPadding(typography.h5),
text = title,
style = typography.h5,
)
[Deleted User] <[Deleted User]> #39
mi...@gmail.com <mi...@gmail.com> #40
ch...@googlemail.com <ch...@googlemail.com> #41
[Deleted User] <[Deleted User]> #42
ji...@hotstar.com <ji...@hotstar.com> #43
si...@gmail.com <si...@gmail.com> #44
I built a component with annotatedStrings and 2 different styles + different sizes + different baselines. Basically, I needed a Superscript text (but aligned with the top and not above the second text, and different 60% of the font size) the second text (Baseline.None). I had some size variations for this component, and for each variation, I had to implement a different Baseline multiplier because it just wasn't aligning properly at the top (because of the font padding).
ag...@gmail.com <ag...@gmail.com> #45
fun Modifier.baselinePadding(
firstBaselineToTop: Dp,
lastBaselineToBottom: Dp
) = layout { measurable, constraints ->
val placeable = measurable.measure(constraints)
check(placeable[FirstBaseline] != AlignmentLine.Unspecified)
val firstBaseline = placeable[FirstBaseline]
check(placeable[LastBaseline] != AlignmentLine.Unspecified)
val lastBaseline = placeable[LastBaseline]
val lastBaselineToBottomHeight = placeable.height - lastBaseline
val lastBaselineToBottomDelta = lastBaselineToBottom.roundToPx() - lastBaselineToBottomHeight
val totalHeight = placeable.height +
(firstBaselineToTop.roundToPx() - firstBaseline)
val placeableY = totalHeight - placeable.height
layout(placeable.width, totalHeight + lastBaselineToBottomDelta) {
placeable.placeRelative(0, placeableY)
}
}
me...@gmail.com <me...@gmail.com> #46
si...@google.com <si...@google.com>
so...@google.com <so...@google.com>
[Deleted User] <[Deleted User]> #47
vi...@gmail.com <vi...@gmail.com> #48
gu...@gmail.com <gu...@gmail.com> #49
android:includeFontPadding
it seems to be pushed up or down depending on the excess padding on the top or bottom.
<hhea>
tag, ascent
for yMax
and descent
for yMin
si...@google.com <si...@google.com> #50
Anastasia, I have an idea and picked up the ticket. Will start discussion soon.
si...@google.com <si...@google.com> #51
Notes: go/compose-include-font-padding-2
ap...@google.com <ap...@google.com> #52
Branch: androidx-main
commit 6b3a3705892a51e67c63b446ea69a5cf249effd2
Author: Siyamed Sinir <siyamed@google.com>
Date: Sun Feb 27 00:13:24 2022
Update screenshot tests for includeFontPadding
aosp/1992050
Bug: 171394808
Change-Id: Ia680e6bbbee0e2da192465eef234fb763793a8d7
M wear/compose/material/button_disabled_cuttlefish.png
M compose/material/material/actionChip_disabled_cuttlefish.png
M wear/compose/material/compactbutton_ltr_cuttlefish.png
M wear/compose/material/swiped_to_right_50_percent_ltr_cuttlefish.png
M compose/material/material/tabs_lightTheme_defaultColors_cuttlefish.png
M compose/material/material/outlinedTextField_disabled_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_centerFab_docked_cuttlefish.png
M compose/material3/material3/drawerItem_lightTheme_defaultColors_pressed_cuttlefish.png
M compose/material/material/fab_text_cuttlefish.png
M compose/material/material/filled_textField_singleLine_labelCenteredVetically_cuttlefish.png
M compose/material/material/dialog_stackedButtons_cuttlefish.png
M compose/material3/material3/centerAlignedAppBar_lightTheme_cuttlefish.png
M compose/material/material/fab_textAndIcon_cuttlefish.png
M compose/material/material/outlinedTextField_readOnly_focused_cuttlefish.png
M compose/material/material/tabs_lightTheme_surfaceColors_pressed_cuttlefish.png
M compose/material/material/actionChip_outlined_disabled_cuttlefish.png
M compose/material/material/badge_lightTheme_longContent_tab_cuttlefish.png
M compose/material/material/filterChip_disabled_selected_cuttlefish.png
M compose/material/material/outlined_textField_focused_cuttlefish.png
M compose/material/material/filled_textField_singleLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M wear/compose/material/compactbutton_disabled_cuttlefish.png
M compose/material3/material3/drawerItem_darkTheme_defaultColors_pressed_cuttlefish.png
M compose/material/material/outlined_textField_withInput_cuttlefish.png
M compose/material/material/dialog_onlyText_cuttlefish.png
M compose/material/material/filterChip_disabled_notSelected_cuttlefish.png
M compose/material/material/filterChip_notSelected_cuttlefish.png
M compose/material/material/outlined_textField_focused_errorState_cuttlefish.png
M compose/material3/material3/color_scheme_light_cuttlefish.png
M compose/material3/material3/tabs_lightTheme_pressed_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_floating_ltr_cuttlefish.png
M compose/material3/material3/outlinedCard_darkTheme_cuttlefish.png
M compose/material3/material3/drawerItem_lightTheme_defaultColors_cuttlefish.png
M compose/foundation/foundation/multiStyleText_setFontWeight_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_centerFab_docked_noCutout_cuttlefish.png
M compose/material3/material3/filled_tonal_button_disabled_light_theme_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_docked_ltr_cuttlefish.png
M compose/material/material/filled_textField_not_focused_cuttlefish.png
M compose/material/material/filled_textField_singleLine_withoutLabel_placeholderCenteredVertically_cuttlefish.png
M compose/material/material/textField_readOnly_scrolled_cuttlefish.png
M compose/material3/material3/filled_tonal_button_light_theme_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_centerFab_docked_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_cuttlefish.png
M compose/material/material/textField_readOnly_cuttlefish.png
M compose/material3/material3/outlined_button_disabled_light_theme_cuttlefish.png
M compose/material3/material3/snackbar_withDismiss_darkTheme_cuttlefish.png
M compose/material/material/scaffold_topAppBar_endFab_ltr_cuttlefish.png
M compose/foundation/foundation/multiStyleText_setFontStyle_cuttlefish.png
M compose/material3/material3/tabs_darkTheme_cuttlefish.png
M compose/material3/material3/elevatedCard_lightTheme_cuttlefish.png
M wear/compose/material/togglebutton_disabled_cuttlefish.png
M compose/material3/material3/alertDialog_withIcon_lightTheme_cuttlefish.png
M wear/compose/material/button_ltr_cuttlefish.png
M compose/material3/material3/snackbar_darkTheme_cuttlefish.png
M compose/material3/material3/filledCard_lightTheme_cuttlefish.png
M compose/material/material/topAndBottomAppBar_floatingFab_snackbar_cuttlefish.png
M compose/material/material/bottomAppBar_snackbar_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_labelAlignedToTop_cuttlefish.png
M compose/material/material/filterChip_with_leading_icon_selected_cuttlefish.png
M compose/material/material/outlined_textField_focused_rtl_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withoutLabel_textAlignedToTop_cuttlefish.png
M compose/material3/material3/button_disabled_light_theme_cuttlefish.png
M compose/material/material/leadingIconTabs_darkTheme_defaultColors_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_docked_rtl_cuttlefish.png
M compose/material/material/textField_readOnly_focused_cuttlefish.png
M compose/material3/material3/outlinedCard_lightTheme_cuttlefish.png
M compose/material/material/tabs_darkTheme_primaryColors_cuttlefish.png
M compose/material/material/outlinedTextField_textCenterAligned_cuttlefish.png
M compose/material/material/topAppBar_snackbar_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_floating_rtl_cuttlefish.png
M compose/material/material/dialog_noTitleOrText_cuttlefish.png
M wear/compose/material/compactbutton_rtl_cuttlefish.png
M compose/material/material/outlined_textField_not_focused_cuttlefish.png
M compose/material3/material3/snackbar_lightTheme_cuttlefish.png
M wear/compose/material/swiped_to_right_50_percent_rtl_cuttlefish.png
M compose/material/material/filterChip_with_leading_icon_disabled_selected_cuttlefish.png
M compose/material/material/button_default_cuttlefish.png
M compose/material/material/tabs_darkTheme_primaryColors_pressed_cuttlefish.png
M compose/material3/material3/elevatedCard_pressed_cuttlefish.png
M compose/material/material/scaffold_topAppBar_centerFab_cuttlefish.png
M compose/material3/material3/snackbar_withAction_lightTheme_cuttlefish.png
M compose/material3/material3/elevatedCard_focused_cuttlefish.png
M compose/material/material/outlinedTextField_readOnly_scrolled_cuttlefish.png
M compose/material3/material3/elevatedCard_darkTheme_cuttlefish.png
M compose/material/material/filled_textField_textColor_defaultContentColor_cuttlefish.png
M compose/material3/material3/elevated_button_disabled_light_theme_cuttlefish.png
M compose/foundation/foundation/text_defaultSelectionColors_cuttlefish.png
M compose/material/material/button_disabled_cuttlefish.png
M compose/material/material/filled_textField_notFocused_errorState_cuttlefish.png
M compose/material/material/actionChip_outlined_cuttlefish.png
M compose/material/material/outlinedTextField_disabled_notScrolled_cuttlefish.png
M compose/material3/material3/color_scheme_dark_cuttlefish.png
M compose/material/material/outlinedTextField_leadingTrailingIcons_cuttlefish.png
M compose/material/material/outlinedTextField_leadingTrailingIcons_error_cuttlefish.png
M compose/material/material/filled_textField_withInput_cuttlefish.png
M compose/material/material/outlinedTextField_readOnly_cuttlefish.png
M compose/material3/material3/filledCard_focus_cuttlefish.png
M compose/material3/material3/outlined_button_light_theme_cuttlefish.png
M compose/material3/material3/color_scheme_light_dynamic_cuttlefish.png
M compose/material/material/outlinedTextField_disabled_notFocusable_cuttlefish.png
M compose/material3/material3/snackbar_withDismiss_lightTheme_cuttlefish.png
M compose/material/material/dialog_titleWithoutTextBaseline_cuttlefish.png
M compose/material3/material3/snackbar_withAction_darkTheme_cuttlefish.png
M compose/material/material/outlinedTextField_lightThemeSelectionColors_cuttlefish.png
M compose/material/material/tabs_lightTheme_surfaceColors_cuttlefish.png
M compose/material/material/filledTextField_lightThemeSelectionColors_cuttlefish.png
M compose/foundation/foundation/textField_defaultSelectionColors_cuttlefish.png
M compose/material/material/dialog_sideBySideButtons_cuttlefish.png
M compose/material3/material3/filledCard_pressed_cuttlefish.png
M compose/material3/material3/button_disabled_dark_theme_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_floating_rtl_cuttlefish.png
M compose/material/material/outlinedTextField_customShape_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_labelCenteredVetically_cuttlefish.png
M compose/material3/material3/fab_extended_text_cuttlefish.png
M compose/material/material/textField_leadingTrailingIcons_cuttlefish.png
M compose/material3/material3/filledCard_darkTheme_cuttlefish.png
M compose/material3/material3/alertDialog_darkTheme_cuttlefish.png
M compose/material/material/filled_textField_singleLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material/material/outlined_textField_textColor_defaultContentColor_cuttlefish.png
M compose/material/material/tabs_darkTheme_defaultColors_cuttlefish.png
M compose/material/material/topAndBottomAppBar_snackbar_cuttlefish.png
M compose/foundation/foundation/text_customSelectionColors_cuttlefish.png
M compose/material3/material3/outlinedCard_focused_cuttlefish.png
M compose/material3/material3/outlinedCard_pressed_cuttlefish.png
M compose/material3/material3/elevated_button_light_theme_cuttlefish.png
M compose/material/material/dialog_onlyTitle_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_docked_rtl_cuttlefish.png
M compose/material/material/outlinedTextField_textAlignedToEnd_cuttlefish.png
M compose/material3/material3/tabs_lightTheme_cuttlefish.png
M compose/material/material/filledTextField_darkThemeSelectionColors_cuttlefish.png
M compose/material/material/textField_disabled_notScrolled_cuttlefish.png
M compose/foundation/foundation/textField_customSelectionColors_cuttlefish.png
M compose/material/material/tabs_lightTheme_defaultColors_pressed_cuttlefish.png
M compose/material/material/snackbar_cuttlefish.png
M compose/material3/material3/filledCard_hover_cuttlefish.png
M compose/material3/material3/tabs_darkTheme_pressed_cuttlefish.png
M compose/material/material/tabs_darkTheme_surfaceColors_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withoutLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material/material/outlinedTextField_darkThemeSelectionColors_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_centerFab_floating_cuttlefish.png
M compose/material3/material3/button_dark_theme_cuttlefish.png
M compose/material/material/filled_textField_focused_errorState_cuttlefish.png
M compose/material/material/filterChip_selected_cuttlefish.png
M compose/material/material/textField_leadingTrailingIcons_error_cuttlefish.png
M compose/material/material/scaffold_topAppBar_endFab_rtl_cuttlefish.png
M compose/material3/material3/alertDialog_withIcon_darkTheme_cuttlefish.png
M compose/material3/material3/elevatedCard_hover_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_centerFab_floating_cuttlefish.png
M compose/material/material/topAndBottomAppBar_dockedFab_snackbar_cuttlefish.png
M compose/material3/material3/centerAlignedAppBar_darkTheme_cuttlefish.png
M compose/material/material/tabs_darkTheme_defaultColors_pressed_cuttlefish.png
M wear/compose/material/button_rtl_cuttlefish.png
M compose/material3/material3/alertDialog_lightTheme_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withoutLabel_placeholderCenteredVertically_cuttlefish.png
M compose/material3/material3/text_button_light_theme_cuttlefish.png
M compose/material/material/leadingIconTabs_lightTheme_defaultColors_cuttlefish.png
M compose/material/material/outlined_textField_notFocused_errorState_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withoutLabel_textCenteredVertically_cuttlefish.png
M compose/material/material/actionChip_cuttlefish.png
M compose/foundation/foundation/multiStyleText_setFontFamily_cuttlefish.png
M compose/material3/material3/color_scheme_dark_dynamic_cuttlefish.png
M compose/material/material/tabs_darkTheme_surfaceColors_pressed_cuttlefish.png
M compose/material3/material3/outlinedCard_hover_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material3/material3/button_light_theme_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_docked_ltr_cuttlefish.png
M compose/material3/material3/fab_extended_text_and_icon_cuttlefish.png
M compose/material3/material3/text_button_disabled_light_theme_cuttlefish.png
M compose/material3/material3/drawerItem_darkTheme_defaultColors_cuttlefish.png
M compose/material/material/scaffold_topAppBar_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_floating_ltr_cuttlefish.png
ap...@google.com <ap...@google.com> #53
Branch: androidx-main
commit b3085385b770c834850a133b07e9b28d5a8adc6d
Author: Siyamed Sinir <siyamed@google.com>
Date: Sun Feb 13 15:52:24 2022
Turn off includeFontPadding
This CL turns off includeFontPadding by default. In order to
prevent tall text clip issues, it applies additional padding when
required.
More details at go/compose-include-font-padding-2
Performance: The major change happened in Paragraph construction for
length of 16 and 32. They regressed around 10%. For example length 16
moved from 0.27ms to 0.31ms (Jio Phone Android 11)
Overall this CL
- turn off includeFontPadding
- add additional padding when the text is higher for only the first
and last line
- update LineHeightSpan to not apply line height to first line
- add demos for the new state
RelNote: "Text: includeFontPadding is now turned off by default. The
clipping issues as a result of includeFontPadding=false is handled
and no clipping should occur for tall scripts.
Test: ./gradlew :text:text:test
Test: ./gradlew :text:text:cAT
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Test: ./gradlew compose:foundation:foundation:test
Test: ./gradlew compose:foundation:foundation:cAT
Bug: 171394808
Change-Id: I31c84166ae5241fea3f49e8f293dd9d8a5d712cb
A text/text/src/androidTest/java/androidx/compose/ui/text/android/PaintBoundsTest.kt
M text/text/src/main/java/androidx/compose/ui/text/android/SpannedExtensions.kt
M compose/ui/ui-text/api/restricted_current.txt
M text/text/src/androidTest/java/androidx/compose/ui/text/android/TextLayoutSpanTest.kt
M text/text/src/main/java/androidx/compose/ui/text/android/TextLayout.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/textfield/TextFieldCursorTest.kt
M text/text/src/main/java/androidx/compose/ui/text/android/style/LineHeightSpan.kt
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTreeTest.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphHelper.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt
A text/text/src/main/java/androidx/compose/ui/text/android/PaintExtensions.kt
A compose/ui/ui-test-font/src/font_ttx/tall_font.ttx
A text/text/src/androidTest/java/androidx/compose/ui/text/android/FontPaddingWithCustomFallbackTest.kt
A compose/ui/ui-test-font/src/commonMain/resources/font/tall_font.ttf
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextDemos.kt
A text/text/src/androidTest/java/androidx/compose/ui/text/android/FontPaddingTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphFillBoundingBoxesTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/TextTestExtensions.kt
M text/text/src/main/java/androidx/compose/ui/text/android/LayoutCompat.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraph.android.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldTest.kt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeFontPadding.kt
M compose/ui/ui-inspection/build.gradle
M compose/ui/ui-text/api/current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
si...@google.com <si...@google.com> #54
si...@google.com <si...@google.com>
ap...@google.com <ap...@google.com> #55
Branch: androidx-main
commit 610346f638983d151c85b0328fa3b3498096543d
Author: Siyamed Sinir <siyamed@google.com>
Date: Sat Mar 19 10:15:06 2022
Fix selection & getLineBottom with top/bottom padding
When includeFontPadding is false TextLayout adds additional padding
around the original Android layout to prevent clipping (aosp/1992050).
In such cases getLineBottom returns the line bottom from the
previously clipped case. This CL adds the bottomPadding to the last
line bottom, and a test for it.
Moreover, when topPadding is set to a non-zero value, selection is
drawn higher than it should be. This CL fixes the selection path
by offsetting it by topPadding to draw in its original location.
However offsetting does not correct the height of the selection for
each line.
Note: SelectionPathHelper is added in the first version of this CL
to illustrate a patch to draw all of selection with the correct
height. However it is not clear if the visual fix is worth the
any performance cost.
Test: New test
Test: ./gradlew :text:text:test
Test: ./gradlew :text:text:cAT
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Bug: 171394808
Change-Id: I22673819a80c9b6ba4d8ad10a2bb020b348c9e27
M text/text/src/androidTest/java/androidx/compose/ui/text/android/FontPaddingWithCustomFallbackTest.kt
M text/text/src/main/java/androidx/compose/ui/text/android/TextLayout.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeFontPadding.kt
ap...@google.com <ap...@google.com> #56
Branch: androidx-main
commit 8e2ae729dd4266a6ee955caf2e65135a3cbb99ba
Author: Siyamed Sinir <siyamed@google.com>
Date: Thu Mar 10 08:23:44 2022
Add deprecated includeFontPadding
aosp/1992050 turned off includeFontPadding by default.
This CL adds platform configuration options for TextStyle,
SpanStyle and ParagraphStyle that includes includeFontPadding param.
Other attempts/ideas
* aosp/2020339
* aosp/2025246
RelNote: "Added temporary compatibility configuration for
includeFontPadding in TextStyle/ParagraphStyle. includeFontPadding
can be changed via TextStyle(platformStyle =
PlatformTextStyle(includeFontPadding = true/false)). This is a
temporary configuration option to enable migration and will be
removed."
Test: New tests
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Test: DemoApp
Test: Treehugger
Test: ANDROIDX_PROJECTS=COMPOSE ./gradlew jvmTest desktopTest \
-Pandroidx.compose.multiplatformEnabled=true --no-daemon
Test: ANDROIDX_PROJECTS=COMPOSE ./gradlew \
:compose:desktop:desktop:desktop-samples:run \
-Pandroidx.compose.multiplatformEnabled=true --no-daemon
Bug: 171394808
Change-Id: If47be074f53de9ccf12af114648b21e25722d166
M compose/ui/ui-inspection/src/androidTest/java/androidx/compose/ui/inspection/inspector/ParameterFactoryTest.kt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidParagraphTest.kt
M compose/ui/ui-test-font/src/commonMain/resources/font/sample_font.ttf
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/TextStyleResolveDefaultsTest.kt
A compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/PlatformTextStyle.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextStyle.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/ParagraphStyleTest.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/TextSpanParagraphStyleTest.kt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/SpanStyle.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/SpanStyleTest.kt
A compose/ui/ui-text/src/skikoMain/kotlin/androidx/compose/ui/text/DesktopTextStyle.skiko.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/PlatformSpanStyleTest.kt
M compose/ui/ui-test-font/src/font_ttx/sample_font.ttx
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/ParagraphStyle.kt
M compose/ui/ui-text/src/test/java/androidx/compose/ui/text/TextStyleTest.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/PlatformTextStyleTest.kt
A compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/AndroidTextStyle.android.kt
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/PlatformParagraphStyleTest.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraph.android.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeFontPadding.kt
M compose/ui/ui-text/api/current.txt
si...@google.com <si...@google.com> #57
Thanks for all your feedback.
In the current state:
- we have turned off includeFontPadding
- prevented font clippings that would normally occur, and backported it
- Added an experimental/deprecated API to help with transition in case default value does not work for you right now:
TextStyle(platformStyle = PlatformTextStyle(includeFontPadding = true/false)
ap...@google.com <ap...@google.com> #58
Branch: androidx-main
commit 8263dbf4386be7a8e53dc809f83cb0eb84329d06
Author: Siyamed Sinir <siyamed@google.com>
Date: Sun Mar 27 22:11:27 2022
includeFontPadding line height fix
When we disabled includeFontPadding, because of the differences
between platform versions, we updated LineHeightSpan not to apply
line height to first line. This might be causing small rounding (1px)
differences between the line heights of 1st and the rest of the lines.
This CL updates AndroidParagraphHelper to return to the state before
includeFontPadding changes if includeFontPadding is true.
Finally, canvas.translate is not needed to be called if the
topPadding is 0. This CL updates TextLayout.kt not to translate if
topPadding is 0.
Test: ./gradlew text:text:test
Test: ./gradlew text:text:cAT
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Test: Manual Test in demo app
Bug: 171394808
Bug: 227095468
Change-Id: I112732a542b47b373d6b45992b9758f1bed0b668
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraphHelper.android.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/AndroidParagraph.android.kt
M text/text/src/main/java/androidx/compose/ui/text/android/TextLayout.kt
ap...@google.com <ap...@google.com> #59
Branch: androidx-main
commit e752cae9056f9bf8d272f822e64f0e2ec4d0c07d
Author: Siyamed Sinir <siyamed@google.com>
Date: Sun Mar 27 09:06:15 2022
Fix TextStyle.canReuseLayout when platformStyle changes
When platformStyle was added, this function didn't compare
platformStyle.
Test: Added tests
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Test: ./gradlew compose:foundation:foundation:test
Test: ./gradlew compose:foundation:foundation:cAT
Bug: 171394808
Change-Id: Ia5e867dc6419162c9f3db99def86f03e8f4ada9f
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextLayoutHelperTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextLayoutHelper.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextDemos.kt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeReuseLayout.kt
ap...@google.com <ap...@google.com> #60
Branch: androidx-main
commit 5dad3878a8895c328bfb596f44098f3c98789e18
Author: Siyamed Sinir <siyamed@google.com>
Date: Tue Mar 29 07:37:42 2022
Add tests for aosp/2043668
Adds test for first line lineHeight issue fixed in aosp/2043668
Also address open comment for aosp/2045375: add class comment to the
demo screen named ComposeReuseLayout.kt
Test: Added tests
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Test: ./gradlew text:text:test
Test: ./gradlew text:text:cAT
Bug: 171394808
Bug: 227095468
Change-Id: I4562b9abd80ab057b2b5abcf82b81521e5d60a4b
M text/text/src/main/java/androidx/compose/ui/text/android/style/LineHeightSpan.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/platform/AndroidParagraphTest.kt
M text/text/src/androidTest/java/androidx/compose/ui/text/android/TextLayoutIntrinsicWidthTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/ComposeReuseLayout.kt
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/platform/extensions/SpannableExtensions.android.kt
ap...@google.com <ap...@google.com> #61
Branch: androidx-main
commit 51b941b3c03a8dcabf041b6f5bcbcc82c1032460
Author: Siyamed Sinir <siyamed@google.com>
Date: Thu Apr 14 02:01:24 2022
Update screenshot tests for includeFontPadding=true
Related: aosp/2059410
Bug: 171394808
Change-Id: I6195e6a1bd2e803a9de80a862bafcf08cb1d31f6
M wear/compose/material/swiped_to_right_50_percent_ltr_cuttlefish.png
M compose/material/material/tabs_lightTheme_defaultColors_cuttlefish.png
M compose/material3/material3/elevatedCard_disabled_darkTheme_cuttlefish.png
M compose/material3/material3/outlined_textField_singleLine_labelCenteredVetically_cuttlefish.png
M compose/material/material/fab_text_cuttlefish.png
M compose/material3/material3/centerAlignedAppBar_lightTheme_cuttlefish.png
M compose/material3/material3/outlinedTextField_leadingTrailingIcons_error_cuttlefish.png
M compose/material3/material3/outlined_textField_focused_errorState_dark_cuttlefish.png
M compose/material/material/outlinedTextField_readOnly_focused_cuttlefish.png
M compose/material/material/tabs_lightTheme_surfaceColors_pressed_cuttlefish.png
M compose/material/material/outlined_textField_focused_cuttlefish.png
M compose/material/material/outlined_textField_withInput_cuttlefish.png
M compose/material3/material3/drawerItem_darkTheme_defaultColors_pressed_cuttlefish.png
M compose/material/material/filterChip_disabled_notSelected_cuttlefish.png
M compose/material/material/outlined_textField_focused_errorState_cuttlefish.png
M compose/material3/material3/color_scheme_light_cuttlefish.png
M compose/material3/material3/outlined_textField_singleLine_withoutLabel_placeholderCenteredVertically_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material3/material3/filledCard_disabled_darkTheme_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_centerFab_docked_noCutout_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_docked_ltr_cuttlefish.png
M compose/material3/material3/filled_textField_withInput_cuttlefish.png
M compose/material3/material3/filled_textField_singleLine_withoutLabel_placeholderCenteredVertically_cuttlefish.png
M compose/material/material/filled_textField_not_focused_cuttlefish.png
M compose/material/material/filled_textField_singleLine_withoutLabel_placeholderCenteredVertically_cuttlefish.png
M compose/material3/material3/filled_tonal_button_light_theme_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_centerFab_docked_cuttlefish.png
M compose/material3/material3/outlinedCard_disabled_darkTheme_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_cuttlefish.png
M compose/material/material/textField_readOnly_cuttlefish.png
M compose/material3/material3/snackbar_withDismiss_darkTheme_cuttlefish.png
M compose/material/material/scaffold_topAppBar_endFab_ltr_cuttlefish.png
M compose/foundation/foundation/multiStyleText_setFontStyle_cuttlefish.png
M compose/material3/material3/textField_leadingTrailingIcons_cuttlefish.png
M wear/compose/material/togglebutton_disabled_cuttlefish.png
M wear/compose/material/button_ltr_cuttlefish.png
M compose/material3/material3/snackbar_darkTheme_cuttlefish.png
M compose/material3/material3/filledCard_lightTheme_cuttlefish.png
M compose/material3/material3/outlined_textField_not_focused_cuttlefish.png
M compose/material/material/topAndBottomAppBar_floatingFab_snackbar_cuttlefish.png
M compose/material3/material3/filledTextField_darkThemeSelectionColors_cuttlefish.png
M compose/material/material/outlined_textField_focused_rtl_cuttlefish.png
M compose/material/material/leadingIconTabs_darkTheme_defaultColors_cuttlefish.png
M compose/material3/material3/outlinedCard_lightTheme_cuttlefish.png
M compose/material/material/text_darkThemeSelectionColors_cuttlefish.png
M compose/material/material/dialog_noTitleOrText_cuttlefish.png
M wear/compose/material/compactbutton_rtl_cuttlefish.png
M wear/compose/material/swiped_to_right_50_percent_rtl_cuttlefish.png
M compose/material3/material3/outlinedTextField_leadingTrailingIcons_cuttlefish.png
M compose/material3/material3/elevatedCard_pressed_cuttlefish.png
M compose/foundation/foundation/text_defaultSelectionColors_cuttlefish.png
M compose/material/material/filled_textField_notFocused_errorState_cuttlefish.png
M compose/material3/material3/fab_extended_animation_cuttlefish.png
M compose/material/material/outlinedTextField_readOnly_cuttlefish.png
M compose/material3/material3/outlined_button_light_theme_cuttlefish.png
M compose/material/material/outlinedTextField_disabled_notFocusable_cuttlefish.png
M compose/material3/material3/snackbar_withDismiss_lightTheme_cuttlefish.png
M compose/material3/material3/filled_textField_textColor_customTextColor_cuttlefish.png
M compose/material/material/tabs_lightTheme_surfaceColors_cuttlefish.png
M compose/material/material/filledTextField_lightThemeSelectionColors_cuttlefish.png
M compose/material3/material3/filledCard_pressed_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material3/material3/filled_textField_focused_errorState_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_labelCenteredVetically_cuttlefish.png
M compose/material/material/textField_leadingTrailingIcons_cuttlefish.png
M compose/material3/material3/filledCard_darkTheme_cuttlefish.png
M compose/material3/material3/alertDialog_darkTheme_cuttlefish.png
M compose/material/material/filled_textField_singleLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material/material/outlined_textField_textColor_defaultContentColor_cuttlefish.png
M compose/material/material/tabs_darkTheme_defaultColors_cuttlefish.png
M compose/material/material/topAndBottomAppBar_snackbar_cuttlefish.png
M compose/material3/material3/outlinedTextField_leadingTrailingIcons_dark_cuttlefish.png
M compose/material3/material3/outlinedCard_pressed_cuttlefish.png
M compose/material3/material3/elevated_button_light_theme_cuttlefish.png
M compose/material/material/dialog_onlyTitle_cuttlefish.png
M compose/material/material/outlinedTextField_textAlignedToEnd_cuttlefish.png
M compose/material/material/filledTextField_darkThemeSelectionColors_cuttlefish.png
M compose/material3/material3/outlined_textField_withInput_dark_cuttlefish.png
M compose/foundation/foundation/textField_customSelectionColors_cuttlefish.png
M compose/material3/material3/outlined_textField_singleLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material3/material3/filledCard_hover_cuttlefish.png
M compose/material/material/tabs_darkTheme_surfaceColors_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withoutLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material/material/outlinedTextField_darkThemeSelectionColors_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_centerFab_floating_cuttlefish.png
M compose/material3/material3/button_dark_theme_cuttlefish.png
M compose/material/material/scaffold_topAppBar_endFab_rtl_cuttlefish.png
M compose/material3/material3/outlinedTextField_readOnly_scrolled_cuttlefish.png
M compose/material3/material3/elevatedCard_hover_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_centerFab_floating_cuttlefish.png
M compose/material3/material3/filled_textField_not_focused_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withoutLabel_placeholderCenteredVertically_cuttlefish.png
M compose/material/material/actionChip_cuttlefish.png
M compose/foundation/foundation/multiStyleText_setFontFamily_cuttlefish.png
M compose/material3/material3/filled_textField_singleLine_labelCenteredVetically_cuttlefish.png
M compose/material3/material3/color_scheme_dark_dynamic_cuttlefish.png
M compose/material/material/tabs_darkTheme_surfaceColors_pressed_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material3/material3/filled_textField_singleLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material3/material3/drawerItem_darkTheme_defaultColors_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_floating_ltr_cuttlefish.png
M compose/material3/material3/filledTextField_lightThemeSelectionColors_cuttlefish.png
M wear/compose/material/button_disabled_cuttlefish.png
M wear/compose/material/compactbutton_ltr_cuttlefish.png
M compose/material/material/actionChip_disabled_cuttlefish.png
M compose/material3/material3/textField_readOnly_focused_cuttlefish.png
M compose/material3/material3/filled_textField_withInput_dark_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_centerFab_docked_cuttlefish.png
M compose/material/material/outlinedTextField_disabled_cuttlefish.png
M compose/material3/material3/drawerItem_lightTheme_defaultColors_pressed_cuttlefish.png
M compose/material/material/filled_textField_singleLine_labelCenteredVetically_cuttlefish.png
M compose/material3/material3/text_darkThemeSelectionColors_cuttlefish.png
M compose/material/material/dialog_stackedButtons_cuttlefish.png
M compose/material/material/fab_textAndIcon_cuttlefish.png
M compose/material/material/actionChip_outlined_disabled_cuttlefish.png
M compose/material/material/badge_lightTheme_longContent_tab_cuttlefish.png
M compose/material/material/filterChip_disabled_selected_cuttlefish.png
M compose/material/material/filled_textField_singleLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M wear/compose/material/compactbutton_disabled_cuttlefish.png
M compose/material/material/dialog_onlyText_cuttlefish.png
M compose/material/material/filterChip_notSelected_cuttlefish.png
M compose/material3/material3/tabs_lightTheme_pressed_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_floating_ltr_cuttlefish.png
M compose/material3/material3/outlined_textField_textColor_customTextColor_cuttlefish.png
M compose/material3/material3/textField_readOnly_scrolled_cuttlefish.png
M compose/material3/material3/outlinedCard_darkTheme_cuttlefish.png
M compose/material3/material3/outlined_textField_withInput_cuttlefish.png
M compose/material3/material3/drawerItem_lightTheme_defaultColors_cuttlefish.png
M compose/material3/material3/outlinedCard_disabled_lightTheme_cuttlefish.png
M compose/material3/material3/text_lightThemeSelectionColors_cuttlefish.png
M compose/foundation/foundation/multiStyleText_setFontWeight_cuttlefish.png
M compose/material3/material3/filled_tonal_button_disabled_light_theme_cuttlefish.png
M compose/material3/material3/textField_readOnly_cuttlefish.png
M compose/material/material/textField_readOnly_scrolled_cuttlefish.png
M compose/material3/material3/outlined_button_disabled_light_theme_cuttlefish.png
M compose/material3/material3/filled_textField_singleLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material3/material3/tabs_darkTheme_cuttlefish.png
M compose/material3/material3/elevatedCard_lightTheme_cuttlefish.png
M compose/material3/material3/alertDialog_withIcon_lightTheme_cuttlefish.png
M compose/material3/material3/outlined_textField_notFocused_errorState_cuttlefish.png
M compose/material/material/bottomAppBar_snackbar_cuttlefish.png
M compose/material3/material3/outlinedTextField_darkThemeSelectionColors_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_labelAlignedToTop_cuttlefish.png
M compose/material/material/filterChip_with_leading_icon_selected_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withoutLabel_textAlignedToTop_cuttlefish.png
M compose/material3/material3/button_disabled_light_theme_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_docked_rtl_cuttlefish.png
M compose/material/material/textField_readOnly_focused_cuttlefish.png
M compose/material/material/tabs_darkTheme_primaryColors_cuttlefish.png
M compose/material/material/outlinedTextField_textCenterAligned_cuttlefish.png
M compose/material/material/topAppBar_snackbar_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_floating_rtl_cuttlefish.png
M compose/material3/material3/snackbar_lightTheme_cuttlefish.png
M compose/material/material/outlined_textField_not_focused_cuttlefish.png
M compose/material3/material3/textField_leadingTrailingIcons_dark_cuttlefish.png
M compose/material/material/filterChip_with_leading_icon_disabled_selected_cuttlefish.png
M compose/material/material/button_default_cuttlefish.png
M compose/material/material/tabs_darkTheme_primaryColors_pressed_cuttlefish.png
M compose/material3/material3/snackbar_withAction_lightTheme_cuttlefish.png
M compose/material/material/scaffold_topAppBar_centerFab_cuttlefish.png
M compose/material3/material3/elevatedCard_focused_cuttlefish.png
M compose/material/material/filled_textField_textColor_defaultContentColor_cuttlefish.png
M compose/material3/material3/elevatedCard_darkTheme_cuttlefish.png
M compose/material/material/outlinedTextField_readOnly_scrolled_cuttlefish.png
M compose/material3/material3/elevated_button_disabled_light_theme_cuttlefish.png
M compose/material3/material3/outlinedTextField_disabled_notScrolled_cuttlefish.png
M compose/material/material/button_disabled_cuttlefish.png
M compose/material3/material3/filled_textField_focused_errorState_dark_cuttlefish.png
M compose/material3/material3/filledCard_disabled_lightTheme_cuttlefish.png
M compose/material/material/actionChip_outlined_cuttlefish.png
M compose/material3/material3/textField_leadingTrailingIcons_error_cuttlefish.png
M compose/material/material/outlinedTextField_disabled_notScrolled_cuttlefish.png
M compose/material3/material3/color_scheme_dark_cuttlefish.png
M compose/material/material/outlinedTextField_leadingTrailingIcons_error_cuttlefish.png
M compose/material/material/outlinedTextField_leadingTrailingIcons_cuttlefish.png
M compose/material3/material3/filledCard_focus_cuttlefish.png
M compose/material/material/filled_textField_withInput_cuttlefish.png
M compose/material3/material3/filled_textField_notFocused_errorState_cuttlefish.png
M compose/material3/material3/color_scheme_light_dynamic_cuttlefish.png
M compose/material3/material3/snackbar_withAction_darkTheme_cuttlefish.png
M compose/material/material/dialog_titleWithoutTextBaseline_cuttlefish.png
M compose/material/material/outlinedTextField_lightThemeSelectionColors_cuttlefish.png
M compose/material3/material3/textField_disabled_notScrolled_cuttlefish.png
M compose/foundation/foundation/textField_defaultSelectionColors_cuttlefish.png
M compose/material/material/dialog_sideBySideButtons_cuttlefish.png
M compose/material3/material3/button_disabled_dark_theme_cuttlefish.png
M compose/material/material/outlinedTextField_customShape_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_floating_rtl_cuttlefish.png
M compose/material3/material3/fab_extended_text_cuttlefish.png
M compose/material3/material3/outlinedTextField_readOnly_cuttlefish.png
M compose/foundation/foundation/text_customSelectionColors_cuttlefish.png
M compose/material3/material3/outlinedCard_focused_cuttlefish.png
M compose/material/material/scaffold_bottomAppBar_endFab_docked_rtl_cuttlefish.png
M compose/material3/material3/tabs_lightTheme_cuttlefish.png
M compose/material/material/textField_disabled_notScrolled_cuttlefish.png
M compose/material3/material3/outlinedTextField_lightThemeSelectionColors_cuttlefish.png
M compose/material/material/tabs_lightTheme_defaultColors_pressed_cuttlefish.png
M compose/material/material/snackbar_cuttlefish.png
M compose/material3/material3/tabs_darkTheme_pressed_cuttlefish.png
M compose/material/material/filterChip_selected_cuttlefish.png
M compose/material/material/filled_textField_focused_errorState_cuttlefish.png
M compose/material/material/textField_leadingTrailingIcons_error_cuttlefish.png
M compose/material3/material3/elevatedCard_disabled_lightTheme_cuttlefish.png
M compose/material3/material3/alertDialog_withIcon_darkTheme_cuttlefish.png
M compose/material/material/topAndBottomAppBar_dockedFab_snackbar_cuttlefish.png
M compose/material3/material3/centerAlignedAppBar_darkTheme_cuttlefish.png
M compose/material/material/tabs_darkTheme_defaultColors_pressed_cuttlefish.png
M wear/compose/material/button_rtl_cuttlefish.png
M compose/material3/material3/alertDialog_lightTheme_cuttlefish.png
M compose/material3/material3/text_button_light_theme_cuttlefish.png
M compose/material/material/leadingIconTabs_lightTheme_defaultColors_cuttlefish.png
M compose/material/material/outlined_textField_notFocused_errorState_cuttlefish.png
M compose/material3/material3/outlinedTextField_readOnly_focused_cuttlefish.png
M compose/material/material/outlined_textField_singleLine_withoutLabel_textCenteredVertically_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_cuttlefish.png
M compose/material3/material3/outlined_textField_singleLine_withLabel_placeholderAlignedToTop_cuttlefish.png
M compose/material3/material3/outlinedCard_hover_cuttlefish.png
M compose/material/material/outlined_textField_multiLine_withLabel_textAlignedToTop_cuttlefish.png
M compose/material3/material3/button_light_theme_cuttlefish.png
M compose/material3/material3/outlined_textField_focused_errorState_cuttlefish.png
M compose/material/material/scaffold_topAndBottomAppBar_endFab_docked_ltr_cuttlefish.png
M compose/material3/material3/fab_extended_text_and_icon_cuttlefish.png
M compose/material3/material3/text_button_disabled_light_theme_cuttlefish.png
M compose/material/material/scaffold_topAppBar_cuttlefish.png
ap...@google.com <ap...@google.com> #62
Branch: androidx-main
commit 85fc924b492636402c5e210641dc69262f89ec32
Author: Siyamed Sinir <siyamed@google.com>
Date: Sat Apr 09 00:50:46 2022
Default includeFontPadding=true
This CL changes the default includeFontPadding back to true.
Previously, for an alpha release we turned it off in aosp/1992050.
This would break some users when switching to the beta/final release.
Moreover, keeping it experimental and optional for now will enable us
to spend a little more time on clipping, line height, text field
related improvements including defining the default line height
behavior with the functionalities in aosp/2058653.
RelNote: "Turned on default includeFontPadding. It is possible to
turn off the includeFontPadding using TextStyle.platformTextStyle
attribute. In the near future we will change the default behavior
however until that time this allows us to better integrate line height
improvements (aosp/2058653) and solve TextField clipping issues."
Test: ./gradlew text:text:test
Test: ./gradlew text:text:cAT
Test: ./gradlew compose:ui:ui-text:test
Test: ./gradlew compose:ui:ui-text:cAT
Bug: 171394808
Change-Id: I01423d9a0042a1f3e462236e1fdadb60a20678fc
M compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/AndroidTextStyle.android.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphFillBoundingBoxesTest.kt
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/selection/TextSelectionColorsScreenshotTest.kt
M compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/ParagraphIntegrationTest.kt
si...@google.com <si...@google.com> #63
An update on includeFontPadding
- The default value for Compose 1.2 beta and later 1.2 is now the old state which is includeFontPadding=true
- It is still possible to opt-in and turn it off via
TextStyle( platformStyle = PlatformTextStyle( includeFontPadding = false ) )
co...@protonmail.com <co...@protonmail.com> #64
@Si...@google.com
Any harm in defaulting to includeFontPadding = false in all of my projects? Seems like it was the default, but got switched and was wondering why the decision to not have includeFontPadding = false by default.
si...@google.com <si...@google.com> #65
Any harm in defaulting to includeFontPadding = false in all of my projects?
No, as far as we know there is not.
Please check
Seems like it was the default, but got switched and was wondering why the decision to not have includeFontPadding = false by default.
It was changed to provide opt-in option for the community, and not change their layout (even if it is a small change) without them opting in for Compose 1.2 Beta. We are currently planning to turn it back off as default as described in RelNote
section in
RelNote: "Turned on default includeFontPadding. It is possible to
turn off the includeFontPadding using TextStyle.platformTextStyle
attribute. In the near future we will change the default behavior
however until that time this allows us to better integrate line height
improvements (aosp/2058653) and solve TextField clipping issues."
co...@protonmail.com <co...@protonmail.com> #66
Awesome. If it will be turned off by default again then I will just wait for that. Thanks! Looking forward to easier translations from figma to compose =)
ma...@gmail.com <ma...@gmail.com> #67
so...@gmail.com <so...@gmail.com> #68
ke...@gmail.com <ke...@gmail.com> #69
Any updates? the issue is marked as Fixed
for some reason
Description
With traditional views, you can specify in XML on your TextView whether or not you want to include font padding using
android:includeFontPadding="false"
.It would be nice if Compose provided a means of doing this (because otherwise it makes it difficult to migrate traditional views over to Compose w/o it looking visually different).