The invention discloses a method and system, display Android product list method comprises: a custom style provides adapter components; define a data structure in accordance with the rules; back-end data structure is defined by the rules, will transfer to the front layout data list of goods; the front end of the received data after the data is transmitted to the adapter, adapter analysis the received data, and calculate the style in the distance, the location of the screen display; according to the results of the adapter, use the original drawing control drawing display. The beneficial effect: through the use of original drawing control, simplify the complex layout calculation and fast rendering graphics, so as to improve the drawing performance, user is not Caton, show fast; to support any style through the custom data structure of a format of the flow of goods and advertising, the client can not make any changes, as long as the interface effect of the server configuration display hope the data front display screen will display truthfully, greatly improves the flexibility and diversity.
【技术实现步骤摘要】
一种Android商品列表的展示方法及系统
本专利技术涉及计算机
,尤其是涉及一种Android商品列表的展示方法及系统。
技术介绍
Android应用展示商品列表是消费者浏览商品,选购商品的重要渠道。商品列表的用户体验至关重要,可影响到用户是否愿意使用该产品。但商品列表的商品种类繁多,样式各一,再加上还需要展示商家的一些广告,使得整个界面十分复杂。用户在浏览商品的时候,就会出现卡顿,造成用户流失。广告也十分重要,是做活动的入口,广告由于需要配合一些活动必须做到灵活配置,灵活显示,不能每次都依赖于客户端添加新样式。现在有的支持商品列表的技术方案有:(1)android原生的listview控件,自定义样式类型(一般是原生控件组合的布局),通过adapter(一种给listview提供样式的组件)绑定数据,然后展示所有商品样式。(2)使用HTML5的网页展示,通过android的webview展示网页类型的商品列表。现在方案的缺陷:一是使用android原生listview控件,若是商品类型太多,会造成listview的复用功能弱化,加上广告占用很多类型,而且自定义的样式是由原生控件组成,使得布局计算非常复杂并且界面过渡绘制超过4x,最终导致滑动浏览商品时卡顿严重。二是使用HTML5的页面,本身由于是网页,网络传输数据量大,用户看到页面就会有明显延迟,又因为会解析整个HTML,然后再渲染webview,用户体验非常差。View:Android图形绘制抽象组件,所有需要绘制的图形需要继承该组件。
技术实现思路
本专利技术的目的在于克服上述技术不足,提出一种A ...
【技术保护点】
一种Android商品列表的展示方法,其特征在于,包括:S1、自定义一样式提供组件adapter;S2、定义一数据结构的规则;S3、后端按照S2定义的数据结构的规则,将商品列表的布局数据传递给前端;S4、前端接收数据后将数据传递给所述adapter,所述adapter解析接收的数据,并计算各样式在屏幕显示的间距、位置;S5、根据所述adapter计算的结果,使用原生绘图控件进行绘图展示。
【技术特征摘要】
1.一种Android商品列表的展示方法,其特征在于,包括:S1、自定义一样式提供组件adapter;S2、定义一数据结构的规则;S3、后端按照S2定义的数据结构的规则,将商品列表的布局数据传递给前端;S4、前端接收数据后将数据传递给所述adapter,所述adapter解析接收的数据,并计算各样式在屏幕显示的间距、位置;S5、根据所述adapter计算的结果,使用原生绘图控件进行绘图展示。2.如权利要求1所述的Android商品列表的展示方法,其特征在于,步骤S1中:所述adapter预先设置需要的样式控件,所述adapter预先设置需要的样式控件继承自View,用于解析接收的数据以及与绘图控件配合进行绘图显示。3.如权利要求1所述的Android商品列表的展示方法,其特征在于,步骤S2中:定义数据结构为行嵌套列,数据结构的行是一个广告结构单元,定义数据结构的列是一个控件组合单元,一数组包含多个行,后端计算每个广告单元的宽高并传递前端,前端根据计算结果进行宽高限制显示,间距字段由后端传递给前端,间距字段控制前端每行之间的间距,分割线字段由后端传递给前端,分割线字段控制前端的分割线显示,后端的倒计时结构传递数据给前端,倒计时结构控制前端的倒计时显示。4.如权利要求1所述的Android商品列表的展示方法,其特征在于,步骤S5中:重写View的onDraw方法,使用方法drawXXX,在原生绘图控件canvas上绘图。5.如权利要求1所述的Android商品列表的展示方法,其特征在于,步骤S5中:通过recyclerview来进行绘图后商品列表的页面展示。6.一种Android商品列表的展示系统...
【专利技术属性】
技术研发人员:杨雪芹,黄承松,夏里峰,宋书俊,
申请(专利权)人:武汉奇米网络科技有限公司,
类型:发明
国别省市:湖北,42
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。