Giter VIP home page Giter VIP logo

spotlight's Introduction

Taku Semba - takusemba.com 👋

Hello, I'm Taku Semba. I mainly work on Android, and interested in Media Streaming, Kubernetes/Docker.

Articles / Presentation 🎨

Book 📕

Get in touch :octocat:

spotlight's People

Contributors

adsamcik avatar bowang18 avatar fweinb avatar ghataa avatar jemshit avatar maherhanafi avatar mourjan avatar takusemba avatar xiryl 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

spotlight's Issues

Close w/ back button

It would be nice if the showcase overlay could be closed by the android (hardware) back button. I think this is the default user expectation.

view

If you want to achieve such as the effect of the map, used to indicate the progress, what is the good way?

Manifest merger failed

i had a issues. please help me.

"Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:6:5-24:19 to override."

<setPoint> in <SimpleTarget> mode

SimpleTarget firstTarget = new SimpleTarget.Builder(this) .setPoint(findViewById(R.id.one)) .setShape(new Circle(100f)) .setTitle("the title") .setDescription("the description") .setOverlayPoint(100f, 100f) .setOnSpotlightStartedListener(new OnTargetStateChangedListener<SimpleTarget>()
setPoint doesn't work on SimpleTarget.
it goes to top left in application, in the corner.

Issue about paddings

Hi

Thanks for your work but i have a problem: If i add this library to my project my other view's paddings are not working. Do you know how to resolve this problem?

Spotlight is not started with CustomTarget

I created a customtarget.

CustomTarget customtarget = new CustomTarget.Builder(activity)
                .setPoint(viewToFocus)
                .setRadius(50f)
                .setView(R.layout.fab_filter_coachmark)
                .build();

Start spotlight:

Spotlight.with(activity)
                    .setOverlayColor(ContextCompat.getColor(activity, R.color.transparent))
                    .setTargets(customtarget)
                    .setClosedOnTouchedOutside(true)
                    .start();

layout : fab_filter_coachmark

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:background="@color/coachMarkBg"
    android:layout_height="match_parent">
    <TextView
        android:id="@+id/textViewDescription"
        android:layout_width="match_parent"
        android:text="Description"
        android:textColor="@color/white"
        android:layout_height="wrap_content" />
    <TextView
        android:layout_width="match_parent"
        android:text="got it"
        android:textColor="@color/blue_priceinsight"
        android:layout_height="wrap_content" />
</LinearLayout>

There are two issues

  1. Custom view is not inflated near to the target, It inflated on the top left of screen.
  2. Spotlight is not started on target.

Target class should be public

I see absolutely no reason why it shouldn't be, it severely limits extensibility and when trying to add different types of targets as target compile error is thrown because it can't infer the type (at least under kotlin)

IOS version

Hi, is there is any plane to develop this lib on IOS?

Text overflow

Description

I have an issue with the description in the simple target.
When I have a large string and move the overlay point away from x=0, it won't wrap the text but lets it overflow the layout. Probably I did something wrong and I will try to fix it with a custom target, but in case it is a generell issue I wanted to let you know. Of course, if I did something wrong, any help to fix it is highly appreciated 😄

Below is an example of what I mean, together with my current layout where I tested it on

Code with screenshots

 Spotlight.with(this)
            .setOverlayColor(R.color.background)
            .setDuration(1000L)
            .setAnimation(DecelerateInterpolator(2f))
            .setTargets(bugTarget)
            .setClosedOnTouchedOutside(true)
            .start()

Without overflow

simple target without overflow

        val bugTarget = SimpleTarget.Builder(this)
            .setPoint(layout_coordinator.width.toFloat() - 50, 400f)
            .setShape(Circle(150f))
            .setTitle(resources.getString(R.string.spotlight_feedback_bug))
            .setDescription(resources.getString(R.string.spotlight_feedback_bug_desc))
            .setOverlayPoint(20f, 500f)
            .build()

With overflow

simple target with overflow

        val bugTarget = SimpleTarget.Builder(this)
            .setPoint(layout_coordinator.width.toFloat() - 50, 400f)
            .setShape(Circle(150f))
            .setTitle(resources.getString(R.string.spotlight_feedback_bug))
            .setDescription(resources.getString(R.string.spotlight_feedback_bug_desc))
            .setOverlayPoint(400f, 500f)
            .build()

Activity Layout

<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/layout_drawer"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/layout_coordinator"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".view.activity.GodActivity">

...

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <com.google.android.material.navigation.NavigationView
        android:id="@+id/drawer_navigation_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        app:headerLayout="@layout/menu_navigation_header"
        app:menu="@menu/menu_drawer_navigation"/>
    
</androidx.drawerlayout.widget.DrawerLayout>

Click Event ?

Is there any click event listener that i can use in this library ?

round rectangle spotlight

Thanks for awesome library, but I am little disappointed that there is no round rectangle option.
anyone who forked and made changes for this feature?

setTargets with ArrayList of Targets as parameter

Good day and thank you for providing the long waited custom shape feature,

could you kindly provide another setTargets method that takes an ArrayList of CustomTargets or SimpleTargets?
It is needed when number of targets is dynamic.

or do you prefer that I fork the project and return with a pull request?

assign target to view..

Hi,

im trying to implement the library, but i cant put target as a view to method setPoint(textview1);

the round is not fit to the view..

any advice would help much.

thanks

Add Test

it would be appreciated, if someone could write tests for me...

Add "show once only" feature

In its current state we have to handle the limiting of the displaying ourselves. It would be great if there was a feature in the api where we can define that the spotlight is displayed only once.

Set click listener only in spotlight

hi there, i want to implement on click only on spotlight so i can say it cant cancellable on when user touch on black area. Is this feature already implemented? or is there any code to backup this logic?

thank you

Having Issue Implementing on Custom View !

The Error was : java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

CustomTarget customTarget = new CustomTarget.Builder(this)
                .setPoint(100f, 100f)
                .setShape(new com.takusemba.spotlight.shape.Circle(120f))
                **.setOverlay(root)**
                .setOnSpotlightStartedListener(new OnTargetStateChangedListener<CustomTarget>() {
                    @Override
                    public void onStarted(CustomTarget target) {
                        // do something
                    }
                    @Override
                    public void onEnded(CustomTarget target) {
                        // do something
                    }
                })
                .build();
CustomTarget customTarget = new CustomTarget.Builder(this)
                .setPoint(100f, 100f)
                .setShape(new com.takusemba.spotlight.shape.Circle(120f))
                **.setOverlay(findViewById(R.id.rl))**
                .setOnSpotlightStartedListener(new OnTargetStateChangedListener<CustomTarget>() {
                    @Override
                    public void onStarted(CustomTarget target) {
                        // do something
                    }
                    @Override
                    public void onEnded(CustomTarget target) {
                        // do something
                    }
                })
                .build();

I tried above two different methods but both throwed same error when added as custom view !

Simple Target is working perfectly though !

Add "Skip tutorial" button

Hi. First of all, thank you for so great library. I have a question, is there any way to add a button (not a target) visible all time over the overlay to add any special action? In my case would be a "Skip intro/tutorial" to close spotlight before all targets have been shown.

Thanks

Code works only from OnClickListener() of a button .

I have created a method to create SimpleTarget and show a SpotLight.

createSpotLight();

If I call it inside View.OnClickListener() it works correctly and focuses on my all views.
But if I call it in onCreate() it does not focus correctly. Instead, it focuses on top of my activity.

Check my full code as below:

On Create of Activity :

@Override
protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_1);

 button1 = (Button) findViewById(R.id.button1);
 button2 = (Button) findViewById(R.id.button2);
 createSpotLight();

 button1.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
   createSpotLight();
  }
 });

 button2.setOnClickListener(new View.OnClickListener() {
  @Override
  public void onClick(View v) {
   showInputAlert();
  }
 });
}

