
回复
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.0'
}
在sdk6,DevEco Studio2.2 Beta1下项目可直接运行 如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, 并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下
<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>
<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"
/>
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缺少相应的接口无法实现一页三张功能
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