0

I have a question that is basically the same as this one: Zoom Content in a RelativeLayout

By using dispatchDraw(Canvas canvas) I can scale ZoomableRelativeLayout, but when I click on the zoomed-in view, the childViews are not scaling with their parent(RelativeLayout), so an old OnClickListener (for a character on the keyboard) gets called every time.

In the blog above someone suggested transformation or a matrix will be a better way to go. Could you guys help me?

Community
  • 1
  • 1
Yuqiu G.
  • 348
  • 4
  • 7

1 Answers1

0

all you need are following methods

public float getTranslatedCoordinates(){

    pointTranslatedX =
           // Math.abs(
            (pointSelectedX - mPivotX ) / scaleFactor + mPivotX
            //)
            ;
    // is not important if our scaleFactor is 3
    // pointTranslatedY = (pointSelectedY - mPivotY ) * scaleFactor + mPivotY;

    Log.e("getTranslatedC", this.toString());
    return pointTranslatedX;
}

getStartMargin() and getKeySelected().

What this question is also about the design from the beginning. Instead of click to zoom onto a part of the QWERTY-Keyboard right where the keyboard is (on a smartWatch screen), you can also display a row above or below the (main) QWERTY-Keyboard. This will improve the usability enormously!

Yuqiu G.
  • 348
  • 4
  • 7