Exemplo n.º 1
0
    public void Show()
    {
        AndroidDialog dialog = AndroidDialog.CreateTimePickerDialog(hour, minute, use24hrsFormat);

        dialog.OnTimePickerSetCompleted += OnPopupCompleted;
        dialog.ShowTimePickerDialog();
    }
    public void Show()
    {
        AndroidDialog dialog = AndroidDialog.CreateDatePickerDialog(day, month, year);

        dialog.OnDatePickerSetCompleted += OnPopupCompleted;
        dialog.ShowDatePickerDialog();
    }
 public void init()
 {
     #if UNITY_ANDROID
     AndroidDialog dialog = AndroidDialog.Create(title, message, yesButton, noButton);
     dialog.urlString = urlString;
     #endif
 }
Exemplo n.º 4
0
    public void Show()
    {
        AndroidDialog dialog = AndroidDialog.CreateAlertDialog(this.title, this.message, this.actions.Keys);

        dialog.OnAlertActionCompleted += OnPopupCompleted;
        dialog.ShowAlertDialog();
    }
Exemplo n.º 5
0
    private void OnInvite(string invitationId)
    {
        inviteId = invitationId;
        AndroidDialog dialog = AndroidDialog.Create("Invite", "You have new invite from firend", "Start Playing", "Open Inbox");

        dialog.OnComplete += OnInvDialogComplete;
    }
    private void ActionAvailableGameSavesLoaded(GooglePlayResult res)
    {
        GooglePlaySavedGamesManager.ActionAvailableGameSavesLoaded -= ActionAvailableGameSavesLoaded;
        if (res.IsSucceeded)
        {
            foreach (GP_SnapshotMeta meta in GooglePlaySavedGamesManager.Instance.AvailableGameSaves)
            {
                Debug.Log("Meta.Title: " + meta.Title);
                Debug.Log("Meta.Description: " + meta.Description);
                Debug.Log("Meta.CoverImageUrl): " + meta.CoverImageUrl);
                Debug.Log("Meta.LastModifiedTimestamp: " + meta.LastModifiedTimestamp);
                Debug.Log("Meta.TotalPlayedTime" + meta.TotalPlayedTime);
            }

            if (GooglePlaySavedGamesManager.Instance.AvailableGameSaves.Count > 0)
            {
                GP_SnapshotMeta s      = GooglePlaySavedGamesManager.Instance.AvailableGameSaves[0];
                AndroidDialog   dialog = AndroidDialog.Create("Load Snapshot?", "Would you like to load " + s.Title);
                dialog.ActionComplete += OnSpanshotLoadDialogComplete;
            }
        }
        else
        {
            AndroidMessage.Create("Fail", "Available Game Saves Load failed");
        }
    }
    void HandleInvitationReceived(UM_RTM_Invite invite)
    {
        inviteId = invite.Id;

        AndroidDialog dialog = AndroidDialog.Create("Invite", "You have new invite from: " + invite.SenderId, "Manage Manually", "Open Google Inbox");

        dialog.ActionComplete += OnInvDialogComplete;
    }
Exemplo n.º 8
0
    //The timer script.
    public IEnumerator TIMER()
    {
        PlayerPrefs.SetInt("notificationCounter", 0);
        timer -= Time.deltaTime * 1;


        while (PlayerPrefs.GetInt("paused") == 0)
        {
            //Changes interactability of the buttons on study page.
            studyButton.interactable  = false;
            resetButton.interactable  = true;
            pauseButton.interactable  = true;
            resumeButton.interactable = false;

            //Changes the color of the ring around the timer.
            timer -= Time.deltaTime;
            float value = timer / duration;
            fillImage.fillAmount = value;

            //Gets the time and displays it right under the timer.
            TimeSpan t = TimeSpan.FromSeconds(timer);
            PlayerPrefs.SetInt("hours", t.Hours);
            PlayerPrefs.SetInt("minutes", t.Minutes);
            PlayerPrefs.SetInt("seconds", t.Seconds);
            PlayerPrefs.SetString("timerString", string.Format("{0:0}:{1:00}:{2:00}", PlayerPrefs.GetInt("hours"), PlayerPrefs.GetInt("minutes"), PlayerPrefs.GetInt("seconds")));
            text.text = PlayerPrefs.GetString("timerString");
            yield return(null);

            //When time runs out. Create a popup and reset the timer.
            if (PlayerPrefs.GetInt("hours") <= 0 && PlayerPrefs.GetInt("minutes") <= 0 && PlayerPrefs.GetInt("seconds") <= 0 && PlayerPrefs.GetInt("notificationCounter") == 0 && PlayerPrefs.GetInt("hasPlayedBefore") == 2)
            {
                ResetClock();
                Pause();
                fillImage.fillAmount = 1f;
                PlayerPrefs.SetString("choice", "timer");
                AndroidDialog.Create("Time's Up", "Try taking a break", "Sure", "No Thanks");



                studyButton.interactable  = true;
                resetButton.interactable  = false;
                pauseButton.interactable  = false;
                resumeButton.interactable = false;
                text.text = "Study";

                PlayerPrefs.SetInt("notificationCounter", 1);
                PlayerPrefs.Save();
            }


            if (PlayerPrefs.GetInt("paused") == 1 || PlayerPrefs.GetInt("paused") == 2)
            {
                PlayerPrefs.Save();
                break;
            }
        }
    }
