https://github.com/leoando/receivecontentsample
sample for unified-content-api(Android 12 +)
https://github.com/leoando/receivecontentsample
android android12 android12-support
Last synced: about 2 months ago
JSON representation
sample for unified-content-api(Android 12 +)
- Host: GitHub
- URL: https://github.com/leoando/receivecontentsample
- Owner: LeoAndo
- Created: 2021-05-17T11:33:09.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-05T07:27:29.000Z (almost 5 years ago)
- Last Synced: 2025-10-30T07:03:29.924Z (7 months ago)
- Topics: android, android12, android12-support
- Language: Kotlin
- Homepage:
- Size: 146 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ReceiveContentSample
sample for unified-content-api(Android 12 +)
[日本語版README](https://github.com/LeoAndo/ReceiveContentSample/blob/main/readme/README_JP.md)
# about unified-content-api
With the existing API, the API to call for each action such as "clipboard, keyboard, drag and drop" to insert content into the app was different.
Since Android 12 added the [OnReceiveContentListener](https://developer.android.com/reference/android/view/OnReceiveContentListener) interface,
This interface allows you to hook events with content inserted in various actions.
[link1](https://developer.android.com/about/versions/12/features/unified-content-api#overview)
# use libraries
[androidx.core:core-ktx:1.5.0-beta03](https://developer.android.com/jetpack/androidx/releases/core#1.5.0-beta03)
[androidx.appcompat:appcompat:1.3.0-beta01](https://developer.android.com/jetpack/androidx/releases/appcompat#1.3.0-beta01)
Currently, there are the following restrictions to use the backward compatible API of androidx.
- Valid only for `AppCompatEditText`. We are considering enabling the content insertion function in other views in the future.
[ref](https://youtu.be/D2cU_itNDAI?t=1602)
# capture
The following external application was used to check the operation.
- Google Chrome
- File Exploler
## Pixcel 4 OS 12 preview
| Insert using Paste
from long-press menu | Insert using drag and drop (image) | Insert using drag and drop (video) | insert a keyboard image |
----|---- |----|----
|
|
|
|
|