# AppIntro
**Repository Path**: HarmonyOS-tpc/AppIntro
## Basic Information
- **Project Name**: AppIntro
- **Description**: 一个帮助您建立酷炫的介绍您的应用程序的openharmony系统库,AppIntro支持申请权限,帮助您方便的创建出色的APP入门体验。
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 1
- **Created**: 2021-04-01
- **Last Updated**: 2023-04-17
## Categories & Tags
**Categories**: harmony
**Tags**: None
## README
## AppIntro
一个帮助您建立酷炫的介绍您的应用程序的openharmony系统库,AppIntro支持申请权限,帮助您方便的创建出色的APP入门体验。
## ScreenShot
|默认文字切换样式|默认图标切换样式|
|
|
|
|自定义进度条指示器| 自定义圆点指示器颜色|
|
|
|
|含有请求权限的滑动页面|
|
|
|
## 使用方法
#### 1、在Ability页面使用时需继承AppIntro或AppIntro2,onSkipPressed()和onDonePressed()处理相关按钮事件
```java
public class DefaultIntro extends AppIntro {
@Override
public void onStart(Intent savedInstanceState) {
setLayoutId();
super.onStart(savedInstanceState) ;
this.addSlide(new AppIntroFragment(this,
"Welcome!",
"This is a demo of the AppIntro library, with a custom background on each slide!",
ResourceTable.Media_ic_slide1,
0,
0,
0,
0,
0,
null,
null,
null));
。。。
this.addSlide(new AppIntroFragment(this,
"Explore",
"Feel free to explore the rest of the library demo!",
ResourceTable.Media_ic_slide4,
0,
0,
0,
0,
0,
null,
null,
null));
}
public void onSkipPressed( Component currentFragment) {
super.onSkipPressed(currentFragment);
terminateAbility();
}
public void onDonePressed( Component currentFragment) {
super.onDonePressed(currentFragment);
terminateAbility();
}
```
### 2、自定义页面按钮属性只能继承AppIntro2,在public void onStart(Intent savedInstanceState)中添加一下方法设置
setNextArrowColor()及setSkipArrowColor()参数是rgba,详情见其中的entry
```java
public void onStart(Intent savedInstanceState){
setLayoutId();
super.onStart(savedInstanceState) ;
this.addSlide(new AppIntroFragment(
this,
"Welcome!",
"This is a demo of the AppIntro library, with a custom background on each slide!",
ResourceTable.Media_ic_slide1,
0,
0,
0,
0,
0,
null,
null,
null
));
。。。
setNextArrowColor(ResourceTable.Color_test_red);
setSkipArrowColor(ResourceTable.Color_test_blue);
backgroundResource = ResourceTable.Media_ic_drawer_header;
setIndicatorColor(ResourceTable.Color_test_bgRed, ResourceTable.Color_test_black);
}
```
### 3、定义页面有权限要求的需在public void onStart(Intent savedInstanceState)中添加一下方法设置
askForPermissions();详情见其中的entry
```java
public void onStart(Intent savedInstanceState){
setLayoutId();
super.onStart(savedInstanceState) ;
this.addSlide(new AppIntroFragment(
this,
"Welcome!",
"This is a demo of the AppIntro library, with a custom background on each slide!",
ResourceTable.Media_ic_slide1,
0,
0,
0,
0,
0,
null,
null,
null
));
。。。
askForPermissions(new String[]{SystemPermission.CAMERA,SystemPermission.LOCATION},2,true);
askForPermissions(new String[]{SystemPermission.WRITE_USER_STORAGE},3,false);
}
```
## entry运行要求
通过DevEco studio,并下载openharmonySDK
将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即您当前IDE新建项目中所用的版本)
## 集成
allprojects{
repositories{
mavenCentral()
}
}
implementation 'io.openharmony.tpc.thirdlib:AppIntro:1.0.3'
# License
Copyright (C) 2015-2020 AppIntro Developers
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.