title: Android (API Level 28), Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
body: <p>I am trying to add a <code>ToggleButton</code> in design mode in Android studio.</p>
  
  <p>I am targeting API Level 28 <code>targetSdkVersion 28</code></p>
  
  <p>My ToggleButton is not showing and I see that error: 
  <code>java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed</code></p>
  
  <p>Here is the <code>xml</code> of the ToggleButton</p>
  
  <pre><code> &lt;ToggleButton
              android:text="ToggleButton"
              android:layout_width="100dp"
              android:layout_height="100dp" tools:layout_editor_absoluteY="369dp"
              tools:layout_editor_absoluteX="133dp" android:id="@+id/toggleButton5" android:textOff="OFF"
              android:textOn="ON" android:textColor="@color/colorAccent" style="@style/AlertDialog.AppCompat"
              tools:text="Hello" android:typeface="normal" android:textStyle="bold" android:textAlignment="center"
      /&gt;
  </code></pre>
  
  <p>Apparently <a href="https://developer.android.com/reference/android/graphics/Canvas#clipRect(android.graphics.RectF,%20android.graphics.Region.Op)" rel="noreferrer">clipRect (RectF rect, Region.Op op)</a> was deprecated in API 26, but I am not sure what needs to be changed?</p>
  
  <p>And here is the complete stack trace:</p>
  
  <pre><code>java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
      at android.graphics.Canvas.checkValidClipOp(Canvas.java:779)
      at android.graphics.Canvas.clipRect(Canvas.java:826)
      at android.view.ViewGroup_Delegate.drawShadow(ViewGroup_Delegate.java:86)
      at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:58)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
      at android.support.constraint.ConstraintLayout.dispatchDraw(ConstraintLayout.java:2023)
      at android.view.View.draw_Original(View.java:20075)
      at android.view.View_Delegate.draw(View_Delegate.java:68)
      at android.view.View.draw(View.java:19849)
      at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4333)
      at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
      at android.view.View.draw_Original(View.java:20075)
      at android.view.View_Delegate.draw(View_Delegate.java:68)
      at android.view.View.draw(View.java:19849)
      at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4333)
      at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63)
      at android.view.ViewGroup.drawChild(ViewGroup.java:4333)
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112)
      at android.view.View.draw_Original(View.java:20210)
      at android.view.View_Delegate.draw(View_Delegate.java:56)
      at android.view.View.draw(View.java:20177)
      at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:405)
      at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:552)
      at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:426)
      at com.android.layoutlib.bridge.BridgeRenderSession.render(BridgeRenderSession.java:108)
      at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:154)
      at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:136)
      at com.android.tools.idea.rendering.RenderTask.lambda$renderInner$5(RenderTask.java:671)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  </code></pre>