• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2006 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package android.view;
18 
19 import com.android.layoutlib.bridge.MockView;
20 
21 import android.content.Context;
22 import android.graphics.Canvas;
23 import android.graphics.Rect;
24 import android.util.AttributeSet;
25 
26 /**
27  * Mock version of the SurfaceView.
28  * Only non override public methods from the real SurfaceView have been added in there.
29  * Methods that take an unknown class as parameter or as return object, have been removed for now.
30  *
31  * TODO: generate automatically.
32  *
33  */
34 public class SurfaceView extends MockView {
35 
SurfaceView(Context context)36     public SurfaceView(Context context) {
37         this(context, null);
38     }
39 
SurfaceView(Context context, AttributeSet attrs)40     public SurfaceView(Context context, AttributeSet attrs) {
41         this(context, attrs , 0);
42     }
43 
SurfaceView(Context context, AttributeSet attrs, int defStyle)44     public SurfaceView(Context context, AttributeSet attrs, int defStyle) {
45         super(context, attrs, defStyle);
46     }
47 
getHolder()48     public SurfaceHolder getHolder() {
49         return mSurfaceHolder;
50     }
51 
52     private SurfaceHolder mSurfaceHolder = new SurfaceHolder() {
53 
54         public boolean isCreating() {
55             return false;
56         }
57 
58         public void addCallback(Callback callback) {
59         }
60 
61         public void removeCallback(Callback callback) {
62         }
63 
64         public void setFixedSize(int width, int height) {
65         }
66 
67         public void setSizeFromLayout() {
68         }
69 
70         public void setFormat(int format) {
71         }
72 
73         public void setType(int type) {
74         }
75 
76         public void setKeepScreenOn(boolean screenOn) {
77         }
78 
79         public Canvas lockCanvas() {
80             return null;
81         }
82 
83         public Canvas lockCanvas(Rect dirty) {
84             return null;
85         }
86 
87         public void unlockCanvasAndPost(Canvas canvas) {
88         }
89 
90         public Surface getSurface() {
91             return null;
92         }
93 
94         public Rect getSurfaceFrame() {
95             return null;
96         }
97     };
98 }
99 
100