[Android Themes] pomenx:
newly added:

2.10 updated, customisable lockscreen

each lockscreen mtz could has a config.xml file, this file describes the items which are configurable. the file config.xml comes along with manifest.xml under the advance folder.

you can customise the unlock application for now. and more.

config.xml format:

// root

<Config>

// config group

// text: the display name of group which shows on the configuration setting UI.

e.g.

<Group text="Date & Time">

// config items:

//text: display name of an item, which displays on the configuration setting UI

//summary: detailed description of an item

//id: the variable name binds to this config item

//default: default value

a config item will bind its value which would be changed by user on the setting UI to the variable specified by id. the variable can be refered in manifest.xml

// switch

<CheckBox text="" summary="" id="show_date" default="1"/>

// text input

<StringInput text="" summary="" id="date_format" default="k:mm"/>

// text choice

<StringChoice text="" summary="" id="time_format">

//choice items:

<Item value="hh:mm" text="12 hours"/>

<Item value="kk:mm" text="24 hours"/>

</StringChoice>

//number choice

<NumberChoice text="" summary="" id="">

//choice items

<Item value="0" text="Mode 1"/>

<Item value="1" text="Mode 2"/>

</NumberChoice>

//number input

<NumberInput text="" summary="" id="" default=""/>

// select application shortcut in unlocker, id: the intent id in EndPoint, will set the intent according to the selection.

<AppPicker text="" id=""/>

sample:

config.xml

<Config>

<Group text="Date & Time">

<CheckBox text="Display date" id="show_date" default="1"/>

<StringInput text="Date format" summary="" id="date_format" default="yyyy/M/d EEEE"/>

<NumberInput text="Date text size" id="text_size_date" default="14"/>

<NumberInput text="Date vertical offset" id="date_position_y" default="0"/>

</Group>

<Group text="App shortcut">

<AppPicker text="Left unlocker shortcut" id="left_task"/>

<AppPicker text="Right unlocker shortcut" id="right_task"/>

</Group>

</Config>

manifest.xml

<!-- if const is true, the variable will only evaluate once at the initial time, -->

<Var name="show_date" expression="ifelse(isnull(#show_date),1,#show_date)" type="number" const="true"/>

<Var name="text_size_date" expression="ifelse(isnull(#text_size_date),18,#text_size_date)" type="number" const="true"/>

<Var name="date_format" expression="ifelse(isnull(@date_format),'MMMMd日 EEEE', @date_format)" type="string" const="true"/>

<DateTime visibility="#show_date" x="#screen_width/2" y="#screen_height-260+49+#time_panel.actual_h+#unlocker.move_y+#date_position_y" align="center" color="#AAEEEEEE" size="#text_size_date" format="@date_format"/>

<Unlocker name="unlocker" bounceInitSpeed="1000">

<StartPoint x="0" y="#screen_height-275" w="#screen_width/4" h="120">

</StartPoint>

<EndPoint x="0" y="#screen_height-150" w="#screen_width/4" h="300">

<Intent id="left_task" action="android.intent.action.VIEW" type="vnd.android.cursor.dir/calls"/>

</EndPoint>

</Unlocker>

<Unlocker name="unlocker" bounceInitSpeed="1000">

<StartPoint x="#screen_width*3/4" y="#screen_height-275" w="#screen_width/4" h="120">

</StartPoint>

<EndPoint x="#screen_width*3/4" y="#screen_height-150" w="#screen_width/4" h="300">

<Intent id="right_task" action="android.intent.action.MAIN" type="vnd.android-dir/mms-sms" category="android.intent.category.DEFAULT"/>

</EndPoint>

</Unlocker>

// show the app shortcut name

<Text x="#screen_width/2" y="#screen_height-350" align="center" color="#AAFFFFFF" alpha="255-#unlocker.move_y*255" size="24" textExp="'slide unlock to '+ifelse(isnull(@right_task.name)+eqs('',@left_task.name),'Phone',@left_task.name)"/>

1.7

2 new elements added <Var> <VarArray> for defining single variable and array

<Var name="" expression="" type="" const=""/>

name: variable name

expression: the expression for this variable note: defining a const string needs a more pair of "'" : expression="'my string'"

type= number/string number variable or string variable default: number

const =true , if const is true, the variable would only calculate once in initiation, if this variable will not change when lockscreen starts runing, set const false can improve performance, if it's changing you should not set it true. default: false

array, index base 0

