字幕组成品列表(Beta)
  • 写在前面
  • Android 平台
    • Game On! 游戏开发系列 - 031
      • Pie Noon - 1503060393
      • The Death of Base Game Activity - 1504030543
      • Surviving OpenGL Context Loss - 1504030546
      • WebP for Game Devs - 1504030547
      • Saved Games In-Depth (Part 1) - 1504070556
      • Saved Games In-Depth (Part 2) - 1504030548
      • Smaller Flipbook Textures with CRABBY - 1504030544
      • Google Tag Manager - 1504030545
      • Flatbuffers - 1505050794
      • Achievement Point Pointers - 1505050796
      • Frequency Scaling - 1505050797
      • Meet the Management APIs - 1501140367
      • Y U Ship Broken Games - 1505050795
    • Android 性能优化 - 088
      • Garbage Collection in Android - 1503170425
      • Performance Cost of Memory Leaks - 1503170424
      • Rendering Performance 101 - 1501130351
      • Understanding Overdraw - 1501130352
      • Understanding VSYNC - 1501130353
      • Tool - Profile GPU Rendering - 1501130354
      • Why 60fps? - 1501130355
      • Android UI and the GPU - 1501130356
      • Invalidations, Layouts, and Performance - 1501130357
      • Overdraw, Cliprect, QuickReject - 1501130358
      • Tool - Memory Monitor - 1501130363
      • Battery Performance 101 - 1501130364
      • Understanding Battery Drain on Android - 1501130365
      • Battery Drain and WakeLocks - 1501130366
      • Memory Performance 101 - 1504170661
    • I/O 2014 Android 开发专题 - 089
      • Activity Transitions - 1504020505
      • Building Apps For Android TV - 1504020520
      • Building great Android media experiences - 1504020510
      • Building a quality app from start to finish - 1504020515
      • App Indexing API - 1504020507
      • What's new in WebView - 1504010484
      • Bluetooth Low Energy - 1504010486
      • Building impressive Android media experiences - 1504010493
      • The next Generation of Authentication - 1504020497
      • Don't Alpha That Pixel! - 1504020523
      • NFC + HCE Your phone in an interactive world - 1504020509
      • Demystifying encodes and decodes of WebM - 1504020521
      • Google Cloud Messaging - 1504020524
      • Getting your Game on the Big Screen - 1504020518
      • I hear you like realtime memes - 1504020511
      • Offerize your App - 1504020506
      • Using the Android Job Scheduler - 1504020504
      • From Holo to Material - 1504020526
      • Under the Hood of Android Auto - 1504020501
      • Isolation for Android App Developers - 1504020498
      • Android Work - 1504010496
      • ExoPlayer: Adaptive video streaming on Android - 1504010489
      • Sample rates and resampling: Why can't we all just agree? - 1504010488
      • Drive Android API - 1504010485
    • Android Studio - 004
      • Layout Editor (Ep 3, Android Studio) - 1503290479
      • Introducing Gradle (Ep 2, Android Studio) - 1503170426
    • I/O 2014 Android 分发主题 - 091
      • Introduction to Google Play - 1504030534
      • Google Play: building your user community - 1504030535
      • Optimizing Apps for Education - 1504030536
      • Succeeding in Education Technology - 1504030530
      • Subscriptions Made Easy with Google Play - 1504030531
      • The world is your playground - go global with Google - 1504030533
      • Maximizing discoverability on Google Play - 1504030538
    • Android Auto - 003
      • Introduction to Android Auto - 1504130615
      • Android Auto Messaging - 1504130617
      • Android Auto Audio - 1504130616
    • Android Wear - 006
      • Designing for Android Wear - 1503210448
      • How We Customized Google Apps for Android Wear - 1503210450
      • Fullscreen apps for Android Wear - 1503210445
      • New Notification Features for Android Wear - 1503210446
      • Building Cloud-powered wearable Apps - 1503210449
      • An Introduction to Android Wear - 1503190435
      • Google I/O 2014 - Android Wear: The developer's perspective - 1503210442
      • Devoxx 2014 Interviews: Android Wear - 1503210440
      • DevBytes: Watch Faces for Android Wear - 1503210439
    • Android TV - 005
      • Using the Leanback library - 1504080588
      • Beach Buggy Racing Multiplayer with Nearby Connections (Play Services) - 1503060387
    • Android for Work - 106
      • Android for Work for Developers - 1503060390
      • App Configurations, Testing and Launchers - 1504110590
    • IO Bytes 2014 - Android - 066
      • Chrome Apps on Android and iOS - 1501080014
      • Perf Primer CPU, GPU and your Android game - 1501080017
  • Chrome 平台
    • IO Bytes 2014 - Chrome and Web - 067
      • Using the PageSpeed API - 1505070815
      • Fabulous Forms for the multi-device web - 1505070816
      • Testing multi-screen web pages - 1505070817
      • Responsive images today - 1505070819
      • Web Performance Testing at YouTube - 1505070828
      • Building sites for the multi-device web - 1505070820
      • Deep dive: Google Cloud Messaging for Chrome - 1505070827
  • Google 创业者资源
    • Coffee with a Googler - 012
      • Chat with Allen Huang of AndroidTV - 1503040384
      • Chat with Fred Chung about developer advocacy - 1503070395
      • Google Fit platform with Michelle Haq - 1503210443
      • Android Auto Product Manager Andrew Brenner - 1501120027
      • Chat with Francis Ma about Google Play services - 1501120028
    • Root Access For Startups - 077
      • What we learned building plug-ins for Android, with startup Magnet - 1503230453
      • How to use crowdfunding to your advantage, with startup Hale Devices - 1503280462
      • How to overcome customer objections when selling tech, with startup Guesswork - 1503280458
    • First Things First - 029
      • Getting started with Android: A crash-course in developing for Android - 1504120601
      • How to ask a question: conducting research for your startup - 1504120603
      • MVP Design Hacks: transform your hot idea into a validated prototype - 1504120602
      • Build something people want: Solving real problems - 1504120605
    • How I - 061
      • Use BigQuery to find my most valuable customers - 1504070573
      • Manage beta testing communities using Google Play - 1504070572
      • Use paper wireframing to build native prototypes - 1504070570
      • Used social media and $0 marketing to get 68 million users - 1504070568
      • Prep to fundraise with four questions - 1504070564
      • Validated my idea in 2 days (with no code) - 1504070562
      • Build open platforms on Android - 1504120596
      • Get cheap, automatic analytics for my business using BigQuery - 1504070571
      • Write press releases to get international media coverage - 1504070569
      • Test beta-product features using Google Apps - 1504070563
      • Use URL builder to measure ROI on social media - 1504070561
      • Use events to build DeadSocial's brand - 1504070557
      • Use BigQuery to visualize streaming data - 1503220452
      • Find, screen, and hire developers - 1503120406
      • Drive engagement with social challenges - 1504070558
  • 设计
    • DesignBytes - 017
      • Paper and Ink: The Materials that Matter - 1505050793
  • 云计算
    • DevBytes: Google Cloud Platform - 021
      • Powering the next killer app with the Google Cloud Platform - 1504210672
      • Introduction to Google Cloud Endpoints - 1504210675
      • The Beauty of Scale with Google Cloud Platform - 1504210678
    • Google Cloud Platform - Big Data - 105
      • GDELT & BigQuery: Understand the world - 1502200379
    • Uncategorized - 999
      • Introducing Google Cloud Platform Resources - 1501190370
  • Google 应用开发
    • Launchpad Online - 072
      • The Setup: Creating new apps using Google APIs - 1503190428
      • Listing your files in Google Drive - 1503190429
      • Customizing Google Analytics for your startup - 1503290473
      • The Launchpad Online series - 1503190427
      • Getting started with Google Analytics - 1503290472
      • Accessing Google Maps from a spreadsheet?!? - 1502220381
      • Change the world in 10 lines of code - 1503080398
    • Google Play Services - 054
      • Google Play services 6.1 - 1503290481
      • Google Play Services 7.0 - 1503200437
      • Google Play Services 6.5 - 1501080015
    • 谷歌地图 iOS SDK - 053
      • Maps Live: New Features in the Google Maps Mobile APIs for Android and iOS - 1504300777
    • Google 移动搜索开发 - 055
      • Is your app in the Google index? - 1504120598
      • Get more engaged users with Google Search for Developers - 1503070397
    • DevBytes: Google Cast - 020
      • Google Cast SDK for Android - 1504180666
      • Media Router Framework - Part 1 - Media Router API - 1504180667
      • Overview for Google Cast Receivers - 1504180664
      • Google Cast SDK for iOS - 1504180663
    • Getting Started with the Google Maps SDK for iOS - 035
      • Getting started with the Google Maps SDK for iOS, Part 1 - 1504270757
    • IO Bytes 2014 - Wearables - 070
      • Voice Driven GDK Glassware - 1505280836
    • Route 85 - 078
      • Introducing Route 85 - 1501120022
      • Quick Tip: Don't Default that Switch! - 1501190371
      • OpenInChrome on iOS, Part 1 - 1501120023
      • OpenInChrome on iOS, Part 2 - 1501120024
      • OpenInChrome on iOS, Part 3 - 1501120025
      • OpenInChrome on iOS, Part 4 - 1501120026
    • DevBytes 2014 - 019
      • Web Components - Template - 1505040789
      • Wearable DataLayer API - 1505050792
      • Using srcset for responsive images - 1505050790
      • The picture element for art direction - 1505050791
    • Uncategorized - 999
      • Sun Surveyor brings augmented reality to photographers using Google Maps APIs - 1504200668
      • Snappy travels with the Roads API - 1503060392
      • Easy Maps Apps in Java and Python - 1501140030
  • Google 广告平台
  • Polymer
    • Polycasts - 076
      • The Awesome Power of Auto-Binding Templates -- Polycasts #08 - 1502220382
      • Content Switcheroo with Core-Pages -- Polycasts #09 - 1502200380
      • Core Iconset -- Polycasts #02 - 1505040788
  • Web 平台
    • HTTP 203 - 062
      • Gotchas - 1501140368
      • Font Rendering - 1501080016
    • Web Components - 081
      • DevBytes: Web Components - Overview - 1504250709
  • 宣传视频
    • Uncategorized - 999
      • Google Developers - 1501150369
      • I/O Extended 2014 - Join me - 1502220383
  • Google 各类开发者会议
    • 2014 Chrome 开发者高峰会议 - 009
      • Keynote - Chrome Dev Summit 2014 (Darin Fisher) - 1503120407
      • TLS All the Things! - Security with Performance(Chris Palmer) - 1503140412
      • Let’s build some apps with Polymer!(Rob Dodson) - 1503150415
      • Day One Closing Remarks(Sundar Pichai) - 1503150417
      • Chrome Leadership panel - 1503160422
      • Fundamentals of Mobile Web Development(Matt Gaunt) - 1503150416
    • 2015 游戏开发者大会中 - 039
      • FlatBuffers - 1504150640
      • Games for Google Cast - 1504150637
      • Top 10 Things Android Game Developers Should Know v 3.0 - 1504150643
      • Automate Publishing for Google Play APIs - 1504150639
      • 3 Game Design Mistakes You're Making - 1504150636
      • Android TV - 1504150638
      • How to Go Viral Without Really Trying - 1504150641
    • Devoxx 2014 Interviews - 024
      • What's new in Android 5.0 Lollipop - 1504260740
      • Android Tools - 1504260743
      • BigQuery and user-defined functions - 1504260744
    • IO Bytes 2014 - 065
      • Dart in Google Cloud - 1505070810
      • Big genomic data on Google Cloud Platform - 1505070811
      • Easy International Checkout with Chrome - 1505070802
      • Google developer tools and APIs for iOS - 1503190436
      • Whet your appetite with IO Bytes - 1501080021
    • PlayTime@Shanghai - 095
      • 主题演讲 Chris Yerga - 1504060549
      • 如何成功地开发你的应用 Ellie Powers - 1504060550
      • 在Google上营利 Brahim Elbouchikhi - 1504060551
      • Playtime Shanghai event sizzle reel - 1504070552
    • Project Google I/O 2015 - 098
      • Project Tango Mobile 3D tracking and perception - 1506120857
      • Democratizing Education - 1506120868
      • Improve your Android app’s accessibility - 1506120864
      • Google Cloud Messaging 3.0 - 1506120844
      • Developers connecting the world through Google Play - 1506120862
  • 开源开放技术
    • Compressor Head - 013
      • The Trailer, Season 2 - 1503060385
      • Behind the Scenes - 1503210441
      • Arithmetic Compression (Ep 5, Compressor Head) Google - 1503070394
      • Introducing Compressor Head - 1502120372
      • Episode 1 (Variable Length Codes) - 1502120373
      • Episode 2 (The LZ77 Compression Family) - 1502120374
      • Episode 3 (Markov Chain Compression) - 1502120375
