Giter Club home page Giter Club logo

taptargetview's Introduction

Video 1 Screenshot 1 Screenshot 2
TapTargetView

Maven Central Release

An implementation of tap targets from Google's Material Design guidelines on feature discovery.

Min SDK: 14

JavaDoc

Installation

TapTargetView is distributed using MavenCentral.

   repositories { 
        mavenCentral()
   }
   
   dependencies {
         implementation 'com.getkeepsafe.taptargetview:taptargetview:x.x.x'
   }

If you wish, you may also use TapTargetView with jitpack. For snapshots, please follow the instructions here.

Usage

Simple usage

TapTargetView.showFor(this,                 // `this` is an Activity
    TapTarget.forView(findViewById(R.id.target), "This is a target", "We have the best targets, believe me")
        // All options below are optional
        .outerCircleColor(R.color.red)      // Specify a color for the outer circle
	.outerCircleAlpha(0.96f)            // Specify the alpha amount for the outer circle
        .targetCircleColor(R.color.white)   // Specify a color for the target circle
        .titleTextSize(20)                  // Specify the size (in sp) of the title text
        .titleTextColor(R.color.white)      // Specify the color of the title text
        .descriptionTextSize(10)            // Specify the size (in sp) of the description text
        .descriptionTextColor(R.color.red)  // Specify the color of the description text
        .textColor(R.color.blue)            // Specify a color for both the title and description text
        .textTypeface(Typeface.SANS_SERIF)  // Specify a typeface for the text
        .dimColor(R.color.black)            // If set, will dim behind the view with 30% opacity of the given color
        .drawShadow(true)                   // Whether to draw a drop shadow or not
        .cancelable(false)                  // Whether tapping outside the outer circle dismisses the view
        .tintTarget(true)                   // Whether to tint the target view's color
        .transparentTarget(false)           // Specify whether the target is transparent (displays the content underneath)
        .icon(Drawable)                     // Specify a custom drawable to draw as the target
        .targetRadius(60),                  // Specify the target radius (in dp)
    new TapTargetView.Listener() {          // The listener can listen for regular clicks, long clicks or cancels
        @Override
        public void onTargetClick(TapTargetView view) {
            super.onTargetClick(view);      // This call is optional
            doSomething();
        }
    });

You may also choose to target your own custom Rect with TapTarget.forBounds(Rect, ...)

Additionally, each color can be specified via a @ColorRes or a @ColorInt. Functions that have the suffix Int take a @ColorInt.

Tip: When targeting a Toolbar item, be careful with Proguard and ensure you're keeping certain fields. See #180

Sequences

You can easily create a sequence of tap targets with TapTargetSequence:

new TapTargetSequence(this)
    .targets(
        TapTarget.forView(findViewById(R.id.never), "Gonna"),
        TapTarget.forView(findViewById(R.id.give), "You", "Up")
                .dimColor(android.R.color.never)
                .outerCircleColor(R.color.gonna)
                .targetCircleColor(R.color.let)
                .textColor(android.R.color.you),
        TapTarget.forBounds(rickTarget, "Down", ":^)")
                .cancelable(false)
                .icon(rick))
    .listener(new TapTargetSequence.Listener() {
        // This listener will tell us when interesting(tm) events happen in regards
        // to the sequence
        @Override
        public void onSequenceFinish() {
            // Yay
        }
        
        @Override
        public void onSequenceStep(TapTarget lastTarget, boolean targetClicked) {
            // Perform action for the current target
        }

        @Override
        public void onSequenceCanceled(TapTarget lastTarget) {
            // Boo
        }
    });

A sequence is started via a call to start() on the TapTargetSequence instance

For more examples of usage, please look at the included sample app.

Tutorials

Third Party Bindings

React Native

Thanks to @prscX, you may now use this library with React Native via the module here

NativeScript

Thanks to @hamdiwanis, you may now use this library with NativeScript via the plugin here

Xamarin

Thanks to @btripp, you may now use this library via a Xamarin Binding located here.

License

Copyright 2016 Keepsafe Software Inc.

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.

taptargetview's People

Contributors

