SoFunction
Updated on 2025-04-07

Flex TileList custom spacing and theme styles


/**
* Author Dante
* Email:rubbish86630@
* CreatedTime:2009.04.13
* Description:
* This component implements the selection and stroke of the theme style and adds spacing
* **/
package myLib {

import ;
import ;

import ;
import ;
public class MyTileList extends TileList {

[Bindable]
private var _verticalGap:Number = 0;

[Bindable]
private var _horizontalGap:Number = 0;

public function MyTileList() {
super();
}
/**
* Rewrite the mouse and click it too loudly
* @indicator:Sprite
* @x:Number
* @y:Number
* @width:Number
* @height:Number
* @color:uint
* @itemRenderer:IListItemRenderer
* return void
* **/
override protected function drawHighlightIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void {
//Drawing
var g:Graphics = ;

();
(color);
//Draw an ellipse
(0, 0, width - _horizontalGap, height - _verticalGap);
();

= x;
= y;
}

/**
* Rewrite and select Highlight
* @indicator:Sprite
* @x:Number
* @y:Number
* @width:Number
* @height:Number
* @color:uint
* @itemRenderer:IListItemRenderer
* return void
* **/
override protected function drawSelectionIndicator(indicator:Sprite, x:Number, y:Number, width:Number, height:Number, color:uint, itemRenderer:IListItemRenderer):void {
//Drawing
var g:Graphics = ;

();
(color);
//Draw an ellipse
(0, 0, width - _horizontalGap, height - _verticalGap);
();

= x;
= y;
}

//=============================
// set and get
//=============================
public function set verticalGap(value:Number):void {
_verticalGap = value;
}

public function get verticalGap():Number {
return _verticalGap;
}

public function set horizontalGap(value:Number):void {
_horizontalGap = value;
}

public function get horizontalGap():Number {
return _horizontalGap;
}
}
}