layout columns and rows - Android Software Development

I'm trying to find something similar to a tab delimited column header and rows.
Ex:
Code:
Column 1 Column 2 Column 3
1 $52.33 $82.54
297 $15,323.87 $82,963.54
No matter what the denominations of the money is or the Column 1 counter, that is, if Column 1 goes to 10 or 100, it won't "push" the values in column 2 and 3 to the right. Same thing with the $ sign; I want it line up underneath the first letter of the column header whether its $0.23, $1.65 or $21,234.88.
Any ideas?

Related

ThrottleLauncher Skining tutorial

Hi!!!
Here you have a little tutorial on how to create Themes for throttlelauncher. I still have to work on it but almost all is here. With this, theorically you can create almost any interface (still there's some work to do to achieve this ).
Any help, sugestions or requests are appreciated.
To read this tutorial is recomended to know XML file format.
First of all the file structure of a setup for throttlelauncher must be this.
- throttlelauncher instalation
|- Setups
|- MyTheme
|- Skins
|- Skin1
|- skin.xml
|- ...pictures of the skin​ |- Skin2
|- skin.xml
|- ...pictures of the skin​ |- Skin3​ |- config.xml
|- ....imported xml files
|- icons
|- ....my icons... any dir estructure​can be placed inside
To configure the app there are several tags. All the xml must be inside the root tag.
configuration: this tag contains the configuration parameters for the app (especified by the tag param). The allowed params names are:
- appear: Boolean value. Defines if the animation from down to top when the app got focus is activated (only valid for the standalon app).
- skin: defines the path of the folder of the skin to use. Relative to the app folder. See some post's below how to create the skin files.
- speeddecreaserate: factor that multiplies the value of your finger speed when starting kinetic scrolling.
- speedinitmultiply: factor that sets how fast the speed will be decreased in kinetic scrolling. IMPORTANT: set a value greatter than 1.
- status: two possible values. 0: normal (will show title bar and button bar of the app). 1: Maximized (will show the app fullscreen).
- osdenabled: It true, the OSD top bar will be shown when element is selected.
- imagecontactnophoto: Relative path to the image to be used it there's no contact photo.
- minclicktime: Min lapse time in miliseconds between the mouse down and up events to perform a click over the pressed element.
- .... there are some more... I will add them latter.
Example:
Code:
<configuration>
<param name="screenshot" value="True" />
<param name="appear" value="True" />
<param name="skin" value="Setups\Touchflo3D\skins\general" />
<param name="speeddecreaserate" value="1.2" />
<param name="speedinitmultiply" value="1.4" />
<param name="status" value="1" />
</configuration>
page: wich represent a page inside the app. Must be placed inside the root tag and the first one in the file is going to be the first one been showed by default. Page can have 2 attributes:
- name: contains the name of the page. This is going to be used when whe create a link to this page.
- loadonstartup: Boolean value, the default is "true". I recomend to set it to "false" in any page that be do not use frecuently to reduce memory usage.
- autounload: Indicates if the page will be unloaded automatically (and all it's resources will be freed).
- autounloadtime: time a unused page will remain loaded until autounload event starts. This param will be only used it autounload is true.
- import: will import the target xml as content of the page.
Example:
Code:
<page name="Home" loadonstartup="True" autounload="false">
row: Must be placed inside a page tag. They are specified in order from top to bottom. The following attributes are allowed:
- name
- marginX / marginY : margin bettwen the elements contained in the row.
- rows: number of rows of elements. If you set it up to -1 the number of rows is infinite.
- minheight: minimum height of the row (use recomended with dinamically sized rows due to contents like all contactswith photo or runningapps or recent)
- mincolwidth:
- scrollingmode: one of [Paged, WheelOfFortune, Direct, Kinetic, Auto, None]
- alignment: one of [left,right,center]
Example:
Code:
<row name="Programs" marginX="5" marginY="1" rows="3" scrolling="Paged">
footer: Must be placed inside the root tag. It parametters are exactly the same as the row. The footer is common for all the pages. Only one footer can be especified.
icon: Must be used inside the row tag or the footer tag. Used to display an icon. The allowed attributes are:
- name: Will be shown in the OSD when the icon is selected.
- path: path of the icon file. Recomended to use png. Can be absolute or relative to the app path. If the path is not specified, then the file on exec (if it's exe or lnk) will be used to obtain the icon image. No zooming efect will be applied in this case.
- exec: file to execute when the icon is clicked (deprecated, use event click instead).
- params: params for the file execution (deprecated, use event click instead).
- width: override the icons width.
- height: override the icons height.
- rowspan: indicates that the icon fills that number of rows intead of 1.
- showtext: will display the name of the icon as footer text.
Example:
Code:
<icon name="New Contact" exec="\windows\poutlook.exe" params="contacts -new" path="icons\contact.png" />
separator: must be especified inside a row or a footer. Allowed attributes are:
- name: if especified will show a vertical oriented text. If not especified the separator will show a vertical line.
Example:
Code:
<separator name="Personal" />
continues
text: Must be especified inside a row or a footer. Used to show text. Inherits all the atributes of the icon (so background icon can be displayed) plus:
- text: contains the text to be shown. The ~ symbol can be used for "new line", and two especial sentences:
* date: #$date,format#. Will be replaced by the date in the format especified. Will be updated automatically every second.
* reg: #$reg,key#. Will de replaced by the value of the desired key. Will be updated every second. When regkey is especified you can also use this format to parse date registry values: #$reg,key,date,dateformat
Example, start date for next apointment: #$reg,HKEY_CURRENT_USER\System\State\Appointments\Next\Start Time,date,MMM/dd/yyyy hh:mm#
- fonttype: font type specified by "fontname,size,bold" or "size,bold".
- fontcolor: RGB value.
- leftmargin: margin left of the text.
- topmargin: margin top of the text.
- spacing: interline spacing.
- textwidth: defines the width of the area filled by the text
- textheight: defines the height of area filled by the text
- textimages: defines a path where you can place images for each caracter on the text. Example: textimages="setups\Touchflo3d\icons\tf3d\numbers\#$char#.png" where #$char# will be replaced on the path for the character.
Example:
Code:
<text text="#$date,HH:mm:ss#~#$date,dd/MM/yy#~#$date,ddd#" fonttype="12,true" fontcolor="255,255,255" leftmargin="10" topmargin="10" spacing="-10" rowspan="3" width="100"/>
clock: must be inside a row or a footer. Inherits all the attributes of the icon. Can contain the following tags:
- hours
- minutes
- seconds
Each of those tags can contain a color attribute with the color in RGB for the line. If some of those tags is not especified, the respective line will not be shown.
Example:
Code:
<clock name="clock" path="clock.png" rowspan="3">
<hours color="0,0,100"/>
<minutes color="100,100,200"/>
<seconds color="160,160,255"/>
</clock>
allcontactswithphoto: must be inside a row or a footer. Will display all contact with photo matching the criteria in the attributes and assigned to the category "ThrottlePhotoDial".
- name: name of the tag element.
- categoryfilter: comma separated list of contact categories to be included on the filter.
- showcategories: If true will automatically show a separator for each category containing contacts.
- max: max number of contacts to display.
- width/height: define the diaplay size of the contact photos.
- All contacts with photo tag may contain two special icons with this two exec values: ":addcontact",":removecontact". This icons will open a contact selecting dialog allowing to choose a contact to asign or remove the "ThrottlePhotoDialer" category.
Example:
Code:
<allcontactswithphoto height="80" width="60" max="100" showcategories="True" name="Group unnamed">
<icon name="New Contact" exec=":addcontact" rowspan="1" height="80" width="80" path="setups\Default\icons\contact_add.png" />
<icon name="Remove Contact" exec=":removecontact" rowspan="1" height="80" width="80" path="setups\Default\icons\contact_del.png" />
</allcontactswithphoto>
lastapps: must be included inside a row or a footer. Will display the last 12 apps executed (same shown in the start menu). Can include the following attributes:
- name.
- zoom: will zoom the icons if different than 1.
Example:
Code:
<lastapps zoom="1" name="Group unnamed" />
runningapps: will display the running apps icons. The following attributes can be included:
- name.
- zoom: will zoom the icons if different than 1.
Inside you can especify the app's to exclude from the list by using the exclude tag as shown in the example.
Example:
Code:
<runningapps zoom="1" name="Group unnamed">
<exclude name="\Windows\shell32.exe" />
<exclude name="\Windows\cprog.exe" />
<exclude name="\Windows\repllog.exe" />
<exclude name="\Windows\gwes.exe" />
<exclude name="\Windows\filesys.exe" />
<exclude name="\Program Files\ThrottleLauncher\ThrottleLauncher.exe" />
</runningapps>
continued....
folder: this will add an icon for each file cotained in the specified folder matching the pattern if any.
- zoom: zoom to be aplied to the icons.
- path: path of the folder to load. If the folder path is on the registry, you may specify the registry path (sample: HKEY_LOCAL_MACHINE\Explorer\CrossPlatformNavigationURL).
- pattern: pattern to be used to filter the files.
- recursive: indicates wether to look into subfolders (any subfolder loaded will generate automatically a spearator named as the folder).
- name
plugin: this is used to include a today plugin inside the main app (not the today plugin).
- name: name of the plugin to be used. Importan the name MUST be the name of entry in HKEY_LOCAL_MACHINE\Software\Microsoft\Today\Items\. ONLY PLUGINS BASE ON DLL's WILL WORK.
examples:
Code:
<plugin name="ADBWeatherPlus"/>
<plugin name="rlToday"/>
<plugin name="HTC Home"/>
<plugin name="BatteryStatus"/>
-throttleplugin: with this tag you can include 3rd party plugins for throttle launcher. For example you can include flash using the following:
<throttleplugin name="Reloj" path="#$THROTTLE#\Plugins\Flash\FlashPlugin.dll" height="90" class="FlashPlugin.FlashThrottlePlugin">
<param name="movie" value="#$THROTTLE#/Setups/Touchflo3dFlash/TWolf/Clock/horas_28_LITE.swf"/>
<param name="width" value="240"/>
<param name="backgroundpath" value="#$THROTTLE#\Setups\Touchflo3dFlash\TWolf\Clock/fondoReloj.jpg"/>
</throttleplugin>
Skins
Skins are based on xml file as config.xml does. Skin xml file may only contain param tag placed inside the root tag. All the params are optional, so if you don't need one, don't especify it!!
All files refenced by the skin.xml need to be placed on the same skin folder.
Params tag format is the following:
Code:
<param name="name" value="value"/>
The allowed names and it's values meanings are:
- trasparency: will allow trasparency for the skin. This means that if the skin is applied to a row the row background will be filled with the main setup skin texture.
- pagebackcolor: backcolor to be used as page background (only used for main setup skin).
- rowbackcolor: backcolor to be used on the rows (this will be used as the trasparent color if trasparency is specified).
- texture: relative path to the texture image to be used as page background.
- rowtexture: relative path to the texture image to be used as rowbackground.
- buttonback: relative path to the back image to be used on all clickable elements.
- selectionimage: relative path to the hover image to be used when an element is selected.
- buttonbackmargin: margin to be used between the buttonback image and the main element image.
- fontstyle: font style for the text displayed for example in the separators or the contact names. Two formats can be used: "size, bold" or "size, bold, fonttype".
- linecolor: color to be used for lines. Must be specified in an RGB value.
- textcolor: color for text. RGB
- osdtextcolor: color for OSD text. RGB
- osdbackcolor: color to be used as the OSD back color. RGB.
- osdfontstyle: font style for the text displayed in the OSD. Two formats can be used: "size, bold" or "size, bold, fonttype".
reserved.......
reserved.....
Thanks, APBilbo, for sharing this. Really appreciate your help towards the community.
Thanks a lot!!! I really love this app. Its the best one I have found so far. I would be surprised if Verizon and T-mobile dont start using this in the phones they sell...
I wish I had the time to create using ThrottleLauncher, I guess I'll leave it up to the pro's. Thanks for sharing your knowledge.

Help with shrinkColumns in a TableLayout

I'm build a TableLayout and one of my columns has a TextView that is long(wordy). It's in column 0. If I use shrinkColumns on column 0, it wraps all TextViews in all rows for column 0, even though most of the columns only have 2 or 3 words. Is there a way to have one cell of the table shrink/word wrap without effecting the others? I would prefer to do it in XML if possible.
so.. you just want to have one cell smaller than the rest?
doesn't that kind of defeat the purpose of a table layout?
can you just use a bunch of linear layouts?

[Request] Small widget that shows value at screen and changes value in text-file

eLocity A7 users need small widget
View
1. Show text at screen according value from config-file
If value 0 then text "USB Slave"
If value 1 then text "USB Host"
2. If user pressed on widget it should change state at screen and value in config-file (inverse value: 0 -> 1 or 1 -> 0)
3. If value was changed then show one of two variants:
a) pop-up text "You must reboot to apply settings" (like in Astro, it shows text "press back once more to exit" in grey square over screen)
b) pop-up window with text "You must reboot to apply settings" and button "Ok"
I don't know has widget ability to show modal-windows?
Config
1. Ability to change path and name of config-file
Additional
1. Without periodical updates. Only when:
- user is pressing on widget
- device is turning on
- device waking from sleep on
Real example
File: /data/data/com.compal.usg_otg/usb.txt
Values in file usb.txt (only one value)
0 or 1
p.s.
I found only text widgets which show some text but they don't read value from file and don't allow change value in file
I know about GScript. I can create script that changes value in file and inverses value too but i don't know how show value at screen
Widget will fuse both functions)
Thx...

