Coder Social home page Coder Social logo

faruktoptas / fancyshowcaseview Goto Github PK

View Code? Open in Web Editor NEW
1.9K 29.0 274.0 4.51 MB

An easy-to-use customisable show case view with circular reveal animation.

License: Apache License 2.0

Kotlin 99.94% Shell 0.06%
fancyshowcaseview android-ui circular-reveal android-development android android-library material-ui material-design animation kotlin

fancyshowcaseview's People

Contributors

97balakrishnan avatar 97sbalakrishnan avatar adrianlxm avatar anuragupadhaya avatar askandrecieve avatar boymustafa avatar chimzycash avatar cypressious avatar daboome avatar efung avatar eric-muchiri avatar faruktoptas avatar gitter-badger avatar harshvardhan-takawale avatar hasbisevinc avatar ichurkin avatar jikolp95 avatar mflisar avatar mrjavaci avatar nickcondron avatar parasdtu avatar polyak01 avatar pozzoooo avatar rajnish23 avatar sfeatherstone avatar shynline avatar svinouze avatar tuhinadasgupta avatar yerenutku avatar yuetchan 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

fancyshowcaseview's Issues

very critical bug with android:windowTranslucentStatus true

Hello! Excellent library and thanks for the work. But I have found a very critical bug.

Try to add

<item name="android:windowTranslucentStatus">true</item>

to your v21+/style and check application.

Result:
photo_2017-08-18_19-16-03

How can we fix it as soon as possible?

Click on view in focus

Hey guys, quick question.

Is it possible to make only the target view (.focusOn) clickable even if .closeOnTouch is false?

Thanks!

Title position is wrong

new Handler().postDelayed(new Runnable() {
          @Override
          public void run() {
              new FancyShowCaseView.Builder(getmActivity())
                      .focusOn(btnTwitterLogin)
                      .title("Etc etc")
                      .focusShape(FocusShape.ROUNDED_RECTANGLE)
                      .fitSystemWindows(true)
                      .titleSize(20, TypedValue.COMPLEX_UNIT_SP)
                      .titleStyle(0, Gravity.TOP | Gravity.CENTER_HORIZONTAL)
                      .build()
                      .show();
              sharedPrefManager.setIsLoginFragmmentAnimationsSeen(true);
          }
      }, 100);

First, in this code snippet (when i use titleStyle(...) ) fistsystemwindows(true) has no effect.

I tried to use titleGravity(..) with fitSystemWindows(true), in that case the title gets pushed outside the screen partially. I thought i could solve it by defining a style with marginTop and apply it and then the fitSystemWindows is eliminated and the button's focus is pushed upwards. :)

Any idea? Btw love the library.

Focus not working with constraint layout

Hey Faruk, I'm trying to implement your lib with dagger and constraint layout.

    @Bind(R.id.login) AppCompatButton login;

 @Override public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
   
new FancyShowCaseView.Builder(getActivity())
        .focusOn(login)
        .title("Focus on View")
        .build()
        .show();
  }

Full size of screen is in focus all the time, can not focus on button or any other view.Can you help?
Thanks

how to show in fragment ?

i checked the code it seems library is finding views from an activity only . how can i display in fragment ?

Bottom bar items are not getting focused

I used it like this:
-=-=-=-=-=-=-=-
new FancyShowCaseView.Builder(this)
.focusOn(findViewById(R.id.tab_home))
.title("Focus on View")
.focusShape(FocusShape.CIRCLE)
.build()
.show();

program

can't work well in android 7.1.1!!

Listener on complete of ShowCase Queue

Hi @faruktoptas,

It would be great if you can provide listener on complete of ShowCase Queue like below:

`FancyShowCaseQueue fq = new FancyShowCaseQueue()
.add(fancyShowCaseView1)
.add(fancyShowCaseView2)
.add(fancyShowCaseView3)
.add(fancyShowCaseView4)
.show();

    fq.setOnCompleteListener(new OnCompleteListener() {
        @Override
        public void onComplete() {
            //Queue completed
        }
    });`

TabLayout custom view focus

Hi, I have a tab alyout with custom view

<ImageView
    android:id="@+id/notification_tab_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/selector_tab_notifications"
    xmlns:android="http://schemas.android.com/apk/res/android" />

My drawable/selector_tab_notifications looks like:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_selected="true" android:drawable="@drawable/ic_ac_tab_notif_select"/>
    <item android:drawable="@drawable/ic_ac_tab_notif"/>
</selector>

I'm trying to use:

new FancyShowCaseView.Builder(this)
                .focusOn(toolbarTabLayout.getTabAt(1).getCustomView())
                .title("Focus text")
                .build()
                .show();
