滑卡设计 [英] Sliding Card Design

查看:39
本文介绍了滑卡设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关如何最好地实现这种效果的一些想法.我有两个片段,一个包含地图(和所有控件),另一个片段包含我的 RecyclerView 以显示结果.在我的活动布局中,我想准确地定位我的地图并列出片段,就像它在 此视频 中的显示方式一样.除非用户主动向上滚动列表,否则地图片段应与列表的最上边缘对齐.我录制的视频应该展示我想要实现的目标.

I am looking for some ideas on how to best achieve this effect. I have two fragments, one containing the map (and all controls) and another fragment that contains my RecyclerView to display the results. In my activity layout I would like to position my map and list fragments exactly how it is shown in this video. The map fragment shall stay aligned with the topmost edge of the list unless the user is actively scrolling the list upwards. The video I recorded should demonstrate what it is I am trying to achieve.

从解释的角度来看,我需要视图和布局的想法.我已经为两个片段和活动之间的所有用户交互实现了所有必要的回调.特别是我最感兴趣的一项是如何对齐两个视图,然后在用户开始滚动时将下方的幻灯片放在视图上.注意列表(显示时)不会向下滚动.

From an explanatory standpoint, I need view and layout ideas. I have already implemented all the necessary callbacks for all user interactions between the two fragments and the activity. One item in particular I am most interested hearing feedback on is how to align two views and then have the lower slide over the view when the user starts scrolling. Notice how the list (when showing) will not scroll downward.

推荐答案

我可以建议的一种方法是将地图和 ListView 放在同一个片段中并尝试 这个.这是 Play Music 中的滑动抽屉动画.

One method I can suggest is to have both the map and the ListView in the same fragment and try this. It's the sliding drawer animation in Play Music.

对于触摸地图将列表视图缩小到底部的栏的部分.我建议你在 listView 中创建动画来缩小和扩展,并分别在事件 Down 和 Up 上调用它们.这是 MotionEvent.

For the part where touching the map shrinks the list view to a bar on the bottom. I suggest you create animations in the listView to shrink and to expand and call them on event Down and Up respectively. Here is the MotionEvent.

这篇关于滑卡设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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