Commit Graph

312 Commits

Author SHA1 Message Date
Daniel Chapin
8de7b4b166 Revert "Remove samples for deprecated Android Beam API"
Revert submission 20750504-nfc-beam-cleanup

Reason for revert: Droidfood blocking bug: 265628639

Reverted changes: /q/submissionid:20750504-nfc-beam-cleanup

Change-Id: I52227544aa152471ab3186eb21dd3a3f0e7cc193
2023-01-17 23:00:19 +00:00
Alisher Alikhodjaev
72f4cdb23f Remove samples for deprecated Android Beam API
Removed samples:
- AndroidBeamDemo
- browseable/BeamLargeFiles

Bug: 236980291
Test: n/a
Change-Id: I1a4565fd087f038e715ea6eb66a5cac700636819
2023-01-09 09:07:35 +00:00
Hongwei Wang
8d408e82c1 Add ability to enter PiP on back pressed in ApiDemos
Bug: 235268241
Test: Press back when in com.example.android.apis/.app.PictureInPicture
Change-Id: I8ceaaf3b1215505bd4919ef5f5da291df62c1049
2022-06-27 11:27:03 -07:00
Mateusz Cicheński
465b945910 Add API demo for keep clear areas.
Bug: 183746978
Test: manual, via extra logging added in DisplayController#onKeepClearAreasChanged
Change-Id: Id291320cdb0ea502c0ff359677f218504c1df597
2022-03-21 17:47:54 +00:00
Hongwei Wang
ec0d9449a1 Add demo for content PiP
Bug: 165793661
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/e9Mp5rvxYBrNOdGSUoSXHO
Test: manual, see Video
Change-Id: I026844cf5eabf30fe553641b36daed6e31e4f893
2022-02-09 16:19:12 -08:00
Hongwei Wang
17aab38616 Consolidate PiP demos in ApiDemos app
Put various configurations for PiP into one Activity, access by navigate
to `App > Activity > Picture in Picture`. Current supports

- Enter PiP with on-screen button
- Enter PiP by swiping up to home or tap on home button
- Toggle the auto enter PiP flag on and off
- Toggle the source rect hint on and off
- Toggle the seamless resize flag on and off
- Change the position of current and next source rect hint
- Tablet layout on foldables

The upcoming content PiP will also be hosted here.

Added also support passing the intent extra, full command

```
adb shell am start \
    --ez auto_pip [true|false] \
    --ez source_rect_hint [true|false] \
    --ez seamless_resize [true|false] \
    --es current_position [start|end] \
    com.example.android.apis/.app.PictureInPicture
```

Bug: 175727044
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/gdcklbUsT7SmbUhNcVSXfd
Test: manual, see Video
Change-Id: I60233f2d6e428d11d4ab1b566e36c38fd4c4f937
2021-12-21 13:48:31 -08:00
Hongwei Wang
d1cc26450c Fix flicker in ApiDemos when auto enter PiP from landscape
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/cNwi8qI0qukRlaIwutzclD
Bug: 179720719
Test: auto enter PiP from landscape using ApiDemos app, see video
Change-Id: Ic421b3766fbc15bf699885863710a14c3178867f
2021-05-12 19:39:23 -07:00
Galia Peycheva
6160e125d4 Merge "Revert "Remove public usages of FLAG_BLUR_BEHIND"" into sc-dev 2021-02-03 05:49:40 +00:00
Galia Peycheva
e8627d6c0b Revert "Remove public usages of FLAG_BLUR_BEHIND"
Revert "Add pid and uid to SF::setClientStateLocked"

Revert "Add USE_BACKGROUND_BLUR to cts expected permissions"

Revert submission 13350963-blur_system_api

Reason for revert: This topic made blurs a system api. API council voted against that and we will instead aim to make it public for S. None of these changes are relevant in that case.

Reverted Changes:
I3683db296:Remove public usages of FLAG_BLUR_BEHIND
I23b21b603:Add USE_BACKGROUND_BLUR to cts expected permission...
Id21f03793:Add pid and uid to SF::setClientStateLocked
If5d8344a5:Add permission for blur SystemApi
I70d1e1715:Add permission check for blurs in SurfaceFlinger
Icf98c3607:Make window background blurs SystemApi
I0b881ec6e:Make BackgroundBlurDrawable a SystemApi

