ApiDemos
Updating android ApiDemos to Android Studio and fixing bugs
Install / Use
/learn @markgray/ApiDemosREADME
% Local Variables: % % fill-column: 9999 % % End: % atLeastHoneycomb v11 HONEYCOMB_MR1 v12 atLeastHoneycombMR2 v13 atLeastIceCreamSandwich v14 ICE_CREAM_SANDWICH_MR1 v15 atLeastJellyBean v16 atLeastJellyBeanMR1 v17 atLeastJellyBeanMR2 v18 atLeastKitKat v19 atLeastLRelease v20 LOLLIPOP v21 LOLLIPOP_MR1 v22 M v23 N v24 N_MR1 v25 O v26 O_MR1 v27 P v28 Q v29 R v30
Accessibility Accessibility/Accessibility Node Querying v14 .accessibility.TaskListActivity .accessibility.TaskListView .accessibility.TaskAdapter new so that kotlin can find it .layout.tasklist_main.xml .layout.tasklist_row.xml Starts up the task list that will interact with the AccessibilityService sample. TaskListView acts as a go-between for all AccessibilityEvents sent from items in its ListView, providing the option of sending more context to an AccessibilityService by adding more AccessibilityRecords to an event.
Accessibility/Accessibility Service v14 .accessibility.ClockBackActivity .accessibility.ClockBackService .layout.accessibility_service.xml This is the entry activity for a sample that demonstrates how to implement an AccessibilityService, namely the ClockBackService
Accessibility/Custom View v14 .accessibility.CustomViewAccessibilityActivity .layout.custom_view_accessibility.xml Demonstrates how to implement accessibility support of custom views. Custom view is a tailored widget developed by extending the base classes in the android.view package. This sample shows how to implement the accessibility behavior via both inheritance (non backwards compatible) and composition (backwards compatible). While the Android framework has a diverse portfolio of views tailored for various use cases, sometimes a developer needs a specific functionality not implemented by the standard views. A solution is to write a custom view that extends one of the base view classes. While implementing the desired functionality a developer should also implement accessibility support for that new functionality such that disabled users can leverage it.
Accessibility/MagnificationService v24 .accessibility.MagnificationService .xml.magnification_service.xml This class is an AccessibilityService that controls the state of display magnification in response to key events. It demonstrates the following key features of the Android accessibility APIs: Basic implementation of an AccessibilityService Observing and respond to user-generated key events Querying and modifying the state of display magnification It includes the file xml/magnification_service.xml describing the service, which is referenced by a meta-data android:name="android.accessibilityservice" android:resource="@xml/magnification_service" element in AndroidManifest.xml.
Animation (disabled for froyo) Animation/Activity Transition v21+ .animation.ActivityTransition Becomes: .layout.image_block.xml Animation/Details of a specific thingy v21+ .animation.ActivityTransitionDetails .layout.image_details.xml Uses ActivityOptions.makeSceneTransitionAnimation to transition using a shared view as the epicenter of the transition. The xml sets android:onClick="clicked" to use for each thumbnail in the GridLayout and clicked() creates an intent to launch ActivityTransitionDetails.class using a bundle containing an ActivityOptions.makeSceneTransitionAnimation() which causes the thumbnail to "expand" into the image detail version. When the ImageView in the image detail version is clicked, the reverse transition to ActivityTransition activity occurs. The animation is set up using AndroidManifest android:theme="@style/ActivityTransitionTheme" which contains elements which point to files in res/transition
Animation/Bouncing Balls v11+ .animation.BouncingBalls .animation.ShapeHolder .layout.bouncing_balls.xml Uses several different kinds of ObjectAnimator to animate bouncing color changing balls. When onTouchEvent is called with either a MotionEvent.ACTION_DOWN or MotionEvent.ACTION_MOVE a ball of random color is added at the events event.getX(), event.getY() coordinates. The ball motion and geometry is animated, then an animator of the balls alpha is played fading it out from an alpha of 1.0 to 0.0 in 250 milliseconds. The onAnimationEnd callback of the fade animation is set to an AnimatorListenerAdapter which removes the ball when the animation is done. The background color is also Animated. Note that setting the background color will automatically invalidate the view, so that the animated color, and the bouncing balls, get redisplayed on every frame of the background color animation.
Animation/Cloning v11 .animation.AnimationCloning .layout.animation_cloning.xml .animation.ShapeHolder Creates an ObjectAnimator to animate the y position of an object from 0 to the bottom of the View, .clones it and uses .setTarget to set it as the animation of a second View. Then it creates two ObjectAnimator's to: animate the y position of an object down, and a second to animate y position up again and creates an AnimatorSet to play them sequentially, clones this AnimatorSet and .setTarget's the clone as the AnimatorSet for a second object. Uses an AnimatorSet to play the first two ObjectAnimator's and first AnimatorSet, requesting that they be run at the same time by calling playTogether(ObjectAnimator1,ObjectAnimator2,AnimatorSet1), and the second AnimatorSet to run after the first AnimatorSet by calling playSequentially(AnimatorSet1,AnimatorSet2).
Animation/Custom Evaluator v11 .animation.CustomEvaluator .layout.animator_custom_evaluator.xml .animation.ShapeHolder Implements the TypeEvaluator interface to animate using a custom: "public Object evaluate(float fraction, Object startValue, Object endValue)" function. The x and y coordinates of an "animation.ShapeHolder ball" are animated by calling evaluate, and onAnimationUpdate is called which calls invalidate() which causes the onDraw method to be called.
Animation/Default Layout Animations v11 -- layout uses GridLayout so crash, if < v14. .animation.LayoutAnimationsByDefault .layout.layout_animations_by_default.xml Uses android:animateLayoutChanges="true" in the GridLayout used to contain buttons, to automate transition animations using the default animations as Buttons are added to or removed from that ViewGroup. .
Animation/Events v11 .animation.AnimatorEvents .layout.animator_events.xml Supposed to show when the various Sequencer Events and Animator Events: Start Repeat Cancel and End occur, but Repeat Events are not generated for the Sequencer because the api does not support setRepeatCount on a AnimatorSet.
Animation/Hide-Show Animations v11 .animation.LayoutAnimationsHideShow .layout_animations_hideshow.xml Uses setLayoutTransition to set default transitions, and setAnimator to specify custom animations if checkbox is checked. Buttons disappear when touched using these animations. If "Gone" checkbox is checked, setVisibility is used to set the button's view to View.GONE which means that it takes up no layout space, and the remaining buttons move together to fill the now empty space, otherwise it is set to View.INVISIBLE which makes it invisible, but it still occupies the same layout space. Pressing the "Show Buttons" button while the "Custom Animations" CheckBox is checked causes a crash which blanks out the system wallpaper. (Sometimes?)
Animation/Layout Animations v11 .animation.LayoutAnimations .animation.FixedGridLayout .layout.layout_animations.xml Adds and removes buttons using custom or default animations. Custom animations crash badly, causing temporary problem for system wallpaper on Pixel
Animation/Loading v11 -> v23 or higher required due to android:fraction="0" .animation.AnimationLoading .animation.ShapeHolder .layout.animation_loading.xml Loads animations from Xml files: R.animator.object_animator (animates ball[0] "y" from 0 to 200, and reverses), R.animator.animator (animates ball[1] alpha from 1 to 0 and reverses), R.animator.animator_set (an animator set which animates ball[2]'s "x" from 0 to 200, and "y" from 0 to 400), R.animator.color_animator (an animator which animates ball[3]'s color from #0f0 to #00ffff), R.animator.object_animator_pvh (an animator which animates ball[4]'s "x" from 0 to 400, and "y" from 0 to 200 using propertyValuesHolder's), R.animator.object_animator_pvh_kf (uses propertyValuesHolder to hold keyfram
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
