2 Star 5 Fork 3

CHINASOFT4_OHOS / RecyclerView-FastScroll

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

RecyclerView-FastScroll

项目介绍

  • 项目名称:RecyclerView-FastScroll
  • 所属系列:openharmony的第三方组件适配移植
  • 功能:一个简单的快速滚动列表控件
  • 项目移植状态:主功能完成
  • 调用差异:无
  • 开发版本:sdk6,DevEco Studio 2.2 Beta1
  • 基线版本:Release 2.0.1

效果演示

效果演示 效果演示

安装教程

1.在项目根目录下的build.gradle文件中,

allprojects {
   repositories {
       maven {
           url 'https://s01.oss.sonatype.org/content/repositories/releases/'
       }
   }
}

2.在entry模块的build.gradle文件中,

dependencies {
   implementation('com.gitee.chinasoft_ohos:RecyclerView-FastScroll:1.0.0')
   ......  
}

在sdk6,DevEco Studio 2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下

使用说明

<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
    ohos:id="$+id:listview"
    ohos:height="match_parent"
    ohos:width="match_parent"
    app:fastScrollPopupBgColor="#FF4081"
    app:fastScrollPopupTextColor="#ffffff"
    app:fastScrollThumbColor="#FF4081" />

要显示FastScrollPopup,适配器必须实现FastScrollRecyclerView.SectionedAdapter并重写getSectionName()。 如果你需要知道什么时候快速滚动开始或停止,你可以设置一个OnFastScrollStateChangedListener到FastScrollRecyclerView。

不同高度

默认情况下,FastScrollRecyclerView适配器中的所有项目具有相同的高度。如果您的适配器然后你应该让你的适配器实现MeasurableAdapter接口和 重写getViewTypeHeight() 否则滚动拇指可能不会出现在正确的位置,滚动可能是不一致的。 getViewTypeHeight()返回给定类型的单个视图的高度,以像素为单位。每个视图的高度必须是一个视图类型的所有实例之间是固定不变的。因为实现者负责计算这个值,这不适用于视图类型,其中视图的高度是由 项目所使用的文本行数可变。

定制

你可以使用xml中的fastScrollAutoHide和fastScrollAutoHideDelay属性来启用/禁用自动隐藏:
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
 app:fastScrollAutoHide="true"
 app:fastScrollAutoHideDelay="1500"
 ...

以下可以通过xml样式:

<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView
    ohos:id="$+id:listview"
    ohos:height="match_parent"
    ohos:width="match_parent"
    ohos:background_element="#ffffff"
    ohos:layout_alignment="vertical_center"
    app:fastScrollAutoHide="true"
    app:fastScrollAutoHideDelay="1500"
    app:fastScrollEnableThumbInactiveColor="true"
    app:fastScrollPopupBackgroundSize="62vp"
    app:fastScrollPopupBgColor="#FF4081"
    app:fastScrollPopupPosition="adjacent"
    app:fastScrollPopupTextColor="#ffffff"
    app:fastScrollPopupTextSize="32fp"
    app:fastScrollPopupTextVerticalAlignmentMode="font_metrics"
    app:fastScrollThumbColor="#FF4081"
    app:fastScrollThumbEnabled="true"/>

测试信息

CodeCheck代码测试无异常

CloudTest代码测试无异常

病毒安全检测通过

当前版本demo功能与原组件基本无差异

版本迭代

  • 1.0.0

版权和许可信息

Apache 2.0

Licenses RecyclerView-FastScroll Copyright (C) 2016 Tim Malseed Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Launcher 3: Copyright (C) 2010 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

一个简单的快速滚动列表控件 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/chinasoft4_ohos/RecyclerView-FastScroll.git
git@gitee.com:chinasoft4_ohos/RecyclerView-FastScroll.git
chinasoft4_ohos
RecyclerView-FastScroll
RecyclerView-FastScroll
master

搜索帮助