我正在尝试对布局实现选框效果,以帮助它从右侧内侧向左侧内侧滚动/动画,就像自动收报机视图一样.
从以下两个链接中,您可以获得更多知识,就像股票市场通过以循环常量方式显示值来更新用户一样.
1)http://www.sify.com/finance/livemarkets/
2)http://terminal.moneycontrol.com/index.php?wl=indices
为此,我已经实现了下面的代码,使其有些类似.
public class HorizonalSlideActivity extends Activity
{
private LinearLayout horizontalOuterLayout;
private HorizontalScrollView horizontalScrollview;
private int scrollMax;
private int scrollPos = 0;
private TimerTask scrollerSchedule;
private Timer scrollTimer = null;
private ScrollAdapter adapter = null;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.horizontal_layout);
adapter = new ScrollAdapter(HorizonalSlideActivity.this);
horizontalScrollview = (HorizontalScrollView) findViewById(R.id.horiztonal_scrollview_id);
horizontalScrollview.setOnTouchListener(new OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
return false;
}
});
horizontalOuterLayout = (LinearLayout) findViewById(R.id.horiztonal_outer_layout_id);
horizontalTextView = (TextView) findViewById(R.id.horizontal_textview_id);
horizontalScrollview.setHorizontalScrollBarEnabled(false); …Run Code Online (Sandbox Code Playgroud) android marquee horizontalscrollview android-animation android-linearlayout
mMediaRecorder = new MediaRecorder();
// Step 1: Unlock and set camera to MediaRecorder
mCamera.unlock();
mMediaRecorder.setCamera(mCamera);
// Step 2: Set sources
// activate this for recording with sound\
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mMediaRecorder.setVideoSize(getMaxSupportedVideoSize().width,getMaxSupportedVideoSize().height);
mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
// Step 4: Set output file
mMediaRecorder.setOutputFile(getOutputMediaFile("movie"));
// Step 4: Set output file
mMediaRecorder.setOutputFile(getOutputMediaFile("movie"));
// Step 5: Set the preview output
mMediaRecorder.setPreviewDisplay(mPreview.getHolder().getSurface());
mMediaRecorder.setOrientationHint(90);
Run Code Online (Sandbox Code Playgroud)
以上代码工作正常但是,视频的质量与我在本机安卓摄像头拍摄的视频不一样,我使用媒体录像机录制的视频质量较差,与原生录像机相比,我怎样才能提高视频质量.
如果有人知道帮助我.谢谢