ajalt avatar ardacebi avatar bridouille avatar christiankatzmann avatar danimahardhika avatar emarc-m avatar endy-s avatar fabianterhorst avatar hannesa2 avatar hearsilent avatar jawnnypoo avatar julioz avatar leshchenko avatar marcorei avatar mickele avatar mumayank avatar paulwoitaschek avatar philippb avatar prokash-sarkar avatar prscx avatar razavioo avatar tushar-acharya avatar udy18rus avatar vahidvdn avatar xiphirx avatar zacsweers 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  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

taptargetview's Issues

Passing in a null listener prevents clicks from being handled

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used: 1.4.0

Stack trace: None

Android version: All

The listener variable is being shadowed unintentionally by the parameter and thus disabling the click listeners.

target disappears during rotation

target disappears during rotation, Does anyone know how to fix it ?

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used:

Stack trace:

Android version:

Description should be optional

Hey, first up, I'm sorry if I'm raising too many issues. I am doing it in a positive way to help give you my honest end-user/ dev experience.

Now on the issue, I haven't read the official guidelines on this matter. If description is mandatory, please close this issue. If not, then I feel not all feature require a description. Title is sufficient. But currently your code will throw an error. Minor issue, but wanted to get clarifications on this, if you may, please?

NPE

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used:
1.5.1

Stack trace:
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.view.View.isLaidOut()' on a null object reference
at com.getkeepsafe.taptargetview.ViewUtil.isLaidOut(ViewUtil.java:28)
at com.getkeepsafe.taptargetview.ViewUtil.onLaidOut(ViewUtil.java:36)
at com.getkeepsafe.taptargetview.ViewTapTarget.onReady(ViewTapTarget.java:35)
at com.getkeepsafe.taptargetview.TapTargetView$9.run(TapTargetView.java:400)
at com.getkeepsafe.taptargetview.ViewUtil$1.onGlobalLayout(ViewUtil.java:60)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:889)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2070)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6642)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5938)
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:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Android version:
Fabric shows this crash for Android 4.x, 5.x and 6.x

Greets

Sequence handling

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used:
1.4.1

Hey
I need a little bit better handling for the sequence. I have to know what target has been shown last, when the user cancels the sequence

maybe
public void onSequenceCanceled(TapTarget currentTapTarget);

Custom parent ViewGroup

Could you please add a way to set a custom parent ViewGroup using the Builder?
I want to show the help for a dialog...

java.lang.NullPointerException: Attempt to read from null array

Hi, I'm experiencing an issue on Android 6.0 Genymotion emulator.
Version 1.3.0
Stacktrace:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.NullPointerException: Attempt to read from null array
at com.getkeepsafe.taptargetview.TapTargetView.onDraw(TapTargetView.java:545)
at android.view.View.draw(View.java:16178)
at android.view.View.updateDisplayListIfDirty(View.java:15174)
at android.view.View.draw(View.java:15948)
at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
at android.view.View.draw(View.java:16181)
at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690)
at android.view.View.updateDisplayListIfDirty(View.java:15174)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Twice call same hint - exception

Hello! I try use your library.
What I doing - call my method, then press target, then call method - app falls.

My method:
TapTargetView.showFor(this,
TapTarget.forView(target, "My target", "My description")
.tintTarget(false) // Whether to tint the target view's color
.drawShadow(true) // Whether to draw the drop shadow
.cancelable(false),
new TapTargetView.Listener() {
@OverRide
public void onTargetClick(TapTargetView view) {
super.onTargetClick(view);
Toast.makeText(getApplicationContext(), "onTargetClick", Toast.LENGTH_SHORT).show();
}
}
);
where target - FloatingActionButton

              java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap@3b22c126
                  at android.graphics.Canvas.throwIfCannotDraw(Canvas.java:1282)
                  at android.graphics.Canvas.drawBitmap(Canvas.java:1416)
                  at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:538)
                  at com.getkeepsafe.taptargetview.TapTargetView.onDraw(TapTargetView.java:483)
                  at android.view.View.draw(View.java:15231)
                  at android.view.View.buildDrawingCacheImpl(View.java:14477)
                  at android.view.View.buildDrawingCache(View.java:14339)
                  at android.view.View.updateDisplayListIfDirty(View.java:14148)
                  at android.view.View.getDisplayList(View.java:14189)
                  at android.view.View.draw(View.java:14959)
                  at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
                  at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
                  at android.view.View.draw(View.java:15234)
                  at android.widget.FrameLayout.draw(FrameLayout.java:598)
                  at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2650)
                  at android.view.View.updateDisplayListIfDirty(View.java:14167)
                  at android.view.View.getDisplayList(View.java:14189)
                  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:5885)
                  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:5254)
                  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:903)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

