package com.codigoparallevar.minicards; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; public class TestActivity extends AppCompatActivity { PartCanvasView partCanvasView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Hide action bar ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.hide(); } // Use controled canvas setContentView(R.layout.activity_test); partCanvasView = (PartCanvasView) findViewById(R.id.canvasView); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); } }); } @Override public boolean onTouchEvent(MotionEvent event) { return partCanvasView.onTouchEvent(event); } }