Status Update
Comments
al...@google.com <al...@google.com>
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #2
The issue is reproducible with core-ktx 1.2.0 and 1.3.0-rc01.
al...@google.com <al...@google.com>
ap...@google.com <ap...@google.com> #3
The Typeface.weight is not a weight of the underlying font file. It is a display style. On older APIs, the display style is adjusted if the Typeface is created from single font. However, after moving to CustomFallbackBuilder, that adjustment is removed since it can crate Typeface from multiple style font files.
Looks like it is good to set display style by ResourcesCompat.getFont for backward compatibility.
al...@google.com <al...@google.com> #4
Hi Nona,
Can you please schedule a release after you merge the fix?
al...@google.com <al...@google.com> #5
Branch: androidx-master-dev
commit 3d6aa2e9b3243dcc4de1f54bd8d40339bd69cb05
Author: Seigo Nonaka <nona@google.com>
Date: Wed May 27 17:38:05 2020
Adjust the Typeface display style with the style of given font
This behavir is implicitly done by Typeface.Builder and
Typeface.createXXX function but not to be done by
Typeface.CustomFallbackBuilder since it is designed to be working
with multiple font files which has different style.
Looks like the style argument is ignored on older API implementation.
Bug: 156853883
Bug: 152023266
Test: ResourcesCompatTest#testGetFont_adjustDisplayStyle passes on 29
Test: ./gradlew core:core:connectedAndroidTest on API 29, 28, 23
Change-Id: I3a377c339a7aed50973cf11df86ddf0069f4ec25
A core/core/src/androidTest/assets/fonts/thin_italic.ttf
A core/core/src/androidTest/assets/fonts/thin_italic.ttx
M core/core/src/androidTest/java/androidx/core/content/res/ResourcesCompatTest.java
A core/core/src/androidTest/res/font/thin_italic.ttf
M core/core/src/main/java/androidx/core/graphics/TypefaceCompatApi29Impl.java
se...@google.com <se...@google.com> #6
as...@google.com <as...@google.com> #7
Any way I can tell what version this will land in?
al...@google.com <al...@google.com>
bu...@google.com <bu...@google.com>
al...@google.com <al...@google.com> #9
Great—works as expected, thanks!
bu...@google.com <bu...@google.com> #10
Bugjuggler:
bu...@google.com <bu...@google.com>
al...@google.com <al...@google.com> #11
Core moved to beta
, so now we need to wait a few weeks until it moves back to alpha
and we can make API changes again.
Bugjuggler: wait until 2024-03-15
bu...@google.com <bu...@google.com> #12
bu...@google.com <bu...@google.com>
al...@google.com <al...@google.com>
ap...@google.com <ap...@google.com> #13
Branch: androidx-main
commit 7b0e5e3b9e416fbd201fbee4fd9ba1667912b130
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:10:04 2024
Move androidx.core:core back to alpha for API changes
Bug: 313834577
Test: ./gradlew :core:core:checkApi
Change-Id: I9974f318bd30daee4baa216485e22a7edf7be7d8
Merged-In: I6236caf2327095763ea82b3661dd1d64c5f91c94
M libraryversions.toml
al...@google.com <al...@google.com> #14
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit 6604eaf83fbfe432168c242c69fb4d709c8a1283
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:11:11 2024
Apply auto-fixes from ObsoleteCompatMethod in androidx.core:core
Bumps annotation dependency to latest for @ReplaceWith.
Relnote: Deprecated obsolete compat methods
Bug: 313834577
Test: ./gradlew :core:core:checkApi
Change-Id: I01d9076d4ef7b12614b233f8b0b3e147e97b8221
M activity/integration-tests/testapp/build.gradle
M appcompat/integration-tests/receive-content-testapp/build.gradle
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/build.gradle
M core/core/src/main/java/androidx/core/accessibilityservice/AccessibilityServiceInfoCompat.java
M core/core/src/main/java/androidx/core/app/ActivityManagerCompat.java
M core/core/src/main/java/androidx/core/app/AlarmManagerCompat.java
M core/core/src/main/java/androidx/core/app/BundleCompat.java
M core/core/src/main/java/androidx/core/app/NavUtils.java
M core/core/src/main/java/androidx/core/app/NotificationCompat.java
M core/core/src/main/java/androidx/core/content/ContextCompat.java
M core/core/src/main/java/androidx/core/graphics/BitmapCompat.java
M core/core/src/main/java/androidx/core/graphics/drawable/DrawableCompat.java
M core/core/src/main/java/androidx/core/location/LocationCompat.java
M core/core/src/main/java/androidx/core/net/ConnectivityManagerCompat.java
M core/core/src/main/java/androidx/core/os/BundleCompat.java
M core/core/src/main/java/androidx/core/os/ParcelCompat.java
M core/core/src/main/java/androidx/core/view/MarginLayoutParamsCompat.java
M core/core/src/main/java/androidx/core/view/MenuCompat.java
M core/core/src/main/java/androidx/core/view/MotionEventCompat.java
M core/core/src/main/java/androidx/core/view/ScaleGestureDetectorCompat.java
M core/core/src/main/java/androidx/core/view/VelocityTrackerCompat.java
M core/core/src/main/java/androidx/core/view/ViewCompat.java
M core/core/src/main/java/androidx/core/view/ViewConfigurationCompat.java
M core/core/src/main/java/androidx/core/view/ViewGroupCompat.java
M core/core/src/main/java/androidx/core/view/ViewParentCompat.java
M core/core/src/main/java/androidx/core/view/accessibility/AccessibilityEventCompat.java
M core/core/src/main/java/androidx/core/view/accessibility/AccessibilityRecordCompat.java
M core/core/src/main/java/androidx/core/widget/CheckedTextViewCompat.java
M core/core/src/main/java/androidx/core/widget/ListPopupWindowCompat.java
M core/core/src/main/java/androidx/core/widget/ListViewCompat.java
M core/core/src/main/java/androidx/core/widget/PopupWindowCompat.java
ap...@google.com <ap...@google.com> #16
Branch: androidx-main
commit ee226e3f129903a29954c39dd49e49ae1f42e320
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:30:49 2024
Apply auto-fix for problematic instances of ObsoleteCompatMethod
These didn't apply cleanly and needed some manual work.
Relnote: Deprecate additional obsolete compat methods
Bug: 313834577
Test: ./gradlew :core:core:checkApi :media:media:checkApi
Change-Id: Ie44708f1423037d74b64aadb7418182a6a1dc089
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/view/MenuItemCompat.java
M core/core/src/main/java/androidx/core/view/accessibility/AccessibilityManagerCompat.java
M core/core/src/main/java/androidx/core/widget/TextViewCompat.java
ap...@google.com <ap...@google.com> #17
Branch: androidx-main
commit 90f97d778b1f3f5e3b0664e0e5df1786f0373c3c
Author: Alan Viverette <alanv@google.com>
Date: Tue Mar 26 16:23:11 2024
Fix ObsoleteCompatDetector auto-fix to remove line breaks
Bug: 313834577
Test: ObsoleteCompatDetectorTest
Change-Id: I1530004a57c019682da7a38a54cadb225753c5fb
A lint-checks/integration-tests/src/main/java/androidx/ObsoleteCompatMethodMissingMultiLineReplaceWith.java
M lint-checks/src/main/java/androidx/build/lint/ObsoleteCompatDetector.kt
M lint-checks/src/test/java/androidx/build/lint/ObsoleteCompatDetectorTest.kt
al...@google.com <al...@google.com> #18
We still have some constants that warrant deprecation and a handful of methods outside of core
, but I think this is sufficient for now.
ub...@gmail.com <ub...@gmail.com> #19
I see that LocationCompat.isMock
was deprecated as part of this effort. This looks like a mistake: Location.isMockProvider
was added in API 18, but deprecated in API 31, at which point Location.isMock
was added. So there remains a need for this compatibility method.
I hope you can revert this one as part of this issue without requiring a separate issue for every single thing that may have gone wrong.
au...@google.com <au...@google.com>
al...@google.com <al...@google.com> #20
LocationCompat.isMock()
calls directly through to the deprecated Location.isFromMockProvider()
regardless of SDK level, which was a bad implementation to begin with.
al...@google.com <al...@google.com>
ap...@google.com <ap...@google.com> #21
Branch: androidx-main
commit 3b9df12d74b961741050fe589aae8003532ec248
Author: Alan Viverette <alanv@google.com>
Date: Wed Jun 12 17:01:10 2024
Undeprecate LocationCompat.isMock, fix delegation on API 31+
Relnote: """Reverts deprecation of LocationCompat.isMock and delegates
to the platform API on API level 31 and above."""
Fixes: 313834577
Test: LocationCompatTest
Change-Id: I559407ae8f2cce149cd2802322485f1b80cb85c9
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/location/LocationCompat.java
ub...@gmail.com <ub...@gmail.com> #22
Thanks for the fix! I just noticed another one:
ParcelCompat.writeBoolean was deprecated with instructions to use Parcel.writeInt directly with a value of 0 or 1. This does not make sense. The point of ParcelCompat.writeBoolean was to complement Parcel.writeBoolean, which was introduced in API 29. Doesn't make sense to take it away now.
al...@google.com <al...@google.com>
ub...@gmail.com <ub...@gmail.com> #23
Just a general thought: it might make sense to review these deprecations systematically. I'm guessing there are quite a few more problems lurking, as I only use a small slice of the affected APIs.
al...@google.com <al...@google.com> #24
Likely, but I don't think we would have caught either of these during manual review. They were technically correct since the implementations were single-line and inlineable, so applying the replacement would still have the same runtime behavior (and bytecode if running an optimizer).
We'd need to go back through and audit methods that were originally written without a proper SDK_INT
check.
ap...@google.com <ap...@google.com> #25
Branch: androidx-main
commit 2d316160b6048996e91929c28ec33d91603900bb
Author: Alan Viverette <alanv@google.com>
Date: Thu Jun 13 14:10:24 2024
Undeprecate ParcelCompat.writeBoolean, fix delegation on API 29+
Relnote: """Reverts deprecation of ParcelCompat.writeBoolean and delegates
to the platform API on API level 29 and above."""
Bug: 313834577
Test: ParcelCompatTest
Change-Id: I9d2436d90f3cbe3bf22e2a3c97171f39b53cf040
M core/core/api/current.txt
M core/core/api/restricted_current.txt
M core/core/src/main/java/androidx/core/os/ParcelCompat.java
al...@google.com <al...@google.com> #26
Closing this out. There may still be one-offs, but let's use new bug reports for those.
Description
```
public static int getWindowSystemUiVisibility(@NonNull View view) {
return view.getWindowSystemUiVisibility();
}
```
These methods should be deprecated.