1 Star 1 Fork 0

CHINASOFT_OHOS / Ohos-Coverflow

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

Ohos-Coverflow

项目介绍

  • 项目名称:Ohos-Coverflow
  • 所属系列:openharmony第三方组件适配移植
  • 功能:轮播图自定义组件
  • 项目移植状态:主功能未完成
  • 调用差异:有
    ohos缺少相应无法实现一页三张功能
  • 开发版本:sdk6,DevEco Studio2.2 Beta1
  • 基线版本:Release -1.0.5

效果演示

example example

安装教程

1.在moudle级别下的build.gradle文件中添加依赖,在dependencies标签中增加对libs目录下jar包的引用

// 添加maven仓库
repositories {
  maven {
       url 'https://s01.oss.sonatype.org/content/repositories/release/'
  }
}
// 添加依赖库
dependencies {
  implementation 'com.gitee.chinasoft_ohos:coverflow:1.0.1'   
}

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

使用说明

  • xml属性单个可滑动的页面
<DirectionalLayout
    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:height="match_parent"
    ohos:width="match_parent"
   >
    <DependentLayout
        ohos:height="250vp"
        ohos:background_element="$color:color_black"
        ohos:width="match_parent">

        <PageSlider
            ohos:center_in_parent="true"
            ohos:margin="30vp"
            ohos:layout_alignment="center"
            ohos:height="230vp"
            ohos:id="$+id:ViewPageSlider"
            ohos:width="match_parent"/>
    </DependentLayout>
</DirectionalLayout>
  • xml 自定义ListContainer下拉滑动时的滑动条
<com.futuremind.recyclerviewfastscroll.FastScroller
        ohos:id="$+id:fast"
        ohos:height="match_parent"
        ohos:width="match_content"
        ohos:align_parent_right="true"
        app:handleColor="#8f93d1"
        app:bubbleColor="#5e64ce"
        app:bubbleTextColor="#e0e0e0"
        app:bubbleTextSize="24fp"
        app:bubbleTextWeight="700"
        ohos:orientation="vertical"
        />
  • Java 调用示例

ListContainer下拉时加入的竖线

   listContainer = (ListContainer) findComponentById(ResourceTable.Id_listcontainerview);
        fastScroller = (FastScroller)findComponentById(ResourceTable.Id_fast);
        fastScroller.setListContainer(listContainer);

两个平滑页面的适配器,在onPageChosen方法进行设置进行联动

   PagerContainerOne.OnSelectListener onSelectListener1 = new PagerContainerOne.OnSelectListener() {
            @Override
            public void select(int index) {
                pageslider1.setCurrpage(index);
                textView.setText(item + index);
                pageslider2.setCurrpage(index);
                textView2.setText(item + index);
            }
        };
        pageslider1.setPageChangeListener(onSelectListener1);
        PagerContainerOne.OnSelectListener onSelectListener2 = new PagerContainerOne.OnSelectListener() {
            @Override
            public void select(int index) {
                pageslider1.setCurrpage(index);
                textView.setText(item + index);
                pageslider2.setCurrpage(index);
                textView2.setText(item + index);
            }
        };
        pageslider2.setPageChangeListener(onSelectListener2);

定义回调方法将当前页面回调出去

public interface OnSelectListener {
        /**
         * 回调当前的页数
         *
         * @param index
         */
        void select(int index);
    }

在外部回调的方法

  /**
     * 设置外部进行回调方法
     *
     * @param listener
     */
    public void setPageChangeListener(OnSelectListener listener) {
        this.mListener = listener;
    }

测试信息

CodeCheck代码测试无异常
CloudTest代码测试无异常
病毒安全检测通过
当前版本demo功能与原组件基本有差异
因ohos缺少相应的接口无法实现一页三张功能

版本迭代

  • 1.0.1

版权和许可信息

The MIT License (MIT)

Copyright (c) 2015 Hugo yu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Status API Training Shop Blog About Pricing

空文件

简介

基于viewpager的cover flow 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/chinasoft_ohos/ohos-Coverflow.git
git@gitee.com:chinasoft_ohos/ohos-Coverflow.git
chinasoft_ohos
ohos-Coverflow
Ohos-Coverflow
master

搜索帮助