private void InitComposition()
        {
            _compositor           = this.GetVisual().Compositor;
            _setAsWallpaperVisual = SetAsWallpaperBtn.GetVisual();
            _setAsLockVisual      = SetAsLockBtn.GetVisual();
            _setBothVisual        = SetBothBtn.GetVisual();
            _setAsTBVisual        = SetAsTB.GetVisual();
            _backFIVisual         = BackFI.GetVisual();
            _openBtnVisual        = OpenBtn.GetVisual();
            _shareBtnVisual       = ShareBtn.GetVisual();

            var opacityAnimation = _compositor.CreateScalarKeyFrameAnimation();

            opacityAnimation.InsertExpressionKeyFrame(1f, "this.FinalValue");
            opacityAnimation.Target   = "Opacity";
            opacityAnimation.Duration = TimeSpan.FromMilliseconds(200);

            var animations = _compositor.CreateImplicitAnimationCollection();

            animations["Opacity"] = opacityAnimation;

            _shareBtnVisual.ImplicitAnimations = animations;

            _setAsWallpaperVisual.SetTranslation(new Vector3(0, 52 * 3, 0));
            _setAsLockVisual.SetTranslation(new Vector3(0, 52 * 2, 0));
            _setBothVisual.SetTranslation(new Vector3(0, 52 * 1, 0));

            _setAsWallpaperVisual.Opacity = 0f;
            _setAsLockVisual.Opacity      = 0f;
            _setBothVisual.Opacity        = 0f;
            _backFIVisual.Opacity         = 0f;
            _shareBtnVisual.Opacity       = 0f;
        }
Exemple #2
0
        private void SetEvent()
        {
            SolidColorBrush onbrush   = "#FFFFFF".ToBrush();
            SolidColorBrush overBrush = "#F7F7F7".ToBrush();
            SolidColorBrush downBrush = "#EAEAEA".ToBrush();

            OpenBtn.SetBtnColor(onbrush, overBrush, downBrush);
            SaveBtn.SetBtnColor(onbrush, overBrush, downBrush);

            OpenBtn.SetOnClick(Open);
            SaveBtn.SetOnClick(Save);
        }
Exemple #3
0
 public void OpenPanel()
 {
     if (anim.GetBool("IsOpen"))
     {
         return;
     }
     AstroMgr.instance.AnimCtrl(false);
     AstroMgr.instance.CloseAllPanel();
     SetSource(sourceIndex);
     anim.SetBool("IsOpen", true);
     isOpen = true;
     OpenBtn.SetActive(false);
 }
Exemple #4
0
        private void InitComposition()
        {
            _compositor           = this.GetVisual().Compositor;
            _setAsWallpaperVisual = SetAsWallpaperBtn.GetVisual();
            _setAsLockVisual      = SetAsLockBtn.GetVisual();
            _setBothVisual        = SetBothBtn.GetVisual();
            _setAsTBVisual        = SetAsTB.GetVisual();
            _backFIVisual         = BackFI.GetVisual();
            _openBtnVisual        = OpenBtn.GetVisual();
            _copyBtnVisual        = CopyUrlBtn.GetVisual();

            _setAsWallpaperVisual.Offset = new Vector3(0, 52 * 3, 0);
            _setAsLockVisual.Offset      = new Vector3(0, 52 * 2, 0);
            _setBothVisual.Offset        = new Vector3(0, 52 * 1, 0);

            _setAsWallpaperVisual.Opacity = 0f;
            _setAsLockVisual.Opacity      = 0f;
            _setBothVisual.Opacity        = 0f;
            _backFIVisual.Opacity         = 0f;
            _copyBtnVisual.Opacity        = 0f;
        }
Exemple #5
0
 public void ClosePanel()
 {
     if (isDetail)
     {
         isDetail = false;
         anim.SetBool("IsDetail", false);
     }
     else if (isCustom)
     {
         isCustom = false;
         anim.SetBool("IsCustom", false);
     }
     else
     {
         anim.SetBool("IsOpen", false);
         isOpen = false;
         SearchBar.interactable = true;
         SearchBar.alpha        = 1f;
         OpenBtn.SetActive(true);
     }
     title.text       = "Asteorid Search";
     searchInput.text = "";
     detailBtn.SetActive(true);
 }
