Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
@Siyamed Feel free to assign to me -- this ticket tracks the API work for image and other rich content insertion.
se...@google.com <se...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 7758f9f93eb72518a8625dca4d078b01df163e18
Author: Nikita Dubrovsky <dubrovsky@google.com>
Date: Fri Nov 13 15:47:10 2020
Move widget.RichContentReceiverCompat to view.OnReceiveContentListener
This change only updates/moves the existing API. A follow-on change will
update the API.
Relnote: Moved widget.RichContentReceiverCompat to view.OnReceiveContentListener.
Bug: 173814913
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.widget.TextViewOnReceiveContentListenerTest
Test: ./gradlew :appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatEditTextReceiveContentTest
Change-Id: Ifdab76f135e840a15430634a22e720947be4eecd
M appcompat/appcompat/api/current.txt
M appcompat/appcompat/api/public_plus_experimental_current.txt
M appcompat/appcompat/api/restricted_current.txt
M appcompat/appcompat/src/androidTest/AndroidManifest.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextReceiveContentActivity.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextReceiveContentTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_edittext_receive_content_activity.xml
M appcompat/appcompat/src/androidTest/res/values/strings.xml
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
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/lint-baseline.xml
M core/core/src/androidTest/AndroidManifest.xml
M core/core/src/androidTest/java/androidx/core/widget/ReceiveContentTestActivity.java
M core/core/src/androidTest/java/androidx/core/widget/TextViewOnReceiveContentListenerTest.java
M core/core/src/androidTest/res/layout/receive_content_activity.xml
M core/core/src/main/java/androidx/core/view/OnReceiveContentListener.java
M core/core/src/main/java/androidx/core/widget/TextViewOnReceiveContentListener.java
https://android-review.googlesource.com/1498950
Branch: androidx-master-dev
commit 7758f9f93eb72518a8625dca4d078b01df163e18
Author: Nikita Dubrovsky <dubrovsky@google.com>
Date: Fri Nov 13 15:47:10 2020
Move widget.RichContentReceiverCompat to view.OnReceiveContentListener
This change only updates/moves the existing API. A follow-on change will
update the API.
Relnote: Moved widget.RichContentReceiverCompat to view.OnReceiveContentListener.
Bug: 173814913
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.widget.TextViewOnReceiveContentListenerTest
Test: ./gradlew :appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatEditTextReceiveContentTest
Change-Id: Ifdab76f135e840a15430634a22e720947be4eecd
M appcompat/appcompat/api/current.txt
M appcompat/appcompat/api/public_plus_experimental_current.txt
M appcompat/appcompat/api/restricted_current.txt
M appcompat/appcompat/src/androidTest/AndroidManifest.xml
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextReceiveContentActivity.java
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextReceiveContentTest.java
M appcompat/appcompat/src/androidTest/res/layout/appcompat_edittext_receive_content_activity.xml
M appcompat/appcompat/src/androidTest/res/values/strings.xml
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
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/lint-baseline.xml
M core/core/src/androidTest/AndroidManifest.xml
M core/core/src/androidTest/java/androidx/core/widget/ReceiveContentTestActivity.java
M core/core/src/androidTest/java/androidx/core/widget/TextViewOnReceiveContentListenerTest.java
M core/core/src/androidTest/res/layout/receive_content_activity.xml
M core/core/src/main/java/androidx/core/view/OnReceiveContentListener.java
M core/core/src/main/java/androidx/core/widget/TextViewOnReceiveContentListener.java
se...@google.com <se...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c2c4ba5ad132860829c09b542b63d7d71e404d7f
Author: Nikita Dubrovsky <dubrovsky@google.com>
Date: Fri Nov 20 16:26:01 2020
Update OnReceiveContentListener API
Relnote: """Updated OnReceiveContentListener and related APIs:
* Updated OnReceiveContentListener so it can be set on any type of view
via ViewCompat.
* Removed getSupportedMimeTypes() from OnReceiveContentListener; now
MIME types are passed as an additional arg on the ViewCompat method
that sets the listener.
* Wrapped arguments to OnReceiveContentListener.onReceiveContent() in
an object.
* Added linkUri as a param to onReceiveContent() to ensure backwards
compatibility with the keyboard image API.
* Added a Bundle param to onReceiveContent() to ensure backwards
compatibility with the keyboard image API and to facilitate evolution
of the API in the future.
* Updated onReceiveContent() to return any content that was not
consumed, as a means to delegate to the default handling.
* Removed TextViewOnReceiveContentListener from the public API since
the default behavior can now be triggered by returning any unconsumed
content from the listener.
"""
Bug: 173814913
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.view.ContentInfoCompatTest
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.view.ViewCompatReceiveContentTest
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.widget.TextViewOnReceiveContentListenerTest
Test: ./gradlew :appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatEditTextReceiveContentTest
Change-Id: Ib4616cb0d0cd9f8537b64de6fcc19b80442dc3fb
M appcompat/appcompat/api/current.txt
M appcompat/appcompat/api/public_plus_experimental_current.txt
M appcompat/appcompat/api/restricted_current.txt
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextReceiveContentTest.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
M core/core/api/current.txt
M core/core/api/public_plus_experimental_current.txt
M core/core/api/restricted_current.txt
A core/core/src/androidTest/java/androidx/core/view/ContentInfoCompatTest.java
A core/core/src/androidTest/java/androidx/core/view/ViewCompatReceiveContentTest.java
M core/core/src/androidTest/java/androidx/core/widget/TextViewOnReceiveContentListenerTest.java
A core/core/src/main/java/androidx/core/view/ContentInfoCompat.java
M core/core/src/main/java/androidx/core/view/OnReceiveContentListener.java
A core/core/src/main/java/androidx/core/view/OnReceiveContentViewBehavior.java
M core/core/src/main/java/androidx/core/view/ViewCompat.java
M core/core/src/main/java/androidx/core/widget/TextViewOnReceiveContentListener.java
M core/core/src/main/res/values/ids.xml
https://android-review.googlesource.com/1510258
Branch: androidx-master-dev
commit c2c4ba5ad132860829c09b542b63d7d71e404d7f
Author: Nikita Dubrovsky <dubrovsky@google.com>
Date: Fri Nov 20 16:26:01 2020
Update OnReceiveContentListener API
Relnote: """Updated OnReceiveContentListener and related APIs:
* Updated OnReceiveContentListener so it can be set on any type of view
via ViewCompat.
* Removed getSupportedMimeTypes() from OnReceiveContentListener; now
MIME types are passed as an additional arg on the ViewCompat method
that sets the listener.
* Wrapped arguments to OnReceiveContentListener.onReceiveContent() in
an object.
* Added linkUri as a param to onReceiveContent() to ensure backwards
compatibility with the keyboard image API.
* Added a Bundle param to onReceiveContent() to ensure backwards
compatibility with the keyboard image API and to facilitate evolution
of the API in the future.
* Updated onReceiveContent() to return any content that was not
consumed, as a means to delegate to the default handling.
* Removed TextViewOnReceiveContentListener from the public API since
the default behavior can now be triggered by returning any unconsumed
content from the listener.
"""
Bug: 173814913
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.view.ContentInfoCompatTest
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.view.ViewCompatReceiveContentTest
Test: ./gradlew :core:core:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.core.widget.TextViewOnReceiveContentListenerTest
Test: ./gradlew :appcompat:appcompat:connectedCheck --info --daemon -Pandroid.testInstrumentationRunnerArguments.class=androidx.appcompat.widget.AppCompatEditTextReceiveContentTest
Change-Id: Ib4616cb0d0cd9f8537b64de6fcc19b80442dc3fb
M appcompat/appcompat/api/current.txt
M appcompat/appcompat/api/public_plus_experimental_current.txt
M appcompat/appcompat/api/restricted_current.txt
M appcompat/appcompat/src/androidTest/java/androidx/appcompat/widget/AppCompatEditTextReceiveContentTest.java
M appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatEditText.java
M core/core/api/current.txt
M core/core/api/public_plus_experimental_current.txt
M core/core/api/restricted_current.txt
A core/core/src/androidTest/java/androidx/core/view/ContentInfoCompatTest.java
A core/core/src/androidTest/java/androidx/core/view/ViewCompatReceiveContentTest.java
M core/core/src/androidTest/java/androidx/core/widget/TextViewOnReceiveContentListenerTest.java
A core/core/src/main/java/androidx/core/view/ContentInfoCompat.java
M core/core/src/main/java/androidx/core/view/OnReceiveContentListener.java
A core/core/src/main/java/androidx/core/view/OnReceiveContentViewBehavior.java
M core/core/src/main/java/androidx/core/view/ViewCompat.java
M core/core/src/main/java/androidx/core/widget/TextViewOnReceiveContentListener.java
M core/core/src/main/res/values/ids.xml
se...@google.com <se...@google.com>
il...@google.com <il...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit fa9a50f143d3e751875066882adc7160e73a6800
Author: Nikita Dubrovsky <dubrovsky@google.com>
Date: Wed Dec 02 11:47:29 2020
Test app for OnReceiveContentListener
Bug: 173814913
Test: Manually tested inserting an image via paste, drop, and from IME
Change-Id: I3cb2eb11dcf14e2172c3ef78abc4b8f7c463f2a9
A appcompat/integration-tests/receive-content-testapp/build.gradle
A appcompat/integration-tests/receive-content-testapp/lint-baseline.xml
A appcompat/integration-tests/receive-content-testapp/src/main/AndroidManifest.xml
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/Logcat.java
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/MainActivity.java
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/MyExecutors.java
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/MyReceiver.java
A appcompat/integration-tests/receive-content-testapp/src/main/res/layout/activity_main.xml
A appcompat/integration-tests/receive-content-testapp/src/main/res/values/strings.xml
A appcompat/integration-tests/receive-content-testapp/src/main/res/values/styles.xml
M settings.gradle
https://android-review.googlesource.com/1555561
Branch: androidx-main
commit fa9a50f143d3e751875066882adc7160e73a6800
Author: Nikita Dubrovsky <dubrovsky@google.com>
Date: Wed Dec 02 11:47:29 2020
Test app for OnReceiveContentListener
Bug: 173814913
Test: Manually tested inserting an image via paste, drop, and from IME
Change-Id: I3cb2eb11dcf14e2172c3ef78abc4b8f7c463f2a9
A appcompat/integration-tests/receive-content-testapp/build.gradle
A appcompat/integration-tests/receive-content-testapp/lint-baseline.xml
A appcompat/integration-tests/receive-content-testapp/src/main/AndroidManifest.xml
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/Logcat.java
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/MainActivity.java
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/MyExecutors.java
A appcompat/integration-tests/receive-content-testapp/src/main/java/androidx/appcompat/demo/receivecontent/MyReceiver.java
A appcompat/integration-tests/receive-content-testapp/src/main/res/layout/activity_main.xml
A appcompat/integration-tests/receive-content-testapp/src/main/res/values/strings.xml
A appcompat/integration-tests/receive-content-testapp/src/main/res/values/styles.xml
M settings.gradle
Description
- Version used: 2.3.0-alpha01
`AppCompatActivity` reimplements `setContentView` and it doesn't call it's super. For this reason the code inside `ComponentActivity.setContentView` is not executed. And for this reason `ViewTreeLifecycleOwner.get(View)` always returns `null`. If my Activity extends from `ComponentActivity` all works like a charm.
To reproduce just create an `AppCompatActivity` with a view get the view with findViewById and call `ViewTreeLifecycleOwner.get` with it.