Skip to content

Android-wangmeng/EasyIntro

Repository files navigation

EasyIntro

一款简单使用的APP介绍页,只需要提供图片

演示

添加如下配置将EasyDialog引入到你的项目当中:

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 CIRCLE_NORMAL DASH_NORMAL ROUND_RECT_NORMAL
IndicatorOneType.SMOOTH CIRCLE_SMOOTH DASH_SMOOTH ROUND_RECT_SMOOTH
IndicatorOneType. WORM CIRCLE_WORM DASH_WORM ROUND_WORM
IndicatorOneType.COLOR CIRCLE_COLOR DASH_COLOR ROUND_COLOR
IndicatorOneType.SCALE CIRCLE_SCALE DASH_SCALE ROUND_SCALE
  • 指示器款示2
Name Preview
IndicatorTwoType.NONE anim_none
IndicatorTwoType.COLOR anim_color
IndicatorTwoType.SCALE anim_scale
IndicatorTwoType.SLIDE anim_slide
IndicatorTwoType.WORM anim_worm
IndicatorTwoType.FILL anim_worm
IndicatorTwoType.THIN_WORM anim_thin_worm
IndicatorTwoType.DROP anim_drop
IndicatorTwoType.SWAP anim_swap

滑动动画

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

License

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.

About

一款简单使用的APP介绍页,只需要提供图片

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages