// Khoi tao gia tri cho fragment layout private void CreateFragments() { explorFragment = new ExploreFragment(); genreFragment = new GenreFragment(); audioFragment = new AudioFragment(); //tracksByGenres = new TracksByGenres (); }
public override void Trigger(TriggerType trigger) { if (trigger == TriggerType.Click) { // Play the sound for the collision with the other AudioFragment tekst = AudioManager.GetFragment("pardon"); sourceManager.PlaySound(tekst, voice); } }
private void CollideWithOtherPerson() { // Play the sound for the collision with the other string[] collisionTekst = new string[] { "sorry", "pardon", "hey", "oef", "pasop", "" }; // The "" causes the walker to say nothing, being impolite AudioFragment tekst = AudioManager.GetFragment(collisionTekst[PRNG.GetNumber(0, collisionTekst.Length - 1)]); sourceManager.PlaySound(tekst, voice); // Give the walker a new position to walk to position = lastPosition; destination = null; }
public override View GetView(int position, View convertView, ViewGroup parent) { var grid = convertView; LayoutInflater inflater = (LayoutInflater)mContext.GetSystemService(Context.LayoutInflaterService); var local = new LocalOnClickListener(); ViewHolder3 holder; if (grid == null) { holder = new ViewHolder3(); grid = inflater.Inflate(Resource.Layout.Attachment_layout, null); var view = grid.FindViewById <ImageView>(Resource.Id.imageview_attach); grid.Tag = new ViewHolder3() { View = view }; } holder = (ViewHolder3)grid.Tag; holder.View.SetImageResource(Resource.Drawable.audiofile); local.HandleOnClick = () => { AudioFragment nextFrag = new AudioFragment(); FragmentTransaction ft = fm.BeginTransaction(); ft.Hide(fm.FindFragmentByTag("ComplainceFragment")); ft.Add(Resource.Id.container, nextFrag); ft.AddToBackStack(null); ft.SetTransition(FragmentTransaction.TransitFragmentOpen); ft.Commit(); Bundle bundle = new Bundle(); bundle.PutString("Path", myList[position].Path); nextFrag.Arguments = bundle; }; holder.View.SetOnClickListener(local); return(grid); }
public override void Trigger(TriggerType trigger) { if (gameObject == null) { return; } if (trigger == TriggerType.PersonTalk || trigger == TriggerType.PersonStartTalking) { // Play a random text for a conversation string[] randomTextForConversation = new string[] { "zin1", "zin2", "zin3", "zin4", "zin5", "zin6", "zin7", "zin8", "zin9", "zin10", "goed", "redelijk", "slecht", "hoeishet", "metjou", "straks" }; AudioFragment tekst = AudioManager.GetFragment(randomTextForConversation[PRNG.GetNumber(0, randomTextForConversation.Length - 1)]); current = sourceManager.PlaySound(tekst, voice); signalOtherToStartTalking = true; } else if (trigger == TriggerType.PersonSaysBye) { // Play a random text to end the conversation string[] randomTextForConversation = new string[] { "totziens", "doei", "ciya" }; AudioFragment tekst = AudioManager.GetFragment(randomTextForConversation[PRNG.GetNumber(0, randomTextForConversation.Length - 1)]); current = sourceManager.PlaySound(tekst, voice); } }