Commit Graph

412 Commits

Author SHA1 Message Date
Hongwei Wang
31c5071a72 Use FixedAspectRatioImageView to demo auto-enter-pip
Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bpKcGg1eoOo5Jz5U6IwBYK
Bug: 191310680
Test: manually auto-enter-pip from landscape, see video
Change-Id: I30a728331f0ffa48c537be7b2611dba0b2df053a
2021-07-12 16:07:23 -07: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
Hongwei Wang
5e8ce64de0 Use a single TextView to demonstrate seamlessResize
For easy side-by-side comparison turning on/off seamlessResizeEnabled
flag. Adjusted also the wording to emphasize the recommended usage.

Bug: 152554547
Test: use the ApiDemos app
Change-Id: I1fbeee2479d9e93614d040d10e01f9fe2fb4c8d4
2021-03-01 11:24:28 -08:00
Hongwei Wang
35faf69308 Add demo for autoEnterPip w/o sourceRectHint
Video: http://rcll/aaaaaabFQoRHlzixHdtY/cdY8k6V9uhJEXyMAKAUA34
Video: http://rcll/aaaaaabFQoRHlzixHdtY/bvodLNGyrIXH8DSvGHehrp
Bug: 179286893
Test: manual in ApiDemos app, see video
Change-Id: Ib1ae64e24c901d2a921b0b5d40bffb196f8121ba
2021-02-08 16:51:58 -08: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
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
Bob Badour
801760580f Merge "Clarify license terms for Romain Guy's artwork." am: a37de64bd6
am: fb5f7546b0

Change-Id: I964e6ca1dcc1bf15925d79a80e9707d8e691c4d8
2019-06-27 20:31:48 -07:00
Bob Badour
e72c60e885 Clarify license terms for Romain Guy's artwork.
As discussed with Romain Guy in the email thread, the Apache 2.0
license applies to the affected .jpg files now and retroactively from
the time of import.

Usage terms updated using exiftool:

$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/ApiDemos/res/drawable-nodpi/frantic.jpg
Warning: [minor] Fixed incorrect list type for XMP-xmpRights:UsageTerms - development/samples/ApiDemos/res/drawable-nodpi/frantic.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/ApiDemos/res/drawable-nodpi/frantic.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p3.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p3.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p2.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/PictureViewer/res/drawable-nodpi/p2.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p3.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p3.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy
$ exiftool -UsageTerms='Apache License Version 2.0' \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p2.jpg
    1 image files updated
$ exiftool -URL -WebStatement -UsageTerms -Rights -Creator \
    development/samples/devbytes/animation/ActivityAnimations/res/drawable-nodpi/p2.jpg
Usage Terms                     : Apache License Version 2.0
Rights                          : Romain Guy
Creator                         : Romain Guy

Test: doesn't realy apply to images

Change-Id: If060c6ba0f0279e3a7e6446061d50cd8e4cdec3c
2019-06-27 14:58:10 -07:00
Bob Badour
3bdea97ab6 Merge "Clarify license terms for Romain Guy's artwork." am: 0e3bcf70c5
am: bcd745dddc

Change-Id: I330e55df545251008c1940ec9b22732799de7fc5
2019-06-05 14:59:37 -07:00
Bob Badour
d41e5f7851 Clarify license terms for Romain Guy's artwork.
As discussed with Romain Guy in the email thread, the Apache 2.0
license applies to the affected .jpg files now and retroactively from
the time of import.

Each of the images was altered using the exiftool:

exiftool -WebStatement=http://www.apache.org/licenses/LICENSE-2.0

Change-Id: I557d0129617164209a3eec7ec2d228f266643ca0
2019-06-05 20:08:08 +00: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
Vladislav Kaznacheev
603a758caf Use menu shortcuts in ApiDemos
Add alphabetic shortcuts to the menu in ActionBarUsage. This mirrors
what is already present in a similar support lib demo.

Bug: 31045453
Test: run com.example.android.apis.app.ActionBarUsage on a device
  with keyboard shortcuts enabled (such as Chromebook). Action menu
  items should display keyboard shortcuts.

Change-Id: I9e6b04df8e2a6cbc728cb60b3706d054521da7cb
2018-04-17 23:02:47 +00:00
Christopher Tate
fc7c9f5d5c Add use of PendingIntent.getForegroundService()
In particular, we have an example of a foreground-service PendingIntent
triggered by a 15-second delayed alarm following a button click.  This
is enough time to exercise use cases like swiping the app out of recents
before the alarm fires, therefore entering the "starting a fg service
when the app is not in a fg state" flows.

Bug: 73559697
Test: this is it
Change-Id: If57908ab852c7a0bfab7bb1da8eda0a47493fc6b
2018-03-19 16:25:01 -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
Adrian Roos
9f8d264a84 Follow-up to I205cdc00533b19be46c7837012a96705c7a4a62f
Test: mmm development/samples/ApiDemos
Change-Id: I3794c3c94785c4de3b130201ff70d05dbe792256
2018-02-20 12:22:17 +01: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
Makoto Onuki
10d6c41f9b Add while-idle alarm support to apidemos
Test: Manual test
Bug: 72124522
Change-Id: I9d0c0ed4b6a045e4f8f566c4e9844290e850e2fc
2018-01-30 13:20:06 -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
6b7860e588 Remove obsolete code from the InstallApk API demo.
1) Remove the "Refresh package" demo. This was using Intent.EXTRA_ALLOW_REPLACE, which was deprecated in API 16.
2) Java code cleanup.

Test: Manually.
Change-Id: I0cbff934ca223a3fe73a1044ed68f3e079be8237
2017-11-17 10:00: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
Felipe Leme
e47849665c Added autofill tags on dialog sample.
Bug: 68816440
Test: mmm -j50 development/samples/ApiDemos && adb install -r $OUT/data/app/ApiDemos/ApiDemos.apk

Change-Id: Ia7514ba3edb7e057fe8490079856d0a233c77fcd
2017-11-08 12:53:55 -08: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
Vladislav Kaznacheev
0f87eb452f Rename View.setTooltip/getTooltip to setTooltipText/getTooltipText
Bug: 34454987
Test: adb shell am start -n com.example.android.apis/.view.Tooltips
Change-Id: I16156e5b928202f50f7290ff30ad36aa80d615d2
2017-01-19 11:05:47 -08:00
Vladislav Kaznacheev
e4b96eb9fc Correct string resources for tooltips demo in ApiDemos
Bug: None
Test: manual
Change-Id: I7bea1d0beb0ec94217fa6aa30c11c32702cd05ba
2016-12-22 14:47:50 -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
3ca1a928a4 Include seamless rotation mode in API Demo.
Test: Try the RotationAnimation activity of API demos.
Change-Id: I4f3aba54d310ecbe06776190a4096c71fdf85d24
2016-10-18 14:42:10 -07:00
Dianne Hackborn
9302998b13 Add API demo for running multiple foreground services.
Change-Id: I44435f6e7750ccbbadf5e293dd10069c6cef94a4
2016-08-01 17:52:18 -07:00
Michael Wright
71620c8898 DO NOT MERGE Rename PointerIcon and Pointer Capture APIs
This is a response to API council feedback.

Bug: 26830970
Change-Id: I19d3919dc201fdf2b949074f02490669b4a5d775
2016-05-17 20:03:23 +01:00
Adrian Roos
1052d438de Update Sample Device Admin
Adds options to exercise the newly added KEYGUARD_DISABLE_REMOTE_INPUT
and not so newly added KEYGUARD_DISABLE_FINGERPRINT.

Change-Id: I0e2a05f2a668b7d8ceacde3abcf5f8c80cb4bdb9
Fixes: 26981262
2016-05-11 15:51:11 -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
08d2a04420 Add a secondary DA to ApiDemos for testing
Bug 27107878

Change-Id: Id8179926d424ca8b4678ac028f4c9eab7a81a4c2
2016-02-10 11:28:49 -08:00
Vladislav Kaznacheev
2ba9c45dc0 Add example of pointer icon resource reference to ApiDemos
Change-Id: I3e88a097725b69aefd38169c0b37d64ebd6ddec5
2016-02-09 00:37:12 +00:00
Alan Viverette
10150941ff Fix ApiDemos layout
Change-Id: I67b15d38a8d947d30ce9c3789c5000c7850861d2
2016-02-05 12:49:44 -05:00
Alan Viverette
47683023d5 Fix duplicate IDs in Material controls demo
Change-Id: Ic87b4ae520ba22387e4902bdc6b841b635921080
2016-02-05 12:41:56 -05:00
Jun Mukai
6cb3668322 Introduce the examples of pointer shape API.
Change-Id: Ib0be39d560fbc00db661f639a02c4df2e2c1867b
2016-02-03 14:54:44 -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
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
Tenghui Zhu
ed6385398a Merge "Add horizontal indeterminate progress bar into ApiDemos" 2015-11-05 23:21:32 +00:00
Tenghui Zhu
6cff2e6826 Merge "Remove ProgressBar4, it is deprecated from Lollipop" 2015-11-05 23:21:24 +00:00
Teng-Hui Zhu
6324dbbae2 Add horizontal indeterminate progress bar into ApiDemos
Change-Id: Iae72019d5ecdfbc710d01bd341b6de058d3b665a
2015-11-03 15:08:20 -08:00
Teng-Hui Zhu
ac7c153cce Remove ProgressBar4, it is deprecated from Lollipop
Change-Id: Ia2a038a973eb6c6021c73d157410be6e64c2b1a7
2015-11-03 13:57:44 -08:00