Skip to content

2. Customized Usage

Faruk Toptaş edited this page Jun 14, 2019 · 3 revisions

Change title font size

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Change title font size")
    .titleSize(14, TypedValue.COMPLEX_UNIT_SP)
    .build()
    .show();

Change title style and position

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Change title style and position")
    .titleStyle(R.style.MyTitleStyle, Gravity.TOP | Gravity.CENTER)
    .build()
    .show();
<style name="MyTitleStyle" parent="@android:style/Widget.TextView">
    <item name="android:textSize">20sp</item>
    <item name="android:paddingTop">50dp</item>
    <item name="android:layout_marginTop">50dp</item>
    <item name="android:textColor">#00ff00</item>
    <item name="android:fontFamily">sans-serif-condensed</item>
</style>

Use spanned title

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title(spannedString)
    .build()
    .show();

Add border to focus shape

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Add border to focus shape")
    .focusBorderColor(Color.GREEN)
    .focusBorderSize(10)
    .build()
    .show();

Change focus circle radius value

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .focusCircleRadiusFactor(1.5)
    .title("Focus on a View with larger circle")
    .build()
    .show();

Change background color

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Change background color")
    .backgroundColor(Color.parseColor("#AAff0000"))
    .build()
    .show();

Dismiss/Skip listener

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Focus on View")
    .dismissListener(new DismissListener() {
        @Override
        public void onDismiss(String id) {
            // FancyShowCaseView is dismissed by user
        }

        @Override
        public void onSkipped(String id) {
            // Skipped because it was setup to shown only once and shown before
        }
    })
    .build()
    .show();

Circular focus to a specific position

new FancyShowCaseView.Builder(this)
    .title("Focus on larger view")
    .focusRectAtPosition(260, 85,  480, 80)
    .roundRectRadius(60)
    .build()
    .show();

Rounded rectangle focus to a specific position

new FancyShowCaseView.Builder(this)
    .title("Focus on larger view")
    .focusCircleAtPosition(400, 400, 100)
    .build()
    .show();

Change focus animation radius and speed

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Focus on View")
    .focusAnimationMaxValue(40) // Default max value is 20
    .focusAnimationStep(3) // Default step value is 1
    .build()
    .show();

Disable focus animation

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Focus on View")
    .disableFocusAnimation()
    .build()
    .show();

Showing only once

new FancyShowCaseView.Builder(this)
    .focusOn(view)
    .title("Focus on View")
    .showOnce("A_UNIQUE_ID")
    .build()
    .show();