/// <summary> /// Called when activity is created. /// </summary> /// <returns>The create.</returns> /// <param name="bundle">Bundle.</param> protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.AudioPlayerPage); _seekBar = FindViewById <CustomSeekBar>(Resource.Id.seekBar); _seekBar.ValueChanged += HandleValueChanged; playButton = FindViewById <ImageButton>(Resource.Id.PlayButton); playButton.SetColorFilter(Color.White); playButton.Click += HandlePlayClick; var rewindButton = FindViewById <ImageButton>(Resource.Id.RewindButton); rewindButton.SetColorFilter(Color.White); rewindButton.Click += HandleRewindForwardClick; var forwardButton = FindViewById <ImageButton>(Resource.Id.ForwardButton); forwardButton.SetColorFilter(Color.White); forwardButton.Click += HandleRewindForwardClick; model = (AudioPlayerPageViewModel)ViewModel; }
/// <summary> /// initializes the activity, calculates and sets the dots on the slider /// </summary> private void Init() { CalcDotPositions (mPicDataList); // set the dots mSeekBar = (CustomSeekBar) view.FindViewById (Resource.Id.seekBar); mSeekBar.DotList = GetListOfDotPositions (mPicDataList); mSeekBar.ProgressDrawable = view.Resources.GetDrawable (Resource.Drawable.customseekbar); // set the first picture mFirstImageView = (ImageView) view.FindViewById (Resource.Id.displayImageSliderFirstImageView); mFirstImageView.SetImageDrawable (mPicDataList [0].Drawable); // set the next picture mNextImageView = (ImageView) view.FindViewById (Resource.Id.displayImageSliderNextImageView); mNextImageView.SetImageDrawable (mPicDataList [1].Drawable); mFirstImageView.BringToFront (); // set start year on the slider var seekBarFirstText = (TextView) view.FindViewById (Resource.Id.displayImageSliderSeekBarFirstText); seekBarFirstText.Text = mPicDataList [0].Year + " " + GetString (Resource.String.after_christ); // set end year on the slider var seekBarEndText = (TextView) view.FindViewById (Resource.Id.displayImageSliderSeekBarEndText); seekBarEndText.Text = mPicDataList [mPicDataList.Count () - 1].Year + " " + GetString (Resource.String.after_christ); mThumbSlidingText = (TextView) view.FindViewById (Resource.Id.displayImageSliderThumbSlidingText); mImageDescription = (TextView) view.FindViewById (Resource.Id.displayImageSliderDescriptionText); AddSeekBarListener (); mImageDescription.Text = page.Images [0].Description; }