package me.toptas.fancyshowcasesample;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import me.toptas.fancyshowcase.FancyShowCaseView;

public class SecondActivity extends BaseActivity {

    @BindView(R.id.button1)
    Button mButton;

    @BindView(R.id.toolbar)
    android.support.v7.widget.Toolbar mToolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_second);
        ButterKnife.bind(this);
        setSupportActionBar(mToolbar);

        focusOnButton();
    }

    /**
     * Focus on a view
     */
    @OnClick(R.id.button1)
    public void focus() {
        if (!isFinishing()) {
            focusOnButton();
        }
    }

    private void focusOnButton() {
        new FancyShowCaseView.Builder(SecondActivity.this)
                .focusOn(mButton)
                .title("Focus a view")
                .fitSystemWindows(true)
                .build()
                .show();
    }

    /**
     * Toggle toolbar visibility
     */
    @OnClick(R.id.button2)
    public void toggleToolbar() {
        if (mToolbar.getVisibility() == View.VISIBLE) {
            mToolbar.setVisibility(View.GONE);
        } else {
            mToolbar.setVisibility(View.VISIBLE);
        }
    }
}

@@ -59,16 +59,72 @@
 Bundle;%0A
+import android.view.Menu;%0Aimport android.view.MenuItem;%0A
 import a
@@ -1487,10 +1487,685 @@
 %7D%0A    %7D%0A
+%0A%0A    @Override%0A    public boolean onCreateOptionsMenu(Menu menu) %7B%0A        getMenuInflater().inflate(R.menu.menu_main, menu);%0A        return super.onCreateOptionsMenu(menu);%0A    %7D%0A%0A%0A    /**%0A     * Shows a FancyShowCaseView that focuses to ActionBar items%0A     *%0A     * @param item actionbar item to focus%0A     * @return true%0A     */%0A    @Override%0A    public boolean onOptionsItemSelected(MenuItem item) %7B%0A        new FancyShowCaseView.Builder(this)%0A                .focusOn(findViewById(item.getItemId()))%0A                .title(%22Focus on Actionbar items%22)%0A                .fitSystemWindows(true)%0A                .build()%0A                .show();%0A        return true;%0A    %7D%0A
 %7D%0A

Add sample for ToolBar menu items