Need Help regarding Self build launcher

Since past i week I have been working on My Custom Launcher. It’s My own build launcher build by Fully reverse Engineering stock launcher to add features. So i built a Engine for watchmaker files(un-protected) and tried to run on on My Launcher.
Please refer to the Video I have attached.The Skins are loading fine but for some the scales are awefully off and I noticed that the Co-ordinates seems to be little off too. Can it be fixed? Does it needs some offset?
Can you please help me with this @Eric_Crochemore.The watchfaces in the video are .watch format
Modded stock Launcher with .watch Support

3 Likes
int w = (int)(hourHand.getIntrinsicWidth()*scale_factor);
int h = (int)(hourHand.getIntrinsicHeight()*scale_factor);
hourHand.setBounds((this.centerX1 + iCenterX) - (w / 2), (this.centerY1 + iCenterY) - (h / 2), this.centerX1 + iCenterX + (w / 2), this.centerY1 + iCenterY + (h / 2));

I am using the first code to set bounds on the drawables. And the following code for drawing Texts of .watch files.I am using a scale factor of 0.8.

paint.setTypeface(this.parseClock.get(i).getW_typeface());
paint.setTextSize(Float.valueOf(this.parseClock.get(i).getW_textsize()));
paint.setAlpha(Integer.parseInt(this.parseClock.get(i).getW_opacity()));
paint.setColor(Color.parseColor("#"+this.parseClock.get(i).getW_color()));
canvas.drawText(String.valueOf(this.mBatteryLevel)+"%",(float)(this.centerX1+iCenterXscale_factor),(float)(this.centerY1+iCenterYscale_factor),paint);

That’s impressive. Normal size is 512, maybe this face uses some special zoom in a script. How do you manage lua scripts ?

1 Like

I haven’t used implemented lua scripts yet… it’s not interactive as your launcher, but will try to implement that later…have you made a list of {tags} for different elements??
It will be great if you can share the list of tags and their definition

1 Like

Here is the wiki
https://watchmaker.haz.wiki/
But without lua, only simple faces will work. But that’s already something. :+1:

1 Like

Yeah realised that…plus without lua…multiple things operlaps which should appear on tap…Thanks…will try to find a workaround for that

Forgot to mention that you could use my WearWatchFace if your launcher is compatible, it opens all faces compatibility.

2 Likes

Yeah…my launcher supports it…but to use this wear os apk, the launcher needs to be installed in system/priv-app because it needs BIND_WALLPAPER permission which is only granted to system apps.

I am planning to use http://www.luaj.org/luaj/3.0/README.html this library for lua scripts and to provide interactivity, but i have a doubt as how statements like “var_switch ==1 and 100 or var_switch ==2 and 100 or 0” can be called from java

It’s not complicated, I was using this library in my 1.x version… the issue is the speed…

1 Like

Anyway i don’t like smooth analog movement of clock, so i replaced it with mechanical movement which i basically 1frame per second of ondraw…i think this library will be fast enough to handle 1 FPS

1 Like

I was using something like that :

globals = org.luaj.vm2.lib.jse.JsePlatform.standardGlobals();
globals.load(script, "mainscript").call();

with script being the lua text…

Also :

LuaValue res = globals.load("bla bla lua" , "temp").call();
if (!res.isnil()) s = res.tojstring();
2 Likes

to make matters worse, you could create tweens.zoom altering the size and x/y position to zoom in and out (working well in UL) but some others use a tweened x/y animation scale instead. I’ve tried both, the latter being more CPU efficient but I Think unsupported by UL if I remember correctly. If you happen to run into zoom problems then you know they could be using animation scaling instead.

2 Likes

Yeah, i figured that out

1 Like