Difference between revisions of "Using Phonebot display properties"

From EtherWiki
Jump to: navigation, search
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
Scripts can access display properties for modules and controls.
 +
 
Methods
 
Methods
  
Line 12: Line 14:
 
|
 
|
 
|}
 
|}
 +
 +
The following groups and properties are valid:
  
 
{|class="wikitable sortable"
 
{|class="wikitable sortable"
Line 21: Line 25:
 
|<code>background</code>
 
|<code>background</code>
 
|<code>color</code>
 
|<code>color</code>
|
+
|An ARGB value, see [http://developer.android.com/reference/android/graphics/Color.html Color]
 
|-
 
|-
 
|<code>font</code>
 
|<code>font</code>
Line 29: Line 33:
 
|
 
|
 
|<code>color</code>
 
|<code>color</code>
|
+
|An ARGB value, see [http://developer.android.com/reference/android/graphics/Color.html Color]
 
|-
 
|-
 
|
 
|
Line 72: Line 76:
 
|}
 
|}
  
 
+
Image properties are available for the [[Phonebot_developer%27s_reference/Object_reference#Image|image control]]. This control can display an image either from a URL or from the local file system.
Image properties are available for the [[Phonebot_developer%27s_reference/Object_reference#Image|image control]] which can display an image either from a URL or from the local file system.
 
  
 
The image can be stored in the following ways:
 
The image can be stored in the following ways:
Line 136: Line 139:
  
 
--[http://developer.android.com/reference/android/graphics/Matrix.ScaleToFit.html Matrix.ScaleToFit]
 
--[http://developer.android.com/reference/android/graphics/Matrix.ScaleToFit.html Matrix.ScaleToFit]
 +
 +
Phonebot Plus provides a dialog for setting these properties when developing applications.
 +
 +
[[Image:Display-properties.small.png]]
  
 
[[Category:Phonebot]]
 
[[Category:Phonebot]]

Latest revision as of 23:06, 18 July 2012

Scripts can access display properties for modules and controls.

Methods

Syntax Description
value = get_display(group, property)
set_display(group, property, value)

The following groups and properties are valid:

Group Property Description
background color An ARGB value, see Color
font bold boolean
color An ARGB value, see Color
italic boolean
name monospace, normal (default), sans, serif
size
image scale see below
source URL or path to image
storage see below
padding bottom
left
right
top

Image properties are available for the image control. This control can display an image either from a URL or from the local file system.

The image can be stored in the following ways:

Name Value Description
Link link Always display the image located at the URL or directory.
Link with copy link_copy Display the linked image and store a local copy If the image is no longer available, the copy will be displayed.
Copy copy Always use a local copy.

The image can be scaled with the following methods:

Name Value Description
Center center Center the image in the view, but perform no scaling.
Center crop center_crop Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).
Center inside center_inside Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).
Fit center fit_center Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. The result is centered inside dst.
Fit end fit_end Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. END aligns the result to the right and bottom edges of dst.
Fit start fit_start Compute a scale that will maintain the original src aspect ratio, but will also ensure that src fits entirely inside dst. At least one axis (X or Y) will fit exactly. START aligns the result to the left and top edges of dst.
Fit XY fit_xy Scale in X and Y independently, so that src matches dst exactly. This may change the aspect ratio of the src.

--ImageView.ScaleType

--Matrix.ScaleToFit

Phonebot Plus provides a dialog for setting these properties when developing applications.

Display-properties.small.png