material-components-android icon indicating copy to clipboard operation
material-components-android copied to clipboard

[Internal] Stop using deprecated androidx.core.view.* methods

Open pubiqq opened this issue 11 months ago • 4 comments

The PR replaces deprecated classes and methods from androidx.core.view.* packages with the recommended ones.

Among them:

  • ViewCompat.LAYOUT_DIRECTION_RTL -> View.LAYOUT_DIRECTION_RTL
  • ViewCompat.getLayoutDirection(view) -> view.getLayoutDirection()
  • ViewCompat.setBackground(view, background) -> view.setBackground(background)
  • ViewCompat.setFitsSystemWindows(view, true) -> view.setFitsSystemWindows(true)
  • AccessibilityEventCompat.TYPE_WINDOW_CONTENT_CHANGED -> AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
  • MarginLayoutParamsCompat class -> ViewGroup.MarginLayoutParams class

and so on.

pubiqq avatar Mar 26 '24 21:03 pubiqq

@pubiqq can you add more context in your descriptions? It helps with the reviews, thanks!

paulfthomas avatar Apr 11 '24 15:04 paulfthomas

Done.

pubiqq avatar Apr 11 '24 18:04 pubiqq

I see 2 files added on my end when trying to sync to our internal repo:

  • third_party/java_src/android_libs/material_components/lib/java/com/google/android/material/transition/platform/MaterialContainerTransform.java
  • third_party/java_src/android_libs/material_components/lib/java/com/google/android/material/transition/platform/SlideDistanceProvider.java

These files do exist already under third_party/java_src/android_libs/material_components/lib/java/com/google/android/material/transition

Can you take a look?

paulfthomas avatar Apr 24 '24 15:04 paulfthomas

Ok, I've removed the changes from the auto-generated classes, but unfortunately I have no way to check if they're generated correctly because I don't have access to your build system, so you'll have to check it yourself.

pubiqq avatar Apr 24 '24 15:04 pubiqq