Exemplo n.º 9
0
    private void OnInvite(GP_Invite invitation)
    {
        if (invitation.InvitationType != GP_InvitationType.INVITATION_TYPE_REAL_TIME)
        {
            return;
        }

        inviteId = invitation.Id;

        AndroidDialog dialog = AndroidDialog.Create("Invite", "You have new invite from: " + invitation.Participant.DisplayName, "Manage Manually", "Open Google Inbox");

        dialog.ActionComplete += OnInvDialogComplete;
    }
    private void ActionAvailableDeviceAccountsLoaded(List <string> accounts)
    {
        string msg = "Device contains following google accounts:" + "\n";

        foreach (string acc in GooglePlayManager.Instance.deviceGoogleAccountList)
        {
            msg += acc + "\n";
        }

        AndroidDialog dialog = AndroidDialog.Create("Accounts Loaded", msg, "Sign With Fitst one", "Do Nothing");

        dialog.ActionComplete += SighDialogComplete;
    }
Exemplo n.º 11
0
    private void OnInvDialogComplete(AndroidDialogResult result)
    {
        //parsing result
        switch (result)
        {
        case AndroidDialogResult.YES:
            AndroidDialog dialog = AndroidDialog.Create("Manage Invite", "Would you like to accept this invite?", "Accept", "Decline");
            dialog.ActionComplete += OnInvManageDialogComplete;
            break;

        case AndroidDialogResult.NO:
            GooglePlayRTM.instance.OpenInvitationInBoxUI();
            break;
        }
    }
Exemplo n.º 12
0
    public IEnumerator TIMER()
    {
        PlayerPrefs.SetInt("notificationCounter", 0);
        timer -= Time.deltaTime * 1;
        while (PlayerPrefs.GetInt("paused") == 0)
        {
            studyButton.interactable  = false;
            resetButton.interactable  = true;
            pauseButton.interactable  = true;
            resumeButton.interactable = false;

            timer -= Time.deltaTime;
            float value = timer / duration;
            fillImage.fillAmount = value;
            TimeSpan t = TimeSpan.FromSeconds(timer);
            PlayerPrefs.SetInt("hours", t.Hours);
            PlayerPrefs.SetInt("minutes", t.Minutes);
            PlayerPrefs.SetInt("seconds", t.Seconds);
            PlayerPrefs.SetString("timerString", string.Format("{0:0}:{1:00}:{2:00}", PlayerPrefs.GetInt("hours"), PlayerPrefs.GetInt("minutes"), PlayerPrefs.GetInt("seconds")));
            text.text = PlayerPrefs.GetString("timerString");
            yield return(null);

            if (PlayerPrefs.GetInt("hours") <= 0 && PlayerPrefs.GetInt("minutes") <= 0 && PlayerPrefs.GetInt("seconds") <= 0 && PlayerPrefs.GetInt("notificationCounter") == 0 && PlayerPrefs.GetInt("hasPlayedBefore") == 2)
            {
                ResetClock();
                Pause();
                fillImage.fillAmount = 1f;
                AndroidDialog.Create("Time's Up", "Try taking a break", "Sure", "No Thanks");


                studyButton.interactable  = true;
                resetButton.interactable  = false;
                pauseButton.interactable  = false;
                resumeButton.interactable = false;
                text.text = "Study";

                PlayerPrefs.SetInt("notificationCounter", 1);
                PlayerPrefs.Save();
            }


            if (PlayerPrefs.GetInt("paused") == 1 || PlayerPrefs.GetInt("paused") == 2)
            {
                PlayerPrefs.Save();
                break;
            }
        }
    }
Exemplo n.º 13
0
    //--------------------------------------
    // INITIALIZE
    //--------------------------------------


    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------


    void OnGUI()
    {
        if (GUI.Button(new Rect(10, 10, 150, 50), "Rate Dialog PopUp"))
        {
            AndroidRateUsPopUp rate = AndroidRateUsPopUp.Create("Rate Us", rateText, rateUrl);
            rate.addEventListener(BaseEvent.COMPLETE, OnRatePopUpClose);
        }


        if (GUI.Button(new Rect(10, 70, 150, 50), "Dialog PopUp"))
        {
            AndroidDialog dialog = AndroidDialog.Create("Dialog Titile", "Dialog message");
            dialog.addEventListener(BaseEvent.COMPLETE, OnDialogClose);
        }

        if (GUI.Button(new Rect(10, 130, 150, 50), "Message PopUp"))
        {
            AndroidMessage msg = AndroidMessage.Create("Message Titile", "Message message");
            msg.addEventListener(BaseEvent.COMPLETE, OnMessageClose);
        }
    }
Exemplo n.º 14
0
 public void init()
 {
     AndroidDialog.Create(this.title, this.message, this.yesButton, this.noButton).urlString = this.urlString;
 }
    void OnPendingGiftsDetected(List <GPGameRequest> gifts)
    {
        AndroidDialog dialog = AndroidDialog.Create("Pending Gifts Detected", "You got few gifts from your friends, do you whant to take a look?");

        dialog.ActionComplete += OnPromtGiftDialogClose;
    }
Exemplo n.º 16
0
    private void DialogPopUp()
    {
        AndroidDialog dialog = AndroidDialog.Create("Dialog Titile", "Dialog message");

        dialog.OnComplete += OnDialogClose;
    }
Exemplo n.º 17
0
    private void OnPendingGiftsDetected(CEvent e)
    {
        AndroidDialog dialog = AndroidDialog.Create("Pending Gifts Detected", "You got few gifts from your friends, do you whant to take a look?");

        dialog.addEventListener(BaseEvent.COMPLETE, OnPromtGiftDialogClose);
    }
    public void DialogPopUp()
    {
        AndroidDialog dialog = AndroidDialog.Create("Dialog Titile", "Dialog message");

        dialog.ActionComplete += OnDialogClose;
    }
Exemplo n.º 19
0
 public static void Popup(string title, string message, string yes, string no, string blah)
 {
     // Method that simplify creating a Popup
     AndroidDialog.Create(title, message, yes, no);
     PlayerPrefs.SetString("choice", blah);
 }