Ejemplo n.º 1
0
        //ReportSong
        private void OnMenuReportSongOnClick(MoreSongClickEventArgs song)
        {
            try
            {
                if (!UserDetails.IsLogin)
                {
                    PopupDialogController dialog = new PopupDialogController(GlobalContext, null, "Login");
                    dialog.ShowNormalDialog(GlobalContext.GetText(Resource.String.Lbl_Login), GlobalContext.GetText(Resource.String.Lbl_Message_Sorry_signin), GlobalContext.GetText(Resource.String.Lbl_Yes), GlobalContext.GetText(Resource.String.Lbl_No));
                    return;
                }

                if (Methods.CheckConnectivity())
                {
                    Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_YourReportSong), ToastLength.Short).Show();
                    //Sent Api >>
                    PollyController.RunRetryPolicyFunction(new List <Func <Task> > {
                        () => RequestsAsync.Tracks.ReportUnReportTrackAsync(song.SongsClass.Id.ToString(), true)
                    });
                }
                else
                {
                    Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 2
0
        //DeleteSong
        private void OnMenuDeleteSongOnClick(MoreSongClickEventArgs song)
        {
            try
            {
                if (!UserDetails.IsLogin)
                {
                    PopupDialogController dialog = new PopupDialogController(GlobalContext, null, "Login");
                    dialog.ShowNormalDialog(GlobalContext.GetText(Resource.String.Lbl_Login), GlobalContext.GetText(Resource.String.Lbl_Message_Sorry_signin), GlobalContext.GetText(Resource.String.Lbl_Yes), GlobalContext.GetText(Resource.String.Lbl_No));
                    return;
                }


                if (Methods.CheckConnectivity())
                {
                    TypeDialog   = "DeleteSong";
                    MoreSongArgs = song;

                    var dialog = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light);
                    dialog.Title(MainContext.GetText(Resource.String.Lbl_DeleteSong));
                    dialog.Content(MainContext.GetText(Resource.String.Lbl_AreYouSureDeleteSong));
                    dialog.PositiveText(MainContext.GetText(Resource.String.Lbl_Yes)).OnPositive(this);
                    dialog.NegativeText(MainContext.GetText(Resource.String.Lbl_No)).OnNegative(this);
                    dialog.AlwaysCallSingleChoiceCallback();
                    dialog.ItemsCallback(this).Build().Show();
                }
                else
                {
                    Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Ejemplo n.º 3
0
        //Event Show More :  DeleteSong , EditSong , GoSong , Copy Link  , Report ..
        public void OnMoreClick(MoreSongClickEventArgs args, string namePage = "")
        {
            try
            {
                NamePage     = namePage;
                MoreSongArgs = args;

                var arrayAdapter = new List <string>();
                var dialogList   = new MaterialDialog.Builder(MainContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light);

                if (MoreSongArgs.SongsClass.UserId == UserDetails.UserId && UserDetails.IsLogin)
                {
                    arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_DeleteSong));
                    arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_EditSong));
                }

                if (UserDetails.IsLogin)
                {
                    arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_ReportSong));
                    //arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_ReportCopyright));
                }

                arrayAdapter.Add(MainContext.GetText(Resource.String.Lbl_Copy));

                dialogList.Title(MainContext.GetText(Resource.String.Lbl_Songs));
                dialogList.Items(arrayAdapter);
                dialogList.PositiveText(MainContext.GetText(Resource.String.Lbl_Close)).OnPositive(this);
                dialogList.AlwaysCallSingleChoiceCallback();
                dialogList.ItemsCallback(this).Build().Show();
            }
            catch (Exception exception)
            {
                Console.WriteLine(exception);
            }
        }
Ejemplo n.º 4
0
 //wael
 //Report Copyright Song
 private void OnMenuReportCopyrightSongOnClick(MoreSongClickEventArgs song)
 {
     try
     {
         if (!UserDetails.IsLogin)
         {
             PopupDialogController dialog = new PopupDialogController(GlobalContext, null, "Login");
             dialog.ShowNormalDialog(GlobalContext.GetText(Resource.String.Lbl_Login), GlobalContext.GetText(Resource.String.Lbl_Message_Sorry_signin), GlobalContext.GetText(Resource.String.Lbl_Yes), GlobalContext.GetText(Resource.String.Lbl_No));
             return;
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Ejemplo n.º 5
0
        //Edit Song
        private void OnMenuEditSongOnClick(MoreSongClickEventArgs song)
        {
            try
            {
                if (!UserDetails.IsLogin)
                {
                    PopupDialogController dialog = new PopupDialogController(GlobalContext, null, "Login");
                    dialog.ShowNormalDialog(GlobalContext.GetText(Resource.String.Lbl_Login), GlobalContext.GetText(Resource.String.Lbl_Message_Sorry_signin), GlobalContext.GetText(Resource.String.Lbl_Yes), GlobalContext.GetText(Resource.String.Lbl_No));
                    return;
                }


                Intent intent = new Intent(MainContext, typeof(EditSongActivity));
                intent.PutExtra("ItemDataSong", JsonConvert.SerializeObject(song.SongsClass));
                intent.PutExtra("NamePage", NamePage);
                MainContext.StartActivity(intent);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }