PART 1
STEP 1
Dimensioning Your Icons
There are many Software for this you can go for gimp, photoshop, illustrator and many more.
I prefer photoshop.
You can download or purcase from Adobe Store.
Icon size: 136 x 136 (pixels)
STEP 2
Adding layer styles.
Playing with Bleending option.
Add your design your settings add beveal, drop shadow and much more.
IMPORTING ICONS TO MIUI THEME EDITOR
STEP : 1
Now the First thing to DO is Extract the zip file.
STEP : 2
Now GO to MIUI Themes Editor and launch it.
There are two ways of getting started up.
Either select a Theme and Edit or start a new project
STEP : 3
Starting Up a New Project.
[Note: Click on the picture for Enlarging]
STEP : 4
Click on File > New Theme
STEP : 5
Specify a name and Location.
STEP : 6
Later Adding
Theme Name
Author
Designer
Version
PART TWO [ IMPORTANT ]
This is how you reach a fancy icons they are noting but icons with Gif kind of animation we call them dynamic
So what's so special about them ?
Heh!!
You need to know som XML tricks like i am going to show you and i will even share my files which you can edit.
So the above metioned picture is an example how to place it.
FOR CALENDAR
Icons
| __ fancy_icons
|__ com.android.calendar
manifest.xml should be place inside the folders with pngs files
<?xml version="1.0" encoding="utf-8"?>
<!-- calendar -->
<Icon version="1" frameRate="0" width="136" height="136" screenWidth="720" useVariableUpdater="DateTime.Day">
<VariableBinders>
<BroadcastBinder action="android.intent.action.TIME_SET" />
<BroadcastBinder action="android.intent.action.DATE_CHANGED" />
</VariableBinders>
<Group pivotX="68" pivotY="68">
<Image x="68" y="68" align="center" alignV="center" src="date.png" srcid="#date" />
</Group>
</Icon>
You need to edit them accordingly like i have thepng files settled inside the folder com.android.calendar
For Rotational ICONS
<?xml version="1.0" encoding="utf-8"?>
<!-- Audio -->
<Icon version="1" frameRate="30" width="192" height="192" screenWidth="1080" >
<Image x="96" y="96" align="center" alignV="center" src="icon_bg.png" />
<Image x="96" y="96" align="center" alignV="center" centerX="59" centerY="59" src="gear.png" >
<RotationAnimation>
<Rotation angle="0" time="0"/>
<Rotation angle="360" time="10000"/>
</RotationAnimation>
</Image>
</Icon>
And place the Two icons inside the subfolders.
Related
just played with my HTC touch HD and try to figure it out on how to change the Image Banner/Browser Icon on my Internet Tab....
check this out
http://s157.photobucket.com/albums/t57/butz007/htc%20touch%20hd/?action=view¤t=safari_browser.jpg
how to do it very simple
1. Create an Icon... must be on .PNG (whatever software do you prefer will definitely do as long as the final output would be on Transparent PNG)
note: the size of the PNG icon must be on 480 by 200 pixels, 72 dpi
2. Edit the XML code, don't be afraid this won't bite you (for all the newbs and non-developers)
you could always locate the XML code on this path on your device go to Application\Manila
InternetPortal.xml and InternetPortal-en-AU.xml
copy that and edit it on your desktop computer using a Notepad
note: make sure you have a back-up copy of the original better do this than sorry
then heres the original code just look the following highlighted text this is the one you going to change
***************************
<?xml version="1.0" encoding="utf-16"?>
<InternetPortal>
<IncludeUserFavorites>True</IncludeUserFavorites>
<Banner
DefaultImagePath="\Windows\480x200.qtc"
SelectedImagePath="\Windows\480x200.qtc"
Text="Launch Gee!"
NavigateUrl="http://gee-select.starhubgee.com.sg/wap/"
Width="480"
Height="215" />
<OperatorLinks>
<Link
Text="YouTube"
Executable="\windows\youtube.exe"
ImagePath="\Windows\HTC\Assets\Images\InternetPortal\youtube.qtc" />
</OperatorLinks>
</InternetPortal>
*******************************************
the first two highlighted text where the image path and the filename of icon that you just created... OK!?
example
DefaultImagePath="\Windows\myicon.png"
SelectedImagePath="\Windows\myicon.png"
second, I'm using a Blackstone that i bought in singapore so theres starhub logo and starhub link there so I've really don't know on your devices if were both the same but i think all htc devices were all the same when it comes to firmware.. so next on my device I got a welcome text
example
Text="Launch achu chu chu etc etc...or welcome to my world!"
Third Highlighted Text is the link of your banner
Whatever Link you may think that you usually go so often using your device
NavigateUrl="http://playboy.com"
and then FINALLY
copy this the two edited xml file and overwrite it on you devices, same path ofcourse.....Application\Manila, using Total Commander
then put your created art (PNG) on the main windows folder and viola, your personalized Internet Tab.......
...............................................................................
LIKE it..LOVE it.. HATE IT.. WHATEVER!! just enjoy it! ...
hi,
although i have done it on an OmniaII, yet i guess it is applicable on win6.5 regardless of the ppc.
ok,
i searched too much for a cab, or any to control start menu font. change sys font is available, menus but not the start menu.
for no reason i know, the start menu has its own control. i was able to make it 3 or 4 or 5 columns , but not the font
any way manually, go to win folder, locate the following 2 files:
StartMenu_GridScene_480x800.cpr
StartMenu_GridScene_480x800.cpr
they are the files controlling how u see start menu
then open both or any of them - i modified both- u will get the following
=================
<Form Width="480" Height="800">
<StartMenu_GridScene ID="Scene">
<GridView ID="Start Menu Items List" Top="0" Left="0" Width="480" Height="696" Columns="3" Scrollable="TRUE" HexagonGrid="TRUE" HorizontalWrapAround="TRUE">
<Image ID="Selection" Left="0" Top="-30" Width="192" Height="158" Source=".\StartMenu_Selection.png" />
<Layer ID="GridItem" Width="192" Height="166" OnAction ="GridItemAction">
<Layer ID="Normal">
<Image ID="Image" Left="51" Top="4" Width="90" Height="90" ScaleStyle="Fit" />
$$$$$HERE$$$$$ <Text ID="Text" Left="18" Top="98" Width="156" Height= $$$$$$"68" FontFamily="Tahoma" FontSize="7" $$$$$$ HorizontalAlignment="Center" VerticalAlignment="Top" Wrap="True" Trimming="EllipsisCharacter" ForeColor="#00FFFFFF" BackColor="#00000000" />
</Layer>
</Layer>
<Layer ID="NoItems">
<Text ID="Text" Width="480" Height="40" FontFamily="Tahoma" FontSize="10" ForeColor="#00FFFFFF" Wrap="False" HorizontalAlignment="Center" Trimming="Character" InnerTextType="Resource">shellres.dll,22596</Text>
</Layer>
</GridView>
</StartMenu_GridScene>
</Form>
======================
ok, i know nothing about this details except the $$$$$$$ ones - i have added the dollar sign for highlighting
i changed it from 7 to 14 .... for example, so i got what u see in the attached files. the font group can also changed.
i used notepad on my desktop and returned them to my omniaII. every change neeeeeeds restart to take effect.
attached are before and after modification.
Hey guys!
After some of @SpaceCaker 's modifications, we found out how to place a custom icon on the title bar of any app. You can use your app's iconfor reference. So, one of the synonyms that could be said for this guide is JellyBean Title Bar. The modification is very easythough, but the hard part is wether you find the right file which controls the title bar on a specified window. But, I can help you in this
After following the guide, if you didn't understand it properly, just give me the app and I will place the custom JB title bar on it as per your request.
Requirments :
- Basic XML knowledge
- APK Multi TOOL/Whichever decompiling tool
- Sources on attachments
Click to expand...
Click to collapse
There are 2 different methods to make this.
First method means that the custom windows are located on layouts folder.
Second method means that the windows are located on XML folder.
The first method is very good and is bugfree, but unfortunately it depends on the app. If wether he has the windows located
on layouts folder or XML folder
The second method is not fully bugfree. If the app's windows are located on XML folder then the title bar is going to be scrolled with the chooserboxes too. The only way to fix it is to create a layout for the window.
Click to expand...
Click to collapse
Screenshots of both methods:
One of HelpCentre (1st method) example given below and the second of DSP manager (2nd method).
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Click to expand...
Click to collapse
1. Decompile the app you want to place the custom title bar. I will take a custom built app "HelpCentre.apk"
2. Download the sources on the attachments and place the layout "title" on the layout folder
and the custom id on ids.xml file on values folder.
Code:
<item type="id" name="imageView1">false</item>
Click to expand...
Click to collapse
3.
a) In the first method the windows are located on the layouts. So see the following :
Go to layouts folder and now find the layout which is resposnible for the first window
Let's use an example :
I have credits.xml file on the layout folder. Now on this window, i want to place a custom title bar.
To do this i should include the custom title on layout folder on the first lines.
To make this, paste this code after xmlns:android="http://schemas.android.com/apk/res/android">
Code:
<include android:layout_width="fill_parent" android:layout_height="50.0dip" layout="@layout/title" />
Be sure to place it on the correct order.
I also, have FAQ.xml too. If i want edit this file too, there will be no title bar as on the end of the guide we will add
NoTitleBar theme on AndroidManifest.xml So, therefore i have to place the same value on it too.
Again, after the code xmlns:android="http://schemas.android.com/apk/res/android"> place this one :
Code:
<include android:layout_width="fill_parent" android:layout_height="50.0dip" layout="@layout/title" />
What if you want to use a custom title for the another window?
Easy, we are going to create another exact file as title.xml just that we will rename it different, like titleFAQ.xml.
On this XML we will change the android:icon value. We can use whatever value for the icon. For example,
"@drawable/ic_credits" Then, we will paste the png you want to place on the drawable-mdpi.
Now in the FAQ.xml file you want to place another icon title we should change the layout target so according to what I did so far on the file, this is the target i should place.
Code:
<include android:layout_width="fill_parent" android:layout_height="50.0dip" layout="@layout/titleFAQ" />
Click to expand...
Click to collapse
b) In the second method the windows are located on the XML folder. So follow below :
Go to XML folder and now find the XML which is responsible for the window.
So I will use the same example.
So let's say that the Credits.xml is on the XML folder. Now instead of including <include android:layout_width="fill_parent"......
you should include this code below xmlns:android="http://schemas.android.com/apk/res/android">
Code:
<CheckBoxPreference android:layout="@layout/title" android:title="Help Centre" android:key="Help_title_Centre" />
Android:title is the name of the title bar. You can set it to whatever name you want. Same goes with android:key.
To use another icon for the another title bar which is located on FAQ.xml like i mentioned before, change
Code:
<CheckBoxPreference android:layout="@layout/titleFAQ" android:title="Help Centre" android:key="Help_title_Centre" />
Click to expand...
Click to collapse
4. Now the final step is to go to AndroidManifest.xml and after the specified activity place the NoTitleBar theme
I edited Credits.xml and FAQ.xml so let's find their activity in there.
Code:
<activity android:name="Credits">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:name="FAQ">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
I now will add the theme value on both activities. This is the code
Code:
android:theme="@*android:style/Theme.Black.NoTitleBar"
After all it will look like this
Code:
<activity android:theme="@*android:style/Theme.Black.NoTitleBar" android:name="Credits">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity android:theme="@*android:style/Theme.Black.NoTitleBar" android:name="FAQ">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
Now we're done working.
5. Recompile the apk
6. Sign it (Always sign if you edit AndroidManifest.xml)
Click to expand...
Click to collapse
Credits :
Full credits goes to the most amazing themer I have ever seen, @SpaceCaker!
He made many works for Touchwiz Resurrection ROM and I have based the guide upon that modifications just that I have edited
the code and fully explained it.
Also, Touchwiz Resurrection Team members @Vishnu pv and @radichification for their support!
Click to expand...
Click to collapse
Enjoy!
Regards,
Teddy
Sweet u posted the guide :3 Good Good
If u are building app from source in a java based app or such
PHP:
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
addPreferencesFromResource(R.xml.twdevs);
setContentView(R.layout.twdevelopers);
add the
PHP:
setContentView(R.layout.twdevelopers);
line or such so u can have a Layout in the preferences app with
PHP:
extends PreferenceActivity{
and add a custom layout wich looks close to this
PHP:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android" >
<include android:layout_width="fill_parent"
android:layout_height="50.0dip"
layout="@layout/title" />
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="345dp" />
</LinearLayout>
</LinearLayout>
If you want to change the background target you should change something on title.xml or any other title xml you have created for your window.
Find :
Code:
<LinearLayout android:gravity="center_vertical"
Change :
Code:
android:background="@drawable/title_background"
to a different png target like :
Code:
android:background="@drawable/ics_title_background"
or :
Code:
android:background="@drawable/touchwiz_title_background"
And put the png on drawable-mdpi.
Also, I have included a normal icon for the title bar, but you can change it anytime, just replace it with another icon.
If you want to change the target of the icon find :
Code:
<ImageView android:id="@id/imageView1"
Change :
Code:
android:background="@drawable/title_icon"
To :
Code:
android:background="@drawable/ics_title_icon"
Or :
Code:
android:background="@drawable/touchwiz_title_icon"
And then like I mentioned before put the png on drawable-mdpi
Currently on the zip source I have included a Touchwiz title background as that's what I have atm, but you can get another one ICS or JB themed. I will provide them later. As per now, only touchwiz title background is available.
Download ZIP on attachments.
Don't forget to put correct credits if you are going to include this into your ROM/MOD/Theme.
Or just add a simple style with 9 png.
Which can be also changed as HomeDisabled as in non-launcher Activity like in ActionBar
Reserved for a simpler Guide
iamareebjamal said:
Or just add a simple style with 9 png.
Which can be also changed as HomeDisabled as in non-launcher Activity like in ActionBar
Reserved for a simpler Guide
Click to expand...
Click to collapse
we do know about this one
but it didnt really always worked and also this way it makes it bit easier to layout the icon properly and bg
because there are a lot of people who try this but fail with photoshoping the icon in background.
i also said that teddy shouldnt include the third method because that would be * to complex* lol
iamareebjamal said:
Or just add a simple style with 9 png.
Which can be also changed as HomeDisabled as in non-launcher Activity like in ActionBar
Reserved for a simpler Guide
Click to expand...
Click to collapse
The guide on the OP is more stable and working proof. Also, more detailed, with opportunity of changing the title's bar background and the title's bar icon.
Sniper Killer said:
The guide on the OP is more stable and working proof. Also, more detailed, with opportunity of changing the title's bar background and the title's bar icon.
Click to expand...
Click to collapse
lol. I don't know what you mean by "STABLE", so I can't speak on that
About working proof, what can be better working proof than Cosmic v3
Title Bar's background and icon both can be changed by that method
Don't misunderstand me, just trying to share another method with people.
PS - You will want to include (if not already) that editing AndroidManifest.xml of system app will require to sign it, and if you want it working on your device, you'll have to disable signature check from service.
Usefull guide for users and also new rising themers Keep it up
PART 1
STEP 1
Dimensioning Your Icons
There are many Software for this you can go for gimp, photoshop, illustrator and many more.
I prefer photoshop.
You can download or purcase from Adobe Store.
Icon size: 136 x 136 (pixels)
STEP 2
Adding layer styles.
Playing with Bleending option.
Add your design your settings add beveal, drop shadow and much more.
IMPORTING ICONS TO MIUI THEME EDITOR
STEP : 1
Now the First thing to DO is Extract the zip file.
STEP : 2
Now GO to MIUI Themes Editor and launch it.
There are two ways of getting started up.
Either select a Theme and Edit or start a new project
STEP : 3
Starting Up a New Project.
[Note: Click on the picture for Enlarging]
STEP : 4
Click on File > New Theme
STEP : 5
Specify a name and Location.
STEP : 6
Later Adding
Theme Name
Author
Designer
Version
PART TWO [ IMPORTANT ]
This is how you reach a fancy icons they are noting but icons with Gif kind of animation we call them dynamic
So what's so special about them ?
Heh!!
You need to know som XML tricks like i am going to show you and i will even share my files which you can edit.
So the above metioned picture is an example how to place it.
FOR CALENDAR
Icons
| __ fancy_icons
|__ com.android.calendar
manifest.xml should be place inside the folders with pngs files
<?xml version="1.0" encoding="utf-8"?>
<!-- calendar -->
<Icon version="1" frameRate="0" width="136" height="136" screenWidth="720" useVariableUpdater="DateTime.Day">
<VariableBinders>
<BroadcastBinder action="android.intent.action.TIME_SET" />
<BroadcastBinder action="android.intent.action.DATE_CHANGED" />
</VariableBinders>
<Group pivotX="68" pivotY="68">
<Image x="68" y="68" align="center" alignV="center" src="date.png" srcid="#date" />
</Group>
</Icon>
You need to edit them accordingly like i have thepng files settled inside the folder com.android.calendar
For Rotational ICONS
<?xml version="1.0" encoding="utf-8"?>
<!-- Audio -->
<Icon version="1" frameRate="30" width="192" height="192" screenWidth="1080" >
<Image x="96" y="96" align="center" alignV="center" src="icon_bg.png" />
<Image x="96" y="96" align="center" alignV="center" centerX="59" centerY="59" src="gear.png" >
<RotationAnimation>
<Rotation angle="0" time="0"/>
<Rotation angle="360" time="10000"/>
</RotationAnimation>
</Image>
</Icon>
And place the Two icons inside the subfolders.
Source : http://en.miui.com/thread-76404-1-1.html
Credits to the OP.
Hello everyone, I've made a simplified tutorial to make your own watchface widget.
In this update I made simpler source code that simplified some steps.
Thanks to xda for posting it in xda Portal
Requirements:
-Eclipse
-Android SDK
-Sony Add-on SDK
Click to expand...
Click to collapse
-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------
1-Download the samples.
2-Extract the zip.
3-Copy the both extracted folders to: "android-sdks\add-ons\addon-sony_add-on_sdk_3_0-sony-19\samples\SmartExtensions".
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
4-Open Eclipse and press Ctrl+N, open "Android" and choose "Android Sample Project".
5-Choose "Sony Add-on SDK 3.0".
6-Choose "SmartExtensions > SmartExtensionAPI" and press Finish.
7-Repeat step 4 to 5, choose "SmartExtensions > SmartExtensionUtils" and press Finish.
8-Repeat step 4 to 5, choose "SmartExtensions > ClockWidgetAnalog" if you wanna make an analog clock. or "SmartExtensions > ClockWidgetDigitalList" if you need to make a digital clock. For example, I'll choose the analog clock.
9-Press Finish
10-Now your workspace should looks like this:
11-To rename the project right click on it like this image:
12-Give it any name you want
13-To rename application package right click like this image:
14-Go to: res/values/strings.xml
15-Change these strings and press Ctrl+S to save it.
-You can keep the 'more apps" link if you want. It go to the watch faces collection thread.
-It's optional to add your email, and here's how to remove "Contact me" button:
-Go to res/layout/activity_preference.xml and find this:
Code:
<Button
android:id="@+id/emailBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="[COLOR="Red"]visible[/COLOR]"
android:text="@string/email_btn"/>
-Then change the text marked with red above to "gone". So it will be like this:
Code:
<Button
android:id="@+id/emailBtn"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="[COLOR="Red"]gone[/COLOR]"
android:text="@string/email_btn"/>
16-Change the graphical resources change files in res/drawable-nodpi
17-Connect you device to the pc
18-Enable USB debugging on your phone
19-Right click on the project > Run As > Android application
20-If you want to share the apk you'll find it in the project bin
21-Enjoy
-----------------------------------------------------------------------------------------------------------------------
How To Resize:
1-Go to "AnalogClock.java" or "DigitalClockLevelList.java in src/-package name-.widgets
2-Edit the marked in red below:
Code:
@Override
public int getWidth() {
return getCellWidth() * [COLOR="Red"]5[/COLOR];
}
@Override
public int getHeight() {
return getCellHeight() * [COLOR="Red"]5[/COLOR];
}
-----------------------------------------------------------------------------------------------------------------------
How To Add Date:
1-Create new xml file in "res/layout" and give it any name you want
2-Add this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1" >
[COLOR="RoyalBlue"]<com.sonyericsson.extras.liveware.aef.widget.TimeLayout[/COLOR]
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="[COLOR="DarkOrange"]@android:color/white[/COLOR]"
widgets:textSize="[COLOR="Lime"]25[/COLOR]px"
widgets:timeType="[COLOR="Red"]days_of_month[/COLOR]" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
</RelativeLayout>
3-You can change the text marked in red above to:
-"days_of_week"
-"days_of_month"
-"days_of_year"
-"months"
4-You can change the number marked in green above to any number you want, to set the font size. Please notice that the unit must be "px" and do not use "dp".
5-You can change on the text marked in orange "white" to "black", or you can remove all the text in orange and put any hex color code. For example:
android:textColor="#ffbf00"
6-To change the position of it, add under "<com.sonyericsson.extras.liveware.aef.widget.TimeLayout" which is marked in blue above:
-android:layout_centerInParent="true" to put it in the center.
-android:layout_centerHorizontal="true" to put it center in horizontal.
-android:layout_centerVertical="true" to put it center in vertical.
-android:layout_alignParentRight="true" to move it to right side.
-android:layout_alignParentLeft="true" to move it to left side.
-android:layout_alignParentTop="true" to move it to to the top.
-android:layout_alignParentBottom="true" to move it to the buttom.
-android:layout_marginRight="10px" change "10" to any number.
-android:layout_marginLeft="10px" change "10" to any number.
-android:layout_marginTop="10px" change "10" to any number.
-android:layout_marginBotton="10px" change "10" to any number.
7-At last, we must include the date xml on the main watch layout xml which is called on my samples "clock_widget_analog.xml" on analog and "clock_widget_levellists.xml" on the digital clock. For example, if you named the xml you made "date.xml" we will add the text marked in red below:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/watchface_bg" />
[COLOR="Red"]<include layout="@layout/date" />[/COLOR]
<include layout="@layout/analog_clock_hand_hours_border" />
<include layout="@layout/analog_clock_hand_minutes_border" />
<include layout="@layout/analog_clock_hand_seconds" />
</RelativeLayout>
-----------------------------------------------------------------------------------------------------------------------
How To Reorder:
1-Open the main layout xml, -"clock_widget_analog.xml" on analog and "clock_widget_levellists.xml" on the digital clock-. For example, I'll work on analog.
2-You can remove text that start with "<!--" and end with "-->" like the marked in red . it's just notes from sony.This will make it easier:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<!-- We set a background on containing the base for a watch face. -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/watchface_bg" />
[COLOR="Red"]<!-- Here we reference a TimeLayout using a single drawable for displaying
the hour hand. -->[/COLOR]
<include layout="@layout/analog_clock_hand_hours_border" />
[COLOR="Red"]<!-- Here we reference a TimeLayout using a single drawable for displaying
the minute hand. -->[/COLOR]
<include layout="@layout/analog_clock_hand_minutes_border" />
[COLOR="Red"]<!-- Here we reference a TimeLayout using a single drawable for displaying
the second hand. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->[/COLOR]
<include layout="@layout/analog_clock_hand_seconds" />
</RelativeLayout>
3-Now you can reorder lines that start with "<include layout="
-----------------------------------------------------------------------------------------------------------------------
Multiple WatchFace In One App:
-First example is to add digital clock to analog:
1-Copy xml and png files in res/layout and res/drawable-nodpi from digital to analog
2-Copy "DigitalClockLevelList.java" on src/-package name-.widgets from digital to analog
3-Open "ClockWidgetRegistrationInformation" in src/-package name-/ and search for: WidgetClassList widgetList = new WidgetClassList();
4-Add this under WidgetClassList widgetList = new WidgetClassList();:
widgetList.add(DigitalClockLevelList.class);
The text marked in red is same file name you've copied in step 2
5-Now Eclipse will underline it in red as error, it will give you a list of fixes, choose first fix
-Second example if you want to make 2 or more analog watchfaces:
1-Go to res/layout and duplicate all except "activity_preferences.xml", you can rename the duplicated xmls for example by adding "2"
2-Duplicate "AnalogClock.java" in src/-package name-.widgets
3-Add graphical resources on res/drawable-nodpi/ and give it the same names but with "_2"
4-Add the following lines to res/values/strings.xml:
Code:
<string name="name_1">Analog 1</string>
<string name="name_2">Analog 2</string>
To be like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- No translation of sample extensions -->
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation">
<string name="app_name">Analog clock widget</string>
<string name="preference_info">Analog clock watchface widget for Sony SmartWatch2\nDeveloped by Naheel Azawy\nVersion 1.0</string>
[COLOR="Red"]<string name="name_1">Analog 1</string>
<string name="name_2">Analog 2</string>[/COLOR]
</resources>
5-Edit "AnalogClock2.java" in src/-package name-.widgets from:
Code:
package com.naheel.sw2.widget.example.analog.widgets;
import com.naheel.sw2.widget.example.analog.R;
/**
* This widget displays an analog clock providing resources which will be
* automatically rotated by the accessory firmware to reflect the time.
*/
public class AnalogClock2 extends SmartWatch2ClockWidget {
public AnalogClock2(WidgetBundle widgetBundle) {
super(widgetBundle);
}
@Override
int getWidgetLayout() {
return R.layout.[COLOR="Red"]clock_widget_analog[/COLOR];
}
@Override
public int getName() {
return R.string.[COLOR="Red"]app_name[/COLOR];
}
@Override
public int getWidth() {
return getCellWidth() * 5;
}
@Override
public int getHeight() {
return getCellHeight() * 5;
}
@Override
public int getPreviewUri() {
return R.drawable.[COLOR="Red"]watchface_analog_preview[/COLOR];
}
}
To:
Code:
package com.naheel.sw2.widget.example.analog.widgets;
import com.naheel.sw2.widget.example.analog.R;
/**
* This widget displays an analog clock providing resources which will be
* automatically rotated by the accessory firmware to reflect the time.
*/
public class AnalogClock2 extends SmartWatch2ClockWidget {
public AnalogClock2(WidgetBundle widgetBundle) {
super(widgetBundle);
}
@Override
int getWidgetLayout() {
return R.layout.[COLOR="Red"]clock_widget_analog_2[/COLOR];
}
@Override
public int getName() {
return R.string.[COLOR="Red"]name_2[/COLOR];
}
@Override
public int getWidth() {
return getCellWidth() * 5;
}
@Override
public int getHeight() {
return getCellHeight() * 5;
}
@Override
public int getPreviewUri() {
return R.drawable.[COLOR="Red"]watchface_analog_preview_2[/COLOR];
}
}
6-Edit "clock_widget_analog_2.xml" on res/layout from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<!-- We set a background on containing the base for a watch face. -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/[COLOR="Red"]watchface_bg[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the hour hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_hours_border[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the minute hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_minutes_border[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the second hand. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_seconds[/COLOR]" />
</RelativeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res/com.sonymobile.smartconnect.extension.testclock"
android:layout_width="215px"
android:layout_height="170px"
android:background="@android:color/transparent"
android:baselineAligned="false" >
<!-- We set a background on containing the base for a watch face. -->
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/[COLOR="Red"]watchface_bg_2[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the hour hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_hours_border_2[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the minute hand. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_minutes_border_2[/COLOR]" />
<!-- Here we reference a TimeLayout using a single drawable for displaying
the second hand. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<include layout="@layout/[COLOR="Red"]analog_clock_hand_seconds_2[/COLOR]" />
</RelativeLayout>
7-Edit "analog_clock_hand_seconds_2.xml" from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a second hand using a drawable and setting the timeType to
seconds. The second hand will be automatically rotated by the accessory
firmware. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]second_00[/COLOR]"
widgets:timeType="seconds" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a second hand using a drawable and setting the timeType to
seconds. The second hand will be automatically rotated by the accessory
firmware. Note: Seconds will not be shown when the backlight is off
on the SmartWatch 2. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]second_00_2[/COLOR]"
widgets:timeType="seconds" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
8-Edit "analog_clock_hand_minutes_border_2.xml" from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a minute hand using a drawable and setting the timeType to
minutes. The minute hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]minute_border_00[/COLOR]"
widgets:timeType="minutes" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines a minute hand using a drawable and setting the timeType to
minutes. The minute hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]minute_border_00_2[/COLOR]"
widgets:timeType="minutes" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
9-Edit "analog_clock_hand_hours_border_2.xml" from:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines an hour hand using a drawable and setting the timeType to
hours_fine. The hour hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]hour_border_00[/COLOR]"
widgets:timeType="hours_fine" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
To:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use TimeLayout components to place TimeViews showing e.g. hours or minutes
when building up the UI. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:widgets="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
widgets:gravity="center" >
<!-- Defines an hour hand using a drawable and setting the timeType to
hours_fine. The hour hand will be automatically rotated by the accessory
firmware. -->
<com.sonyericsson.extras.liveware.aef.widget.TimeView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/[COLOR="Red"]hour_border_00_2[/COLOR]"
widgets:timeType="hours_fine" />
</com.sonyericsson.extras.liveware.aef.widget.TimeLayout>
-----------------------------------------------------------------------------------------------------------------------
---Old thread---
-----------------------------------------------------------------------------------------------------------------------
Please do not take everything and say it's you'r own job. It's enough to say thanks to me on your app. There's something in this world called google removal
Click to expand...
Click to collapse
If you made a watch, post it here and I'll add it to the collection
Hello,
Thank you very much for your Tutorial. I got my own analog clock.
But is there any way to have a background for Digital Clock?
8-Edit "analog_clock_hand_minutes_border_2.xml" from
dont have analog_clock_hand_minutes_border_2.xml !
---------- Post added at 02:53 PM ---------- Previous post was at 02:47 PM ----------
my watch faces
Hi,
Is it still possible to create new watch faces for the SW2 these days? The main obstacle to start seems to be the inability to download the Sony Add-on SDK. I have only been able to find version 1.0 so far with much searching. Does anyone know where the version 3 file can be downloaded?
Thanks,
Lee