How to use Guide view in android?

In this article we discuss about the use of guide view in android application.

Introduction

Guide view is used to guide the user for how to use a particular application or functionality of application.it helps the user to understand the functionality.

How to use Guide view in android_1

Steps for using guide view:

Step 1: Add dependency

implementation 'com.github.mreram:showcaseview:1.4.0'

Step 2: Add this in your root build.gradle at the end of repositories:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Step 3 : Add this when you want to show guide view :

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();
  • If you want to add listener on guide view then add like this:
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();
  • If you want to change title and content text size the add this :
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();

For the reference you can use this :

https://github.com/mreram/ShowCaseView

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe

Select Categories