new FancyShowCaseView.Builder(this)             
            .focusOn((ImageView)toolbarTabLayout.getTabAt(1).getCustomView().findViewById(R.id.notification_tab_view))
                .title("Focus text")
                .build()
                .show();

and nothing works. Is there a solution to this problem?

Add abort/cancel method to FancyShowCaseQueue

I used to call FancyShowCaseView.hideCurrent(activity) to hide a whole FancyShowCaseQueue of an Activity.
This doesn't seem to work anymore as it only closes the currently displayed FancyShowCaseView inside the Queue.

Is the current behavior a bug or intended? If it's intended, i think FancyShowCaseQueue should also
have a hideCurrent Method. Or is there already a way to accomplish that?

Adding new shapes

What do you think about adding new shapes besides circle and rounded rectangle? The code reads as though rounded rectangle was added as an afterthought. Thinking about generalizing the code and supporting a couple more shapes (elipse, rectangle).

Can't get right focus height with focusRectAtPosition()

I'm setting the view using .focusRectAtPosition() and get focus height multiplied by 2.

 // Calculate position
        val centerY = onScreenY + cityNameTV.height / 2
        val centerX = cityNameTV.left + cityNameTV.width / 2
        val width = activity.getScreenWidth()
        val height = resources.getDimensionPixelSize(R.dimen.city_showcase_height)

        // Create showcase
        FancyShowCaseView.Builder(activity)
                .backgroundColor(ContextCompat.getColor(context, R.color.showcase))
                .focusShape(FocusShape.ROUNDED_RECTANGLE)
                .focusRectAtPosition(centerX, centerY, width, height)
                .roundRectRadius(1) // Almost 0 :)
                .disableFocusAnimation()
                .customView(R.layout.layout_showcase_city) {
                    it.button.setOnClickListener { cityShowcase.hide() }
                }
                .closeOnTouch(false)
                .exitAnimation(AnimationUtils.loadAnimation(context, R.anim.fscv_fade_out).apply {
                    setAnimationListener(object : Animation.AnimationListener {
                        override fun onAnimationEnd(animation: Animation?) {
                            cityShowcase.removeView()
                        }

                        override fun onAnimationRepeat(animation: Animation?) {}
                        override fun onAnimationStart(animation: Animation?) {}
                    })
                })
                .build()

Height is from dimensions:

<dimen name="city_showcase_height">12dp</dimen>

And I get the visual height of focus exactly as the status bar (24dp).
Could you please help with this?

Out of memory issue on createBitmap

Recenlty i started facing OOM issue on android 6.0.0 on createBitmap, did someone else face the same issue.
i have used RGB_565 in place of ARGB_888 to reduce the memory usage.

mCalculator = new Calculator(mActivity, mFocusShape, mView, mFocusCircleRadiusFactor, mFitSystemWindows); Bitmap bitmap = Bitmap.createBitmap(mCalculator.getBitmapWidth(), mCalculator.getBitmapHeight(), Bitmap.Config.RGB_565); bitmap.eraseColor(mBackgroundColor);

FancyShowCaseView.Builder.build() method performance

First of all, thanks for this awesome library. Here is a small performance enhancement request. The builder should check whether it has been shown before if showOnce flag is set and do thing if it has been shown before. No need to continue building the view in this case. Thanks.

Chaining show case views

Is this possible? There is no listener for on showcase closed (only for the animation).

Would be nice to have at least a callback which can be setup via the builder

Action bar items are not getting focused

Action bar items are only getting focused if I call them inside onOptionsItemSelected() as per given sample program. But if I initialize the menu item view and then show casing it, show case focus is not getting visible / remains unfocused. Any way to fix it?

Reset showOnce

It would be nice to support resetting of the showOnce flag, indiviually and all at once

Updating README.md

  • Explain all Builder parameters in README.md
  • Add more examples with screenshots

Graphics problem when rotating screen

Thank you for this amazing repository!
I've noticed some problem after rotating screen:

  • wrong background
  • wrong circle position
    How can I fix it?
    Cheers!

Looping with custom animation

Hello! The library is great, but there is an error. I want to set your fade animation for every api version. I use this code to create an animation:
Animation animationOut = AnimationUtils.loadAnimation(this, R.anim.fscv_fade_out);
And then in the builder:
.exitAnimation(animationOut)

Now, if I tap the show case view, it appears again and again

Skip button

Hello there,
thank you for this amazing library!
I wonder if it is possible to add a skip button in order to close all the further FancyShowCaseView.
Can you suggest me how can I reach that?
Cheers!

Overlapping focus view and title

I think it would make sense to add some logic to avoid this...

The text should be placed in the biggest remaining space on the screen by default imho...

Flag to disable Focus animation

The animation on the focus is nice, but probably more often than not, i don't want that and have
a static focus instead.
A flag to disable it on the Builder would be nice.

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.