一款简单使用的APP介绍页,只需要提供图片
dependencies {
implementation 'com.intro.wm:easyintro:1.0.1'
}
要使用EasyIntro,您只需创建一个新的Activity即可扩展EasyIntro,如下所示:
public class MyIntroActivity extends EasyIntro {
/**
* 设置布局(如果对布局不满意,可以自定义布局(参考layout_my_appintro),但是里面的控件ID不能变)
*/
@Override
protected int getLayoutId() {
return super.getLayoutId();
}
/**
* 需要展示的图片数组(必须重写)
*/
@Override
protected int[] getSlide() {
return new int[]{R.mipmap.guide_page_1,R.mipmap.guide_page_2,R.mipmap.guide_page_3,R.mipmap.guide_page_4};
}
/**
* 设置指示器信息(指示器样式配置在这,详见下面说明)
*/
@Override
protected IndicatorInfo getIndicatorInfo() {
return super.getIndicatorInfo();
}
/**
* 设置指示器款式(一共两种款式:EasyIndicatorStyle.INDICATOR_ONE(黑夜)和EasyIndicatorStyle.INDICATOR_TWO)
*
* @return
*/
@Override
protected EasyIndicatorStyle getIndicatorStyle() {
return super.getIndicatorStyle();
}
/**
* 设置页面滑动动画(默认:TransformerType.ACCORDION)
* @return
*/
protected TransformerType getTransformer(){
return super.getTransformer();
}
}请注意,您不需要调用setContentView,EasyIntro会调用它。 最后,在AndroidManifest.xml中声明Activity,如下所示:
<activity android:name=".MyIntroActivity"
android:label="My Custom EasyIntro" />
建议不要声明MyEasyIntro为您的第一个Activity,除非您希望每次应用启动时都启动该简介。 理想情况下,您只应向用户显示一次,并在完成后将其隐藏(您可以在中使用一个标志SharedPreferences)
-
指示器配置类(IndicatorInfo)| Method | Description | Default | |--|--|--| | setWidthDP(float widthDP) | 设置宽度 | 5dp | | setHeightDP(float heightDP) | 设置高度 | 5dp | | setIndicatorOneType(IndicatorOneType indicatorOneType) | 设置款式1类型| IndicatorOneType.NORMAL | | setIndicatorTwoType(IndicatorTwoType indicatorTwoType) | 设置款式2类型| IndicatorTwoType.NONE | | setSelectedColor(int selectedColor) | 设置选中颜色 | Color.WHITE | | setUnSelectedColor(int unSelectedColor) | 设置未选中颜色| Color.BLACK | -
指示器款示1
| 属性 | IndicatorOneStyle.CIRCLE | IndicatorOneStyle.DASH | IndicatorOneStyle.ROUND_RECT |
|---|---|---|---|
| IndicatorOneType.NORMAL | ![]() |
![]() |
![]() |
| IndicatorOneType.SMOOTH | ![]() |
![]() |
![]() |
| IndicatorOneType. WORM | ![]() |
![]() |
![]() |
| IndicatorOneType.COLOR | ![]() |
![]() |
![]() |
| IndicatorOneType.SCALE | ![]() |
![]() |
![]() |
指示器款示2
| TransformerType.DEFAULT | TransformerType.ACCORDION |
|---|---|
![]() |
![]() |
| TransformerType.BACKGROUND_TO_FOREGROUND | TransformerType.DEPTH_PAGE |
|---|---|
![]() |
![]() |
| TransformerType.CUBE_IN | TransformerType.CUBE_OUT |
|---|---|
![]() |
![]() |
| TransformerType.DRAW_FROM_BACK | TransformerType.FLIP_HORIZONTAL |
|---|---|
![]() |
![]() |
| TransformerType.FLIP_VERTICAL | TransformerType.ROTATE_UP |
|---|---|
![]() |
![]() |
| TransformerType.FOREGROUND_TO_BACKGROUND | TransformerType.ROTATE_DOWN |
|---|---|
![]() |
![]() |
| TransformerType.ZOOM_IN | TransformerType.ZOOM_OUT |
|---|---|
![]() |
![]() |
| TransformerType.STACK | TransformerType.TABLET |
|---|---|
![]() |
![]() |
| TransformerType.ZOOM_OUT_SLIDE |
|---|
![]() |
Copyright (C) wangmeng, EasyIntro Open Source Project
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.









