Can taskbar display seconds in time??

I need show time in HH:mm:ss format in taskbar,but WM6.5 just show HH:mm, I need display seconds,how can I do it? thanks everyone...
IMHO yes. To change the time layout or format in taskbar you
1. Go to HKEY_LOCAL_MACHINE\nls\overrides
2. Edit the following values
STime STRING ":" - This setting allows you to modify the separator between hours and minutes, minutes and seconds
STFmt STRING "h:mm:ss tt" - Changes the time layout or format (see below list)
S1159 STRING "am" - Allows you to modify the AM suffix
S2359 STRING "pm" - Allows you to modify the PM suffix
Info:
Time Format String
h - Hours 12 Hour Clock with No Leading Zero
hh - Hours 12 Hour Clock with Leading Zero
H - Hours 24 Hour Clock with No Leading Zero
HH - Hours 24 Hour Clock with Leading Zero
m - Minutes with No Leading Zero
mm - Minutes with Leading Zero
s - Seconds with No Leading Zero
Ss - Seconds with Leading Zero
t - am/PM indicator - First Letter Only
tt - am/PM indicator - First Two Letters
ttt - am/PM indicator - First Three Letters
Thanks for help,but my default setting already is STFmt=HH:mm:Ss ,but in Wm6.5's taskbar only show hour and minute,no seconds,I don;t know why...
May be somebody know how do time with seconds on lock screen? Or how use HH:mm:ss ff in HKLM\nls\overrides or in other place...