Bug: 177523043
Change-Id: Ic1f1657eee370a2fcc625c28f876c34e3e0427e9
2021-02-01 10:43:52 +00:00
jorgegil@google.com
371e9e86f1 Add Api Demo for PiP source rect hint
- Demonstrates the source rect hint API (on enter and exit)
- Invoke path: App -> Activity -> Picture In Picture Source Rect Hint

Video: http://rcll/e8RgaQ0dFlwFuh0c7GRpyy/cCQiDoYLvfJ4dKwQQbsaYC
Bug: 167447693
Test: m -j ApiDemos
Change-Id: I80b41b017b021bf6da16a21fe9d5bf8ec0c35ea5
2021-01-28 21:17:30 +00:00
jorgegil@google.com
66780efd43 Add ApiDemo for PiP seamless resize
- Demonstrates the seamless resize API (both enabled and disabled)
- Invoke path: App -> Activiy -> Picture In Picture Seamless Resize

Video: http://rcll/e8RgaQ0dFlwFuh0c7GRpyy/UVHnwihysd2to0Py2IqU2
Bug: 152554547
Test: m -j ApiDemos
Change-Id: I331a0d60e5a93c24c1ad48bb1cdcda9570c0337d
2021-01-25 13:43:55 -08:00
Hongwei Wang
e07065a463 Merge "Add ApiDemo for PiP auto enter API" 2021-01-21 21:54:07 +00:00
Hongwei Wang
b0715f27ef Add ApiDemo for PiP auto enter API
- Demonstrates the autoEnterPip API with multi-activity in original task
- Invoke path: App -> Activity -> Picture in Picture Auto Enter

Video: http://rcll/aaaaaabFQoRHlzixHdtY/gIO4G5dybW7tJWXihkhXfE
Bug: 177335910
Test: m -j ApiDemos
Test: see video
Change-Id: If69116dd52476ead8cc46dc3475447d4bfa64ff8
2021-01-18 16:03:55 -08:00
Galia Peycheva
a4af55c95a Remove public usages of FLAG_BLUR_BEHIND
WindowManager.LayoutParams.FLAG_BLUR_BEHIND has been deprecated since
2011 and has been a no-op ever since.
We are @remove-ing it in S and making it a SystemApi to be used for
cross-app blurs. To that end, we have to remove its public usages.

This CL removes its usage in ApiDemos.

Bug: 177524486
Test: m
Change-Id: I3683db296e8331a9d255d39f23fad7dedc28bb9b
2021-01-15 08:18:47 +01:00
Louis Pullen-Freilich
1496f57583 Removes framework Preference demos
The framework Preference APIs are deprecated, so these samples are
misleading and should be removed.

Trying to submit again now that the relevant sample tags have been removed.

Bug: b/119602280
Test: n/a
Change-Id: I7efb509f5c938122575cf4177b50872bfc089d00
2018-11-19 18:05:33 +00:00
Louis Pullen-Freilich
4b364839bd Revert "Removes framework Preference demos"
This reverts commit 946280d6ce.

Reason for revert: Breaking builds due to doc generation using these samples

Change-Id: I7caf9792e84e0e1eedea4a7294a321c684be2d5c
2018-11-16 18:26:28 +00:00
Louis Pullen-Freilich
946280d6ce Removes framework Preference demos
The framework Preference APIs are being deprecated, so removing the
samples will help avoid confusion.

