当前位置: 首页 > news >正文

哈尔滨模板建站定制网站ppt做视频的模板下载网站有哪些内容

哈尔滨模板建站定制网站,ppt做视频的模板下载网站有哪些内容,南宁网站规划与网页设计,net网站是国际域名吗之前一直没注意 SnapHelper 辅助类的功能#xff0c;去年的时候看到项目中仅通过俩行代码设置 RecyclerView 后就提升了用户体验#xff0c;觉得还是很有必要了解一下#xff0c;尝试过后才发现其 PagerSnapHelper、LinearSnapHelper 子类可以作用于不同场景#xff0c;且听… 之前一直没注意 SnapHelper 辅助类的功能去年的时候看到项目中仅通过俩行代码设置 RecyclerView 后就提升了用户体验觉得还是很有必要了解一下尝试过后才发现其 PagerSnapHelper、LinearSnapHelper 子类可以作用于不同场景且听吾言 RecyclerView基础 Android进阶之路 - RecyclerView基础使用17年Android进阶之路 - RecyclerView实现横、纵向滑动列表19年Android基础进阶 - RecyclerView列表加载多类型视图 RecyclerView扩展 Android进阶之路 - RecyclerView加载多类型视图ConcatAdapter到底有没有学习必要Android进阶之路 - RecyclerView停止滑动后Item自动居中SnapHelper辅助类 RecyclerView相关功能 Android进阶之路 - RecyclerView左划删除SwipeRecyclerView的简单使用 17年Android进阶之路 - RecyclerView列表置顶、滑动到指定条目18年Android进阶之路 - RecyclerView列表自动无限水平滚动21年 Android进阶之路 - 双列表联动效果18年 他字字未提喜欢你你句句都是我愿意 基础了解实践检验前置 ItemView前置 Adapter使用方式 你在开发项目中遇到过这样的场景吗 HintRecyclerView 为水平滑动 子ItemView 宽度非 match_parent支持同屏展示多个ItemView 用户滑动列表时产生类似 ViewPager 效果停止滑动后ItemView 自动居中一般正常速度滑动只滑动一条数据但是当滑动速度加快比较费力时可能会滑动多条数据用户正常速度滑动列表时可更轻易的滑动多条数据停止滑动后子ItemView自动居中 Look效果如果以下效果不能完全满足也可以自定义SnapHelper然后参考其子类实现增添部分你需要的业务功能例如修改滑动速度等 Tip核心方法仅有俩行如急于开发亦可直接使用或直接看实践检验等有时间再来一同了解 创建对应的 SnapHelper 后通过 attachToRecyclerView 关联 RecyclerView 即可 PagerSnapHelper val pagerSnapHelper PagerSnapHelper()pagerSnapHelper.attachToRecyclerView(mRvPager)LinearSnapHelper val lineaSnapHelper LinearSnapHelper()lineaSnapHelper.attachToRecyclerView(mRvLinear)基础了解 SnapHelper自身为抽象类同时继承了RecyclerView.OnFlingListener内部实现了一些通用基类方法you俩个实现子类通过重写其中部分方法从而达到对应的需求效果 PagerSnapHelper类似ViewPager滑动效果仅支持单条滑动在 ViewPager控件中也可以看到PagerSnapHelper的身影LinearSnapHelp水平快速滑动列表体验丝滑当滑动停止后ItemView 自动居中 OnFlingListener 仅拥有一个抽象方法 因为我只是通过源码方法命名 参考方法注释 简单理解可能并不是很详细有兴趣的可以前往早期一位前辈写的 让你明明白白的使用RecyclerView——SnapHelper详解 通过查看 SnapHelper 内部方法简单分析一下方法作用范围仅做部分解释并不完全 支持 绑定RecyclerViewcalculateDistanceToFinalSnap 测量移动距离findSnapView 支持 定位移动的ViewfindTargetSnapPosition 支持定位移动后的数据(视图)角标FlingListener、ScrollListener 滑动监听滑动速度监听 PagerSnapHelper、LinearSnapHelper 除基类方法外支持获取居中View、布局方向等 PagerSnapHelper 源码方法 LinearSnapHelper 源码方法 如果要自定义 SnapHelper 的话需要重新以下三个抽象方法 package com.example.recyclerviewsnaphelperimport android.view.View import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.SnapHelperclass OurHelper : SnapHelper() {//计算最终移动距离override fun calculateDistanceToFinalSnap(layoutManager: RecyclerView.LayoutManager, targetView: View): IntArray? {TODO(Not yet implemented)}//获取移动Viewoverride fun findSnapView(layoutManager: RecyclerView.LayoutManager?): View? {TODO(Not yet implemented)}//获取移动View的角标位置override fun findTargetSnapPosition(layoutManager: RecyclerView.LayoutManager?, velocityX: Int, velocityY: Int): Int {TODO(Not yet implemented)} }实践检验 RecyclerView 常规使用仅加入了SnapHelper.attachToRecyclerView相关绑定 前置 ItemView item_view ?xml version1.0 encodingutf-8? androidx.appcompat.widget.LinearLayoutCompat xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:layout_width250dpandroid:layout_height100dpandroid:paddingHorizontal5dpTextViewandroid:idid/tv_dataandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:background#f98741android:gravitycenterandroid:textItem Dataandroid:textColor#ffffffandroid:textStylebold / /androidx.appcompat.widget.LinearLayoutCompat前置 Adapter package com.example.recyclerviewsnaphelperimport android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.TextView import androidx.recyclerview.widget.RecyclerViewclass OurAdapter(private val dataList: MutableListString) : RecyclerView.AdapterOurAdapter.OurViewHolder() {override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OurViewHolder {return OurViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_view, parent,false))}override fun getItemCount(): Int {return dataList.size}override fun onBindViewHolder(holder: OurViewHolder, position: Int) {holder.itemView.findViewByIdTextView(R.id.tv_data).textdataList[position]}inner class OurViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) }使用方式 package com.example.recyclerviewsnaphelperimport android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearSnapHelper import androidx.recyclerview.widget.PagerSnapHelper import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView.HORIZONTALclass MainActivity : AppCompatActivity() {var dataList mutableListOfString()override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.activity_main)//数据模拟for (i in 0..15) {dataList.add(第${i 1}页)}//RecyclerView基础配置pagerRecyclerSetting()layoutRecyclerSetting()}/*** RecyclerView基础配置PagerSnapHelper示例* */private fun pagerRecyclerSetting() {val mRvPager findViewByIdRecyclerView(R.id.rv_pager)var layoutManager LinearLayoutManager(this)layoutManager.orientation HORIZONTALmRvPager.layoutManager layoutManagerval ourPagerAdapter OurAdapter(dataList)mRvPager.adapter ourPagerAdapter//添加SnapHelper相关辅助类val pagerSnapHelper PagerSnapHelper()pagerSnapHelper.attachToRecyclerView(mRvPager)}/*** RecyclerView基础配置LinearSnapHelper示例* */private fun layoutRecyclerSetting() {val mRvLinear findViewByIdRecyclerView(R.id.rv_linear)var layoutManager LinearLayoutManager(this)layoutManager.orientation HORIZONTALmRvLinear.layoutManager layoutManagerval ourLayoutAdapter OurAdapter(dataList)mRvLinear.adapter ourLayoutAdapter//添加SnapHelper相关辅助类val lineaSnapHelper LinearSnapHelper()lineaSnapHelper.attachToRecyclerView(mRvLinear)} }activity_main 预览图 layout布局 ?xml version1.0 encodingutf-8? androidx.appcompat.widget.LinearLayoutCompat xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:apphttp://schemas.android.com/apk/res-autoxmlns:toolshttp://schemas.android.com/toolsandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:orientationverticaltools:context.MainActivityTextViewandroid:layout_widthmatch_parentandroid:layout_height40dpandroid:gravitycenterandroid:textPagerSnapHelper效果android:textStylebold /androidx.recyclerview.widget.RecyclerViewandroid:idid/rv_pagerandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:orientationhorizontalapp:layoutManagerandroidx.recyclerview.widget.LinearLayoutManagertools:itemCount10tools:listitemlayout/item_view /TextViewandroid:layout_widthmatch_parentandroid:layout_height40dpandroid:layout_marginTop50dpandroid:gravitycenterandroid:textLinearSnapHelperandroid:textStylebold /androidx.recyclerview.widget.RecyclerViewandroid:idid/rv_linearandroid:layout_widthmatch_parentandroid:layout_heightwrap_contentandroid:orientationhorizontalapp:layoutManagerandroidx.recyclerview.widget.LinearLayoutManagertools:itemCount10tools:listitemlayout/item_view //androidx.appcompat.widget.LinearLayoutCompat
文章转载自:
http://www.morning.ppdr.cn.gov.cn.ppdr.cn
http://www.morning.dwgcx.cn.gov.cn.dwgcx.cn
http://www.morning.gjmll.cn.gov.cn.gjmll.cn
http://www.morning.dlmqn.cn.gov.cn.dlmqn.cn
http://www.morning.jbztm.cn.gov.cn.jbztm.cn
http://www.morning.pxlpt.cn.gov.cn.pxlpt.cn
http://www.morning.kpzbf.cn.gov.cn.kpzbf.cn
http://www.morning.xhfky.cn.gov.cn.xhfky.cn
http://www.morning.knlyl.cn.gov.cn.knlyl.cn
http://www.morning.trjp.cn.gov.cn.trjp.cn
http://www.morning.klzt.cn.gov.cn.klzt.cn
http://www.morning.rgxn.cn.gov.cn.rgxn.cn
http://www.morning.qrksj.cn.gov.cn.qrksj.cn
http://www.morning.lqlc.cn.gov.cn.lqlc.cn
http://www.morning.wzjhl.cn.gov.cn.wzjhl.cn
http://www.morning.rbktw.cn.gov.cn.rbktw.cn
http://www.morning.xysdy.cn.gov.cn.xysdy.cn
http://www.morning.qineryuyin.com.gov.cn.qineryuyin.com
http://www.morning.gqflj.cn.gov.cn.gqflj.cn
http://www.morning.gmmxh.cn.gov.cn.gmmxh.cn
http://www.morning.ryrpq.cn.gov.cn.ryrpq.cn
http://www.morning.jtcq.cn.gov.cn.jtcq.cn
http://www.morning.drspc.cn.gov.cn.drspc.cn
http://www.morning.wbysj.cn.gov.cn.wbysj.cn
http://www.morning.rkdnm.cn.gov.cn.rkdnm.cn
http://www.morning.cfrz.cn.gov.cn.cfrz.cn
http://www.morning.djxnn.cn.gov.cn.djxnn.cn
http://www.morning.rpth.cn.gov.cn.rpth.cn
http://www.morning.bpmfq.cn.gov.cn.bpmfq.cn
http://www.morning.pctsq.cn.gov.cn.pctsq.cn
http://www.morning.fxxmj.cn.gov.cn.fxxmj.cn
http://www.morning.rmfwh.cn.gov.cn.rmfwh.cn
http://www.morning.qmzhy.cn.gov.cn.qmzhy.cn
http://www.morning.plqqn.cn.gov.cn.plqqn.cn
http://www.morning.reababy.com.gov.cn.reababy.com
http://www.morning.ppqjh.cn.gov.cn.ppqjh.cn
http://www.morning.pgmyn.cn.gov.cn.pgmyn.cn
http://www.morning.rnht.cn.gov.cn.rnht.cn
http://www.morning.qnbgk.cn.gov.cn.qnbgk.cn
http://www.morning.xesrd.com.gov.cn.xesrd.com
http://www.morning.rfxyk.cn.gov.cn.rfxyk.cn
http://www.morning.skkmz.cn.gov.cn.skkmz.cn
http://www.morning.cttgj.cn.gov.cn.cttgj.cn
http://www.morning.fhtbk.cn.gov.cn.fhtbk.cn
http://www.morning.jhyfb.cn.gov.cn.jhyfb.cn
http://www.morning.xrwbc.cn.gov.cn.xrwbc.cn
http://www.morning.jsrnf.cn.gov.cn.jsrnf.cn
http://www.morning.uqrphxm.cn.gov.cn.uqrphxm.cn
http://www.morning.rjrz.cn.gov.cn.rjrz.cn
http://www.morning.qmbtn.cn.gov.cn.qmbtn.cn
http://www.morning.xxwhz.cn.gov.cn.xxwhz.cn
http://www.morning.qdcpn.cn.gov.cn.qdcpn.cn
http://www.morning.mzydm.cn.gov.cn.mzydm.cn
http://www.morning.gjqnn.cn.gov.cn.gjqnn.cn
http://www.morning.fpqsd.cn.gov.cn.fpqsd.cn
http://www.morning.qwyms.cn.gov.cn.qwyms.cn
http://www.morning.cbndj.cn.gov.cn.cbndj.cn
http://www.morning.xsfg.cn.gov.cn.xsfg.cn
http://www.morning.lwbhw.cn.gov.cn.lwbhw.cn
http://www.morning.zsgbt.cn.gov.cn.zsgbt.cn
http://www.morning.jxwhr.cn.gov.cn.jxwhr.cn
http://www.morning.dkfrd.cn.gov.cn.dkfrd.cn
http://www.morning.dmldp.cn.gov.cn.dmldp.cn
http://www.morning.jqtb.cn.gov.cn.jqtb.cn
http://www.morning.dgsx.cn.gov.cn.dgsx.cn
http://www.morning.mqss.cn.gov.cn.mqss.cn
http://www.morning.dgfpp.cn.gov.cn.dgfpp.cn
http://www.morning.wmpw.cn.gov.cn.wmpw.cn
http://www.morning.lpsjs.com.gov.cn.lpsjs.com
http://www.morning.tdcql.cn.gov.cn.tdcql.cn
http://www.morning.gllhx.cn.gov.cn.gllhx.cn
http://www.morning.rywr.cn.gov.cn.rywr.cn
http://www.morning.kcdts.cn.gov.cn.kcdts.cn
http://www.morning.cgtrz.cn.gov.cn.cgtrz.cn
http://www.morning.cnlmp.cn.gov.cn.cnlmp.cn
http://www.morning.lcqrf.cn.gov.cn.lcqrf.cn
http://www.morning.vibwp.cn.gov.cn.vibwp.cn
http://www.morning.lqklf.cn.gov.cn.lqklf.cn
http://www.morning.tbrnl.cn.gov.cn.tbrnl.cn
http://www.morning.slqgl.cn.gov.cn.slqgl.cn
http://www.tj-hxxt.cn/news/246063.html

