I have a MtxVideoView class which contains textview and surfaceview. The MtxVideoView class extends FrameLayout. I want to change size of MtxVideoView . How can do that ?
Following the code of special view
public class MtxVideoView extends FrameLayout implements SurfaceHolder.Callback, MediaPlayer.OnPreparedListener,
VideoControllerView.MediaPlayerControl, MediaPlayer.OnErrorListener {
private Context mContext;
private SurfaceHolder mSurfaceHolder;
private SurfaceView mSurfaceView;
private MediaPlayer mPlayer;
private VideoControllerView controller;
private TextView mMessage;
private boolean mbSrcAvailable = false;
private boolean mbSurfaceCreated = false;
private String mSource = "";
private String mUserName = "";
private String mPassword = "";
private boolean mbFullscreen = false;
private FullScreenListener mFullScreenListener;
private int mCount = 0;
static interface FullScreenListener {
void onFullScreen( View view, boolean bFullScreen);
}
public void setFullScreenListener( FullScreenListener listener ){
mFullScreenListener = listener;
}
public MtxVideoView(Context context) {
super(context);
mContext = context;
mbFullscreen = false;
Init();
}
public MtxVideoView(Context context, AttributeSet attrs) {
super(context, attrs);
mContext = context;
Init();
}
public MtxVideoView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
mContext = context;
Init();
}
private void Init(){
mSurfaceView = new SurfaceView(mContext);
mSurfaceView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT ));
addView(mSurfaceView);
mMessage = new TextView(mContext);
mMessage.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT ));
mMessage.setGravity(Gravity.CENTER);
mMessage.setTextColor(Color.WHITE);
this.addView(mMessage);
mSurfaceHolder = mSurfaceView.getHolder();
mSurfaceHolder.addCallback(this);
}
}