Giter Site home page Giter Site logo

tutors's Introduction

Download Android Arsenal API License

Tutors

A simple way to show the user interface tutorials.

Getting Started

compile 'com.github.popalay:tutors:latest-version'
compile 'com.github.popalay:tutors-kotlin:latest-version'

Usage

From Java

Tutors tutors = new TutorsBuilder()
                .textColorRes(android.R.color.white)
                .shadowColorRes(R.color.shadow)
                .textSizeRes(R.dimen.textNormal)
                .completeIconRes(R.drawable.ic_cross_24_white)
                .nextButtonTextRes(R.string.action_next)
                .completeButtonTextRes(R.string.action_got_it)
                .spacingRes(R.dimen.spacingNormal)
                .lineWidthRes(R.dimen.lineWidth)
                .cancelable(false)
                .build();

tutors.show(getSupportFragmentManager(), toolbar, "It's a toolbar", !iterator.hasNext());

See sample.

From Kotlin

val tutors = Tutors.create {
             textColorRes = android.R.color.white
             shadowColorRes = R.color.shadow
             textSizeRes = R.dimen.textNormal
             completeIconRes = R.drawable.ic_cross_24_white
             nextButtonTextRes = R.string.action_next
             completeButtonTextRes = R.string.action_got_it
             spacingRes = R.dimen.spacingNormal
             lineWidthRes = R.dimen.lineWidth
             cancelable = false
}

tutors.show(supportFragmentManager, view = toolbar, text = "It's a toolbar", isLast = true)

See sample.

License

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.

tutors's People

Contributors

popalay 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tutors's Issues

What is the latest version of this library?

I am trying to add like this

compile 'com.github.popalay:tutors:latest-version'

but endup getting error can't resolve for com.github.popalay:tutors:latest-version.

I think Gradle is not able to find the latest version of the library. Can anyone tell the latest version of this library?

Bug with a "Text" position

When the "tutors" is starting at the first time, you can see a bug with a wrong "Text" position. It's because of view lifecycle :)

You can fix it, just do your "Positioning logic" in the OnLayoutChanged method.
For example:
@Override protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); moveText(!inTop()); }

Text & Lines misses when using NestedScrollView

Version 1.0.4.

I have a nested scroll view with two buttons:

<android.support.v4.widget.NestedScrollView
            android:id="@+id/scroll"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            android:fillViewport="true"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

   <LinearLayout>
       <Button/>
       <Button/>
   </LinearLayout>
</android.support.v4.widget.NestedScrollView>

I want to show tutorial for these two buttons. The first one misses a lot, the second โ€” a little bit:

First button
Second button

If I'll show tutorial for the second button only:

Second button only

I've tried to add a delay in 2 seconds before displaying the tutorial and nothing changed.

RuntimeException: Canvas: trying to use a recycled bitmap

Hey great library! but we have one problem where the app sometimes crashes for users during TutorialLayout::onDraw (using java).

Fatal Exception: java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@3febdf66 at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1282) at android.view.GLES20Canvas.drawBitmap(GLES20Canvas.java:579) at com.popalay.tutors.TutorialLayout.onDraw(TutorialLayout.java:133) at android.view.View.draw(View.java:15246) at android.widget.FrameLayout.draw(FrameLayout.java:598) at android.view.View.updateDisplayListIfDirty(View.java:14182) at android.view.View.getDisplayList(View.java:14204) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3441) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3420) at android.view.View.updateDisplayListIfDirty(View.java:14142) at android.view.View.getDisplayList(View.java:14204) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3441) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3420) at android.view.View.updateDisplayListIfDirty(View.java:14142) at android.view.View.getDisplayList(View.java:14204) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3441) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3420) at android.view.View.updateDisplayListIfDirty(View.java:14142) at android.view.View.getDisplayList(View.java:14204) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2530) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2352) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1982) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5895) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:550) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5348) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:947) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)

Is there anything that can be done with this? without some kind of fix or workaround for this we will have to find a new solution for tutorials which is a shame cause this library is awesome, thanks!

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.