Giter Club home page Giter Club logo

andcoachmark's Introduction

Build Status codecov SIT

Is a library that provides a highly customizable CoachmarkView

Demo

Features

  • The Description Text is rendered dynamically on top or bottom.
  • The ActionDescriptionText (Text with arrow to the circle) is rendered dynamically left/top/bottom/right with this priority.
  • Both views can be customized - the library takes inflated views as parameters.
  • Above described rendering strategy can be replaced by your own implementations or the priority of the available strategies can be changed.
  • Decide how the button that closes the coachmark should appear (cancel/ok on right side, ok button below description, no button just click to dismiss). It's also possible to write your own rendering.
  • All colors and texts can be changed when setting up the Coachmark with the provided Builder.
  • Decide how the CoachmarkView should appear (NoAnimation or Animation that animates the circle around the clicked view getting smaller until it reaches the clicked view). It's also possible to write your own startup animation.

Implementation

  1. Add it in your root build.gradle at the end of repositories:

    allprojects {
       repositories {
       	...
       	maven { url 'https://jitpack.io' }
       }
    }
    
  2. Add gradle dependency

    compile 'com.github.Kaufland:andcoachmark:1.2.9'
    
  3. Configure Coachmark

    LayoutInflater mInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
            
    View actionDescription = mInflater.inflate(R.layout.test_action_description, null);
    View description = mInflater.inflate(R.layout.test_description, null);
    
    OkAndCancelAtRightCornerButtonRenderer buttonRenderer = new OkAndCancelAtRightCornerButtonRenderer.Builder(this)
         	.withCancelButton("Cancel", new CoachmarkClickListener() {
                	@Override
                    	public boolean onClicked() {
                        	Toast.makeText(MainActivity.this, "Cancel", Toast.LENGTH_LONG).show();
                        	//return true to dismiss the coachmark
                        	return true;
                    	}
                	})
          	.withOkButton("OK", new CoachmarkClickListener() {
                    	@Override
                    	public boolean onClicked() {
                        	Toast.makeText(MainActivity.this, "OK", Toast.LENGTH_LONG).show();
                        	//return true to dismiss the coachmark
                    	}
                	})
          	.build();
    
    new CoachmarkViewBuilder(MainActivity.this)
    .withAnimationRenderer(new ConcentricCircleAnimationRenderer.Builder().withDuration(500).build())
    	.withActionDescription(actionDescription)
    	.withDescription(description)
    	.withButtonRenderer(buttonRenderer)
    	.buildAroundView(clickedView).show();

andcoachmark's People

Contributors

sbra0902 avatar vkost1505 avatar thaberkern avatar mpradzin avatar

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.