Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Monday, September 7, 2015

Create a Compound Widget for Android Lollipop: Part 4

Integrate a custom widget

This is the fourth in a four part article detailing the implementation of a compound widget for Android Lollipop. In this part I will implement my widget's programming and design interfaces.

Create a Compound Widget for Android Lollipop: Part 3

Create a class for my compound widget

This is the third in a four part article detailing the implementation of a compound widget for Android Lollipop. In this part I will implement a class to hold the code that defines my widget's behavior. I am going to start by implementing the minimum required to be able to use my widget in Android Studio's Design editor.

Create a Compound Widget for Android Lollipop: Part 2

Create a layout for a compound widget

This is the second in a four part article detailing the implementation of a compound widget for Android Lollipop. In this part I will implement the layout file for my widget. It will contain 4 sub widgets - 3 sliders  to adjust the quantity of red, green, and blue in the color and a preview area to show the color.


The orange rectangle represents the preview area and the red, green, and blue bars represent their respective color sliders. The gray rectangles represent layout elements. The outer layout will be a horizontal LinearLayout. The inner layout will hold the three color sliders and be a vertical LinearLayout.

Create a Compound Widget for Android Lollipop: Part 1

This is the first in a four part article detailing the implementation of a compound widget for Android Lollipop. A compound widget is a widget that is made up of other preexisting widgets. Typically a compound widget will hide the properties those sub widgets usually expose and expose its own custom properties instead.

The example I am going to use is to recreate the classic color picker control. The first version of this I remember seeing was on the Commodore Amiga 30 years ago.


I am going to create a simplified version of this that will set one color.