导航抽屉(Google+ 与 YouTube) [英] Navigation Drawer (Google+ vs. YouTube)

查看:37
本文介绍了导航抽屉(Google+ 与 YouTube)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道如何实现像当今一些顶级应用程序一样的滑动菜单?

其他堆栈溢出.

  • 开发者文档可以在 在这里.
  • <小时>

    编辑 #2:

    Roman Nurik(Google 的 Android 设计工程师)已确认推荐的行为是在打开抽屉时不要移动操作栏(如 YouTube 应用).请参阅此 Google+ 帖子.

    <小时>

    编辑 #1:

    我刚刚回答了这个问题,但我再次强调 Prixing 拥有最好的弹出菜单......到目前为止.它非常漂亮,非常流畅,让 Facebook、Google+ 和 YouTube 相形见绌.EverNote 也很不错……但仍然不如 Prixing 完美.查看这一系列帖子,了解如何实现弹出菜单(正是 Prixing 的首席开发人员本人!).

    <小时>

    原答案:

    Adam Powell 和 Richard Fulcher 在 49:47 - 52:50 上讨论了这个问题题为Android 导航"的 Google I/O 演讲.

    总结一下他们的回答,截至本文发布之日,滑出式导航菜单还不是正式成为 Android 应用程序设计标准的一部分.您可能已经发现,目前没有对此功能的本地支持,但有人讨论将其添加到即将到来的支持包修订版中.

    就 YouTube 和 G+ 应用而言,它们的行为不同似乎很奇怪.我最好的猜测是 YouTube 应用固定操作栏位置的原因是,

    1. 对于使用 YouTube 应用的用户来说,最重要的导航选项之一是搜索,它在操作栏中的 SearchView 中执行.在这方面,将操作栏设为静态是有意义的,因为它允许用户始终选择搜索新视频.

    2. G+ 应用程序使用 ViewPager 来显示其内容,因此针对布局内容(即操作栏下的所有内容)制作特定的拉出菜单没有多大意义.滑动应该提供一种在页面之间导航的方式,而不是一种全局导航的方式.这可能就是他们决定在 G+ 应用中采用与在 YouTube 应用中不同的方式的原因.

      另外,请查看 Google Play 应用以获取另一个版本的拉出菜单"(当您位于最左侧的页面时,向左滑动并拉出,将出现半页"菜单).

    您是对的,因为这不是非常一致的行为,但 Android 团队似乎尚未就应如何实施此行为达成 100% 的共识.如果将来应用更新,使两个应用中的导航相同,我不会感到惊讶(他们似乎非常热衷于在谈话中使所有 Google 制造的应用的导航保持一致).

    Does anyone know how to implement a sliding menu like some of the top apps of today?

    Other Stack Overflow questions haven't had any answers on how to do this, so I'm trying to gather as much info to help out others. All the applications I mention below do a great job of implementing the slide menu.

    1. Google Plus (as of 7/7/12)

    You can only go from the first screen to the second screen by clicking the G+ logo in the upper left hand corner. Notice that the entire screen moves from it's position and get's nudged to the right side of the screen (including the action bar). To get back to the first screen you can either slide the right side back into focus or you can click the G+ icon again.

    2. YouTube (as of 7/7/12)

    You can go from the first screen to second screen using two methods. Either click the YouTube logo in the upper left, or you can use a swipe gesture to move it to the right. This is already different from the G+ app. Secondly, you can see that the action bar stays put (Unlike G+). Lastly, to get the original screen back it works just like G+.

    解决方案

    Edit #3:

    The Navigation Drawer pattern is officially described in the Android documentation!

    Check out the following links:

    • Design docs can be found here.
    • Developer docs can be found here.

    Edit #2:

    Roman Nurik (an Android design engineer at Google) has confirmed that the recommended behavior is to not move the Action Bar when opening the drawer (like the YouTube app). See this Google+ post.


    Edit #1:

    I answered this question a while ago, but I'm back to re-emphasize that Prixing has the best fly-out menu out there... by far. It's absolutely beautiful, perfectly smooth, and it puts Facebook, Google+, and YouTube to shame. EverNote is pretty good too... but still not as perfect as Prixing. Check out this series of posts on how the flyout menu was implemented (from none other than the head developer at Prixing himself!).


    Original Answer:

    Adam Powell and Richard Fulcher talk about this at 49:47 - 52:50 in the Google I/O talk titled "Navigation in Android".

    To summarize their answer, as of the date of this posting the slide out navigation menu is not officially part of the Android application design standard. As you have probably discovered, there's currently no native support for this feature, but there was talk about making this an addition to an upcoming revision of the support package.

    With regards to the YouTube and G+ apps, it does seem odd that they behave differently. My best guess is that the reason the YouTube app fixes the position of the action bar is,

    1. One of the most important navigational options for users using the YouTube app is search, which is performed in the SearchView in the action bar. It would make sense to make the action bar static in this regard, since it would allow the user to always have the option to search for new videos.

    2. The G+ app uses a ViewPager to display its content, so making the pull out menu specific to the layout content (i.e. everything under the action bar) wouldn't make much sense. Swiping is supposed to provide a means of navigating between pages, not a means of global navigation. This might be why they decided to do it differently in the G+ app than they did in the YouTube app.

      On another note, check out the Google Play app for another version of the "pull out menu" (when you are at the left most page, swipe left and a pull out, "half-page" menu will appear).

    You're right in that this isn't very consistent behavior, but it doesn't seem like there is a 100% consensus within the Android team on how this behavior should be implemented yet. I wouldn't be surprised if in the future the apps are updated so that the navigation in both apps are identical (they seemed very keen on making navigation consistent across all Google-made apps in the talk).

    这篇关于导航抽屉(Google+ 与 YouTube)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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