Created
November 13, 2014 19:39
-
-
Save akira-sasaki/7221a690eb542001a3ad to your computer and use it in GitHub Desktop.
Preview.java( MyCamera )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package gclue.com.camera; | |
import android.content.Context; | |
import android.util.Log; | |
import android.view.SurfaceHolder; | |
import android.view.SurfaceView; | |
class Preview extends SurfaceView implements SurfaceHolder.Callback { | |
private static final String TAG = "MyCamera"; | |
Preview(Context context) { | |
super(context); | |
getHolder().addCallback(this); | |
getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); | |
} | |
@Override | |
protected void onLayout(boolean changed, int l, int t, int r, int b) { | |
Log.d(TAG, "onLayout l:"+l+"t:"+t+"r:"+r+"b:"+b); | |
} | |
@Override | |
public void surfaceCreated(SurfaceHolder holder) { | |
Log.d(TAG, "surfaceCreated"); | |
} | |
@Override | |
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { | |
Log.d(TAG, "surfaceChanged format:"+format+"width:"+width+"height:"+height); | |
} | |
@Override | |
public void surfaceDestroyed(SurfaceHolder holder) { | |
Log.d(TAG, "surfaceDestroyed"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment