Category «Android Advanced Concepts»

Maintaining Compatibility in Android

Some material design features like the material theme and custom activity transitions are only available on Android 5.0 (API level 21) and above. However, you can design your apps to make use of these features when running on devices that support material design and still be compatible with devices running previous releases of Android. Define …

Defining Custom Animations in Anroid

Animations in material design give users feedback on their actions and provide visual continuity as users interact with your app. The material theme provides some default animations for buttons and activity transitions, and Android 5.0 (API level 21) and above lets you customize these animations and create new ones: Touch feedback Circular Reveal Activity transitions …

Working with Drawables in Android

The following capabilities for drawables help you implement material design in your apps: Drawable tinting Prominent color extraction Vector drawables This lesson shows you how to use these features in your app. Tint Drawable Resources With Android 5.0 (API level 21) and above, you can tint bitmaps and nine-patches defined as alpha masks. You can …

Dragging and Scaling in Android

This lesson describes how to use touch gestures to drag and scale on-screen objects, using onTouchEvent() to intercept touch events. Drag an Object If you are targeting Android 3.0 or higher, you can use the built-in drag-and-drop event listeners withView.OnDragListener, as described in Drag and Drop. A common operation for a touch gesture is to …

Handling Multi-Touch Gestures in Android

A multi-touch gesture is when multiple pointers (fingers) touch the screen at the same time. This lesson describes how to detect gestures that involve multiple pointers. Track Multiple Pointers When multiple pointers touch the screen at the same time, the system generates the following touch events: ACTION_DOWN—For the first pointer that touches the screen. This …

Handling the Results in Android

As shown in the previous lesson, you should begin loading your data with a CursorLoader in your implementation of onCreateLoader(). The loader then provides the query results to your Activity or FragmentActivity in your implementation ofLoaderCallbacks.onLoadFinished(). One of the incoming arguments to this method is aCursor containing the query results. You can use this object …