<VarArray type="string">

<Vars>

<Var name="date_format1" index="#time/2000%5"/>

<Var name="date_format2" index="2" const="true"/>

...

</Vars>

<Items>

<Item expression="ifelse(isnull(@date_format),'MMMMd日 EEEE', @date_format)"/>

<Item value="EEEE"/>

...

</Items>

</VarArray>

type=number/string number array or string array, default: number

Var: the variable binds to this array

name

index, could be an expression

Item: element in array

expression: the expression of this variable

value: if element is const value, use value to specify

code sample:

<!-- if const is true, the variable will only evaluate once at the initial time, -->

<Var name="show_date" expression="ifelse(isnull(#show_date),1,#show_date )" type="number" const="true"/>

<Var name="text_size_date" expression="ifelse(isnull(#text_size_date),18,#tex t_size_date)" type="number" const="true"/>

<VarArray type="string">

<Vars>

<Var name="date_format1" index="#time/2000%5"/>

<Var name="date_format2" index="2" const="true"/>

</Vars>

<Items>

<Item expression="ifelse(isnull(@date_format),'MMMMd日 EEEE', @date_format)"/>

<Item value="EEEE"/>

<Item value="yyyy年"/>

<Item value="MMMM"/>

<Item value="d日"/>

</Items>

</VarArray>

<DateTime visibility="#show_date" x="#screen_width/2" y="100" align="center" color="#AAEEEEEE" size="#text_size_date" format="@date_format1"/>

// the datetime show date in different format every 2 seconds.

new attribute for Unlocker: alwaysShow="true/false"

<Unlocker alwaysShow="true">

before if one unlocker is in non normal state, other unlockers will be hide, this brings inconvenience sometime, now you can specify a unlocker show always

12.16

expression support strings, concatenate strings or numbers using "+" , isnull can be used to string variable，ifelse can select strings as well, string compare: eqs(@string1, @string2)

Text added textExp attribute which support string expression:

example:

<Text visibility="#hasweather" x="(#screen_width/2)+180" y="#screen_height-290" w="360" size="36" color="#ffffff" alpha="255" align="right"

textExp="ifelse(isnull(#weather_temperature),'--',#weather_lowTemperature) + '℃'"

alpha="255-#unlocker.state*255"/>

12.5

support formating of “where”

<ContentProviderBinder where="" whereFormat="" whereParas="">

content provider supports dependency, variables acquired after the query of a ContentProviderBinder can be used as the query parameter of another ContentProviderBinder

<ContentProviderBinder name="name1" dependency="name2">

<ContentProviderBinder name="name2" >

after name2 query complete, name1 could use the variables binded in name2 as format parameters. and if the data changes in name2 and triggers the query of name2, it will also trigger the query of name1 after query complete of name2.

11.24

support the content provider in android, basically it provides a common interface to query applications' raw database. and the new feature of lockscreen defines a set of xml language for describing how to query the content provider and bind the result to lockscreen variables, so the lockscreen could display any other applications' information as long as it provides a content provider.

xml format:

<VariableBinders>

<ContentProviderBinder uri="content://sample/test" c uriFormat="" uriParas="" columns="col1,col2" where="" args="" order="" countName="count_name">

<Variable name="variable_name1" type="int" column="col1" row="0"/>

<Variable name="variable_name2" type="string" column="col2" row="0"/>

</ContentProviderBinder>

</VariableBinders>

VariableBinders: defines all kinds of variables which bind to a certain source.

ContentProviderBinder: define a content provider and variables bind to it.

uri: content provider uri, specifies which content provider your are selecting.

uriFormat: if the uri needs appending a variable, this can be used together with uriParas

uriParas: just like the Text element's format and paras

columns: what columns you want to query, separate by comma

where: the query condition, same as the SQL

args: arguments for "where", maybe it's not useful for now.

order: order by specification, refer to SQL

countName: bind the query result count to a number variable which has the given name.

Variable: defines a variable

name: variable name

type: the type in database, could be string/double/float/int/long

column: to which column of the result it binds.

row: to which row of the result it binds

