fade-in view-type

The fade-in view-type increases the opacity of an item to the specified amount on MIDP 2.0+ devices.

Design


In the above example the "Save Game" menu entry is activated programmatically when the user selects the corresponding commands entry. This is done by calling UiAccess.setAccessible( List list, int listIndex, boolean accessible) with a #style preprocessing directive:
//#style fadeIn
UiAccess.setAccessible(this.menuScreen, 1, true);

The style fadeIn then uses the fade-in view-type. You can see a full working example of this in the accessible sample application.

.mainItem {
	margin: 2; /* for the border of the :hover style */
	padding: 5;
	background: none;
	font-color: fontColor;
	font-style: bold;
	font-size: small;
	layout: center; 
	max-width: 100;
	icon-image: url( icon%INDEX%.png );
	icon-image-align: top;
}

.mainItem:hover {
	margin: 0;
	background {
		type: round-rect;
		arc: 8;
		color: brightBgColor;
		border-color: fontColor;
		border-width: 2;
	}
	layout: expand | center;	
}

.mainItem:pressed {
	margin: 0;
	background {
		type: round-rect;
		arc: 8;
		color: fontColor;
		border-color: fontColor;
		border-width: 2;
	}
	font-color: brightFontColor;
	layout: expand | center;	
}

.fadeIn extends .mainItem {
	//#if polish.midp2
		view-type: fade-in;	
		fade-in-transparency-start: 40;
		fade-in-next-style: .mainItem;
	//#endif
}

CSS attributes:

CSS Attribute  DefaultValuesExplanationSince
fade-in-next-style - style The style that should be automatically set when the fade-in animation has been finished. 1.3
fade-in-transparency-delta 20 integer The amount by which the transparency is increased in each animation step. 1.3
fade-in-transparency-end 255 integer The transparency that is used for the last animation step. 1.3
fade-in-transparency-start 10 integer The transparency that is used for the first animation step. 1.3

JavaDoc