Dynamic text wrap

Hi,
In my application i am dynamically creating a table layout. In each row of the table layout have 3 text views. but the auto wrap of the text is not working on these text views in multiple screen resolutions.
vrenjithkr said:
Hi,
In my application i am dynamically creating a table layout. In each row of the table layout have 3 text views. but the auto wrap of the text is not working on these text views in multiple screen resolutions.
Click to expand...
Click to collapse
did you set the height and width to "wrap_content"? if yes and still didnt work try this
Code:
android:layout_weight="1"
android:ellipsize="none"
android:maxLines="100"
android:scrollHorizontally="false"
android:layout_weight="1" android:ellipsize="none" android:maxLines="100" android:scr
Thank you for reply. I am dynamically crating the table layout. How can give these details in activity class..
vrenjithkr said:
Thank you for reply. I am dynamically crating the table layout. How can give these details in activity class..
Click to expand...
Click to collapse
You need to specify the layout parameters look at this sample program of adding a text view
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:stretchColumns="0,1" android:id="@+id/main_table" android:layout_weight="1" android:layout_height="wrap_content" android:layout_width="match_parent"> </TableLayout>
Once you ready with basic blank table layout open your respective activity page and define the table element
TableLayout t1; TableLayout tl = (TableLayout) findViewById(R.id.main_table);
Create table row header to hold the column headings
TableRow tr_head = new TableRow(this); tr_head.setId(10); tr_head.setBackgroundColor(Color.GRAY); tr_head.setLayoutParams(new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
Add two data sections to the table row
TextView label_date = new TextView(this); label_date.setId(20); label_date.setText("DATE"); label_date.setTextColor(Color.WHITE); label_date.setPadding(5, 5, 5, 5); tr_head.addView(label_date);// add the column to the table row here TextView label_weight_kg = new TextView(this); label_weight_kg.setId(21);// define id that must be unique label_weight_kg.setText("Wt(Kg.)"); // set the text for the header label_weight_kg.setTextColor(Color.WHITE); // set the color label_weight_kg.setPadding(5, 5, 5, 5); // set the padding (if required) tr_head.addView(label_weight_kg); // add the column to the table row here
Regards
MasterAwesome

Categories

Resources