Status Update
Comments
al...@google.com <al...@google.com>
ju...@google.com <ju...@google.com>
4b...@gmail.com <4b...@gmail.com> #2
private fun setAsyncText(textView: AppCompatTextView, text: String?) {
if (!text.isNullOrEmpty()) {
val textFuture = PrecomputedTextCompat.getTextFuture(text!!, textView.textMetricsParamsCompat, null)
textView.setTextFuture(textFuture) //Crash
}
}
el...@gmail.com <el...@gmail.com> #3
textView.setLayoutDirection(ViewCompat.getLayoutDirection(textView));
before :
setTextFuture(....)
je...@google.com <je...@google.com> #4
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
}
}
el...@gmail.com <el...@gmail.com> #5
minSdk 21
targetSdk 28
Thanks #3 again.
el...@gmail.com <el...@gmail.com> #6
TextViewCompat.java:889
if (!param.equals(precomputed.getParams())) {
throw new IllegalArgumentException("Given text can not be applied to TextView.");
}
PrecomputedTextCompat.class:334
with : this.mTextDir != other.getTextDirection() == true
So,
TextDirection on TextView and TextDirection on Param is difference
maybe, it handled wrong or missing conditional on getTextDirectionHeuristic of TextViewCompat
el...@gmail.com <el...@gmail.com> #7
el...@gmail.com <el...@gmail.com> #8
But I think you should handle it in the AppcompatTextView. It is better. If a developer forgets testing with RTL. I think this is the nightmare(it is difficult to determine the bug) when they update their app on the Play Store.
I read this article, in the part databing he noted about set the direction
fun asyncText
..........
// first, set all measurement affecting properties of the text
// (size, locale, typeface, direction, etc)
But in the offical document isn't good (lack direction)
Anything layout related property changes, text size, typeface, letter spacing, etc after this method call will causes IllegalArgumentException during View measurement.
My view: Handling this in the AppcompatTextView is the best choice if you can do it.
Thanks!
be...@gmail.com <be...@gmail.com> #9
gr...@gmail.com <gr...@gmail.com> #10
el...@gmail.com <el...@gmail.com> #11
el...@gmail.com <el...@gmail.com> #12
Description shared by an external reporter:
================================
1.
Version used: androidx.appcompat:appcompat:1.1.0-alpha1
AppCompatTextView.setTextFuture
i found
2.
Non-fatal Exception: java.lang.IllegalArgumentException: Given text can not be applied to TextView.
at androidx.core.widget.TextViewCompat.retrieveField(Unknown Source:22)
at androidx.appcompat.widget.AppCompatTextView.consumeTextFutureAndSetBlocking(Unknown Source:15)
at androidx.appcompat.widget.AppCompatTextView.onMeasure(Unknown Source)
at com.bilibili.magicasakura.widgets.AppCompatTintTextView.onMeasure(Unknown Source)
at android.view.View.measure(View.java:22145)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1514)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:806)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:685)
at android.view.View.measure(View.java:22145)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
at androidx.cardview.widget.CardView.onMeasure(Unknown Source:80)
at android.view.View.measure(View.java:22145)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.measureChildWithMargins(Unknown Source:98)
at androidx.recyclerview.widget.LinearLayoutManager.generateDefaultLayoutParams(Unknown Source:60)
at androidx.recyclerview.widget.LinearLayoutManager.generateDefaultLayoutParams(Unknown Source:44)
at androidx.recyclerview.widget.LinearLayoutManager.findViewByPosition(Unknown Source:36)
at androidx.recyclerview.widget.LinearLayoutManager.setOrientation(Unknown Source:6)
at androidx.recyclerview.widget.RecyclerView.exceptionLabel(Unknown Source:39)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(Unknown Source:91)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:979)
at android.view.Choreographer.doCallbacks(Choreographer.java:791)
at android.view.Choreographer.doFrame(Choreographer.java:723)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:965)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6707)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:108)
device: meizu, Android 7 and 8
And you can see fabric detail
===========================================
Requesting team for initial inputs. Please let us know if this can be handled as a part of this bug else we will create a separate bug for this.
ju...@google.com <ju...@google.com>
el...@gmail.com <el...@gmail.com> #13
el...@gmail.com <el...@gmail.com> #14
Monthly ping...
el...@gmail.com <el...@gmail.com> #15
jd...@xooloo.com <jd...@xooloo.com> #16
Hello guys, this Style is now required on Android 13 to get Notification Permission exemption for VoIP Apps.
If you want dev to adopt Android 13 API, you should really consider including it in AndroidX.
Having such important feature ignored for months, is a strong signal that adopting Android 13 API should be delayed for any serious developer.
ag...@snappler.com <ag...@snappler.com> #17
ar...@google.com <ar...@google.com>
ko...@gmail.com <ko...@gmail.com> #18
el...@gmail.com <el...@gmail.com> #19
kw...@visualtouchpos.com <kw...@visualtouchpos.com> #20
ar...@gmail.com <ar...@gmail.com> #21
ar...@gmail.com <ar...@gmail.com> #22
ap...@google.com <ap...@google.com> #23
Branch: androidx-main
commit 5916349f37585425a855d0b13259009d1843d28c
Author: Alexander Roederer <aroederer@google.com>
Date: Wed Aug 10 14:44:51 2022
Adds CallStyle to NotificationCompat
Adds CallStyle to NotificationCompat. Adds support for use of
Notification.CallStyle in API version 31 and higher, and creates an
unstyled notification that mimics the look of CallStyle in versions
lower than 31. Also adds testing to cover these cases.
Test: Added unit test coverage for all new class uses
Bug: 199294989
Change-Id: Id9a5321ab9172a004215c85aa2e6d7165a01e074
Relnote: Adds Callstyle to NotificationCompat
M core/core/api/current.txt
M core/core/api/public_plus_experimental_current.txt
M core/core/api/restricted_current.txt
M core/core/src/androidTest/java/androidx/core/app/NotificationCompatTest.java
M core/core/src/main/java/androidx/core/app/NotificationCompat.java
A core/core/src/main/res/drawable/ic_call_answer.xml
A core/core/src/main/res/drawable/ic_call_answer_low.xml
A core/core/src/main/res/drawable/ic_call_answer_video.xml
A core/core/src/main/res/drawable/ic_call_answer_video_low.xml
A core/core/src/main/res/drawable/ic_call_decline.xml
A core/core/src/main/res/drawable/ic_call_decline_low.xml
M core/core/src/main/res/values/colors.xml
M core/core/src/main/res/values/strings.xml
ar...@google.com <ar...@google.com> #24
CallStyle is now available in NotificationCompat. Please note associated doc comments regarding the use of this style, namely that CallStyle Notifications need to be associated with a foreground service and for proper ranking on older versions, we encourage marking the Notification as colorized, using Builder#setColorized.
na...@google.com <na...@google.com> #25
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.core:core:1.10.0-alpha01
Description
Component used: androidx.core:core-ktx Version used: 1.7.0-alpha02 Devices/Android versions reproduced on: N/A
Hi,
Notification.CallStyle API has been announced for a while now, but there is still no mention of the CallStyle in the NotificationCompat API. Do you plan on adding it?
Best regards,