简体   繁体   English

Android 滑出视图

[英]Android slide out view

I am wondering how to achieve some kind of draggable view.我想知道如何实现某种可拖动视图。 I am not speaking about the navigation drawer!不是在说导航抽屉! Several other applications implement this kind of views, for example the new stock Android Lollipop Calculator application.其他几个应用程序实现了这种视图,例如新的股票 Android Lollipop Calculator 应用程序。 There you can drag out the extended symbols view from the right hand corner.在那里您可以从右上角拖出扩展符号视图。 Another application is Google maps.另一个应用是谷歌地图。 When checking out a location, it's possible to extend the location information by dragging up the bottom information view.签出位置时,可以通过向上拖动底部信息视图来扩展位置信息。 It appears that there are two points where the view is able to lock in, meaning that when pulling the view up to a specific point and releasing, will result in the drawer not closing entirely but to align to the specific locking points.似乎有两个点可以锁定视图,这意味着当将视图拉到特定点并释放时,将导致抽屉不会完全关闭,而是与特定锁定点对齐。

How is that achieved or is a library required?这是如何实现的或者是否需要图书馆?

Thanks in advance提前致谢

The stock calculator app appears to use ViewPager to achieve the slideout numberpad.股票计算器应用程序似乎使用 ViewPager 来实现滑出式数字键盘。 It's a part of android, no libraries so that would be a good starting point.它是 android 的一部分,没有库,所以这是一个很好的起点。

Here's the class in question (Rest of the code to the left) 这是有问题的课程(左侧的其余代码)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM