A customizable welcome screen

Overview

Welcome

Android Arsenal Download Build Status codecov Codacy Badge

An easy to use and customizable welcome screen for Android apps.

Sample video

Look in the sample to see how the above welcome screen is created.

Features

  • Fully customizable
  • RTL support
  • Ability to use built in layouts or custom fragments
  • Built in layouts support all screen sizes and orientations

Please open a new issue if you find a bug or have a problem.

Javadoc

Changelog/Releases

Major Changes in 1.0.0

If you used the library prior to version 1.0, read 1.0.0.md for details on all breaking changes.

Demo

A demo app is available on Google play:

Get it on Google Play

The source code is in the sample module.

Contributing

Feel free to open a PR to add a feature or fix a bug, all contributions are welcome. Please read the contribution notes.

All development takes place on the dev branch.

Table of Contents

Adding to your project

This library is available through jCenter.

Gradle:

compile 'com.stephentuso:welcome:1.4.1'

If you use proguard, add the following to your proguard rules

-keepclassmembers class * extends com.stephentuso.welcome.WelcomeActivity {
    public static java.lang.String welcomeKey();
}

Basic Usage

Extend WelcomeActivity

To create a welcome screen, add a class to your project that extends WelcomeActivity and add it to AndroidManifest:

<activity android:name=".MyWelcomeActivity"
    android:theme="@style/WelcomeScreenTheme"/>

The theme must be a child theme of WelcomeScreenTheme

Override the Activity's configuration() method. Use WelcomeConfiguration.Builder to set it up:

@Override
protected WelcomeConfiguration configuration() {
    return new WelcomeConfiguration.Builder(this)
            .defaultBackgroundColor(R.color.background)
			.page(new TitlePage(R.drawable.logo,
					"Title")
			)
			.page(new BasicPage(R.drawable.image,
					"Header",
					"More text.")
					.background(R.color.red_background)
			)
			.page(new BasicPage(R.drawable.image,
					"Lorem ipsum",
					"dolor sit amet.")
			)
            .swipeToDismiss(true)
            .build();
}

You do not need to override onCreate or call setContentView.

Note: For now, defaultBackgroundColor() needs to be called before adding pages.

Show the welcome screen

Welcome screens are started with WelcomeHelper. onSaveInstanceState is needed to be sure only one instance of the welcome screen is started. Add the following to the Activity you want to show the welcome screen before (probably your launcher activity):

WelcomeHelper welcomeScreen;

@Override
protected void onCreate(Bundle savedInstanceState) {
    ...
    welcomeScreen = new WelcomeHelper(this, MyWelcomeActivity.class);
    welcomeScreen.show(savedInstanceState);
    ...
}

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    welcomeScreen.onSaveInstanceState(outState);
}

If you have issues with the buttons/indicator being covered by the nav bar, use one of the .SolidNavigation welcome screen themes.

To force the welcome screen to be shown, for example, to let the user view it again when a button is pressed, create a WelcomeHelper as shown above and call .forceShow().

Skipping/Back button behavior

By default, the welcome screen can be skipped, and pressing the back button will navigate to the previous page or close (skip) the welcome screen if on the first page. This can be changed with Builder.canSkip(), backButtonSkips() (only applies if canSkip is true), and backButtonNavigatesPages(). If you disable skipping, the welcome screen will not be stored as completed when it closes.

If you want to require users to navigate through the welcome screen before using the app, call canSkip(false) and close your app if the welcome screen's result is RESULT_CANCELED.

See Results below for how to respond if a welcome screen is canceled.

Included pages

The classes listed below are subclasses of WelcomePage and can be used with the page method of WelcomeConfiguration.Builder

TitlePage

A page with an image and a title. A parallax effect can be applied to the image.

Constructor:

TitlePage(@DrawableRes int drawableResId, String title)

BasicPage

A page with an image, heading, and description. A parallax effect can be applied to the image.

Constructor:

BasicPage(@DrawableRes int drawableResId, String title, String description)

ParallaxPage

Similar to the basic page, but instead of an image you can supply a layout that will have a parallax effect applied to it. The speed at which the layout's children move is determined by their position in the layout, the first will move the slowest and the last will move the fastest.

Constructor:

ParallaxPage(@LayoutRes int layoutResId, String title, String description)

FullscreenParallaxPage

Applies a parallax effect in the same way the normal parallax page does, but the layout you provide fills the whole fragment, and there isn't a header or description.

Constructor:

FullscreenParallaxPage(@LayoutRes int layoutResId)

Custom pages

You can add your own fragments to the welcome screen with FragmentWelcomePage:

@Override
protected WelcomeConfiguration configuration() {
    return new WelcomeConfiguration.Builder(this)
            ...
            .page(new FragmentWelcomePage() {
                    @Override
                    protected Fragment fragment() {
                        return new ExampleFragment();
                    }
                }.background(R.color.red_background))
            ...
}

See animations below for adding animations to custom fragments.

Custom Done Button

If you want to use a button in a custom fragment instead of the default done button, call useCustomDoneButton(true) on the builder and new WelcomeFinisher(MyFragment.this).finish() in the button's OnClickListener.

Bottom Layouts

The layout shown beneath the pages can be changed with the bottomLayout Builder method, which uses the WelcomeConfiguration.BottomLayout enum. The possible values are explained below.

STANDARD

The default layout, can have skip/previous buttons, the current page indicator, and next/done buttons.

STANDARD_DONE_IMAGE

Same as STANDARD, but the done button is an ImageButton rather than a Button. Uses a check mark as the image by default (that can be changed with styles).

BUTTON_BAR

Has two buttons side by side at the bottom with the current page indicator above them. By default the text is "Log In" and "Sign Up", but can be changed with styles. In your WelcomeActivity subclass, override onButtonBarFirstPressed and onButtonBarSecondPressed to handle clicks. More documentation will be added later, see ButtonBarWelcomeActivity in the sample for an example.

BUTTON_BAR_SINGLE

Same as BUTTON_BAR, but with just one button (uses onButtonBarFirstPressed for clicks).

INDICATOR_ONLY

Just the current page indicator, no buttons.

NONE

No layout; no buttons, no indicator

Styling

Themes

The provided themes are listed below.

Transparent status/navigation on API 19+. Content does not flow under status bar:

  • WelcomeSceenTheme - The default theme. For use with dark backgrounds; the text, indicator, and buttons are light colored.
  • WelcomeScreenTheme.Light - For use with light backgrounds; the text, indicator, and buttons are dark colored.

Transparent status bar, solid navigation bar on API 19+. Content does not flow under status bar:

  • WelcomeScreenTheme.SolidNavigation
  • WelcomeScreenTheme.Light.SolidNavigation

Transparent status bar, solid navigation bar on API 19+. Content flows under status bar:

  • WelcomeScreenTheme.SolidNavigation.UnderStatusBar
  • WelcomeScreenTheme.Light.SolidNavigation.UnderStatusBar

Styles

Typefaces and a few other things (animations, button visibility) have to be set with WelcomeConfiguration.Builder, but everything else that is customizable can be changed with styles.

You can add styles as shown below. Optional items are in square brackets.

<style name="CustomWelcomeScreenTheme" parent="SEE THEMES ABOVE">

    <!---- TEXT STYLES ---->

    <!-- Color of button text and titles/headings (in built in fragments)
        By default, this is also the color of the done/next button -->
    <item name="android:textColorPrimary">color</item>

    <!-- Color of other text
        By default, this is used for the skip button text color -->
    <item name="android:textColorSecondary">color</item>

    <!-- Descriptions/other text -->
    <item name="welcomeNormalTextStyle">@style/MyNormalText</item>
    <!-- Headings -->
    <item name="welcomeLargeTextStyle">@style/MyLargeText</item>
    <!-- Titles -->
    <item name="welcomeTitleTextStyle">@style/MyTitleText</item>


    <!---- BUTTON STYLES ---->

    <!-- Background is applied to all buttons,
        to change a specific button background use the individual button styles -->
    <item name="welcomeButtonBackground">drawable</item>

    <!-- Done/skip button text -->
    <item name="welcomeButtonSkipText">string</item>
    <item name="welcomeButtonDoneText">string</item>

    <!-- Button styles for STANDARD and STANDARD_DONE_IMAGE -->
    <item name="welcomeButtonSkipStyle">@style/MyButtonSkip</item>
    <item name="welcomeButtonNextStyle">@style/MyButtonNext</item>
    <item name="welcomeButtonDoneStyle">@style/MyButtonDone</item>

    <!-- Button styles for BUTTON_BAR -->
    <item name="welcomeButtonBarFirstStyle">@style/MyButtonFirst</item>
    <item name="welcomeButtonBarSecondStyle">@style/MyButtonSecond</item>


    <!---- OTHER STYLES ---->

    <!-- Current page indicator -->
    <item name="welcomeIndicatorStyle">@style/MyWelcomeIndicator</item>

    <!-- Divider between bottom layout and pages -->
    <item name="welcomeDividerStyle">@style/MyWelcomeScreenDivider</item>

    <!-- The drawable or color to fade to if swipeToDismiss is enabled -->
    <item name="android:windowBackground">drawable|color</item>

    <!-- Add the following if you want to show the action bar.
        Use Builder.showActionBarBackButton(true) to show
        the back button. -->
    <item name="windowActionBar">true</item>
    <item name="windowNoTitle">false</item>
</style>

<style name="MyWelcomeIndicator" parent="WelcomeScreenPageIndicator[.Light]">
    <item name="indicatorColor">color</item>
    <item name="currentPageColor">color</item>
    <item name="animation">fade|slide|none</item>
</style>

<!-- Use this to change the next button's image/color
    To support RTL, add this in values-ldrtl/styles with an image facing left -->
<style name="MyButtonNext" parent="WelcomeScreenButton.Next">
    <item name="android:src">drawable</item>
    <item name="android:tint">color</item>
</style>

<style name="MyButtonSkip" parent="WelcomeScreenButton.Skip">
    <item name="android:textColor">color</item>
</style>

<style name="MyButtonDone" parent="WelcomeScreenButton.Done">
    <!-- If using BottomLayuout.STANDARD -->
    <item name="android:textColor">color</item>
    <!-- If using BottomLayout.STANDARD_DONE_IMAGE -->
    <item name="android:tint">color</item>
    <item name="android:src">drawable</item>
</style>

<!-- A divider that is directly above the buttons/indicator.
The background color is transparent by default -->
<style name="MyWelcomeScreenDivider" parent="WelcomeScreenDivider[.Dark|.Light]">
    <item name="android:background">drawable|color</item>
    <item name="android:layout_height">dimen</item>
</style>

<!-- The following can apply to any of the three text styles -->
<style name="MyText" parent="WelcomeScreenText[.Large|.Title][.Centered]">
    <!-- Add any properties that can be applied to a TextView -->
</style>

Welcome screen keys

If you want to use multiple welcome screens (in different parts of your app) or have updated one and want to show it again, you can assign keys (Make sure they are unique!) to welcome screens by adding the following to your welcome screen Activity.

public static String welcomeKey() {
    return "Your unique key";
}

Note: Only change this to a new value if you want everyone who has already used your app to see the welcome screen again! This key is used to determine whether or not to show the welcome screen.

Results

You can listen for the result of a welcome screen in the Activity that started it by overriding onActivityResult:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);


    if (requestCode == WelcomeHelper.DEFAULT_WELCOME_SCREEN_REQUEST) {
        // The key of the welcome screen is in the Intent
        String welcomeKey = data.getStringExtra(WelcomeActivity.WELCOME_SCREEN_KEY);

        if (resultCode == RESULT_OK) {
            // Code here will run if the welcome screen was completed
        } else {
            // Code here will run if the welcome screen was canceled
            // In most cases you'll want to call finish() here
        }

    }

}

One use for this is making sure users see the whole welcome screen before using your app - disable skipping and then close your main activity when the welcome screen is canceled.

Animations

Animations that play as pages are scrolled can be added to your custom fragments by implementing WelcomePage.OnChangeListener. As an example, a fade effect is shown below.

@Override
public void onScrolled(int pageIndex, float offset, int offsetPixels) {
    if (Build.VERSION.SDK_INT >= 11 && imageView != null) {
        imageView.setAlpha(1-Math.abs(offset));
    }
}

To add parallax effects similar to the included parallax page, use WelcomeUtils.applyParallaxEffect() in onScrolled. For example:

@Override
public void onScrolled(int pageIndex, float offset, int offsetPixels) {
    if (parallaxLayout != null)
        WelcomeUtils.applyParallaxEffect(parallaxLayout, false, offsetPixels, 0.3f, 0.2f);
}

License

Copyright 2015-2017 Stephen Tuso

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.
Comments
  • Blank screen when app is launched a second time

    Blank screen when app is launched a second time

    There is a blank screen that appears to be like the app is launched but hasn't any UI to display. Pressing back dismisses the app and one can navigate normally with device otherwise everything appears like the device has frozen, which is not the case but that there's an app running with no interface and appears transparent to the device screen. This happens when the app is launched the subsequent times from the very first time it is installed and launched. Please we need this issue fixed asap.

    opened by larrytech7 7
  • Add support for VectorDrawable in BasicWelcomeFragment

    Add support for VectorDrawable in BasicWelcomeFragment

    I use VectorDrawables in my project and I noticed they caused issues below Android 5. I looked around found this solution. I am currently using my modified version in my project. If you could merge this (and possibly apply the same logic to your entire project), I'll switch to using your project as an external dependency.

    Thanks.

    opened by makiftutuncu 6
  • Return to the same Activity after finishing

    Return to the same Activity after finishing

    Hi, thank you for this great library. I've been using it and everything is fine and the welcome screen looks perfect, the only thing I don't understand is how to go back to the main layout after showing the welcome screen.

    My MainActivity:

    @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            sampleWelcomeScreen = new WelcomeHelper(this, WelcomeActivity.class);
            sampleWelcomeScreen.show(savedInstanceState);
    }
    
    @Override
        protected void onSaveInstanceState(Bundle outState) {
            super.onSaveInstanceState(outState);
            sampleWelcomeScreen.onSaveInstanceState(outState);
        }
    
    // If this method should display toast at the end or cancel the welcome screen, it is not doing so
    @Override
        public void onActivityResult(int requestCode, int resultCode, Intent data) {
            if (requestCode == REQUEST_WELCOME_SCREEN_RESULT) {
    
                if (resultCode == RESULT_OK) {
                    Toast.makeText(getApplicationContext(), "Completed (RESULT_OK)", Toast.LENGTH_SHORT).show();
    //this Toast is not displayed
                } else if (resultCode == RESULT_CANCELED) {
                    Toast.makeText(getApplicationContext(), "Canceled (RESULT_CANCELED)", Toast.LENGTH_SHORT).show();
    //this Toast is not displayed
                }
            }
        }
    

    I want you to end or click on "done" to display activity_main again

    opened by josequintana94 5
  • App crash at WelcomeHelper

    App crash at WelcomeHelper

    Here is logcat

    03-24 06:48:01.122 4030-4030/com.stephentuso.welcomeexample E/AndroidRuntime: FATAL EXCEPTION: main Process: com.stephentuso.welcomeexample, PID: 4030 java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jacoco/agent/rt/internal_b0d6a23/Offline; at com.stephentuso.welcome.WelcomeHelper.$jacocoInit(WelcomeHelper.java:0) at com.stephentuso.welcome.WelcomeHelper.(WelcomeHelper.java:25) at com.stephentuso.welcomeexample.MainActivity.onCreate(MainActivity.java:38) at android.app.Activity.performCreate(Activity.java:6672) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6123) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jacoco.agent.rt.internal_b0d6a23.Offline" on path: DexPathList[[zip file "/data/app/com.stephentuso.welcomeexample-1/base.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.stephentuso.welcomeexample-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.stephentuso.welcomeexample-1/lib/arm, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.stephentuso.welcome.WelcomeHelper.$jacocoInit(WelcomeHelper.java:0)  at com.stephentuso.welcome.WelcomeHelper.(WelcomeHelper.java:25)  at com.stephentuso.welcomeexample.MainActivity.onCreate(MainActivity.java:38)  at android.app.Activity.performCreate(Activity.java:6672)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1140)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2612)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2724)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1473)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6123)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) 

    i attached the screenshot of class and line no where it show the error.

    capture1

    opened by shrivastavaanurag 5
  • Testing welcome android in another project

    Testing welcome android in another project

    I was looking up some documentation related to android testing and it was advised that if I am testing a library, I should open a new project and test the methods. Could that be incorporated into the github repo ? If so, how?

    Thanks!

    opened by brendabrandy 5
  • Updating project causes issues with class resolution

    Updating project causes issues with class resolution

    I am in the process of updating the gradle files to a project that was working fine about 7 months ago. I am attempting to update to buildToolsVersion 27.0.3, compileSdkVersion 27

    I have the following dependencies config:

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
            exclude group: 'com.android.support', module: 'support-annotations'
        })
    
        compile(name: 'unity-ads', ext: 'aar')
        compile files('libs/YouTubeAndroidPlayerApi.jar')
    
        compile('com.stripe:stripe-android:1.0.4@aar') {
            transitive = true;
        }
        compile('io.fabric.sdk.android:fabric:1.3.10@aar') {
            transitive = true;
        }
        compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
            transitive = true;
        }
        compile('com.twitter.sdk.android:twitter:3.1.1@aar') {
            transitive = true
        }
        compile('me.leolin:ShortcutBadger:1.1.21@aar') {
            transitive = true
        }
    
    
        compile 'com.google.android.gms:play-services-ads:15.0.1'
        compile 'com.google.android.gms:play-services-auth:15.0.1'
    
        implementation 'com.google.firebase:firebase-core:15.0.2'
        implementation 'com.google.firebase:firebase-database:15.0.1'
        implementation 'com.google.firebase:firebase-auth:15.1.0'
        implementation 'com.google.firebase:firebase-messaging:15.0.2'
        implementation 'com.google.firebase:firebase-storage:15.0.2'
        implementation 'com.google.firebase:firebase-config:15.0.2'
    
        compile 'com.android.support:appcompat-v7:27.1.1'
        compile 'com.android.support:support-compat:27.1.1'
        compile 'com.android.support:recyclerview-v7:27.1.1'
        compile 'com.android.support:cardview-v7:27.1.1'
        compile 'com.android.support:design:27.1.1'
        compile "com.android.support:support-emoji:27.1.1"
        compile 'com.android.support.constraint:constraint-layout:1.1.0'
        compile 'com.android.volley:volley:1.1.0'
    
        compile 'com.facebook.android:facebook-android-sdk:4.33.0'
        compile 'com.squareup.picasso:picasso:2.5.2'
        compile 'com.squareup.okhttp:okhttp:2.4.0'
        compile 'jp.wasabeef:picasso-transformations:2.2.1'
        compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.4.1'
        compile 'com.stephentuso:welcome:1.4.1'
    
        testCompile 'junit:junit:4.12'
    }
    

    And the following build script config:

        repositories {
            mavenCentral()
            jcenter()
            google()
            maven { url 'https://maven.fabric.io/public' }
            maven { url 'https://maven.google.com' }
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
            classpath 'com.google.gms:google-services:3.3.0'
            classpath 'io.fabric.tools:gradle:1.25.3'
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

    Everything in the updated project seems to be resolving except for the 'welcome-android' library which results in a 'Cannot resolve symbol WelcomeActivity' etc. I investigated it, assuming that it might be an issue with the repository dependency configuration and perhaps it had changed from mavernCentral() however that doesn't seem to be the case. This is in a live production app that is requiring an update from the market vendors and so I would like to resolve it ASAP. Many thanks if you can help.

    stale 
    opened by gpaluk 4
  • cannot be cast to welcome.WelcomeViewPagerIndicator

    cannot be cast to welcome.WelcomeViewPagerIndicator

    WelcomeViewPagerIndicator indicator = (WelcomeViewPagerIndicator) findViewById(R.id.wel_pager_indicator); I am getting at this point.

    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.techies.developer/com.techies.developer.welcomeexample.SampleWelcomeActivity}: java.lang.ClassCastException: com.stephentuso.welcome.WelcomeViewPagerIndicator cannot be cast to com.techies.developer.welcome.WelcomeViewPagerIndicator at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2560) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2640) at android.app.ActivityThread.access$800(ActivityThread.java:182) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1493) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5682) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758) Caused by: java.lang.ClassCastException: com.stephentuso.welcome.WelcomeViewPagerIndicator cannot be cast to com.techies.developer.welcome.WelcomeViewPagerIndicator at com.techies.developer.welcome.WelcomeActivity.onCreate(WelcomeActivity.java:110) at android.app.Activity.performCreate(Activity.java:6161) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1112) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2507) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2640)  at android.app.ActivityThread.access$800(ActivityThread.java:182)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1493)  at android.os.Handler.dispatchMessage(Handler.java:111)  at android.os.Looper.loop(Looper.java:194)  at android.app.ActivityThread.main(ActivityThread.java:5682)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758) 

    stale 
    opened by meshileya 4
  • is there method for changing the description text color

    is there method for changing the description text color

    BasicPage has method for changing the header color

    headerColor

    for each page but it did not see method for changing the description text for each page. I know I can do via custom fragment however, it would be useful to be add to the library.

    opened by MuBoori 4
  • App crashes after the 16th screen

    App crashes after the 16th screen

    I'm using welcome-android to create a slideshow gathering all the things my wife loves. There are 36 pages, and I'm using almost all page example model included in welcome-android. Until now, I used only photo.png provided in welcome-android https://github.com/stephentuso/welcome-android/blob/master/sample/src/main/res/drawable/photo.png, and I could see the whole slideshow without any issue.

    Now, I replace "photo.png" with resized photos/clipart (500x500px & transparent background), and here is my problem/issue : App crashes after the 16th screen.

    Here is my logcat : http://pastebin.com/LfDkGTag

    opened by KevinMinions 4
  • Its crashing on Vivo v1 device

    Its crashing on Vivo v1 device

    android.view.InflateException: Binary XML file line #44: Error inflating class Button at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2338) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5292) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #44: Error inflating class Button at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713) at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at android.support.v7.app.AppCompatDelegateImplV9.b(AppCompatDelegateImplV9.java:284) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.stephentuso.welcome.ui.WelcomeActivity.onCreate(WelcomeActivity.java:42) at android.app.Activity.performCreate(Activity.java:5264) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)  at android.app.ActivityThread.access$800(ActivityThread.java:151)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:5292)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)  at dalvik.system.NativeStart.main(Native Method)  Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f02005f a=3 r=0x7f02005f} at android.content.res.Resources.loadDrawable(Resources.java:2124) at android.content.res.TypedArray.getDrawable(TypedArray.java:602) at android.view.View.(View.java:3579) at android.widget.TextView.(TextView.java:642) at android.widget.Button.(Button.java:107) at android.support.v7.widget.AppCompatButton.(AppCompatButton.java:61) at android.support.v7.widget.AppCompatButton.(AppCompatButton.java:57) at android.support.v7.app.AppCompatViewInflater.a(AppCompatViewInflater.java:109) at android.support.v7.app.AppCompatDelegateImplV9.b(AppCompatDelegateImplV9.java:1013) at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1072) at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:44) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:684) at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)  at android.view.LayoutInflater.inflate(LayoutInflater.java:492)  at android.view.LayoutInflater.inflate(LayoutInflater.java:397)  at android.view.LayoutInflater.inflate(LayoutInflater.java:353)  at android.support.v7.app.AppCompatDelegateImplV9.b(AppCompatDelegateImplV9.java:284)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  at com.stephentuso.welcome.ui.WelcomeActivity.onCreate(WelcomeActivity.java:42)  at android.app.Activity.performCreate(Activity.java:5264)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2302)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)  at android.app.ActivityThread.access$800(ActivityThread.java:151)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:5292)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)  at dalvik.system.NativeStart.main(Native Method) 

    opened by NileshJarad 4
  • Preview fails because of dependency preference-v7:24.2.1 conflicting.

    Preview fails because of dependency preference-v7:24.2.1 conflicting.

    I am not sure how I will help you to reproduce it but I have support library version 25.1.0 and welcome:1.1.0.

    I initially get this warning/error from Android Studio:

    image

    This crashed the preview with a stracktrace:

    java.lang.NoSuchFieldError: ViewBackgroundHelper at android.support.v7.widget.AppCompatBackgroundHelper.loadFromAttributes(AppCompatBackgroundHelper.java:46) at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:63) at android.support.v7.widget.AppCompatImageView.<init>(AppCompatImageView.java:56) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:441) at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:240) at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:195) at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadClass(LayoutlibCallbackImpl.java:193) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:333) at android.view.BridgeInflater.onCreateView(BridgeInflater.java:152) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:717) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:785) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:222) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:834) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at com.android.layoutlib.bridge.bars.CustomBar.<init>(CustomBar.java:95) at com.android.layoutlib.bridge.bars.NavigationBar.<init>(NavigationBar.java:52) at com.android.layoutlib.bridge.bars.NavigationBar.<init>(NavigationBar.java:46) at com.android.layoutlib.bridge.impl.Layout.createNavBar(Layout.java:284) at com.android.layoutlib.bridge.impl.Layout.<init>(Layout.java:140) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:301) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

    When I remove the compile 'com.stephentuso:welcome:1.1.0' dependency from my build.gradle, everything is working again.

    Is there any way we can bump up preference-v7 version to 25.1.0. I feel like that might fix the issue.

    My apologies if this is not this libraries problem but as removing this dependency was a direct solution to the preview crashing, I thought I should report it here.

    Love your work and appreciate all the hard work btw 👍.

    opened by omerfarukyilmaz 4
  • Add a fullscreen image page

    Add a fullscreen image page

    Hi, I'm using your fantastic welcome-android to develop welcomPage in my own app. However, the project seems to lack a page to quickly load full-screen images.

    TitleP

    TitlePage has a TextView instead of fullscreen image, and images load slowly. FullscreenParallaxPage is not convenient to simply load an image.

    Therefore, I develop a FullscreenImagePage and FullscreenImageFragment base on WelcomePage to make afullscreen image as the background of the welcome page which uses the Glide to load image.

    By the way, I am an incoming Android engineer and I hope you can give me your valuable advice.

    Everything goes well with your work

    opened by 541056967 0
  • Allow fragments to be garbage collected when scrolled away

    Allow fragments to be garbage collected when scrolled away

    Currently once a page fragment is created, it won't be GCd until the activity closes. Ideally, only the current and immediately adjacent pages would be held on to

    enhancement 
    opened by stephentuso 1
  • Bottom Bar Background

    Bottom Bar Background

    we can't change the bottom bar background for each page. I used FullscreenParallaxPage with customize layout, but botttom bar can't change according to color of current page.

    enhancement help wanted 
    opened by salmanseifian 2
  • More page layout options

    More page layout options

    Now that in 1.0 the builder page method only takes a WelcomePage, rather than a bunch of different methods and parameters for each page type, it is much easier to add some more options. For the basic page, title page, and parallax page, I'm thinking the layout options would be the current (text on bottom, large image), text on top with large image, and more centered text with smaller image. Each class could then have a layout method that used an enum perhaps, and then a different layout file would be used based on that.

    enhancement 
    opened by stephentuso 0
Releases(v1.4.1)
Owner
Stephen Tuso
Currently experimenting with: React, styled-components, GraphQL, Docker, TypeScript
Stephen Tuso
Android samples built using Jetpack Window Manager for foldable and dual-screen devices like Microsoft Surface Duo.

Jetpack Window Manager samples for dual-screen and foldable devices like Microsoft Surface Duo Android app samples that use Jetpack Window Manager to

Microsoft 45 Dec 19, 2022
See a pretty error screen when your Android app crashes

WhatTheStack WhatTheStack is a library to make your debugging experience on Android better. It shows you a pretty error screen when your Android App c

Kshitij Chauhan 241 Nov 11, 2022
A Simple Splash Screen For Kotlin

SolarSystem I have Completed the TASK-1: Made the splash screen TASK-2: Made a b

Vedant Taak 0 Dec 22, 2021
Happy-Birthday - Design and implement a single screen app that displays information

Happy Birthday Android App | Android Basics in Kotlin Course Solution code for t

Anas Tariq 1 Feb 6, 2022
This Android application demonstrates new splash screen API launched by Google last year.

This Android application demonstrates new splash screen API launched by Google last year.

Mohit Rajput 1 Feb 22, 2022
An Android mobile app for viewing device screen in your web browser

Screen Stream over HTTP An Android mobile app for viewing device screen in your web browser. Developed by Dmitriy Krivoruchko · If there are any issue

Dmitriy Krivoruchko 1.1k Dec 31, 2022
Turtle Graphics 🐢 implementation for Android Platform with Code Editor, Preview Screen and packages

Turtle Graphics Download Turtle is an Android Application inspired from the original Turtle Graphics and Logo, Logo is an educational programming lang

Amr Hesham 15 Dec 30, 2022
Android cutout screen support Android P. Android O support huawei, xiaomi, oppo and vivo.

CutoutScreenSupport Android cutout screen support Android P. Android O support huawei, xiaomi, oppo and vivo. Usage whether the mobile phone is cutout

hacket 5 Nov 3, 2022
Quick photo and video camera with a flash, customizable resolution and no ads.

Simple Camera A camera with flash, zoom and no ads. The camera is usable for both photo taking and video recording. You can switch between front and r

Simple Mobile Tools 644 Dec 26, 2022
A simple calendar with events, customizable widgets and no ads.

Simple Calendar A simple calendar with events and a customizable widget. A simple calendar with optional CalDAV synchronization. You can easily create

Simple Mobile Tools 3k Jan 3, 2023
⏲ A highly customizable interval timer app for Android

TimeR Machine A highly customizable interval timer app for Android Structure The app uses the Navigation component. Modules whose names start with app

null 51 Dec 7, 2022
QuizApp - App for using (opentdb.com) API for making quizzes with customizable options

