GithubHelp home page GithubHelp logo

riggaroo / materialintrotutorial Goto Github PK

View Code? Open in Web Editor NEW
811.0 34.0 130.0 5.03 MB

[DEPRECATED] Library demonstrating a material intro tutorial much like the ones on Google Sheets

Java 100.00%

materialintrotutorial's Introduction

MaterialIntroTutorial

Android Library demonstrating a material intro tutorial much like the ones on Google Sheets

This library creates an introduction screen for your application. The help tutorial takes the background colour set for each page and when scrolling between the two pages, the two colours will fade into one another.

Example:

Download

Build Status

Example Usage

Add the following into your build.gradle:

        compile 'za.co.riggaroo:materialhelptutorial:1.+'

In your activity, create a list of TutorialItems (set the title, subtitle, background colour and image drawable int). Pass them onto the MaterialTutorialActivity and start the activity for result.

    public void loadTutorial() {
        Intent mainAct = new Intent(this, MaterialTutorialActivity.class);
        mainAct.putParcelableArrayListExtra(MaterialTutorialActivity.MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS, getTutorialItems(this));
        startActivityForResult(mainAct, REQUEST_CODE);

    }

    private ArrayList<TutorialItem> getTutorialItems(Context context) {
        TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle),
                R.color.slide_1, R.drawable.tut_page_1_front,  R.drawable.tut_page_1_background);

	// You can also add gifs, [IN BETA YET] (because Glide is awesome!)
	TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle),
                R.color.slide_1, R.drawable.gif_drawable, true);

        ...

        ArrayList<TutorialItem> tutorialItems = new ArrayList<>();
        tutorialItems.add(tutorialItem1);
        ...

        return tutorialItems;
    }

You should see a tutorial like below:

This library is using the following:

License

MIT License

Copyright (c) 2015 Rebecca Franks

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

materialintrotutorial's People

Contributors

geralt-encore avatar kaiwinter avatar leeyc09 avatar riggaroo avatar spongebobrf 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  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  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

materialintrotutorial's Issues

change font

hi friend. is it possible to change the font of tutorial slides? like changing the titles fonts

Suggestion: start animated gifs when the slide is showed

Hi again. I have another suggestion for you.

I noticed that if I have for example, two slides, with two animated gifs, both are started when the slide 1 is showed. I suppose that the viewpager loads the second slide in advance, and because of that the gif animation is started.

But it is a little bit confusing that when the users slides to slide 2, that the animation is not a the start.

Regards and thank you for your attention!

Percent Library deprecated

Hi,
I know you must be well aware that percent library is deprecated. Any plans to replace it with constraint layout?

UI somehow "broken" when only one TutorialItem is added

When only one TutorialItem is passed to the MaterialTutorialActivity, like:

ArrayList<TutorialItem> tutorialItems = new ArrayList<>();
tutorialItems.add(tutorialItem1);
return tutorialItems;

the FINISH button is missing, instead the > button is shown but it does nothing when you tap it:
screenshot_20171207-120902-small

In this case I would expect the FINISH button to be shown.

Can't use android.graphics.Color.rgb()?

I'd like to set the colors programmatically like so:

TutorialItem tutorialItem1 = new TutorialItem(
	context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle),
	android.graphics.Color.rgb(255, 0, 0), // << RIGHT HERE
	R.drawable.tut_page_1_front,
	R.drawable.tut_page_1_background
)

but it throws android.content.res.Resources$NotFoundException: Resource ID #0xffff0000.

Is this really not possible?

Example Source

Here's an example on how to implement it.
https://github.com/KeepSafe/TapTargetView/pull/71/files

A few requests

Hello there, I would like to use this, but need a few more features. I will try to implement if I have time later but if you can, here they are:

  • An option to change text colors. Including title, subtitle and activity buttons (skip and done)
  • An option to localize skip and done buttons.

That's it for now. It's looking good and hope you can implement these features.
Thanks!

Android 8.0-8.1 critical bug with startActivityForResult

If I call startActivity, it works fine. If I call startActivityForResult my app closes with error:

04-13 19:50:18.465 6672-6672/com.serp.benchpressplus E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.serp.benchpressplus, PID: 6672
java.lang.IllegalArgumentException: View=DecorView@2ee20e4[] not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:485)
at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:380)
at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:99)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3714)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1638)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Your library code is not standardized enough, causing my project to be abnormal

