Search in sources :

Example 1 with FreehandView

use of com.davemorrissey.labs.subscaleview.sample.extension.views.FreehandView in project subsampling-scale-image-view by davemorrissey.

the class ExtensionFreehandFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(layout.extension_freehand_fragment, container, false);
    rootView.findViewById(id.previous).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            ((ExtensionActivity) getActivity()).previous();
        }
    });
    final FreehandView imageView = (FreehandView) rootView.findViewById(id.imageView);
    imageView.setImage(ImageSource.asset("squirrel.jpg"));
    rootView.findViewById(id.reset).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            imageView.reset();
        }
    });
    return rootView;
}
Also used : OnClickListener(android.view.View.OnClickListener) FreehandView(com.davemorrissey.labs.subscaleview.sample.extension.views.FreehandView) View(android.view.View) FreehandView(com.davemorrissey.labs.subscaleview.sample.extension.views.FreehandView)

Aggregations

View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 FreehandView (com.davemorrissey.labs.subscaleview.sample.extension.views.FreehandView)1