Languages

Menu
Sites
Language

How to scroll a section using bezel in Gear S2

This is a example code bhow to scroll a section using bezel for Gear S2 and it's tested in Tizen SDK 2.3.1.

Responses

5 Replies
Stuart Zhang

Hello  daniel kim,

I have tried your sample in my Gear S2 emulator. However, both CSS and Javascript files (e.g. tau.css and tau.js) serving the Tizen Advanced UI Framework can't be introduced into the web app.I have referenced the online tutorial (https://developer.tizen.org/dev-guide/2.3.1/org.tizen.web.apireference/html/ui_fw_api/wearable/circular_support/circular_support.htm) to inser the two <link> elements into the <head> element and a <script> element into the <body> element.

  <link rel="stylesheet" href="tau.css">
  <link rel="stylesheet" media="all and (-tizen-geometric-shape: circle)" href="tau.circle.css">

  <script type="text/javascript" src="tau.js"></script>
  
Nevertheless, after the web app is launched in the debug mode, I have never got the help from the Tizen Advanced UI Framework. That's to say, the three TAU-series files are unavailable.

Could you please teach me how to introduce the TAU files into my app?

daniel kim

Hi,

I guess that below tags are missed and I would suggest you to use TAUBasic or TAUList template for your project.

    <script type="text/javascript" src="lib/tau/wearable/js/tau.min.js"></script>
    <script type="text/javascript" src="js/circle-helper.js"></script>

Regards

Denis Miroshnikov

hello Daniel,

  I try to use handling rotary events from bezel in my watchface for s2-3 for settings menu with web api , but I can't hanle this events.. just nothing handled by this listener ((  why ???

Praditio Aditya Nugraha

You should add a validation so it won't fall to an exception.

var sections = document.querySelectorAll("section");

    document.addEventListener("rotarydetent", function(event){
         if (event.detail.direction === "CW") { 
                     if((sectionChanger.getActiveSectionIndex() + 1) < sections.length)
                    sectionChanger.setActiveSection(sectionChanger.getActiveSectionIndex() + 1, 100);
                } else {
                    if((sectionChanger.getActiveSectionIndex() - 1) >= 0)
                    sectionChanger.setActiveSection(sectionChanger.getActiveSectionIndex() - 1, 100);
                }
         }, false);    

 

Denis Miroshnikov

hello Daniel,

 

  I try to use handling rotary events from bezel in my watchface for s2-3 for settings menu with web api , but I can't hanle this events.. just nothing handled by this listener ((  why ???