代码拉取完成,页面将自动刷新
该三方开源库从github fork过来,主要将底层接口调用的实现修改成鸿蒙接口的实现,将三方库鸿蒙化,供开发鸿蒙应用的开发者使用
fork地址:https://github.com/ybq/ParallaxViewPager
fork版本号/日期:1.0.1 / 2015/12/10
原项目Readme地址:https://github.com/ybq/ParallaxViewPager/blob/master/README.md
项目移植状态:支持组件所有基本功能
完成度:100%
调用差异:动画差值器需在代码中设置,无法通过xml方式设置
1.har导入
将har包放入lib文件夹并在build.gradle添加
implementation fileTree(dir: 'libs', include: ['*.har'])
2.Library引用
添加本工程中UcropLib模块到任意工程中,在需要使用的模块build.gradle中添加
implementation project(':library')
或者
allprojects{
repositories{
mavenCentral()
}
}
implementation 'io.openharmony.tpc.thirdlib:ParallaxViewPager:1.0.2'
1 .在布局文件中添加以下代码
<com.github.ybq.parallaxviewpager.ParallaxViewPager
ohos:id="$+id:pvp_main"
ohos:height="match_parent"
ohos:width="match_parent"
ohos:outset="0.62"
ohos:overlay_mode="0"
ohos:shadow_width="60"
/>
2.在代码中初始化参数
//初始化控件
parallaxViewPager = (ParallaxViewPager) findComponentById(ResourceTable.Id_pvp_main);
//设置控件的Provider
parallaxViewPager.setProvider();
//设置控件的模式
parallaxViewPager.setSliderMode(Mode.LEFT_OVERLAY);
//设置控件的动画差值器
parallaxViewPager.setInterpolator(new DecelerateInterpolator());
3.一些功能设置介绍
ParallaxViewPager.setSlideMode(Mode mode)//设置parallaxViewPager的动画模式
ParallaxViewPager.getSlideMode()//获取parallaxViewPager的动画模式
ParallaxViewPager.setProvider();//设置parallaxViewPager显示的布局
ParallaxViewPager.setInterpolator();//设置动画的差值器
ParallaxViewPager.getInterpolator();//获取动画的差值器
ParallaxViewPager.setOutset()//设置动画的偏移
ParallaxViewPager.getOutset ();//获取动画的偏移
ParallaxViewPager.setRightShadow()//设置右边的shadow
ParallaxViewPager.setLeftShadow();//设置左边的shadow
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.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型