示例#1
0
        /// <summary>
        /// Sets the global references to UI elements and event handlers for those elements.
        /// </summary>
        private void setupViewElements()
        {
            mVideoView     = (SurfaceView)findViewById(R.id.video);
            mTitleText     = (TextView)findViewById(R.id.titleText);
            mPositionText  = (TextView)findViewById(R.id.positionText);
            mDurationText  = (TextView)findViewById(R.id.durationText);
            mSubtitlesText = (TextView)findViewById(R.id.subtitlesText);
            mSeekBar       = (SeekBar)findViewById(R.id.videoPosition);
            mPlayButton    = (ImageButton)findViewById(R.id.playPause);
            mMuteButton    = (ImageButton)findViewById(R.id.mute);
            mSeekBar.OnSeekBarChangeListener = this;
            mPlayButton.OnClickListener      = this;
            mPositionText.Text = "00:00";

            mProgressDialog                  = new ProgressDialog(this);
            mProgressDialog.Message          = "Buffering...";
            mProgressDialog.Cancelable       = true;
            mProgressDialog.OnCancelListener = new OnCancelListenerAnonymousInnerClassHelper(this);

            View stopButton = findViewById(R.id.stop);

            stopButton.OnClickListener  = this;
            mMuteButton.OnClickListener = this;

            mDevicePicker                        = (DevicePicker)FragmentManager.findFragmentById(R.id.playerPicker);
            mDevicePicker.DeviceType             = SmcDevice.TYPE_AVPLAYER;
            mDevicePicker.DeviceSelectedListener = this;
        }
示例#2
0
        public override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView                                = R.layout.main;
            mSourceDevicePicker                        = (DevicePicker)FragmentManager.findFragmentById(R.id.sourcePicker);
            mSourceDevicePicker.DeviceType             = SmcDevice.TYPE_PROVIDER;
            mSourceDevicePicker.DeviceSelectedListener = mSourceDevicePickerListener;

            mPlayerDevicePicker = (DevicePicker)FragmentManager.findFragmentById(R.id.playerPicker);
            //mPlayerDevicePicker.setDeviceType(SmcDevice.TYPE_IMAGEVIEWER);
            mPlayerDevicePicker.DeviceSelectedListener = mPlayerDevicePickerListener;

            mListView = (ListView)findViewById(R.id.listView);
            mListView.OnItemClickListener = this;
            mItemAdapter      = new ItemAdapter(this);
            mListView.Adapter = mItemAdapter;
            mListView.OnItemLongClickListener = this;
            mItemStack = new Stack <SmcItem>();

            mSmcLib = new Smc();
            try
            {
                mSmcLib.initialize(BaseContext);
            }
            catch (SsdkUnsupportedException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);                 //TODO Handle exceptions.
            }
        }
示例#3
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.uploader;

            mTargetDevicePicker                        = (DevicePicker)FragmentManager.findFragmentById(R.id.targetPicker);
            mTargetDevicePicker.DeviceType             = SmcDevice.TYPE_PROVIDER;
            mTargetDevicePicker.DeviceSelectedListener = this;
            mUploadButton = (Button)findViewById(R.id.button);
            mUploadButton.OnClickListener = uploadClickListener;
            progressBar = (ProgressBar)findViewById(R.id.progress);


            SmcItem.LocalContent content = LocalContent;

            if (content == null)
            {
                Toast.makeText(this, "Content not supported", Toast.LENGTH_SHORT).show();
                this.finish();
            }
            else
            {
                itemToUpload = new SmcItem(content);
                ((TextView)findViewById(R.id.header)).Text = "File: " + itemToUpload.Uri.ToString();
            }
        }