Fixed
Status Update
Comments
al...@google.com <al...@google.com>
ju...@google.com <ju...@google.com>
ew...@amazon.com <ew...@amazon.com> #2
Or when changing to textView.textMetricsParamsCompat still crash.
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
ar...@google.com <ar...@google.com>
ap...@google.com <ap...@google.com> #3
add this line :
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
ar...@google.com <ar...@google.com> #4
Thanks, #3. It worked.
But I think it is better when set before this line
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
Set android:layoutDirection="locale" or android:layoutDirection="inherit" for AppCompatTextView in the XML layout didn't this problem.
The new method btw re-set layoutDirector. Weird! This should handle in the AppcompatTextView.
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
textView.layoutDirection = textView.layoutDirection
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
But I think it is better when set before this line
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
Set android:layoutDirection="locale" or android:layoutDirection="inherit" for AppCompatTextView in the XML layout didn't this problem.
The new method btw re-set layoutDirector. Weird! This should handle in the AppcompatTextView.
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
textView.layoutDirection = textView.layoutDirection
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
Description
Version used: 1.7.0, 1.8.0-alpha02
Devices/Android versions reproduced on: Google Pixel 4a on Android 12
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue. n/a
- A screenrecord or screenshots showing the issue (if UI related). n/a
NotificationCompat.BigPictureStyle doesn't support setting a big picture by using an icon, which was added to the platform's BigPictureStyle in API 31 (
showBigPictureWhenCollapsed and setContentDescription, the other two new additions in API 31, are supported in the latest version of androidx.core:core.
Are you planning to support bigPicture(icon) in NotificationCompat.BigPictureStyle and can you share when it is expected to become available, or won't this be feasible to support? I understand that animated images will only work on API 31, but it would be helpful to be able to use it on that API level, right now it isn't possible to use it when building with NotificationCompat at all.