title: How to make my canvas scrollable
body: <p>I draw with the code below a algorithm. But how can I make it scrollable (vertical and horizontal)?
  The Problem is, that in portrait mode the drawing goes outside the display, but when I make it smaller the user cant read the text anymore.</p>
  
  <pre><code>public class legende extends View {
  
      private Paint paint;
      private RectF einstiegRectF;
      private RectF massnahmenRectF;
      Path arrowPath;
  
      public legende(Context context) {
          super(context);
          init();
      }
  
      public void init(){
          paint = new Paint();
          einstiegRectF =  new RectF(20, 20, 820, 220);
          arrowPath = new Path();
          massnahmenRectF = new RectF(20, 320, 820, 420);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
          super.onDraw(canvas);
  
          paint.setStyle(Paint.Style.FILL);
          paint.setColor(Color.WHITE);
          canvas.drawPaint(paint);
  
          paint.setColor(Color.parseColor("#ccd2ec"));
          paint.setStyle(Paint.Style.FILL);
          canvas.drawOval(einstiegRectF, paint);
  
          paint.setColor(Color.BLACK);
          paint.setStyle(Paint.Style.STROKE);
          canvas.drawOval(einstiegRectF, paint);
  
          paint.setTextSize(35);
          canvas.drawText("Einstiegsbedingungen / Fortsetzung von ...", 100, 130, paint);
  
          paint.setStrokeWidth(8);
          canvas.drawLine(420, 220, 420, 300, paint);
  
          arrowPath.moveTo(420, 300);
          arrowPath.lineTo(430, 300);
          arrowPath.lineTo(420, 310);
          arrowPath.lineTo(410, 300);
          arrowPath.close();
          canvas.drawPath(arrowPath, paint);
  
          paint.setStrokeWidth(4);
          paint.setColor(Color.BLACK);
          paint.setStyle(Paint.Style.STROKE);
          canvas.drawRect(massnahmenRectF, paint);
  
          paint.setStrokeWidth(0);
          canvas.drawText("Maßnahme", 350, 382, paint);
  
          paint.setStrokeWidth(4);
          Path rectArrow = new Path();
          rectArrow.moveTo(840, 370);
          rectArrow.lineTo(940, 320);
          rectArrow.lineTo(1240, 320);
          rectArrow.lineTo(1240, 420);
          rectArrow.lineTo(940, 420);
          rectArrow.close();
          canvas.drawPath(rectArrow, paint);
      }
  }
  </code></pre>