Clicking multiple times in target while dismiss animation is running restarts animation

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Whenever the TapTargetView is clicked, onTargetClick is triggered, which calls view.dismiss(true); - that will kick off the dismiss animation. If the user repeatedly clicks the target while the animation is running, that listener method will be called again, which restarts the dismiss animation, allowing the whole cycle to be executed indefinitely.

Version used:
1.5.1

Stack trace:
None.

Android version:
API 25

Release request

Hi
Can You please make a new release with the latest changes ( Transparent target) ?

Option for transparent target circle

Let's say you want to use the TapTargetView with the 3 dots settings icon (overflow icon) that is available in the toolbar of some apps on top right side. Since there is no resource ID associated to this icon, using TapTarget.forBounds is the only way to target this icon. Unfortunately, the target circle cannot be transparent, thus hidding the icon when TapTargetView is used.

It would be nice to have an option for having a transparent target circle. Probably, using transparentPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR)) with the Paint object instance when the option is enabled.

NPE

Hello

im facing an NPE in fabrics crash dashboard, but dont know how to solve this. can you give me a hint please?

i have a sequence of two items. first is a toolbar action item second is a spinner view. it works correctly on my phone but crashes a lot on my users phones.

Fatal Exception: java.lang.NullPointerException: Attempt to read from null array
at com.getkeepsafe.taptargetview.TapTargetView$10.onClick(TapTargetView.java:435)
at android.view.View.performClick(View.java:5207)
at android.view.View$PerformClick.run(View.java:21168)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

For Display Swipable Area

how to show anim for SwipableLeft or SwipableRight area ??
i.e. like opening Drawer & for the Pull to refresh events

Investigate alternatives to rendering a drop shadow

Currently the library makes use of a software layer and shadow layer to render a drop shadow. This is problematic solely because it forces the use of a software layer when drop shadows are enabled (which is the default)

Ability to specify text size via dimens attrs

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Instead of passing in sp absolute values for the title and description texts, I think it would also be valuable to be able to pass in dimension resources (such as R.dimen.something) to enable reuse of those values.

Version used:
1.5.1

Stack trace:
None.

Android version:
API 25

Accept Point/ Rect as param for showFor

I'm currently using this library for implementation of feature overlays:
https://github.com/amlcurran/ShowcaseView

This library provides a way to highlight elements by passing Point. That is just great as it helps in highlighting elements which aren't views. Or legacy elements which were not views in earlier android OS versions but have become views in recent versions of android OS. One example I can quote is ListView's fastScroller which was a Drawable pre-kitkat. Post that it became a view.

Your lib is already better than this lib. If you add this functionality, your lib will expand to support any area in the app (and not just views) and become even more awesome!

This is just a humble feature request. :)

cancelable(true) requires listener to be set, is it intended?

In latest lib version 1.0.1. setting cancelable(true) requires listener to be set. It's confirmed by Source where on setOnClickListener (and on setOnLongClickListener), the method finishes without doing anything if Listener is null. Which IMO contradicts cancelable(true) is enough to make this view cancelable. It's not mentioned in doc that cancelable(true) alone is good, and we require setListener to work with it. Is this behaviour intended? Or went there accidentally?

In any case I propose any of these three changes.

  1. Mention in docs that cancelable(true) requires listener to be set.
  2. Listener null checks require only when you are dealing with listeners i.e. calling listener method, rest can be fine IMO.
  3. Define a default listener, when cancelable(true) is called, also set listener be set with that default listener. This will make cancelable(true) stand alone without much efforts.

