The invention provides a method and device for a drop-down to refresh the APP interface. The method includes: detecting the user drop-down operation on the screen when the displacement of the calling application APP bar control change monitoring interface, through the moving distance displacement monitoring interface to obtain APP interface from the APP control column, determine the drop-down operation at the end of the APP interface of mobile Yu Huo distance equal to the first preset threshold, triggering folding toolbar controls playing the first animation stored at the same time, implementation of the APP interface refresh operation, and set up the screen can not touch. Thus, the custom animation needs can be met when the APP interface is refreshed, and it is easy to realize, strong compatibility and low learning cost.
【技术实现步骤摘要】
下拉刷新APP界面的实现方法及装置
本专利技术涉及通信
,尤其涉及一种下拉刷新APP界面的实现方法及装置。
技术介绍
伴随着手机应用的飞速发展,手机应用程序(Application,APP)占据着非常大的市场份额,APP中最重要的功能就是与用户的交互功能,其中下拉刷新这种交互方式是现在智能触屏手机app中最为常用的交互方式之一。现有的下拉刷新功能实现方式中,安卓系统中最主要的实现方式就是采用谷歌官方控件中的下拉刷新控件(SwipRefreshLayout),该控件性能良好,兼容性强,可以很好地实现下拉刷新的功能。但是实现方式的样式固定不变,很难满足当前大多数APP中的需求,例如无法实现自定义动画、内容跟随移动等功能。为实现自定义动画的功能,许多开发者自己开发实现下拉刷新功能的下拉刷新框架,主要是通过预设的计算方式计算视图(view)的移动距离并控制自定义动画的播放和视图的重新布局,改变界面样式。但是,由于需要自行计算视图移动距离,实现比较复杂,且不同开发者的计算方式不同,而计算方式的不同造成不同下拉刷新框架的性能等方面有很大的差异,兼容性差,在其它应用需要使 ...
【技术保护点】
一种下拉刷新APP界面的实现方法,其特征在于,包括:检测到用户对屏幕的下拉操作时,调用应用程序APP栏控件的位移改变监听接口;通过所述位移改变监听接口从所述APP栏控件获取APP界面的移动距离;确定所述下拉操作结束时APP界面的移动距离大于或等于第一预设阈值时,触发折叠工具栏控件播放预存的第一动画,同时执行APP界面刷新操作,并设置所述屏幕不可触摸。
【技术特征摘要】
1.一种下拉刷新APP界面的实现方法,其特征在于,包括:检测到用户对屏幕的下拉操作时,调用应用程序APP栏控件的位移改变监听接口;通过所述位移改变监听接口从所述APP栏控件获取APP界面的移动距离;确定所述下拉操作结束时APP界面的移动距离大于或等于第一预设阈值时,触发折叠工具栏控件播放预存的第一动画,同时执行APP界面刷新操作,并设置所述屏幕不可触摸。2.根据权利要求1所述的方法,其特征在于,还包括:确定所述下拉操作结束时APP界面的移动距离小于所述第一预设阈值时,将APP界面回弹到初始位置。3.根据权利要求1或2所述的方法,其特征在于,还包括:确定APP界面刷新操作成功或者超时,将APP界面回弹到初始位置。4.根据权利要求3所述的方法,其特征在于,所述检测到用户对屏幕的下拉操作之后,还包括:记录所述下拉操作的初始点击位置,并设置所述屏幕的状态为被点击状态。5.根据权利要求4所述的方法,其特征在于,所述记录所述下拉操作的初始点击位置之后,还包括:确定所述下拉操作未结束时APP界面的移动距离大于或等于第二预设阈值时,触发所述折叠工具栏控件播放预存的第二动画。6.一种下拉刷新APP界面的实现装置,其特征在于,...
【专利技术属性】
技术研发人员:孟敬楠,
申请(专利权)人:北京五八信息技术有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。