Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public class ClippingActivity extends Activity {
  2.  
  3. @Override
  4. protected void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6. setContentView(new ClippingView(this));
  7. }
  8. }
  9.  
  10. class ClippingView extends View {
  11.  
  12. Rect r = new Rect();
  13.  
  14. public ClippingView(Context context) {
  15. super(context);
  16. }
  17.  
  18. @Override
  19. protected void onDraw(Canvas canvas) {
  20. canvas.getClipBounds(r);
  21. Log.d("ClippingView","onDraw: " + r);
  22. }
  23.  
  24. @Override
  25. public boolean onTouchEvent(MotionEvent event) {
  26. invalidate(0,0,400,400);
  27. return true;
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement