Inheritance: android.view.View
Exemplo n.º 1
0
		protected override void onCreate (android.os.Bundle savedInstanceState)
		{
			base.onCreate (savedInstanceState);

			int pos = getIntent ().getIntExtra (MainActivity.EXTRA_POSITION, -1);
			var ta = getResources ().obtainTypedArray (R.array.lemurs);
			var sa = getResources ().getStringArray (R.array.lemur_string_array);

			getWindow ().setTitle (java.lang.CharSequenceProxy.Wrap (sa [pos]));

			var drawable = ta.getDrawable (pos);

			var view = new ImageView (this);
			view.setImageDrawable (drawable);
			view.setOnClickListener (this);

			setContentView (view);
		}
            public CardboardOverlayEyeView(Context context, AttributeSet attrs)
                : base(context, attrs)
            {
                imageView = new ImageView(context, attrs);
                imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
                imageView.setAdjustViewBounds(true);  // Preserve aspect ratio.
                addView(imageView);

                textView = new TextView(context, attrs);
                textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14.0f);
                textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
                textView.setGravity(Gravity.CENTER);
                textView.setShadowLayer(3.0f, 0.0f, 0.0f, Color.DKGRAY);
                addView(textView);
            }
		/// <summary>
		/// Sets the global references to UI elements and event handlers for those elements.
		/// </summary>
		private void setupViewElements()
		{
			mTitleText = (TextView) findViewById(R.id.titleText);
			mArtistText = (TextView) findViewById(R.id.artistText);
			mCoverArt = (ImageView) findViewById(R.id.coverImage);
			mSeekBar = (SeekBar) findViewById(R.id.musicPosition);
			mPlayButton = (ImageButton) findViewById(R.id.playPause);
			mMuteButton = (ImageButton) findViewById(R.id.mute);
			mPositionText = (TextView) findViewById(R.id.positionText);
			mDurationText = (TextView) findViewById(R.id.durationText);

			mSeekBar.OnSeekBarChangeListener = this;
			mPlayButton.OnClickListener = this;
			mMuteButton.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;

			mDevicePicker = (DevicePicker) FragmentManager.findFragmentById(R.id.playerPicker);
			mDevicePicker.DeviceType = SmcDevice.TYPE_AVPLAYER;
			mDevicePicker.DeviceSelectedListener = this;
		}