Powered by GitBook
On this page
  • 译者信息
  • 解说词中文版:

Was this helpful?

  1. Android 平台
  2. Android Wear - 006

Fullscreen apps for Android Wear - 1503210445

PreviousHow We Customized Google Apps for Android Wear - 1503210450NextNew Notification Features for Android Wear - 1503210446

Last updated 5 years ago

Was this helpful?

视频发布时间

2014年6月25日

视频介绍

Learn how to write beautiful apps outside the stream on Android Wear, with a focus on how users leave apps and how to design for a round screen.

视频推介语

暂无,待补充。

译者信息

翻译

润稿

终审

原始链接

中文字幕

翻译流水号

加入字幕组

eternity

Eric Jin

程路

1503210445

解说词中文版:

大家好 我是Will Haldean Brown 我是

Android Wear 团队的一个软件工程师

今天 我给大家说一下为智能手表遍写全屏

沉浸式应用。

许多为安卓智能手表的技术设计方面你会很熟悉

正像平常智能手表

工作的方式一样

然而 我将会和大家说一下两个大的不同的方面

用户是怎么退出应用的

并且怎样设计和实现你的应用

使他在一个圆形的屏幕上看起来更好

我们首先讨论一下用户是怎么退出智能手表上的应用吧

在手机或者平板上 用户会使用返回键

