_views[0] =
ActivityIndicatorFactory.createActivityIndicator(0, bitmap, 5,
0, "with border", Field.FIELD_HCENTER);
_views[0].setBorder(border);
add(_views[0]);
add(new SeparatorField());
// Add an ActivityIndicatorView with label and animation centered in a
// horizontal layout
bitmap = Bitmap.getBitmapResource("spinner.png");
_views[1] =
ActivityIndicatorFactory.createActivityIndicator(
new HorizontalFieldManager(), Field.FIELD_HCENTER,
bitmap, 5, 0, "horizontal centered layout",
Field.FIELD_HCENTER);
add(_views[1]);
add(new SeparatorField());
// Add a centered ActivityIndicatorView between two focusable fields
add(new LabelField("focusable field", Field.FOCUSABLE));
bitmap = Bitmap.getBitmapResource("spinner2.png");
_views[2] =
ActivityIndicatorFactory.createActivityIndicator(
Field.FIELD_HCENTER, bitmap, 6, Field.FIELD_HCENTER,
"centered between focusable fields",
Field.FIELD_HCENTER);
add(_views[2]);
add(new LabelField("focusable field", Field.FOCUSABLE));
add(new SeparatorField());
// Add a right justified ActivityIndicatorView
bitmap = Bitmap.getBitmapResource("spinner.png");
_views[3] =
ActivityIndicatorFactory.createActivityIndicator(
Field.USE_ALL_WIDTH, bitmap, 5, Field.FIELD_RIGHT,
"right justified layout", Field.FIELD_VCENTER);
add(_views[3]);
add(new SeparatorField());
Background background; // Reuse this reference
// Add an ActivityIndicatorView featuring a solid black background
bitmap = Bitmap.getBitmapResource("orchid.png");
background = BackgroundFactory.createSolidBackground(Color.BLACK);
_views[4] =
ActivityIndicatorFactory.createActivityIndicator(0, bitmap, 6,
0);
_views[4].setBackground(background);
add(_views[4]);
add(new LabelField("solid background"));
add(new SeparatorField());
// Add an ActivityIndicatorView to another ActivityIndicatorView
bitmap = Bitmap.getBitmapResource("progress.png");
background = BackgroundFactory.createSolidBackground(Color.DARKGRAY);
_views[5] =