When you use the "com.android.support:support" library, please introduce it to your library with "provided" or "compileOnly".
I have to block your support library and reintroduced it myself.
like this:


implementation 'com.android.support:percent:28.0.0'
implementation ('za.co.riggaroo:materialhelptutorial:1.6.0'){
    exclude group: 'com.android.support'
}

NullPointerException in MaterialTutorialPresenter

I received some ACRA crash reports from my app with the stacktrace below.

java.lang.NullPointerException
    at za.co.riggaroo.materialhelptutorial.tutorial.c.a(MaterialTutorialPresenter.java:37)
    at za.co.riggaroo.materialhelptutorial.tutorial.MaterialTutorialActivity.onCreate(MaterialTutorialActivity.java:76)
    at android.app.Activity.performCreate(Activity.java:5187)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2145)
    at android.app.ActivityThread.access$600(ActivityThread.java:130)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1211)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4847)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:535)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)

I cannot reproduce this crash. Do you have an idea? I don't think I'm using the library in a wrong way because the stacktrace doesn't contain any of my classes. Maybe the exception is thrown when the app is started or comes back from background? This is how I trigger the MaterialTutorialActivity:

TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.howto_loop_title1), context.getString(R.string.howto_loop_text1), R.color.light_orange, R.drawable.loop_intro_1);
TutorialItem tutorialItem2 = new TutorialItem("", context.getString(R.string.howto_loop_text2), R.color.light_orange, R.drawable.loop_intro_2);
TutorialItem tutorialItem3 = new TutorialItem("", context.getString(R.string.howto_loop_text3), R.color.light_orange, R.drawable.loop_intro_3);

ArrayList<TutorialItem> tutorialItems = new ArrayList<>();
tutorialItems.add(tutorialItem1);
tutorialItems.add(tutorialItem2);
tutorialItems.add(tutorialItem3);

Intent intent = new Intent(context, MaterialTutorialActivity.class);
intent.putParcelableArrayListExtra(MaterialTutorialActivity.MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS, tutorialItems);
startActivity(intent);

Looking at MaterialTutorialPresenter.java:37 I don't know how tutorialItems can be null here. Maybe the intent extra gets lost anywhere?

Parallax effect

Hi!
Very nice tutorial!
Would it be possible to add an optional "parallax" effect maybe between the foreground and background drawables, a bit like Google's one?
Thank you, and compliments again!

Support for API 10

I see that minSdkVersion is set to 11.

Yet, when I try to add compile 'za.co.riggaroo:materialhelptutorial:1.1.0' to my gradle build, it fails to build with the following message :

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 15 declared in library [za.co.riggaroo:materialhelptutorial:1.1.0] app/build/intermediates/exploded-aar/za.co.riggaroo/materialhelptutorial/1.1.0/AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="za.co.riggaroo.materialhelptutorial" to force usage

It complains about version 15 ? It should complain about version 11, shouldn't it ?


Not sure if easier to add support for API 10 to this library or to roll my own onboarding activity... Ideas ?

Suggestion: in the return intent, inform if the user completed the tutorial

Hi, your library works very well, and it is very appreciated. Thank you for your effort.

I have a suggestion. Maybe you find useful to inform the calling activity, if the user completed the tutorial (that is, if all slides where seen, and the tutorial was not skipped). For analytics purposes.

Regards!

Could not find property 'bintray_user'

Hey I'm getting this issue with the gradle

Restart@RESTART32 /C/Users/Restart/AndroidStudioProjects/MaterialIntroTutorial (master)
$ ./gradlew build

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\Restart\AndroidStudioProjects\MaterialIntroTutorial\materialhelptutorial\build.gradle' line: 40
  • What went wrong:
    A problem occurred evaluating project ':materialhelptutorial'.
    Could not find property 'BINTRAY_USER' on com.jfrog.bintray.gradle.BintrayExtension_Decorated@27976390.
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.849 secs

Add support for Picasso

Hi,
As you know Glide's method count is much bigger than Picasso and not everyone can use it so please add Picasso support.
thanks

Update Readme

Hey, actually better than having

compile 'za.co.riggaroo:materialhelptutorial:1.1.0'

it would maybe make more sense to have:

compile 'za.co.riggaroo:materialhelptutorial:1.+'

So that the compatibility for 11+ is out of the box and you do not need to update the readme for every version

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.