Exemple #6
0
        private void Speechreco_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            string speech = e.Result.Text;

            try
            {
                switch (speech)
                {
                ///basic commands
                case "hello":
                case "hello martha":
                case "martha hello":
                    martha.Speak("hello sir");
                    break;

                case "how are you":
                case "martha how are you":
                case "how are you martha":
                    martha.Speak("Iam fine sir");
                    break;

                case "what is your name":
                    martha.Speak("my name is martha iam an ai");
                    break;

                case "what is your gender":
                    martha.Speak("i dont have a gender but my voice seems to be male");
                    break;

                case "are you there":
                case "martha are you there":
                case "are you there martha":
                    martha.Speak("yes sir always ready");
                    break;

                case "exit":
                case "sleep":
                case "goodbye":
                case "goodbye martha":
                case "martha goodbye":
                case "martha bye":
                    martha.Speak("good bye sir have a nice day");
                    Application.Exit();
                    break;

                ///opening commands
                case "open google":
                case "martha open google":
                case "open google martha":
                    martha.Speak("opening google");
                    martha.Speak("loading");
                    Process.Start("chrome.exe", "http://www.google.com");
                    break;

                case "icognito":
                case "martha turn icognito":
                case "turn icognito":
                    SendKeys.Send("^+n");
                    break;

                case "open youtube":
                case "martha open youtube":
                case "open youtube martha":
                    martha.Speak("opening youtube");
                    martha.Speak("loading sir");
                    Process.Start("chrome.exe", "http://www.youtube.com");
                    break;

                case "open facebook":
                case "martha open facebook":
                case "open facebook martha":
                    martha.Speak("opening facebook");
                    martha.Speak("loading");
                    Process.Start("chrome.exe", "http://www.facebook.com");
                    break;

                case "open instagram":
                case "martha open instagram":
                case "open instagram martha":
                    martha.Speak("opening instagram");
                    martha.Speak("loading sir");
                    Process.Start("chrome.exe", "http://www.instagram.com");
                    break;

                case "open whatsapp":
                case "martha open whatsapp":
                case "open  whatsapp martha":
                    martha.Speak("opening whatsapp");
                    martha.Speak("loading");
                    Process.Start("chrome.exe", "http://www.whatsapp.com");
                    break;

                case "open amzon":
                case "martha open amazon":
                    martha.Speak("opening amazon");
                    martha.Speak("loading");
                    martha.Speak("happy shoppoing sir");
                    Process.Start("chrome.exe", "http://www.amazon.in");
                    break;

                case "open flipkart":
                case "martha open flipkart":
                    martha.Speak("opening flipkart");
                    martha.Speak("loading");
                    martha.Speak("happy shopping sir");
                    Process.Start("chrome.exe", "http://www.flipkart.com");
                    break;

                case "open notepad":
                case "martha open notepad":
                    martha.Speak("opening notepad");
                    Process.Start("notepad.exe");
                    break;

                case "open wordpad":
                case "martha open wordpad":
                    martha.Speak("opening wordpad");
                    Process.Start("wordpad.exe");
                    break;

                case "open cmd":
                case "martha open commandpromt":
                    martha.Speak("opening commandpromt");
                    Process.Start("cmd.exe");
                    break;


                ///date and time
                case "what time is it":
                case "martha what is the time":
                    martha.Speak(DateTime.Now.ToString("h:mm:tt"));
                    break;

                case "what is the date":
                case "martha what is the date":
                    martha.Speak(DateTime.Now.ToString("MM/dd/yyyy"));
                    break;



                ///battery status


                ///cricket updates
                case "get cricket updates":
                    martha.Speak("getting cricket updates");
                    Process.Start("chrome.exe", "http://www.cricbuzz.com");
                    break;

                ///Media player commands
                case "open playlist":
                    martha.Speak("opening playlist");
                    martha.Speak("sir please select songs from your drives");
                    Add_Music.PerformClick();
                    break;

                case "play songs":
                    martha.Speak("playing songs");
                    PlayBtn.PerformClick();
                    break;

                case "pause song":
                    martha.Speak("pausing the song");
                    PlayBtn.PerformClick();
                    break;

                case "resume song":
                    martha.Speak("resuimg the song");
                    PlayBtn.PerformClick();
                    break;

                case "stop song":
                    martha.Speak("stoping the song");
                    MediaStopBtn.PerformClick();
                    break;

                case "play next song":
                    martha.Speak("playing next song");
                    NextBtn.PerformClick();
                    break;

                case "play previous song":
                    martha.Speak("playing previous song");
                    PreviousBtn.PerformClick();
                    break;

                case "forward song":
                    martha.Speak("forwarding the song");
                    FastForwardBtn.PerformClick();
                    break;

                case "rewind song":
                    martha.Speak("rewinding the song");
                    FastRewindBtn.PerformClick();
                    break;

                case "go fullscreen":
                    martha.Speak("going full screen");
                    Full_Screen.PerformClick();
                    break;

                ///text reader
                case "open text files":
                    OpenBtn.PerformClick();
                    break;

                case "read":
                    ReadBtn.PerformClick();
                    break;

                case "pause":
                    PauseBtn.PerformClick();
                    break;

                case "resume":
                    PauseBtn.PerformClick();
                    break;

                case "stop":
                    martha.SpeakAsyncCancelAll();
                    break;

                ///Gmail Reader
                case "get emails":
                case "get all emails":
                case "get all inbox emails":
                    GmailReaderBtn.PerformClick();
                    AllEmails();
                    break;

                case "check for new emails":
                    username = textBox1.Text;
                    password = textBox2.Text;
                    QEvent   = "Checkfornewemails";
                    martha.SpeakAsyncCancelAll();
                    Emailnum = 0;
                    CheckEmails();
                    break;

                case "read email":
                    GmailReaderBtn.PerformClick();
                    martha.SpeakAsyncCancelAll();
                    try
                    {
                        martha.SpeakAsync(MsgList[Emailnum]);
                    }
                    catch
                    {
                        martha.SpeakAsync("there are no emails");
                    }
                    break;

                case "next email":
                    GmailReaderBtn.PerformClick();
                    martha.SpeakAsyncCancelAll();
                    try
                    {
                        Emailnum += 1;
                        martha.SpeakAsync(MsgList[Emailnum]);
                    }
                    catch
                    {
                        Emailnum -= 1;
                        martha.SpeakAsync("there are no further emails");
                    }
                    break;

                case "previous email":
                    GmailReaderBtn.PerformClick();
                    martha.SpeakAsyncCancelAll();
                    try
                    {
                        Emailnum -= 1;
                        martha.SpeakAsync(MsgList[Emailnum]);
                    }
                    catch
                    {
                        Emailnum += 1;
                        martha.SpeakAsync("there are no previous emails");
                    }
                    break;

                case "stop reading gmails":
                {
                    martha.SpeakAsyncCancelAll();
                    break;
                }

                ///pronounciation
                case "pronounce":
                {
                    PronounceBtn.PerformClick();
                    break;
                }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("MessageBox:martha is in pause state trun it to speaking state");
            }
        }