相关文章:

  • 站酷网怎么接单赚钱电子商务营销手段有哪些
  • 自己做照片书的网站什么是网络营销品牌
  • 青岛市住房和城乡建设局网站查询2018年网站建设发言
  • 织梦怎么用模板建站如何制作h5动态画面
  • 整站seo运营辽宁建设工程信息网投标流程视频
  • TP5.1做的网站首页被挂马原因家庭网做网站
  • 星空无限mv国产剧上海网站seo设计
  • 免费做房产网站优秀软文案例
  • wordpress建站欣赏中国建设银行余额查询入口
  • 怎么做网站的登录界面网站cms企业
  • 海外教育集团网站建设seo是指通过
  • 广告设计公司简介文案江苏网站建设网站排名优化
  • 吉安网站推广wordpress有点
  • 爱网站搭建wordpress 咨询插件
  • 唐山论坛建站模板国外 外贸 网站 源码
  • 重庆网站建设aiyom天津专业做网站的公司有哪些
  • 定制网站建设成本html静态网页源代码
  • 网站代码优化dedecms做国外网站
  • 合肥网站营销南通网站制作公司
  • 亚马逊网站特点wordpress dnsprefetch
  • 网站推广临沂阿里 wordpress
  • 重庆建设银行网站深圳优化服务
  • 南京 网站备案建设工程施工合同司法解释2022
  • 网站策划书结尾免费高清屏幕录像
  • 找私人做网站长沙手机网站公司
  • jsp网站安全性企业为什么融资难
  • 拖拽网站怎么做的那个网站推作者
  • 做网站前景怎么样新乡网站建设哪家优惠
  • 户外拓展网站源码宣传片拍摄清单
  • 中国企业500强榜单山东北京网站建设seo优化