Giter Site home page Giter Site logo

orimboolak / showcaseview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mreram/showcaseview

0.0 1.0 0.0 4.93 MB

:flashlight:The ShowcaseView library is designed to highlight and showcase specific parts of apps to the user with an attractive and flat overlay.

License: Apache License 2.0

Java 100.00%

showcaseview's Introduction

🔦ShowCaseView🔦

APK API Android Arsenal awesome-android

How to use:question:

Sample usage in your activity:

 new GuideView.Builder(this)
         .setTitle("Guide Title Text")
         .setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
         .setGravity(Gravity.auto) //optional
         .setDismissType(DismissType.anywhere) //optional - default DismissType.targetView
         .setTargetView(view)
         .setContentTextSize(12)//optional
         .setTitleTextSize(14)//optional
         .build()
         .show();

Installation

maven:

<repositories>
   <repository>
     <id>jitpack.io</id>
     <url>https://jitpack.io</url>
   </repository>
</repositories>
Step 2. Add the dependency
<dependency>
    <groupId>com.github.mreram</groupId>
    <artifactId>showcaseview</artifactId>
    <version>1.1</version>
</dependency>

gradle:

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

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}
Step 2. Add the dependency
implementation 'com.github.mreram:showcaseview:1.1'

Change type face

 new GuideView.Builder(this)
            .setTitle("Guide Title Text")
            .setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
            .setTargetView(view)
            .setContentTypeFace(Typeface)//optional
            .setTitleTypeFace(Typeface)//optional
            .setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
            .build()
            .show();

Change title and Content text size

new GuideView.Builder(this)
            .setTitle("Guide Title Text")
            .setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
            .setTargetView(view)
            .setContentTextSize(12)//optional
            .setTitleTextSize(14)//optional
	    .setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
            .build()
            .show();

Change Gravity

new GuideView.Builder(this)
         .setTitle("Guide Title Text")
         .setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
         .setGravity(Gravity.CENTER)//optional
         .setTargetView(view) 
         .setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
         .build()
         .show();

use Spannable for Content

 new GuideView.Builder(this)
            .setTitle("Guide Title Text")
            .setTargetView(view)
            .setContentSpan((Spannable) Html.fromHtml("<font color='red'>testing spannable</p>"))
            .setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
            .build()
            .show();

Set Listener

  new GuideView.Builder(MainActivity.this)
                  .setTitle("Guide Title Text")
                  .setContentText("Guide Description Text\n .....Guide Description Text\n .....Guide Description Text .....")
                  .setGravity(Gravity.CENTER)
                  .setTargetView(view1)
	          .setDismissType(DismissType.outSide) //optional - default dismissible by TargetView
                  .setGuideListener(new GuideListener() {
                      @Override
                      public void onDismiss(View view) {
                         //TODO ...
                      }
                   })
                   .build()
                   .show();

DismissType Attribute

Type Description
outside Dismissing with click on outside of MessageView
anywhere Dismissing with click on anywhere
targetView Dismissing with click on targetView(targetView is assigned with setTargetView method)

Contribution 💥

Pull requests are welcome! 👏

You can improve/fix some part of it .

Add Tests:

Assuming that the code in question already has automated (unit) tests, do add tests for the code you submit. This isn't a hard rule. There are various cases where you may need to add code without test coverage (e.g. when adding a Object), but if it can be tested, it should be tested.

License

   Copyright 2018 Mohammad Reza Eram

   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.
   
   

showcaseview's People

Contributors

mreram avatar

Watchers

 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.