Search in sources :

Example 1 with HorizontalListView

use of com.example.advanceDemo.view.HorizontalListView in project LanSoEditor_advance by LanSoSdk.

the class Demo3LayerFilterActivity method initView.

private void initView() {
    findViewById(R.id.id_filterLayer_demo_next).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mplayer != null) {
                mplayer.stop();
                mplayer.release();
                mplayer = null;
            }
            drawPadView.stopDrawPad();
            filterExecute();
        }
    });
    listFilterView = (HorizontalListView) findViewById(R.id.id_filterlayer_filterlist);
    listFilterView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            if (filterLayer != null) {
                GPUImageFilter filter = filterList.getFilter(getApplicationContext(), arg2);
                currrentFilterName = filterList.getName(arg2);
                filterLayer.switchFilterTo(filter);
            }
        }
    });
    drawPadView = (DrawPadView) findViewById(R.id.id_filterLayer_demo_view);
    skbarFilterAdjuster = (SeekBar) findViewById(R.id.id_filterLayer_demo_seek1);
    skbarFilterAdjuster.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
        }

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            if (mFilterAdjuster != null) {
                mFilterAdjuster.adjust(progress);
            }
        }
    });
    skbarFilterAdjuster.setMax(100);
    findViewById(R.id.id_filterLayer_demo_selectbtn).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            selectFilter();
        }
    });
    findViewById(R.id.id_filterdemo_saveplay).setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (SDKFileUtils.fileExist(dstPath)) {
                Intent intent = new Intent(Demo3LayerFilterActivity.this, VideoPlayerActivity.class);
                intent.putExtra("videopath", dstPath);
                startActivity(intent);
            } else {
                Toast.makeText(Demo3LayerFilterActivity.this, "目标文件不存在", Toast.LENGTH_SHORT).show();
            }
        }
    });
    findViewById(R.id.id_filterdemo_saveplay).setVisibility(View.GONE);
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) SeekBar(android.widget.SeekBar) Intent(android.content.Intent) OnSeekBarChangeListener(android.widget.SeekBar.OnSeekBarChangeListener) GLSurfaceView(android.opengl.GLSurfaceView) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) DrawPadView(com.lansosdk.videoeditor.DrawPadView) HorizontalListView(com.example.advanceDemo.view.HorizontalListView) Paint(android.graphics.Paint) GPUImageFilter(jp.co.cyberagent.lansongsdk.gpuimage.GPUImageFilter) OnClickListener(android.view.View.OnClickListener)

Aggregations

Intent (android.content.Intent)1 Paint (android.graphics.Paint)1 GLSurfaceView (android.opengl.GLSurfaceView)1 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 AdapterView (android.widget.AdapterView)1 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)1 HorizontalScrollView (android.widget.HorizontalScrollView)1 SeekBar (android.widget.SeekBar)1 OnSeekBarChangeListener (android.widget.SeekBar.OnSeekBarChangeListener)1 TextView (android.widget.TextView)1 HorizontalListView (com.example.advanceDemo.view.HorizontalListView)1 DrawPadView (com.lansosdk.videoeditor.DrawPadView)1 GPUImageFilter (jp.co.cyberagent.lansongsdk.gpuimage.GPUImageFilter)1