for example (code only works in this week's version which is not released yet):

query weather info from google weather.

(check out the attachment "TF3 lockscreen weather.zip" change zip to mtz)

<!-- content provider binder for google weather -->

<VariableBinders>

<ContentProviderBinder

uriFormat="content://com.google.android.apps.genie.geniewidget.weather/weather/current/%d"

uriParas="#time_sys"

columns="iconResId,location,temperature,lowTemperature,highTemperature,description"

countName="hasweather">

<Variable name="weather_id" type="int" column="iconResId"/>

<Variable name="weather_location" type="string" column="location"/>

<Variable name="weather_temperature" type="int" column="temperature"/>

<Variable name="weather_lowTemperature" type="int" column="lowTemperature"/>

<Variable name="weather_highTemperature" type="int" column="highTemperature"/>

<Variable name="weather_description" type="string" column="description"/>

</ContentProviderBinder>

</VariableBinders>

<!-- weather info display -->

<Text visibility="#hasweather" x="240" y="60" w="360" size="24" color="#FFFFFF" alpha="200" align="center"

format="%s %s %d℃"

paras="@weather_location,@weather_description,#weather_temperature" />

<Text visibility="#hasweather*not(isnull(#weather_lowTemperature))*not(isnull(#weather_highTemperature))" x="240" y="85" w="360" size="22" color="#FFFFFF" alpha="200" align="center"

format="%d℃ / %d℃" paras="#weather_lowTemperature,#weather_highTemperature"/>

<Text visibility="#hasweather*isnull(#weather_lowTemperature)*not(isnull(#weather_highTemperature))" x="240" y="85" w="360" size="22" color="#FFFFFF" alpha="200" align="center"

format="--℃ / %d℃" paras="#weather_highTemperature"/>

<Text visibility="#hasweather*not(isnull(#weather_lowTemperature))*isnull(#weather_highTemperature)" x="240" y="85" w="360" size="22" color="#FFFFFF" alpha="200" align="center"

format="%d℃ / --℃" paras="#weather_lowTemperature" />

<Image src="weather.png" visibility="#hasweather" x="240" y="100" srcid="#weather_id" align="center">

<PositionAnimation>

<Position x="-10" y="0" time="1000"/>

<Position x="10" y="0" time="3000"/>

<Position x="0" y="0" time="4000"/>

</PositionAnimation>

</Image>

// google weather id list

weather_chance_of_rain = 2130837536;

weather_chance_snow = 2130837540;

weather_chance_storm = 2130837544;

weather_clear = 2130837556;

weather_cloudy = 2130837560;

weather_flurries = 2130837564;

weather_fog = 2130837568;

weather_heavy_rain = 2130837572;

weather_icy_sleet = 2130837576;

weather_mist = 2130837583;

weather_partly_cloudy = 2130837587;

weather_rain = 2130837600;

weather_snow_rain = 2130837606;

weather_snow = 2130837608;

weather_sunny = 2130837612;

weather_thunderstorm = 2130837617;

weather_unknown = 2130837621;

weather_windy = 2130837626;

another one:

query the MIUI note content:

<VariableBinders>

<ContentProviderBinder uri="content://notes/note" columns="modified_date,snippet" order="modified_date DESC" countName="note_count">

<Variable name="note_date1" type="long" column="modified_date" row="0"/>

<Variable name="note_snippet1" type="string" column="snippet" row="0"/>

</ContentProviderBinder>

</VariableBinders>

<DateTime x="300" y="50" color="#ffffffff" visibility="#note_count" value="#note_date1" format="yyyy年MMMMdd日 hh:mm"/>

<Text x="5" y="180" w="450" color="#ffffffff" visibility="#note_count" size="18" marqueeSpeed="60" text="@note_snippet1"/>

the missed call query:

columns = "_id,number"

where = "type=3 AND new=1";

uri ="content://call_log/calls";

you can display the call number in lockscreen and the date or anything else.

and added several functions for expression:

eq(x, y) // x==y ? 1 : 0

ne(x, y) // x!=y ? 1 : 0

ge(x, y) // x>=y ? 1 : 0

gt(x, y) // x>y ? 1 : 0

le(x, y) // x<=y ? 1 : 0

lt(x, y) // x<y ? 1 : 0

isnull(x) // x==null ? 1 : 0 // whether the expression contains a null variable. usually for binded variables, to judge whether the value in database is null.

not(x) x>0 ? 0 : 1

ifelse(x, y, z) // x>0 ? y : z

others:

1. using images to display a number

<ImageNumber number="" src="">

number: the expression of number value

src: the image name, supports SourceAnimation

if src="number.png" it will use number_0.png number_1.png ... images to draw the number, kinda like the Time

2. #time_sys variable, the current system time in miliseconds