# ParallaxViewPager **Repository Path**: HarmonyOS-tpc/ParallaxViewPager ## Basic Information - **Project Name**: ParallaxViewPager - **Description**: HarmonyOS Parallax-ViewPager - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2021-04-01 - **Last Updated**: 2024-11-25 ## Categories & Tags **Categories**: harmonyos-view-transition **Tags**: None ## README 该三方开源库从github fork过来,主要将底层接口调用的实现修改成鸿蒙接口的实现,将三方库鸿蒙化,供开发鸿蒙应用的开发者使用 fork地址:https://github.com/ybq/ParallaxViewPager fork版本号/日期:1.0.1 / 2015/12/10 [demo演示](https://gitlab.huawei.com/opensource_insight/parallaxviewpager/blob/master/demo.mp4) 原项目Readme地址:https://github.com/ybq/ParallaxViewPager/blob/master/README.md 项目移植状态:支持组件所有基本功能 完成度:100% 调用差异:动画差值器需在代码中设置,无法通过xml方式设置 # ParallaxViewPager ## 导入方法 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 .在布局文件中添加以下代码 ``` ``` 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 ``` ## LICENSE ```Copyright 2015 ybq 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. ```