GithubHelp home page GithubHelp logo

mizzledk / introactivity Goto Github PK

View Code? Open in Web Editor NEW
72.0 3.0 16.0 590 KB

The IntroActivity library allows you to easily create beautiful intro screens for your app. DEPRECATED.

License: Apache License 2.0

Java 100.00%

introactivity's Introduction

IntroActivity

The IntroActivity library allows you to easily create beautiful intro screens for your app.

IntroActivity

Airplane vector image designed by Freepik.

YouTube demo

YouTube demo

Watch it on YouTube.

How do I use IntroActivity?

Simple. Just create an Activity and extend IntroActivity.

By extending IntroActivity, you'll automatically implement the initialize() method. This is where you set up your intro screens and any custom styling. It is not possible to override onCreate() as this is used by the library to set up your intro screen.

Here's an example of how to extend IntroActivity and add a basic intro screen:

public class DemoActivity extends IntroActivity {

    @Override
    protected void initialize() {
        String description = "This is a description.";

        // Intro screen with title and description
        addIntroScreen(
                IntroFragment.newInstance("Title", description),
                ContextCompat.getColor(this, R.color.material_blue)
        );
    }
    
}

Gradle dependency

1. Add the JitPack repository to your Gradle build file

allprojects {
	repositories {
		...
    	maven { url "https://jitpack.io" }
	}
}

2. Add the dependency

compile 'com.github.MizzleDK:IntroActivity:v0.1'

Custom styling

The library allows you to perform various custom styling using the following methods:

  • setShowSkipButton(boolean showSkipButton)
  • setShowNextButton(boolean showNextButton)
  • setSkipButtonTextColor(int color)
  • setNextButtonBackgroundColor(int color)
  • setNextButtonIconColor(int color)
  • setProgressCircleColor(int color)

Handling button click events

When you extend IntroActivity, you'll need to implement a few methods as well. These are:

  • onSkipPressed()
  • onNextPressed(int)
  • onDonePressed()

The methods are called when the user presses the Skip button, Next button and Done button, respectively.

Example

The app folder of the repo contains a simple demo app with six intro screens, showcasing the different options.

introactivity's People

Contributors

mizzledk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

introactivity's Issues

Path animation crashes on Android N

As title. Not yet sure why it happens, but here's some of the crash log:

04-04 22:10:40.232 4640-4640/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-04 22:10:40.232 4640-4640/? A/DEBUG: Build fingerprint: 'google/angler/angler:N/NPC56W/2673096:user/release-keys'
04-04 22:10:40.233 4640-4640/? A/DEBUG: Revision: '0'
04-04 22:10:40.233 4640-4640/? A/DEBUG: ABI: 'arm64'
04-04 22:10:40.233 4640-4640/? A/DEBUG: pid: 4596, tid: 4634, name: RenderThread  >>> com.miz.introactivity <<<
04-04 22:10:40.233 4640-4640/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
04-04 22:10:40.242 4640-4640/? A/DEBUG: Abort message: 'Unsupported command: 3'
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x0   0000000000000000  x1   000000000000121a  x2   0000000000000006  x3   0000000000000008
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x4   00006e6174736e69  x5   0000000000000000  x6   000000792fcd1000  x7   0000000000000000
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x8   0000000000000083  x9   ffffffffffffffdf  x10  0000000000000000  x11  0000000000000001
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x12  0000000000000018  x13  0000000000000000  x14  0000000000000000  x15  0008e1786086642a
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x16  000000792d339ec8  x17  000000792d2e37cc  x18  0000000000000000  x19  0000007911cf64f8
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x20  0000000000000006  x21  0000007911cf6450  x22  0000000000000000  x23  00000079210ae610
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x24  0000000000000000  x25  0000007911cf4990  x26  000000000000006d  x27  000000792c8d96a4
04-04 22:10:40.242 4640-4640/? A/DEBUG:     x28  00000000fffffff2  x29  0000007911cf4330  x30  000000792d2e0bf8
04-04 22:10:40.242 4640-4640/? A/DEBUG:     sp   0000007911cf4310  pc   000000792d2e37d4  pstate 0000000060000000
04-04 22:10:40.243 4645-4645/? I/art: JIT created with initial_capacity=64KB, max_capacity=64MB, compile_threshold=10000, save_profiling_info=1
04-04 22:10:40.251 4640-4640/? A/DEBUG:     #00 pc 000000000006a7d4  /system/lib64/libc.so (tgkill+8)
04-04 22:10:40.251 4640-4640/? A/DEBUG:     #01 pc 0000000000067bf4  /system/lib64/libc.so (pthread_kill+64)
04-04 22:10:40.251 4640-4640/? A/DEBUG:     #02 pc 000000000002386c  /system/lib64/libc.so (raise+24)
04-04 22:10:40.251 4640-4640/? A/DEBUG:     #03 pc 000000000001c2a4  /system/lib64/libc.so (abort+52)
04-04 22:10:40.251 4640-4640/? A/DEBUG:     #04 pc 000000000000ed74  /system/lib64/libcutils.so (__android_log_assert+224)
04-04 22:10:40.251 4640-4640/? A/DEBUG:     #05 pc 000000000003c15c  /system/lib64/libhwui.so
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #06 pc 000000000003b71c  /system/lib64/libhwui.so (android::uirenderer::VectorDrawableUtils::verbsToPath(SkPath*, android::uirenderer::VectorDrawable::Path::Data const&)+132)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #07 pc 0000000000086258  /system/lib64/libhwui.so (android::uirenderer::VectorDrawable::FullPath::getUpdatedPath()+44)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #08 pc 0000000000085aa4  /system/lib64/libhwui.so (android::uirenderer::VectorDrawable::Path::draw(SkCanvas*, SkMatrix const&, float, float)+96)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #09 pc 00000000000868dc  /system/lib64/libhwui.so (android::uirenderer::VectorDrawable::Group::draw(SkCanvas*, SkMatrix const&, float, float)+204)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #10 pc 00000000000868dc  /system/lib64/libhwui.so (android::uirenderer::VectorDrawable::Group::draw(SkCanvas*, SkMatrix const&, float, float)+204)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #11 pc 0000000000086fac  /system/lib64/libhwui.so (android::uirenderer::VectorDrawable::Tree::getBitmapUpdateIfDirty()+144)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #12 pc 000000000004dcbc  /system/lib64/libhwui.so
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #13 pc 0000000000045790  /system/lib64/libhwui.so
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #14 pc 0000000000045644  /system/lib64/libhwui.so
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #15 pc 00000000000603ec  /system/lib64/libhwui.so
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #16 pc 00000000000310c4  /system/lib64/libhwui.so
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #17 pc 000000000003275c  /system/lib64/libhwui.so
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #18 pc 0000000000037cc4  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+152)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #19 pc 00000000000151f8  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+272)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #20 pc 000000000009b474  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+116)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #21 pc 00000000000673dc  /system/lib64/libc.so (__pthread_start(void*)+208)
04-04 22:10:40.252 4640-4640/? A/DEBUG:     #22 pc 000000000001d510  /system/lib64/libc.so (__start_thread+16)

problem in library

when I set the last position of current item , the background become back.

Please help me?

Description limited to two lines

In the layout of the intro screen, as shown below the description TextView is limited to 2 lines.
Why is the description limited to two lines? Two lines doesn't seem that much

<TextView
        android:id="@+id/description"
        tools:text="Description"
        ...
        android:lines="2"
        ... />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.