或者home键来退出应用

但是 这些按钮在安卓智能手表设备上是看不到的

作为替代 用户有两种方式来退出应用

通过从屏幕左边滑动 和长按应用

在安卓智能手表上 我们引入一个新的窗口属性

窗口滑动式退出

这个窗口属性可以被指定在你的Activity的主题上

当窗口滑动退出属性设置为TRUE

当你从左边滑动至右边的时候 你的Activity将会退出。

这个滑动退出工作的模式和Viewpaper工作的方式相似

如果Activity的内容的本身就

能滚动 这个窗口将不会退出

除非用户滚动到

内容的边缘 然后再次滑动

这可以让你创建一个极好的 像流动一样的体验

通过滑动仍然可以退出

所有的安卓智能手表的应用的默认

主题 或者从默认的主题下继承的主题

这将可以保证你的安卓智能手表应用有许多的风格

并且看起来很好

它也可以滑动退出

我们识别出那些应用

不能使用滑动退出的功能

例如 一个地图的应用有无穷无尽的界面

是不能达到边界的

如果你不想使用滑动的手势

你能关闭滑动退出属性在你的主题上

通将属性设置为false。

对于不能滑动退出的应用

我们推荐你在应用上用长按的

手势来作为退出按钮

为了告诉用户你的应用支持长压退出的方式

你应该展示一个长时按压的示意

当你的应用被第一次使用的时候

正像你现在在这看到的 在屏幕上某些地方长时按压

会出现一个退出的按钮覆盖在应用的上面

轻点那个按钮结束Activity

他可以带用户回到主界面

为了使你更容易的实现长按退出应用

我们已经为你做了一个UI view的逻辑

让你可以调用退出覆盖视图

加入它到你的应用,

首先,把它加入你你的 activities layout XML里。

确保它添加在一个可以影响

全部布局的地方

你也必须保证视图的大小可以占据整个

屏幕

在这儿 我有一个作为布局的最后一个子框架

设定子框架的高和宽和父框架匹配

这确保它可以占据整个屏幕覆盖一切

现在 让我们看一下你Activity类

在它的onCreate 拉出你的退出界面

并且设置介绍文字。

这些文字会在你第一次开启你的活动的时候展示出来

作为你个覆盖物覆盖你的内容

并且应该告诉用户他们可以长按屏幕来返回home界面

这叫做 showIntroIfNecessary

这些介绍文字只在你的应用

第一次运行的时候显示。

接下来 当你的Activity被长按的时候我们需要将其连接到

显示器上

使用一个GestureDetector和一个SimpleOnGestureListener类

使用这些框架类将会保证

周围的时机姿态

和所有的应用一致

当你得到长按回调

显示你那些退出覆盖层

展现出退出键

如果用户点击这个按钮 你的Activity将会结束

但是如果他们不点击这个按钮

这个覆盖的界面将会自动隐藏

等着下一个展现的呼叫

最后 仍然在你的Activity中 重载

这个onTouchEvent方法

并且将receiveTouchEvents传入GestureDetector

如果GestureDetector返回 true

你应该返回 真 并且不把这个事件

传递到正常的Activity的onTouchEvent方法中。

如果GestureDetector类返回值为 假

使用正常的Activity触摸处理。

现在 让我们说一些不同的事情

怎么样使你的应用

在Moto 360的圆形屏幕上变得漂亮

首先 让我们看一下360屏幕的尺寸

它是一个具有320像素的圆

在底部有一个30像素的下巴

因此 这个系统报道说它的型号从320至290像素

当我们了解了整个发展过程

这个链可能会导致一些意想不到的结果

导入现有的布局

例如,看这个action cards

我们想要想把操作图放在屏幕的中心

但是 当我们设置布局使其垂直居中

这个蓝圈偏移15像素

我们认为最好是

一个中心布局

在屏幕的圆心

在我前面提到的默认的主题里

windowOverscan 属性已经设置了

现在 视图层次的根

被判断是320*320像素

这将导致你应用的顶层视图

以相同的320320像素 而不是320290

并且以你的中心布局按照所期望的方式工作

你怎么监测你的Activity在一个圆形的屏幕上的运行呢?

你的views可以请求应用窗口插图

并且得到callback,包含一个窗口插图对象

告诉你Moto360屏幕的形状

它告诉你底层视图是30像素

你要使用这个含义无论在哪儿

你需要放置在下巴以外

在这儿很好的使用这个视图

保证你的应用在将来的设备上看起来更好

为了保存你写的这些样板代码

我们加了一个叫做WatchViewStub的视图

根据你的应用是否在一个长方形或者圆形

的设备上运行

允许你增加两个不同布局的其中一个

你可以使用一个WatchViewStub类作为任何

你想要的为了在圆的屏幕上看起来不同的视图层次的源

使用它 创建一个新的桩,在Activity或fragments 的onCreate

一旦你这样做

你需要给你的桩两个视图布局

一个是为了填充圆形的设备

另一个是为了长方形的设备

尽管这还是一个障碍

因为这些布局不能增加

除非这个视图连接了布局层次

你还没有子框架的权限

相反 增加一个OnLayoutInflatedListener类

当适当的内部布局已经增加的时候

会被调用

这两种退出视图,以及这个WatchViewStub类

都在可用的支持的库里

它也提供了一个叫做盒嵌入布局的布局管理框架

它扩展了框架布局 允许开发者

在长方形或者圆形的屏幕上使用相同的布局

在这个例子中 左边有一个文本视图

底部的左边有一个取消按钮

底部的右边有一个OK的按钮

当同一个布局被用在圆形的屏幕上

我们想要视图元素放在

圆圈的边缘而不是正中间

这个通过添加可用的布局框

属性来实现

它定义了一组边缘、左、右和底部

去对齐那个圆形中的盒子(矩形)。

这使得很容易得到一个背景出血(译者:出血是一个印刷专有名词)

到整个圆,但其他成员容纳在非剪裁区。

在这儿 你可以看到一个文本视图

框在圆形屏幕中心的正方形

在一个正方形的屏幕上 布局框参数被忽略了

对这个平台我实在很兴奋 我希望你也一样

对你开发的应用我已经迫不及待了

Youtube
Youtube
加入 GDG 字幕组
video_screenshot