FORUMS
Remove All Ads from XDA

[DEV] Create custom home screen pages for the Pace

7,444 posts
Thanks Meter: 6,037
 
Post Reply Email Thread
I've previously hinted that I was working on getting custom pages working for the launcher on the Pace - well here it is

This allows for custom home screen pages with your own content, there's very little in terms of limits. Code is standard Android Java, you just need to include a library (see GitHub) and follow the example code (the class MUST extend AbstractPlugin, again see the GitHub)

When compiled, the example code shows this on the homescreen page:


Example code and guide for use on GitHub
The Following 11 Users Say Thank You to Quinny899 For This Useful Post: [ View ]
 
 
18th February 2018, 06:15 PM |#2  
GreatApo's Avatar
Senior Member
Thanks Meter: 212
 
Donate to Me
More
You are the man! I see you are on flames, I have some suggestions for improvements!

...Calender is coming!

Edit:
I tryied to make a new exactly identical project with yours, it installed with no errors, but i couldn't see it anywhere... :P Is there anything else we should notice when making a new project? Except form API version to android 5.0 etc... We make a project for phone not androidware right? (i later added the "android.support.wear" in manifest but without luck).
On the other hand, changing your project worked (i really can't find the problem with mine). However, i tried to load a JS calendar through webview without luck. I see a blank page and if change to app mode, the app crashes :/
Any good way to debug all these from adb? (couldn't find sth in logcat)
The Following User Says Thank You to GreatApo For This Useful Post: [ View ] Gift GreatApo Ad-Free
18th February 2018, 10:26 PM |#3  
Quinny899's Avatar
OP Recognized Developer / Recognized Contributor
Flag Ormskirk, Lancashire, UK
Thanks Meter: 6,037
 
Donate to Me
More
Whilst working on a little something (see the spoiler below), I found there's something quite important I hadn't mentioned. To update views, you need to run code on the UI thread. There's usually not an easy way to do this - remember, a plugin is not an Activity so we can't do the normal things.

However, Huami thought of this, so you can run:
Code:
getHost().runTaskOnUI(this, new Runnable() {
    @Override
    public void run() {
        ...
    }
});
Coming soon (WIP UI and not complete):


I want to get a circular progress bar for the song's duration working as well as iron out some bugs before release. Sadly album art background isn't possible (but would look amazing, especially with palette colour icons!) as the art is not sent to the watch - this page is hooking the built in music control from the phone, no bluetooth trickery at all!
The Following User Says Thank You to Quinny899 For This Useful Post: [ View ]
19th February 2018, 01:11 AM |#4  
Quinny899's Avatar
OP Recognized Developer / Recognized Contributor
Flag Ormskirk, Lancashire, UK
Thanks Meter: 6,037
 
Donate to Me
More
Quote:
Originally Posted by GreatApo

You are the man! I see you are on flames, I have some suggestions for improvements!

...Calender is coming!

Edit:
I tryied to make a new exactly identical project with yours, it installed with no errors, but i couldn't see it anywhere... :P Is there anything else we should notice when making a new project? Except form API version to android 5.0 etc... We make a project for phone not androidware right? (i later added the "android.support.wear" in manifest but without luck).
On the other hand, changing your project worked (i really can't find the problem with mine). However, i tried to load a JS calendar through webview without luck. I see a blank page and if change to app mode, the app crashes :/
Any good way to debug all these from adb? (couldn't find sth in logcat)

Sometimes the page loading can be a bit strange. Make sure you're doing nothing demanding in getView - I've found that even adding a listener in getView can cause it to come up blank this evening (use onActive instead)

In terms of logcat, use a normal logcat with no filter, as the logging is split between the launcher itself logging when a page is loaded/unloaded and the app logging when you tell it to. If you want to just show the logs from the app or launcher, I recommend using pidcat

It's also entirely possible the watch struggles with webviews, or may do within the launcher. I've not tested it, but I know they're pretty demanding usually - better to do it in Java because the watch is not that powerful
19th February 2018, 01:29 AM |#5  
GreatApo's Avatar
Senior Member
Thanks Meter: 212
 
Donate to Me
More
Quote:
Originally Posted by Quinny899

Sometimes the page loading can be a bit strange. Make sure you're doing nothing demanding in getView - I've found that even adding a listener in getView can cause it to come up blank this evening (use onActive instead)

In terms of logcat, use a normal logcat with no filter, as the logging is split between the launcher itself logging when a page is loaded/unloaded and the app logging when you tell it to. If you want to just show the logs from the app or launcher, I recommend using pidcat

It's also entirely possible the watch struggles with webviews, or may do within the launcher. I've not tested it, but I know they're pretty demanding usually - better to do it in Java because the watch is not that powerful

I am just editing your project again, awesome work!
WebView was a dead end for me, i am a javascript quy thats why i was trying it...

Anyway, i edited a simple calendarView (damn it needs a lot of tests), and boom! We have a calendar!

I am adding new icons and i am uploading it as version 1.0.0. Colors are NOT so visible in watch's sreen. I will try to change them (no luck untill now, any idea?) or i will try to use this lib.
Attached Thumbnails
Click image for larger version

Name:	com.dinodevs.pacecalendarwidget.png
Views:	1100
Size:	163.3 KB
ID:	4424425  
19th February 2018, 06:49 AM |#6  
Member
Thanks Meter: 8
 
More
It's possible to add home screen's WatchDroid ? Thanks
19th February 2018, 12:03 PM |#7  
GreatApo's Avatar
Senior Member
Thanks Meter: 212
 
Donate to Me
More
Quote:
Originally Posted by kwet

It's possible to add home screen's WatchDroid ? Thanks

I think no. The app should be changed to do so...
19th February 2018, 05:05 PM |#9  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by GreatApo

I am just editing your project again, awesome work!
WebView was a dead end for me, i am a javascript quy thats why i was trying it...

Anyway, i edited a simple calendarView (damn it needs a lot of tests), and boom! We have a calendar!


I am adding new icons and i am uploading it as version 1.0.0. Colors are NOT so visible in watch's sreen. I will try to change them (no luck untill now, any idea?) or i will try to use this lib.

Hi all, I imported the Example in Android Studio (Hello world).
It compile with success, but when playing, it tells that no Activity is present.
How to run the example?
Thank you
19th February 2018, 05:12 PM |#10  
GreatApo's Avatar
Senior Member
Thanks Meter: 212
 
Donate to Me
More
Quote:
Originally Posted by Fabrizio Casellato

Hi all, I imported the Example in Android Studio (Hello world).
It compile with success, but when playing, it tells that no Activity is present.
How to run the example?
Thank you

You can't run it for bebug in PC since this is not a new activity, you just extend the activity of your watch's launcher. So, you install it, reboot your launcher and see the results :P

I suppose you will have to make a new normal apk first to test your code in your PC.
19th February 2018, 05:20 PM |#11  
Junior Member
Thanks Meter: 0
 
More
I've a Pace. I'm trying to compile on it.
Now, I do: Run -> Run... -> Edit Configuration... -> Launch Nothing.
This creates an apk and installs it on the watch.
I rebooted the Pace, but I can't see any new plugin.
Soooob

What am I wrong?

---------- Post added at 06:20 PM ---------- Previous post was at 06:18 PM ----------

However, I've deployed an app of Activities, that I'd like to transform to plugin (as the beautiful calendar!).
May... I have the project, so to copy the steps from it?
Thank you very much
Post Reply Subscribe to Thread

Tags
amazfit, custom, homescreen, pace, page

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes