Android_800_thumb800

Build your own custom layouts and manage the related adapters for populating them with useful data.

Creating Custom Adapters

android_custom_adapter

 

activity_main.xml

gridimage.xml

MainActivity.java

drawable source download: drawable-xxxhdpi

Other Controls

ScrollView is a control for setting up a View container with a vertical scrollbar. This is useful when you have too much to fit onto a single screen.
The ProgressBar and RatingBar controls are like sliders. The first shows the progress of some operation visually (perhaps a file download or music playing), and the second shows a rating scale of stars.
The Chronometer control is a timer that counts up. There’s a CountDownTimer class if you want something to help you display a countdown timer, but it’s not a View class. The Switch control, which functions like a ToggleButton but visually has a side-to-side presentation, was introduced in Android 4.0, along with the Space view, a lightweight view that can be used in layouts to more easily create spaces between other views.
WebView is a very special view for displaying HTML. It can do a lot more than that, including handling cookies and JavaScript and linking to Java code in your application. But before
you go implementing a web browser inside your application, you should carefully consider invoking the on-device web browser to let it do all that heavy lifting.

Apress Pro Android 5

Android 6 – More Advanced UI Layouts

Category: AndroidPrograming
0
599 views

Join the discussion

Your email address will not be published. Required fields are marked *

Comment moderation is enabled. Your comment may take some time to appear.