# ViewPagerIndicator **Repository Path**: baijuncheng-open-source/ViewPagerIndicator ## Basic Information - **Project Name**: ViewPagerIndicator - **Description**: 寻呼指示部件 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-09 - **Last Updated**: 2024-11-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ViewPagerIndicator ========================== Paging indicator widgets that are compatible with the `PageSlider` from the HarmonyOS to improve discoverability of content. ![输入图片说明](https://images.gitee.com/uploads/images/2021/0706/145029_f6a44fb9_8230582.gif "SVID_20210706_144324_1.gif") These widgets can also be used in conjunction with [ActionBarSherlock][3]! ## Using the Library in your application ### Solution 1: local source code integration, users can customize base on the source code 1.Copy the library folder to the project directory; 2.Modify project settings.gradle, add dependencies on three modules as follows: `include ':library'` 3.Introduce the dependency of imported module in the project. Take the entry module as an example, you need to modify the dependency of imported module in the entry module build.gradle file to add dependencies: ```xml dependencies { entryImplementation project(':entry') implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) debugImplementation project(path: ':library') } ``` ### Solution 2: local har package integration 1.Compile the project and copy the har package generated in the build directory of folder library to the project lib folder 2.Add the following code in gradle of entry ```xml implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) ``` ### Solution 3: remote maven repo integration The lib is available on Maven Central, you can find it with [Gradle, please] ```xml dependencies { implementation 'com.gitee.baijuncheng-open-source:ViewPagerIndicator:1.0.0' } ``` Usage ===== *For a working implementation of this project see the `sample/` folder.* 1. Include one of the widgets in your view. This should usually be placed adjacent to the `PageSlider` it represents. 2. In your `onStart` method , bind the indicator to the `PageSlider`. //Set the pager with an adapter PageSlider pager = (PageSlider)findComponentById(ResourceTable.Id_pager); //Bind the title indicator to the adapter LinePageIndicator indicator = (LinePageIndicator)findComponentById(ResourceTable.Id_indicator); indicator.setViewPager(pager); 3. *(Optional)* If you use an `OnPageChangeListener` with your view pager you should set it in the indicator rather than on the pager directly. //continued from above indicator.setOnPageChangeListener(mPageChangeListener); Theming ------- There are three ways to style the look of the indicators. 1. **Theme XML**. An attribute for each type of indicator is provided in which you can specify a custom style. 2. **Layout XML**. Through the use of a custom namespace you can include any desired styles. 3. **Object methods**. Both styles have getters and setters for each style attribute which can be changed at any point. Each indicator has a demo which creates the same look using each of these methods. Developed By ============ * Jake Wharton - License ======= Copyright 2012 Jake Wharton Copyright 2011 Patrik Åkerfeldt Copyright 2011 Francisco Figueiredo Jr. 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]: https://github.com/pakerfeldt [2]: http://developer.android.com/sdk/compatibility-library.html [3]: http://actionbarsherlock.com [4]: https://github.com/pakerfeldt/android-viewflow [5]: https://github.com/franciscojunior [6]: https://gist.github.com/1122947 [7]: http://developer.android.com/guide/developing/projects/projects-eclipse.html [8]: http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject [9]: https://raw.github.com/JakeWharton/Android-ViewPagerIndicator/master/sample/screens.png [10]: https://play.google.com/store/apps/details?id=com.viewpagerindicator.sample