I am giving these suggestions based on what I have seen in the code, I am ok with any of the options taken which can make library more useful. Anyway, thanks a lot for this lib.

Setting text size for custom typeface ( question )

Hi there,
Is it possible to set text size for title and description separately?!
You know what, in some cases when you set typeface to text, it seems too big!! and need to reduce text size to get better result!

Or can set two different typeface for title and description?

Thanks :)

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

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

.outerCircleColor(android.graphics.Color.rgb(255, 0, 0))

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

Is this really not possible?

Close animation unhandled behavior

Hi there
I'm using SNAP-SHOT version.
When user touch outside of outer circle, view start close animation.
But if user touch twice and more and more, close animation repeat more and more.

It seems to be a unhandled behavior ;)

Clipped on StatusBar for ToolbarMenuItem

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used: 1.5.1

Stack trace:

Android version: 7.1.1 (API 25)


Using the demo-app the circle is clipped on the statusbar.

image


This was not the case in the old version I used (1.3.0) and not in the screenshot in the README. I'd like to have the circles overlapping everything (like in the screenshots).

Experiencing an NPE on dismiss

I am seeing a NullPointerException on dismissing the tutorial everytime.

java.lang.NullPointerException: Attempt to write to field 'android.view.ViewParent android.view.View.mParent' on a null object reference

and it is happening here,

private final ValueAnimator dismissConfirmAnimation = new FloatValueAnimatorBuilder()
            .duration(250)
            .interpolator(new AccelerateDecelerateInterpolator())
            .onUpdate(new FloatValueAnimatorBuilder.UpdateListener() {
                @Override
                public void onUpdate(float lerpTime) {
                    final float spedUpLerp = Math.min(1.0f, lerpTime * 2.0f);
                    outerCircleRadius = calculatedOuterCircleRadius * (1.0f + (spedUpLerp * 0.2f));
                    outerCircleAlpha = (int) ((1.0f - spedUpLerp) * 255.0f);
                    outerCirclePath.reset();
                    outerCirclePath.addCircle(outerCircleCenter[0], outerCircleCenter[1], outerCircleRadius, Path.Direction.CW);
                    targetCircleRadius = (1.0f - lerpTime) * TARGET_RADIUS;
                    targetCircleAlpha = (int) ((1.0f - lerpTime) * 255.0f);
                    targetCirclePulseRadius = (1.0f + lerpTime) * TARGET_RADIUS;
                    targetCirclePulseAlpha = (int) ((1.0f - lerpTime) * targetCirclePulseAlpha);
                    textAlpha = (int) ((1.0f - spedUpLerp) * 255.0f);
                    calculateDrawingBounds();
                    invalidateViewAndOutline(drawingBounds);
                }
            })
            .onEnd(new FloatValueAnimatorBuilder.EndListener() {
                @Override
                public void onEnd() {
                    parent.removeView(TapTargetView.this);
                    onDismiss();
                }
            })
            .build();

on line

parent.removeView(TapTargetView.this);

Any help on solving this issue?

Listener discrepancy.

I added the library as a dependency in my project and started following the sample App you provided to create a "Helper" for my users.

When I added the listener, so I could make a sequence of "tap targets", I noticed there was a discrepancy between the listener provided by the imported library and the sample.

The listener provided by the library looks like this:

    public interface Listener {
        void onTargetClick(TapTargetView view);
        void onTargetLongClick(TapTargetView view);
    }

The listener used in the sample looks like this:

    public static class Listener {
        public void onTargetClick(TapTargetView view) {
            view.dismiss(true);
        }

        public void onTargetLongClick(TapTargetView view) {
            view.dismiss(true);
        }

        public void onTargetCancel(TapTargetView view) {
            view.dismiss(false);
        }
    }

Could you please take a look?

Error with FAB (I guess AppCompat)

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used:
1.3.0
Stack trace:
No direct method <init>(Landroid/widget/ImageView;Landroid/support/v7/widget/AppCompatDrawableManager);
Android version:
6.0

After add to gradle, and try to recompile apk, when I run, shows me that error.
here is my gradle configurations:

compileSdkVersion 23
buildToolsVersion '24.0.1'
minSdkVersion 17
targetSdkVersion 22
classpath 'com.android.tools.build:gradle:2.2.1'

