So I decide to create widget to show my note I chose to make note as picture.
I've try it with basic widget, add picture and edited a little line of code so I can make I show the note.
But only one page.
I would like to get key event to move to another page of note.
such as
//When Key is press
...{
screen1 = screen1+1;
if(screen1>4){screen1=0;}
if(screen1==0)
{
setLayout(Rez.Layouts.MainLayout(dc));
}
if(screen1==1)
{
setLayout(Rez.Layouts.MainLayout1(dc));
}
if(screen1==2)
{
setLayout(Rez.Layouts.MainLayout2(dc));
}
if(screen1==3)
{
setLayout(Rez.Layouts.MainLayout3(dc));
}
if(screen1==4)
{
setLayout(Rez.Layouts.MainLayout4(dc));
}
}...
Here's my code.
using Toybox.WatchUi as Ui;
var screen1;
class testtView extends Ui.View {
//! Load your resources here
function onLayout(dc) {
screen1=1;
setLayout(Rez.Layouts.MainLayout2(dc));
}
//! Restore the state of the app and prepare the view to be shown
function onShow() {
}
//! Update the view
function onUpdate(dc) {
// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
}
//! Called when this View is removed from the screen. Save the
//! state of your app here.
function onHide() {
}
}
And more question
Can I load my widget to my Fenix3 without put it to store. If I can how to do that?
Thanks