Quiz-App App for using (opentdb.com) API for making quizzes with customizable op

Uptech 0 Nov 22, 2021
This service provides first-class custom ROM integration for my Repainter app, which offers customizable dynamic theming for Android 12.

Repainter ROM integration This service provides first-class custom ROM integration for my Repainter app, which offers customizable dynamic theming for

Danny Lin 42 Jan 7, 2023
Welcome Fruit Ninja 🥝 on Jetpack Compose Desktop 🚀, using Canvas API 🎨

Compose-Fruit-Ninja ?? Welcome Fruit Ninja on Jetpack Compose Desktop ?? , using Canvas API ?? Featured on jetc-dev How to Run From gradle tab from ri

Chetan Gupta 54 Nov 2, 2022
Splash screen demo that used with ‘Splash Screen‘ API on Android 12.

Splash Screen Feature Splash screen demo that used with Splash Screen API on Android 12. ?? Screenshot Default splash screen Splash screen with animat

Ellison Chan 60 Nov 16, 2022
A dual screen capable home screen launcher for Android phones with dual displays, such as the LG V60, G8X & Velvet.

Duality-Launcher A dual screen capable home screen launcher for Android phones with dual displays, such as the LG V60, G8X & Velvet

Russ Nash 6 Sep 8, 2022
Screen Capture Utils - A plugin to handle screen capture events on android and ios

Screen Capture Utils A plugin to handle screen capture events on android and ios ?? Initialize SDK late ScreenCaptureUtils screenCaptureUtils;

Chiziaruhoma Ogbonda 41 Apr 12, 2022
Proof of concept of custom widgets and apps running on the Z Flip3 cover screen. Adds a widget to Z Flip3 cover screen that lets you launch a web browser-like app on the cover.

SubUI-browser Proof of concept of custom widgets and apps running on the Z Flip3 cover screen. Adds a widget to Z Flip3 cover screen that lets you lau

null 35 Dec 24, 2022
Learn how to make an app designed for single-screen devices shine when running on foldable and dual-screen devices

dcberlin21-workshop Make your app shine om foldable devices with the samples we have here. Related links SDK open-source code SDK samples (Kotlin) App

Cesar Valiente 3 Oct 26, 2021
Cesar Valiente 1 Sep 3, 2022