捆绑HTML页面时出错 [英] Erroring with Bundle of HTML Pages

查看:48
本文介绍了捆绑HTML页面时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过使用HTML页面来创建一个超过3个级别的树形结构(捆绑物封面->捆绑卡->菜单项).

我有一捆带有封面的卡,使用setText()可以正确显示所有卡片.

然后我将其中一张卡更改为setHtml()而不是setText(),并使用了操场上的HTML模板进行测试.

然后我使用ArrayList<String>将HTML页面添加到了该卡.在操场上,我得到了下面的卡片.当我在Glass上访问时,出现意外停止".

这绝对是一个错误,但我想知道是否有计划允许这4级树(捆绑包-> HTML封面-> HTML页面->菜单项).

{
  "kind": "mirror#timelineItem",
  "id": "b599da0d-494c-4ac9-ac24-bb5bddc1a209",
  "bundleId": "customBundle",
  "created": "2013-06-12T17:32:30.636Z",
  "updated": "2013-06-12T17:32:30.636Z",
  "etag": "\"r3ghbVW9Rp1kDP4UexS05_pFx4E/T3Df9IBGUombFb5U_Y1rda4CWwM\"",
  "html": "<article>\n  <section>\n    <div class=\"text-x-large\">\n      <p class=\"yellow\">8:00<sub>PM</sub></p>\n      <p>Dinner with folks tonight</p>\n    </div>\n  </section>\n  <footer>\n    <div>Their place</div>\n  </footer>\n</article>\n",
  "htmlPages": [
    "<article>\n  <section>\n    <table class=\"align-justify\"> \n      <tbody>\n        <tr>\n          <td>AAPL</td>\n          <td>503.73</td>\n          <td class=\"red\">-16.57 (3.18%)</td>\n        </tr>\n        <tr>\n          <td>AMZN</td>\n          <td>274.03</td>\n          <td class=\"green\">+6.09 (2.27%)</td>\n        </tr>\n        <tr>\n          <td>GOOG</td>\n          <td>727.58</td>\n          <td class=\"red\">-12.41 (1.68%)</td>\n        </tr>\n      </tbody>\n    </table>\n  </section>\n</article>\n",
    "<article>\n  <section>\n    <ul class=\"text-x-small\">\n      <li>Gingerbread</li>\n      <li>Chocolate Chip Cookies</li>\n      <li>Tiramisu</li>\n      <li>Donuts</li>\n      <li>Sugar Plum Gummies</li>\n    </ul>\n  </section>\n  <footer>\n    <p>Grocery list</p>\n  </footer>\n</article>\n"
  ],
  "menuItems": [
    {
      "action": "REPLY"
    },
    {
      "id": "moreInfo",
      "action": "CUSTOM",
      "values": [
        {
          "displayName": "Get More Info",
          "iconUrl": "https://MYAPP.appspot.com/static/images/drill.png"
        }
      ]
    },
    {
      "action": "TOGGLE_PINNED"
    }
  ],
  "notification": {
    "level": "DEFAULT"
  }
}

解决方案

您是正确的,如果同时尝试分页和线程捆绑,则会出现一些奇怪的行为.您将看到捆绑包盖,但是按入捆绑包时,Glass报告意外停止.

它并没有明确表示您无法在文档中执行此操作,并且基于......

您的确切问题已在问题跟踪器中报告为错误:

https://code.google.com/p/google-glass-api/issues/detail?id = 77

我会给该问题加注星标,然后等待更新.同时,您将不得不使用分页或线程处理的3个嵌套级别.将来确实会出现四个级别,如下所示:

封面->捆绑商品->页面->操作

I am trying to create a tree structure that is more than 3 levels (Bundle Cover -> Bundled Cards -> Menu Items) by using HTML pages.

I have a bundle of cards with a cover that displays appropriately all using setText().

Then I changed one of the cards to setHtml() instead of setText() and used the HTML template from the playground to test.

Then I added HTML pages to that card using an ArrayList<String>. Using the playground, I get the card below. When I access on Glass, I get "Stopped unexpectedly."

This is definitely a bug but I want to know if there is plans to allow this 4 level tree (Bundle Cover -> HTML Cover -> HTML Pages -> Menu Items).

{
  "kind": "mirror#timelineItem",
  "id": "b599da0d-494c-4ac9-ac24-bb5bddc1a209",
  "bundleId": "customBundle",
  "created": "2013-06-12T17:32:30.636Z",
  "updated": "2013-06-12T17:32:30.636Z",
  "etag": "\"r3ghbVW9Rp1kDP4UexS05_pFx4E/T3Df9IBGUombFb5U_Y1rda4CWwM\"",
  "html": "<article>\n  <section>\n    <div class=\"text-x-large\">\n      <p class=\"yellow\">8:00<sub>PM</sub></p>\n      <p>Dinner with folks tonight</p>\n    </div>\n  </section>\n  <footer>\n    <div>Their place</div>\n  </footer>\n</article>\n",
  "htmlPages": [
    "<article>\n  <section>\n    <table class=\"align-justify\"> \n      <tbody>\n        <tr>\n          <td>AAPL</td>\n          <td>503.73</td>\n          <td class=\"red\">-16.57 (3.18%)</td>\n        </tr>\n        <tr>\n          <td>AMZN</td>\n          <td>274.03</td>\n          <td class=\"green\">+6.09 (2.27%)</td>\n        </tr>\n        <tr>\n          <td>GOOG</td>\n          <td>727.58</td>\n          <td class=\"red\">-12.41 (1.68%)</td>\n        </tr>\n      </tbody>\n    </table>\n  </section>\n</article>\n",
    "<article>\n  <section>\n    <ul class=\"text-x-small\">\n      <li>Gingerbread</li>\n      <li>Chocolate Chip Cookies</li>\n      <li>Tiramisu</li>\n      <li>Donuts</li>\n      <li>Sugar Plum Gummies</li>\n    </ul>\n  </section>\n  <footer>\n    <p>Grocery list</p>\n  </footer>\n</article>\n"
  ],
  "menuItems": [
    {
      "action": "REPLY"
    },
    {
      "id": "moreInfo",
      "action": "CUSTOM",
      "values": [
        {
          "displayName": "Get More Info",
          "iconUrl": "https://MYAPP.appspot.com/static/images/drill.png"
        }
      ]
    },
    {
      "action": "TOGGLE_PINNED"
    }
  ],
  "notification": {
    "level": "DEFAULT"
  }
}

解决方案

You are correct that if you try to both paginate and thread bundles, you get some wonky behavior. You will see the bundle cover, but upon pressing into it, Glass reports an unexpected stop.

It doesn't explicitly say that you can't do this in the docs, and we can expect this to work in the future, even though it does not work now, based on ...

Your exact issue has already been reported as a bug in the issue tracker:

https://code.google.com/p/google-glass-api/issues/detail?id=77

I would go star that issue and wait for updates. In the meantime, you will have to live with 3 levels of nesting with either paging or threading. In the future it does appear that four levels will be possible as follows:

cover -> items in the bundle -> their pages -> their actions

这篇关于捆绑HTML页面时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