1 package com.xtremelabs.robolectric.shadows; 2 3 import android.graphics.Canvas; 4 import android.graphics.Rect; 5 import android.view.Surface; 6 import android.view.SurfaceHolder; 7 import android.view.SurfaceView; 8 import com.xtremelabs.robolectric.internal.Implementation; 9 import com.xtremelabs.robolectric.internal.Implements; 10 11 @Implements(SurfaceView.class) 12 @SuppressWarnings({"UnusedDeclaration"}) 13 public class ShadowSurfaceView extends ShadowView { 14 @Implementation getHolder()15 public SurfaceHolder getHolder() { 16 return new SurfaceHolder() { 17 @Override public void addCallback(Callback callback) { 18 } 19 20 @Override public void removeCallback(Callback callback) { 21 } 22 23 @Override public boolean isCreating() { 24 return false; 25 } 26 27 @Override public void setType(int i) { 28 } 29 30 @Override public void setFixedSize(int i, int i1) { 31 } 32 33 @Override public void setSizeFromLayout() { 34 } 35 36 @Override public void setFormat(int i) { 37 } 38 39 @Override public void setKeepScreenOn(boolean b) { 40 } 41 42 @Override public Canvas lockCanvas() { 43 return null; 44 } 45 46 @Override public Canvas lockCanvas(Rect rect) { 47 return null; 48 } 49 50 @Override public void unlockCanvasAndPost(Canvas canvas) { 51 } 52 53 @Override public Rect getSurfaceFrame() { 54 return null; 55 } 56 57 @Override public Surface getSurface() { 58 return null; 59 } 60 }; 61 } 62 } 63