public void Info(object message)
 {
     if (!IsInfoEnabled)
     {
         return;
     }
     InfoMethod.Invoke(_logger, new[] { message });
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            v = inflater?.Inflate(Resource.Layout.GFOSTPlayerScreen, container, false);

            ostActivity = Activity as GFOSTPlayerActivity;

            musicAlbumArt = v.FindViewById <ImageView>(Resource.Id.GFOSTPlayerMusicAlbumArt);
            musicName     = v.FindViewById <TextView>(Resource.Id.GFOSTPlayerMusicName);
            musicSeekBar  = v.FindViewById <SeekBar>(Resource.Id.GFOSTPlayerMusicSeekBar);
            musicSeekBar.StopTrackingTouch += (sender, e) =>
            {
                try
                {
                    MusicRepo.ostPlayer.Seek((double)e.SeekBar.Progress / 100 * MusicRepo.ostPlayer.Duration);
                }
                catch (Exception ex)
                {
                    ETC.LogError(ex, Activity);
                }
            };
            musicLengthText  = v.FindViewById <TextView>(Resource.Id.GFOSTPlayerMusicLengthText);
            musicNowPosition = v.FindViewById <TextView>(Resource.Id.GFOSTPlayerMusicNowPositionText);

            skipPreviousButton           = v.FindViewById <ImageView>(Resource.Id.GFOSTPlayerSkipPreviousButton);
            skipPreviousButton.Clickable = true;
            skipPreviousButton.Click    += MusicControlButton_Click;
            playPauseButton           = v.FindViewById <ImageView>(Resource.Id.GFOSTPlayerPlayPauseButton);
            playPauseButton.Clickable = true;
            playPauseButton.Click    += MusicControlButton_Click;
            skipNextButton            = v.FindViewById <ImageView>(Resource.Id.GFOSTPlayerSkipNextButton);
            skipNextButton.Clickable  = true;
            skipNextButton.Click     += MusicControlButton_Click;

            if (ETC.useLightTheme)
            {
                skipPreviousButton.SetImageResource(Resource.Drawable.SkipPrevious_WhiteTheme);
                playPauseButton.SetImageResource(Resource.Drawable.PlayPause_WhiteTheme);
                skipNextButton.SetImageResource(Resource.Drawable.SkipNext_WhiteTheme);
            }
            else
            {
                skipPreviousButton.SetImageResource(Resource.Drawable.SkipPrevious);
                playPauseButton.SetImageResource(Resource.Drawable.PlayPause);
                skipNextButton.SetImageResource(Resource.Drawable.SkipNext);
            }

            infoMethod = new InfoMethod(RefreshInfo);

            if (MusicRepo.isOSTLoad && MusicRepo.ostPlayer.IsPlaying)
            {
                ChangeMusicAlbum();
                infoMethod();
            }

            return(v);
        }
Exemple #3
0
        /// <summary>
        /// 得到用户信息
        /// </summary>
        /// <param name="userName">用户名/Uid</param>
        /// <param name="infoMethod">查询方式</param>
        /// <returns></returns>
        private UcUserInfo userInfo(string userName, InfoMethod infoMethod)
        {
            var args = new Dictionary <string, string>
            {
                { "username", userName },
                { "isuid", ((int)infoMethod).ToString() }
            };

            return(new UcUserInfo(SendArgs(args, UcUserModelName.ModelName, UcUserModelName.ActionInfo)));
        }
        public void InfoFormat(string format, params object[] args)
        {
            if (!IsInfoEnabled)
            {
                return;
            }
            string message = String.Format(format, args);

            InfoMethod.Invoke(_logger, new object[] { message });
        }
Exemple #5
0
 /// <summary>
 /// 得到用户信息
 /// </summary>
 /// <param name="userName">用户名/Uid</param>
 /// <param name="infoMethod">查询方式</param>
 /// <returns></returns>
 public UcUserInfo userInfo(string userName, InfoMethod infoMethod)
 {
     var args = new Dictionary<string, string>
                    {
                        {"username", userName},
                        {"isuid", ((int) infoMethod).ToString()}
                    };
     return new UcUserInfo(SendArgs(args, UcUserModelName.ModelName, UcUserModelName.ActionInfo));
 }