Status Update
Comments
nj...@google.com <nj...@google.com>
si...@google.com <si...@google.com>
si...@google.com <si...@google.com> #2
1. Have you saw crash in real device or only in simulators?
2. Do you use dynamic feature for language ID?
si...@google.com <si...@google.com> #3
Tested on Android 12 Emulator with custom executor, but cannot repro this issue.
si...@google.com <si...@google.com> #4
-
Second crash in the description is from a real device. Experienced it myself on two different Xiaomi phones, plus lots of crashes from users in the Google Play console.
-
Dynamic features are not used in the application.
As a wild guess, I have downgraded build tools from 31.0.0 to 30.0.3, compileSdk from 31 to 30, and moved all work with Language ID to the service in a separate process (just to be sure that crash can kill secondary process instead of main). This combination is in beta for 2 days by now and I don't see any SIGSEGV crashes.
pa...@gmail.com <pa...@gmail.com> #5
Hmm, I feel the crash might be something related to separate/secondary process.
I also changed compileSdk and targetSDK to 31 but still cannot repro this issue.
1s...@gmail.com <1s...@gmail.com> #6
On the contrary, there was no separate process before, when crashes started.
In the new build (with the aforementioned changes) I can see SIGSEGV crash, but only one instead of dozens and it has a bit different backtrace:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
liblanguage_id_jni.so (offset 0x11e000)
backtrace:
#00 pc 000000000003c7c0 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003b960 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bb48 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 000000000003bafc /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000036c98 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000032714 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000031cac /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/split_config.arm64_v8a.apk!lib/arm64-v8a/liblanguage_id_jni.so (offset 0x11e000)
#00 pc 0000000000057438 /data/app/azagroup.reedy-mF7zTu2bv_ELlbFArwNgqA==/oat/arm64/base.odex (offset 0x57000)
co...@protonmail.com <co...@protonmail.com> #7
FYI, ML Kit launched a new language ID SDK in the latest release, which uses a new language ID model.
Could you try the new SDK version(17.0.0) to check if you can still repro this native crash? Thanks!
al...@gmail.com <al...@gmail.com> #8
Thank you, I'll try it and check.
ma...@gmail.com <ma...@gmail.com> #9
Hello. I have similar experience.
- I'm using mlkit-language 16.1.1
- I didnot meet this error until using AGP 4.2
- I can get this error since using AGP 7.0
- This error raised on Release build only(minimized by R8)
- This error raised without obfuscation.
to...@gmail.com <to...@gmail.com> #11
I created reproducible project.
$ git clone https://github.com/ganadist/VersionCodeDemo -b mlkit_agp7 mlkit_agp7
$ cd mlkit_agp7
$ ./gradlew :app:pPRUA
$ adb install app/build/outputs/universal_apk/productionRelease/app-production-release-universal.apk
$ adb shell am start -n com.example.myapplication/.MainActivity
$ adb logcat -b crash -d
10-19 19:41:49.844 17810 17810 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf9d733c in tid 17810 (e.myapplication), pid 17810 (e.myapplication)
10-19 19:41:50.473 17849 17849 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-19 19:41:50.473 17849 17849 F DEBUG : Build fingerprint: 'google/crosshatch/crosshatch:12/SPB5.210812.002/7671067:user/release-keys'
10-19 19:41:50.473 17849 17849 F DEBUG : Revision: 'MP1.0'
10-19 19:41:50.473 17849 17849 F DEBUG : ABI: 'arm64'
10-19 19:41:50.473 17849 17849 F DEBUG : Timestamp: 2021-10-19 19:41:49.903736988+0900
10-19 19:41:50.473 17849 17849 F DEBUG : Process uptime: 0s
10-19 19:41:50.473 17849 17849 F DEBUG : Cmdline: com.example.myapplication
10-19 19:41:50.474 17849 17849 F DEBUG : pid: 17810, tid: 17810, name: e.myapplication >>> com.example.myapplication <<<
10-19 19:41:50.474 17849 17849 F DEBUG : uid: 10240
10-19 19:41:50.474 17849 17849 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf9d733c
10-19 19:41:50.474 17849 17849 F DEBUG : x0 0000000000000000 x1 00000000000008fc x2 0000007a76760c71 x3 0000000000000000
10-19 19:41:50.474 17849 17849 F DEBUG : x4 0000000000000010 x5 0000007ba4db49d0 x6 0000007b34dc3680 x7 3de38e3900000608
10-19 19:41:50.474 17849 17849 F DEBUG : x8 0000007bb4dbedf0 x9 0000007acf9db2aa x10 0000000000000000 x11 0000007acf9d6640
10-19 19:41:50.474 17849 17849 F DEBUG : x12 0000000000000009 x13 0000000000000000 x14 0000000000000061 x15 00000000ebad6a89
10-19 19:41:50.474 17849 17849 F DEBUG : x16 0000007a767cfef8 x17 0000007d9a564b40 x18 0000007da3830000 x19 0000007feaf56a08
10-19 19:41:50.474 17849 17849 F DEBUG : x20 0000000000000000 x21 0000007ba4da50b0 x22 0000007bb4dbedf0 x23 0000007ba4da50b8
10-19 19:41:50.474 17849 17849 F DEBUG : x24 0000000000000009 x25 000000000000067e x26 0000000000000012 x27 0000000000000008
10-19 19:41:50.474 17849 17849 F DEBUG : x28 0000007b64dc8440 x29 0000000000000000
10-19 19:41:50.474 17849 17849 F DEBUG : lr 0000007a7678a964 sp 0000007feaf56810 pc 0000007a7678b7c0 pst 0000000060000000
10-19 19:41:50.474 17849 17849 F DEBUG : backtrace:
10-19 19:41:50.474 17849 17849 F DEBUG : #00 pc 000000000003c7c0 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #01 pc 000000000003b960 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #02 pc 000000000003bb48 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #03 pc 000000000003bafc /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #04 pc 0000000000036c98 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #05 pc 00000000000324a4 /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
10-19 19:41:50.474 17849 17849 F DEBUG : #06 pc 0000000000031b5c /data/app/~~mHaMq-e9ocbm9UfYnkCGkQ==/com.example.myapplication-HgG9vkluwDDO1K78-Vzr0A==/lib/arm64/liblanguage_id_jni.so (Java_com_google_mlkit_nl_languageid_internal_LanguageIdentificationJni_nativeIdentifyLanguage+100) (BuildId: 859ec0ec2000a39e6ae8ed42e1704f46)
But after downgrade to AGP 4.2, crash is not reproducible.
$ git clone https://github.com/ganadist/VersionCodeDemo -b mlkit_agp42 mlkit_agp42
$ cd mlkit_agp42
$ ./gradlew :app:pPRUA
$ adb install app/build/outputs/universal_apk/productionRelease/app-production-release-universal.apk
$ adb shell am start -n com.example.myapplication/.MainActivity
Also, I tried to disable
$ git clone https://github.com/ganadist/VersionCodeDemo -b mlkit_agp7_r8_disable_inline_optimizer mlkit_agp7_r8
$ cd mlkit_agp7_r8
$ ./gradlew :app:pPRUA
$ adb install app/build/outputs/universal_apk/productionRelease/app-production-release-universal.apk
$ adb shell am start -n com.example.myapplication/.MainActivity
ci...@gmail.com <ci...@gmail.com> #12
I tried the repro steps but got a NPE when I run ./gradlew :app:pPRUA
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.NullPointerException
> java.lang.NullPointerException (no error message)
Could you also check if this is reproducible on 17.0.0
or 17.0.1
? If yes, could you attach the full log that I can take a look? Thanks!
[Deleted User] <[Deleted User]> #13
Here are gradle build scan logs for each branches.
All builds were clean build, and disabled build cache.
- mlkit_agp7 :
https://scans.gradle.com/s/qrymdqfzwokbq - mlkit_agp42 :
https://scans.gradle.com/s/b6644hzfyfhaw - mlkit_agp7_r8_disable_inline_optimizer :
https://scans.gradle.com/s/c6h5hy2nxod4u
Also, I pushed to update MLKit Language Id version 17.0.1 on
And here is crash log after apply 17.0.1
You can see that BuildId
of liblanguage_id_l2c_jni.so
was changed from 859ec0ec2000a39e6ae8ed42e1704f46
to be6e59455cc10135330c93acdebfc121
10-20 03:07:24.522 24587 24628 F libc : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf995426 in tid 24628 (pool-3-thread-3), pid 24587 (e.myapplication)
10-20 03:07:25.190 24710 24710 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-20 03:07:25.190 24710 24710 F DEBUG : Build fingerprint: 'google/crosshatch/crosshatch:12/SPB5.210812.002/7671067:user/release-keys'
10-20 03:07:25.190 24710 24710 F DEBUG : Revision: 'MP1.0'
10-20 03:07:25.190 24710 24710 F DEBUG : ABI: 'arm64'
10-20 03:07:25.190 24710 24710 F DEBUG : Timestamp: 2021-10-20 03:07:24.583346246+0900
10-20 03:07:25.190 24710 24710 F DEBUG : Process uptime: 0s
10-20 03:07:25.190 24710 24710 F DEBUG : Cmdline: com.example.myapplication
10-20 03:07:25.190 24710 24710 F DEBUG : pid: 24587, tid: 24628, name: pool-3-thread-3 >>> com.example.myapplication <<<
10-20 03:07:25.190 24710 24710 F DEBUG : uid: 10240
10-20 03:07:25.190 24710 24710 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7acf995426
10-20 03:07:25.190 24710 24710 F DEBUG : x0 0000007b54da9d30 x1 0000007d9a5fe7cc x2 0000000000000000 x3 0000000000000010
10-20 03:07:25.190 24710 24710 F DEBUG : x4 0000000000000000 x5 0000007c34dbc79c x6 0000002f0000083b x7 000003c300002dd5
10-20 03:07:25.190 24710 24710 F DEBUG : x8 0000000000000001 x9 0000000000000004 x10 0000000000000010 x11 0000000000000000
10-20 03:07:25.190 24710 24710 F DEBUG : x12 0000000000000000 x13 000000000000217e x14 0000007acf9932a8 x15 000000000000217e
10-20 03:07:25.190 24710 24710 F DEBUG : x16 0000000000000000 x17 0000007d9a564c78 x18 0000007a6ef18000 x19 0000007c34dbc580
10-20 03:07:25.190 24710 24710 F DEBUG : x20 0000007ca4dc7170 x21 0000007ca4dc7800 x22 0000007ca4dc71e0 x23 0000000000000000
10-20 03:07:25.190 24710 24710 F DEBUG : x24 0000000000000018 x25 0000000000000007 x26 0000000000000006 x27 0000000000000004
10-20 03:07:25.190 24710 24710 F DEBUG : x28 0000007ca4dc7090 x29 0000007cb4da9940
10-20 03:07:25.190 24710 24710 F DEBUG : lr 0000007a770a9624 sp 0000007a6f7de9c0 pc 0000007a770a96a8 pst 0000000020000000
10-20 03:07:25.190 24710 24710 F DEBUG : backtrace:
10-20 03:07:25.190 24710 24710 F DEBUG : #00 pc 00000000000386a8 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #01 pc 00000000000388a0 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #02 pc 00000000000844a0 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #03 pc 000000000008783c /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #04 pc 0000000000035fc4 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #05 pc 0000000000034954 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.190 24710 24710 F DEBUG : #06 pc 00000000000340e8 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/lib/arm64/liblanguage_id_l2c_jni.so (Java_com_google_mlkit_nl_languageid_internal_ThickLanguageIdentifier_nativeIdentifyPossibleLanguages+108) (BuildId: be6e59455cc10135330c93acdebfc121)
10-20 03:07:25.191 24710 24710 F DEBUG : #07 pc 00000000002d9a44 /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #08 pc 000000000020a700 /apex/com.android.art/lib64/libart.so (nterp_helper+5648) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #09 pc 00000000000cd0dc /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #10 pc 000000000020a044 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #11 pc 00000000000ccfa8 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #12 pc 0000000000557cb4 /system/framework/arm64/boot-framework.oat (android.os.Binder.transact+148) (BuildId: 43a571a0ad85d6451b47016336a541ecb0eb12bb)
10-20 03:07:25.191 24710 24710 F DEBUG : #13 pc 000000000020b53c /apex/com.android.art/lib64/libart.so (nterp_helper+9292) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #14 pc 00000000000b7aba /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #15 pc 000000000020a044 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #16 pc 00000000000a7496 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #17 pc 000000000020a044 /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #18 pc 00000000000a7360 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #19 pc 000000000020ae64 /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #20 pc 000000000009e46c /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #21 pc 000000000020ae64 /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #22 pc 00000000000d33d6 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #23 pc 000000000020ae64 /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #24 pc 000000000009df0a /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #25 pc 0000000000209124 /apex/com.android.art/lib64/libart.so (nterp_helper+52) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #26 pc 000000000009e350 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #27 pc 000000000037b9ac /apex/com.android.art/javalib/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor.runWorker+988) (BuildId: ab2bf4ec264efdb6c452a238be38fe624de826b8)
10-20 03:07:25.191 24710 24710 F DEBUG : #28 pc 00000000003751d4 /apex/com.android.art/javalib/arm64/boot.oat (java.util.concurrent.ThreadPoolExecutor$Worker.run+68) (BuildId: ab2bf4ec264efdb6c452a238be38fe624de826b8)
10-20 03:07:25.191 24710 24710 F DEBUG : #29 pc 000000000020aec4 /apex/com.android.art/lib64/libart.so (nterp_helper+7636) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #30 pc 000000000009e370 /data/app/~~KjjULZV48O7KSOgOP1wYNQ==/com.example.myapplication-vFUidUPTjaGg4oo3SRAYJw==/oat/arm64/base.vdex
10-20 03:07:25.191 24710 24710 F DEBUG : #31 pc 00000000001bf35c /apex/com.android.art/javalib/arm64/boot.oat (java.lang.Thread.run+76) (BuildId: ab2bf4ec264efdb6c452a238be38fe624de826b8)
10-20 03:07:25.191 24710 24710 F DEBUG : #32 pc 00000000002d0164 /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #33 pc 000000000031ccac /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+156) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #34 pc 00000000003cf8a0 /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+380) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #35 pc 0000000000460894 /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+992) (BuildId: cdecb8dde1264c9871695c29854aa3b1)
10-20 03:07:25.191 24710 24710 F DEBUG : #36 pc 00000000000b1910 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: ba489d4985c0cf173209da67405662f9)
10-20 03:07:25.191 24710 24710 F DEBUG : #37 pc 00000000000513f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: ba489d4985c0cf173209da67405662f9)
dj...@gmail.com <dj...@gmail.com> #14
Cross-posted on R8 issue tracker.
[Deleted User] <[Deleted User]> #15
kr...@gmail.com <kr...@gmail.com> #16
Added workarounds in
i....@getorca.app <i....@getorca.app> #17
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).