android.widget.Magnifier Java Examples

The following examples show how to use android.widget.Magnifier. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PolygonView.java    From AndroidDocumentScanner with MIT License 5 votes vote down vote up
private void init() {
    polygonView = this;
    pointer1 = getImageView(0, 0);
    pointer2 = getImageView(getWidth(), 0);
    pointer3 = getImageView(0, getHeight());
    pointer4 = getImageView(getWidth(), getHeight());
    midPointer13 = getImageView(0, getHeight() / 2);
    midPointer13.setOnTouchListener(new MidPointTouchListenerImpl(pointer1, pointer3));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
        magnifier = new Magnifier(polygonView);
    midPointer12 = getImageView(0, getWidth() / 2);
    midPointer12.setOnTouchListener(new MidPointTouchListenerImpl(pointer1, pointer2));

    midPointer34 = getImageView(0, getHeight() / 2);
    midPointer34.setOnTouchListener(new MidPointTouchListenerImpl(pointer3, pointer4));

    midPointer24 = getImageView(0, getHeight() / 2);
    midPointer24.setOnTouchListener(new MidPointTouchListenerImpl(pointer2, pointer4));

    addView(pointer1);
    addView(pointer2);
    addView(midPointer13);
    addView(midPointer12);
    addView(midPointer34);
    addView(midPointer24);
    addView(pointer3);
    addView(pointer4);
    initPaint();
}