Methods Summary |
---|
private void | displayAudioInfo()
if (null != mAudioInfoView) {
mAudioInfoView.setVisibility(View.VISIBLE);
}
|
private void | hideAudioInfo()
if (null != mAudioInfoView) {
mAudioInfoView.setVisibility(View.GONE);
}
|
private void | initAudioInfoView(java.lang.String name)
if (null == mAudioInfoView) {
LayoutInflater factory = LayoutInflater.from(getContext());
mAudioInfoView = factory.inflate(R.layout.playing_audio_info, null);
int height = mAudioInfoView.getHeight();
TextView audioName = (TextView) mAudioInfoView.findViewById(R.id.name);
audioName.setText(name);
addView(mAudioInfoView, new LayoutParams(
LayoutParams.FILL_PARENT, AUDIO_INFO_HEIGHT,
0, getHeight() - AUDIO_INFO_HEIGHT));
if (DEBUG) {
mAudioInfoView.setBackgroundColor(0xFFFF0000);
}
}
mAudioInfoView.setVisibility(View.GONE);
|
protected void | onSizeChanged(int w, int h, int oldw, int oldh)
super.onSizeChanged(w, h, oldw, oldh);
if (mSizeChangedListener != null) {
if (LOCAL_LOGV) {
Log.v(TAG, "new size=" + w + "x" + h);
}
mSizeChangedListener.onSizeChanged(w, h - AUDIO_INFO_HEIGHT);
}
|
public void | pauseAudio()
if ((mAudioPlayer != null) && mIsPrepared) {
if (mAudioPlayer.isPlaying()) {
mAudioPlayer.pause();
}
}
mStartWhenPrepared = false;
|
public void | pauseVideo()
if (mVideoView != null) {
if (LOCAL_LOGV) {
Log.v(TAG, "Pausing video playback.");
}
mVideoView.pause();
}
|
public void | reset()
if (null != mScrollText) {
mScrollText.setVisibility(View.GONE);
}
if (null != mImageView) {
mImageView.setVisibility(View.GONE);
}
if (null != mAudioPlayer) {
stopAudio();
}
if (null != mVideoView) {
stopVideo();
mVideoView.setVisibility(View.GONE);
}
|
public void | seekAudio(int seekTo)
if ((mAudioPlayer != null) && mIsPrepared) {
mAudioPlayer.seekTo(seekTo);
} else {
mSeekWhenPrepared = seekTo;
}
|
public void | seekVideo(int seekTo)
if (mVideoView != null) {
if (seekTo > 0) {
if (LOCAL_LOGV) {
Log.v(TAG, "Seeking video playback to " + seekTo);
}
mVideoView.seekTo(seekTo);
}
}
|
public void | setAudio(android.net.Uri audio, java.lang.String name, java.util.Map extras)
if (audio == null) {
throw new IllegalArgumentException("Audio URI may not be null.");
}
if (LOCAL_LOGV) {
Log.v(TAG, "Changing audio source to " + audio);
}
if (mAudioPlayer != null) {
mAudioPlayer.reset();
mAudioPlayer.release();
mAudioPlayer = null;
}
mIsPrepared = false;
try {
mAudioPlayer = new MediaPlayer();
mAudioPlayer.setOnPreparedListener(mPreparedListener);
mAudioPlayer.setDataSource(mContext, audio);
mAudioPlayer.prepareAsync();
} catch (IOException e) {
Log.e(TAG, "Unexpected IOException.", e);
mAudioPlayer.release();
mAudioPlayer = null;
}
initAudioInfoView(name);
|
public void | setImage(java.lang.String name, android.graphics.Bitmap bitmap)
if (mImageView == null) {
mImageView = new ImageView(mContext);
addView(mImageView, new LayoutParams(
0, 0, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
if (DEBUG) {
mImageView.setBackgroundColor(0xFFFF0000);
}
}
if (null == bitmap) {
bitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.ic_missing_thumbnail_picture);
}
mImageView.setImageBitmap(bitmap);
|
public void | setImageRegion(int left, int top, int width, int height)
if (mImageView != null) {
mImageView.setLayoutParams(new LayoutParams(width, height, left, top));
}
|
public void | setImageRegionFit(java.lang.String fit)
// TODO Auto-generated method stub
|
public void | setImageVisibility(boolean visible)
if (mImageView != null) {
mImageView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
}
|
public void | setOnSizeChangedListener(OnSizeChangedListener l)
mSizeChangedListener = l;
|
public void | setText(java.lang.String name, java.lang.String text)
if (null == mScrollText) {
mScrollText = new ScrollView(mContext);
mScrollText.setScrollBarStyle(SCROLLBARS_OUTSIDE_INSET);
addView(mScrollText, new LayoutParams(
0, 0, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
if (DEBUG) {
mScrollText.setBackgroundColor(0xFF00FF00);
}
}
if (null == mTextView) {
mTextView = new TextView(mContext);
mTextView.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
mScrollText.addView(mTextView);
}
mScrollText.requestFocus();
mTextView.setText(text);
|
public void | setTextRegion(int left, int top, int width, int height)
if (mScrollText != null) {
mScrollText.setLayoutParams(new LayoutParams(width, height, left, top));
}
|
public void | setTextVisibility(boolean visible)
if (mScrollText != null) {
mScrollText.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
}
|
public void | setVideo(java.lang.String name, android.net.Uri video)
if (mVideoView == null) {
mVideoView = new VideoView(mContext);
addView(mVideoView, new LayoutParams(
0, 0, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
if (DEBUG) {
mVideoView.setBackgroundColor(0xFFFF0000);
}
}
if (LOCAL_LOGV) {
Log.v(TAG, "Changing video source to " + video);
}
mVideoView.setVideoURI(video);
|
public void | setVideoRegion(int left, int top, int width, int height)
if (mVideoView != null) {
mVideoView.setLayoutParams(new LayoutParams(width, height, left, top));
}
|
public void | setVideoVisibility(boolean visible)
if (mVideoView != null) {
mVideoView.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
}
|
public void | setVisibility(boolean visible)
// TODO Auto-generated method stub
|
public void | startAudio()
if ((mAudioPlayer != null) && mIsPrepared) {
mAudioPlayer.start();
mStartWhenPrepared = false;
displayAudioInfo();
} else {
mStartWhenPrepared = true;
}
|
public void | startVideo()
if (mVideoView != null) {
if (LOCAL_LOGV) {
Log.v(TAG, "Starting video playback.");
}
mVideoView.start();
}
|
public void | stopAudio()
if ((mAudioPlayer != null) && mIsPrepared) {
mAudioPlayer.stop();
mAudioPlayer.release();
mAudioPlayer = null;
hideAudioInfo();
} else {
mStopWhenPrepared = true;
}
|
public void | stopVideo()
if ((mVideoView != null)) {
if (LOCAL_LOGV) {
Log.v(TAG, "Stopping video playback.");
}
mVideoView.stopPlayback();
}
|