# SCViewPager **Repository Path**: HarmonyOS-tpc/SCViewPager ## Basic Information - **Project Name**: SCViewPager - **Description**: A simple ViewPager extends that provide scroll based animation. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 1 - **Created**: 2021-04-01 - **Last Updated**: 2023-04-17 ## Categories & Tags **Categories**: harmonyos-view-transition **Tags**: None ## README # SCViewPager _Jazz for openHarmonyOS_ A simple ViewPager extends that provide scroll based animation. ## Preview ## Gradle ``` allprojects{ repositories{ mavenCentral() } } implementation 'io.openharmony.tpc.thirdlib:SCViewPager:1.0.2' ``` ## Usage First, add SCViewPager to your project. Create an activity with the viewPage and the views you want to animate. ``` xml ``` Retrieve view and add animation after you have set viewPager and his adapter. ``` java Point size = SCViewAnimationUtil.getDisplaySize(this); Component component = findComponentById(ResourceTable.Id_text_to_animate); SCViewAnimation viewAnimation = new SCViewAnimation(component); viewAnimation.startToPosition((int) (size.getPointXToInt() * 1.5), null); viewAnimation.addPageAnimation(new SCPositionAnimation(0, -(int) (size.getPointXToInt() * 1.5), 0)); mViewPager.addAnimation(viewAnimation); ``` ## entry运行要求 通过DevEco studio,并下载SDK 将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本)