Method that creates spotlight:

private void createSpotLight() {
 // make an target
 SimpleTarget simpleTarget1 = new SimpleTarget.Builder(MainActivity.this)
  .setPoint(findViewById(R.id.textview_1))
  .setRadius(200 f)
  .setTitle("This is textview")
  .setDescription("It is used to show a title")
  .build();

 // make an target
 SimpleTarget simpleTarget2 = new SimpleTarget.Builder(MainActivity.this)
  .setPoint(button1)
  .setRadius(100 f)
  .setTitle("This is a button")
  .setDescription("It starts Spotlight")
  .build();

 // Create Spotlight Targets
 SimpleTarget simpleTarget3 = new SimpleTarget.Builder(MainActivity.this)
  .setPoint(button2) // position of the Target. setPoint(Point point), setPoint(View view) will work too.
  .setRadius(100 f) // radius of the Target
  .setTitle("This is another Button") // title
  .setDescription("It will open a popup") // description
  .build();

 // Pass targets to method that show spotlight
 showSpotLight(simpleTarget1, simpleTarget2, simpleTarget3);
}

setOverlayColor error

I get error message "Android Release error: Expected a color resource id (R.color.) but received an RGB integer" when try call
setOverlayColor(ContextCompat.getColor(MainActivity.this, R.color.background))

Possible cause by annotation @ColorRes in your define method setOverlayColor

Coachmark with Dialog

Its an awesome library but I have a query how do I show the coachmark over the dialog. Its always coming behind the dialog. I am using the DialogFragment with animation in android.

can't set alpha?

it's always in zero to one, can you provide method to set zero to 0.x?

setview method not found

There is no set view method for the customtarget and simpletarget class, Can you please help me on what cause this? also i saw that the setpoint method can also take a view parameter can this be used instead of setview? Thanks

title and text on spot

hi i make a round rectangle for my app's help, everything fine but texts show on spot.
you can see this problem on pictures .

screenshot_20180726-020304
screenshot_20180726-020236

Make SpotlightView/Targetclickable

Can you make spotlightview or the target clickable? I know we can make a custom view and set clickable there but it would be great to make the target itself clickable to make the user tap on the target to move forward

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.