Bug: b/119602280
Test: n/a
Change-Id: Ib3a2c38b8fbb0f1afc9ef6a35963def46ee931f7
2018-11-15 12:51:50 +00:00
KOUSHIK PANUGANTI
7f203340ff Migrated various apps under development/samples/ApiDemos to androidx
Bug: 76692459
Test: make ApiDemos
Change-Id: Ie02783ba14b294a220383a3d53e96a6fdb3117b8
2018-04-24 17:13:55 -07:00
Adrian Roos
59e2e04dc1 ApiDemos: Add maxAspectRatio demo
Bug: 72696928
Test: Install and open ApiDemos > App > Activity > Max Aspect Ratio > 1:1 / 16:9 / Any
Change-Id: Ie76c8c4babd6b4c281eec8ff977a0c02a868ee0e
2018-03-15 15:32:12 +01:00
Dianne Hackborn
7049e08d6f Fix issue #72116995: Add permission guarding Service#startForeground
Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I3fab8561028d5c2b54a5e8468f7ff51bcd7bc3df
2018-03-05 17:00:51 -08:00
Adrian Roos
71fc3601bd ApiSamples: Add PIP sample
Test: Open ApiSamples > App > Activity > Picture in Picture
Change-Id: I205cdc00533b19be46c7837012a96705c7a4a62f
2018-02-19 18:34:48 +01:00
Ian Pedowitz
b19c1b8ec6 Revert "Fix issue #72116995: Add permission guarding Service#startForeground"
This reverts commit 7890baea48.

Reason for revert: b/73224471

Bug: 73224471
Bug: 72116995
Change-Id: Ife5dc5c14026ae7dcb126b0b3c3e7701ed3eaebe
2018-02-12 16:12:26 +00:00
Dianne Hackborn
7890baea48 Fix issue #72116995: Add permission guarding Service#startForeground
Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I88e3f6f1395b7ee0c0af41c9f7e9a5971da17631
2018-02-07 14:05:31 -08:00
Dianne Hackborn
0d3c8bac64 Revert "Fix issue #72116995: Add permission guarding Service#startForeground"
This reverts commit cbe2f1bf27.

Test: NA
Bug: 72116995
2018-01-25 12:55:58 -08:00
Dianne Hackborn
cbe2f1bf27 Fix issue #72116995: Add permission guarding Service#startForeground
Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: Ib8471d514bc2c126c34a867ca8ff77d90be9661e
2018-01-21 19:57:14 -08:00
Peter Visontay
e746637688 Merge "Add an ApiDemo for showing an overlay window." 2017-12-14 14:02:53 +00:00
Peter Visontay
48f2a3142e Use FileProvider (instead of a world-readable file) in the APK installer demo.
World-readable files have been disallowed since N.

Test: Manually.
Change-Id: Iab174799403023378200d75dac5e8cd02e64dbf8
2017-12-12 18:16:29 +00:00
Peter Visontay
ad360d40be Add an ApiDemo for showing an overlay window.
Test: manually.
Change-Id: I9eaa9c0eeb3bc04389c27a7fe5e74fc5acdc59fd
2017-12-12 15:44:02 +00:00
Peter Visontay
75bca25be1 Add a demo of the Session-based PackageInstaller to ApiDemos.
Test: Manually.
Change-Id: If084477e8970777ef5cd90c55afe86a116ee1458
2017-11-16 21:49:17 +00:00
Dianne Hackborn
5229a90146 Add sample for enqueuing work in a job.
Basically this is to have sample code to include in the java docs.

Bug: 37544153  API Review: JobWorkItem

Test: none

Change-Id: Ie4ed3ce4af8239010da2647fab00ed2aadb1d348
2017-04-21 15:02:25 -07:00
Dianne Hackborn
8a416b3033 API demo for notification that starts a background service.
Test: not relevant

Change-Id: I9ad6640dccded3be0baf879a6694f9535144d80c
2017-01-23 14:20:03 -08:00
TreeHugger Robot
3d87989183 Merge "Add tooltip demo to ApiDemos" 2016-11-22 22:15:47 +00:00
Vladislav Kaznacheev
922dea9376 Add tooltip demo to ApiDemos
Test: launch com.example.android.apis.view.Tooltips
Bug: 31515376
Change-Id: I5456740c4e93105c5058c198b22f4fd7634f3b46
2016-10-20 15:28:25 -07:00
Robert Carr
bde918648d API Demos: Specify rotation animation in manifest
Just an example of specifying rotation animation
in manifest.

Test: Try running the activity and verify the rotation animation is crossfade
Change-Id: I4481c0fd317fa4f472822159288bd5521cc52ec2
2016-10-19 14:49:18 -07:00
Dianne Hackborn
9302998b13 Add API demo for running multiple foreground services.
Change-Id: I44435f6e7750ccbbadf5e293dd10069c6cef94a4
2016-08-01 17:52:18 -07:00
Alan Viverette
dede2c340a Use Light.DarkActionBar theme as default for ApiDemos
Change-Id: I6ed0b034641953b6b445ea818c7b3b379089d53d
2016-04-19 10:16:12 -04:00
Dianne Hackborn
a4a1bb7dca Add sample for observing only photos changes.
Change-Id: I954fb466fb21d73f88b1dd1bc86eac617a628073
2016-03-21 13:31:34 -07:00
Makoto Onuki
68bfa3736d Make ApiDemos movable to SD card
Change-Id: I53d923a44360c16d42d1b646a182c706888027a8
2016-02-16 17:03:02 -08:00
Makoto Onuki
08d2a04420 Add a secondary DA to ApiDemos for testing
Bug 27107878

Change-Id: Id8179926d424ca8b4678ac028f4c9eab7a81a4c2
2016-02-10 11:28:49 -08:00
Jun Mukai
6cb3668322 Introduce the examples of pointer shape API.
Change-Id: Ib0be39d560fbc00db661f639a02c4df2e2c1867b
2016-02-03 14:54:44 -08:00
Yohei Yukawa
fa3c909d8d Merge "Add sample code for EditorInfo#hintLocales." 2016-01-27 18:00:35 +00:00
Yohei Yukawa
85a32da54f Add sample code for EditorInfo#hintLocales.
This CL adds some sample entries so that IME developers can test their
IMEs with various EditorInfo#hintLocales.

Bug: 22859862
Change-Id: Ic0bc98bc4c9cb7b874ca8d54433bde76d05e8e03
2016-01-26 13:50:50 -08:00
Dianne Hackborn
e3ad7fa9ac Add API demo for monitoring media content.
Both the classic ContentObserver API, and the new
JobScheduler API.

Change-Id: I2011389abb2f863e810ccc9012fb3c53c93c76fd
2016-01-22 11:08:37 -08:00
Alan Viverette
bfd633ad65 Update ApiDemos control samples for Material
Adds examples for a variety of Material-only control styles including
underlined Spinner and discrete SeekBar. Groups controls into cards.

For the old-style controls, moves some run-time setup tasks into XML.

Bug: 19352193
Change-Id: Ibb1c82ac6ecaca3b93f3acfd65ef67cd9784fef4
2016-01-07 16:41:10 -05:00
Yohei Yukawa
fafac8ef79 Add an API sample to show subtype enabler.
At least on AOSP InputMethodManager#showInputMethodAndSubtypeEnabler()
has been broken for long time.  Also, there has been a valid alternative
way to do the same thing.

This CL adds an API sample to officially encourage people to use
Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS intent rather than trying
to rely on InputMethodManager#showInputMethodAndSubtypeEnabler(), which
is highly likely to be broken.

Bug: 26189558
Change-Id: I915a2d81948598ed08b4ef9111bdd128fd93f3df
2015-12-14 18:59:44 -08:00
Dianne Hackborn
1cd11bc0ff Extend foreground service test to demonstrate doze behavior.
Change-Id: I81162b6a309a09c1041b71fce1e9a8335afa5b53
2015-12-02 14:17:08 -08:00
Alan Viverette
c3042be803 Add sample magnification controller service
Bug: 22718911
Change-Id: I25d2ca95836f7fe033accf215fd925fd06505b12
2015-11-13 10:49:10 -05:00
Teng-Hui Zhu
ac7c153cce Remove ProgressBar4, it is deprecated from Lollipop
Change-Id: Ia2a038a973eb6c6021c73d157410be6e64c2b1a7
2015-11-03 13:57:44 -08:00
Alan Viverette
93e094856e Add number picker to ApiDemos
Change-Id: I33dc7a01f543cb5308e810f508bedc3d25eb366a
2015-09-18 09:43:08 -04:00
James Cook
6a57fe0646 Add more text samples to ApiDemos, move to Views/Text
There are many more variants of TextView and EditText than are shown
in Views/Controls. Add new pages with some of the variants and move
all the text examples to Views/Text.

Bug: 21518721
Change-Id: Ie839e9c964d019ffbe8be2170e124276b087916d
2015-05-29 14:50:40 -07:00