On dismissed?

This might already be solved, but i'd like to do the following: Get notified when the user taps outside of the info window thus it being "cancelled". The reason for that is i'd like to do the exact same thing in the demo, but without needing to write in each of the descriptions "To close this, tap on the highlighted item" or similar. To us it may be obvious but it'd be great if simply tapping anywhere allowed me to display the next info item.

Target is appearing behind BottomSheetDialog

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used:

None:

Android version: 6.0

as per the title says, the Target appears behind the BottomSheetDialog even if i used getActivity()or getDialog()

Unable to create TapTargetSequence

Hello,

I have imported dependency via jcenter(), but TapTargetSequence is inaccessible. It seems in exported android archive TapTargetSequence is not their.

Android below API 21: TapTargetView

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used:
compile 'com.getkeepsafe.taptargetview:taptargetview:1.5.2'
Stack trace:
FATAL EXCEPTION: main
java.lang.IllegalArgumentException: Layout: -240 < 0
at android.text.Layout.(Layout.java:138)
at android.text.StaticLayout.(StaticLayout.java:104)
at android.text.StaticLayout.(StaticLayout.java:90)
at android.text.StaticLayout.(StaticLayout.java:68)
at android.text.StaticLayout.(StaticLayout.java:48)
at com.getkeepsafe.taptargetview.TapTargetView.updateTextLayouts(TapTargetView.java:714)
at com.getkeepsafe.taptargetview.TapTargetView$9.run(TapTargetView.java:399)
at com.getkeepsafe.taptargetview.ViewUtil$1.onGlobalLayout(ViewUtil.java:60)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:808)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1768)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
at android.view.Choreographer.doCallbacks(Choreographer.java:562)
at android.view.Choreographer.doFrame(Choreographer.java:532)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)

Android version:
API < 21

Tint floating action button

There is no possibility to tint floating action button and set icon color or drawable.
I got all button in the tint color without any icon

Feature Request:- Expose method which takes menuitem as target

I have a situation where I change the visibility of a menuitem in onPrepareOptionsMenu within a fragment. I want to show a TapTargetView when the item becomes visible.

I have a reference to the menuitem and would like to create the TapTargetView with the menuitem as the target, possibly in onPrepareOptionsMenu.

I have tried getting a reference to the toolbar and finding the item in onPrepareOptionsMenu using the id but it always resolves as null in this method.

Could you assist or possibly add the ability to pass a menuitem?

Thanks
Jason

java.lang.RuntimeException: Canvas: trying to use a recycled bitmap android.graphics.Bitmap

Version 1.2.0

Code to make the exception to happen on the third TapTarget :

Display display = getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
Rect bounds = new Rect(size.x / 2,
                       size.y / 2,
                       (size.x / 2) + 150,
                       (size.y / 2) + 150);

new TapTargetSequence(getActivity())
        .targets(
                TapTarget.forBounds(bounds,
                                    "Title 1",
                                    "Text 1")
                         .cancelable(false)
                         .icon(ContextCompat.getDrawable(getActivity(),
                                                         R.drawable.drawable_1)),
                TapTarget.forBounds(bounds,
                                    "Title 2",
                                    "Text 2")
                         .cancelable(false)
                         .icon(ContextCompat.getDrawable(getActivity(),
                                                         R.drawable.drawable_2)),
                TapTarget.forBounds(bounds,
                                    "Title 3",
                                    "Text 3")
                         .cancelable(false)
// Bug Here (maybe because we reuse drawable_1)
// Don't even work with a clone of the drawable made with mutate()
                         .icon(ContextCompat.getDrawable(getActivity(),
                                                         R.drawable.drawable_1))) 
        .listener(new TapTargetSequence.Listener()
        {
            @Override
            public void onSequenceFinish()
            {
                Log.d("TAG", "onSequenceFinish");
            }

            @Override
            public void onSequenceCanceled()
            {

            }
        }).start();

No exception with this code :

Display display = getActivity().getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
Rect bounds = new Rect(size.x / 2,
                       size.y / 2,
                       (size.x / 2) + 150,
                       (size.y / 2) + 150);

new TapTargetSequence(getActivity())
        .targets(
                TapTarget.forBounds(bounds,
                                    "Title 1",
                                    "Text 1")
                         .cancelable(false)
                         .icon(ContextCompat.getDrawable(getActivity(),
                                                         R.drawable.drawable_1)),
                TapTarget.forBounds(bounds,
                                    "Title 2",
                                    "Text 2")
                         .cancelable(false)
                         .icon(ContextCompat.getDrawable(getActivity(),
                                                         R.drawable.drawable_2)),
                TapTarget.forBounds(bounds,
                                    "Title 3",
                                    "Text 3")
                         .cancelable(false)
                         .icon(ContextCompat.getDrawable(getActivity(),
                                                         R.drawable.drawable_3)))
        .listener(new TapTargetSequence.Listener()
        {
            @Override
            public void onSequenceFinish()
            {
                Log.d("TAG", "onSequenceFinish");
            }

            @Override
            public void onSequenceCanceled()
            {

            }
        }).start(); 

The TapTarget does not fit properly after rotation

The TapTarget does not fit properly after rotation, In landscape mode the taptarget should be in the settings icon

screenshot_2016-10-08-23-56-27
screenshot_2016-10-08-23-56-40

screenshot_2016-10-09-00-03-08
screenshot_2016-10-09-00-03-18

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used:

Stack trace:

Android version:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.StaticLayout.getHeight()' on a null object reference

As per the title, im getting below exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.text.StaticLayout.getHeight()'
on a null object reference
at com.getkeepsafe.taptargetview.TapTargetView.getTextBounds(TapTargetView.java: 523)
at com.getkeepsafe.taptargetview.TapTargetView.calculateDimensions(TapTargetView.java: 499)
at com.getkeepsafe.taptargetview.TapTargetView.access$700(TapTargetView.java: 54)
at com.getkeepsafe.taptargetview.TapTargetView$9.run(TapTargetView.java: 313)
at com.getkeepsafe.taptargetview.ViewUtil$1.onGlobalLayout(ViewUtil.java: 60)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java: 912)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java: 2063)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java: 1174)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java: 6241)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java: 873)
at android.view.Choreographer.doCallbacks(Choreographer.java: 676)
at android.view.Choreographer.doFrame(Choreographer.java: 606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java: 859)
at android.os.Handler.handleCallback(Handler.java: 739)
at android.os.Handler.dispatchMessage(Handler.java: 95)
at android.os.Looper.loop(Looper.java: 168)
at android.app.ActivityThread.main(ActivityThread.java: 5845)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 687)

my Target setup as below:

new TapTargetView.Builder((Activity) itemView.getContext())
                    .title(R.string.long_press)
                    .description(R.string.long_press_to_open_gallery)
                    .outerCircleColor(R.color.white)
                    .targetCircleColor(R.color.IndigoPrimary)
                    .textColor(R.color.white)
                    .dimColor(R.color.black)
                    .tintTarget(true)
                    .drawShadow(true)
                    .cancelable(false)
                    .listener(new TapTargetView.Listener() {
                        @Override public void onTargetClick(TapTargetView view) {}

                        @Override public void onTargetLongClick(TapTargetView view) {
                            itemView.performLongClick();
                        }
                    })
                    .showFor(image);

couldn't really know what's going on. any ideas what could cause this?

TapTargets for views near the top of the screen show title in status bar

  • I have verified the issue exists on the latest version
  • I am able to reproduce it

Version used: 1.4.1

Stack trace: N/A

Android version: 7.0

See screenshot. Would it be possible in this case to move the title below the target? I tried setting the bounds manually to a smaller square at the left/right sides of the view but the same thing happened.

screenshot_20161019-164849

Problem with transparentTarget=true on Android 4.2

  • [true ] I have verified the issue exists on the latest version
  • [ true] I am able to reproduce it

Hello.
I have a such problem on device with api 17 (see screenshot)
Can we fix this?

default

Version used:
compile 'com.getkeepsafe.taptargetview:taptargetview:1.5.1'
Stack trace:
No any
Android version:
Android Api 17, Nexus 5

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.