Example #1
0
        private void InitFragment()
        {
            mConversationFragment = (ConversationFragment)SupportFragmentManager.FindFragmentByTag(LivepersonFragment);
            Log.Debug(Tag, "initFragment. mConversationFragment = " + mConversationFragment);

            try
            {
                if (mConversationFragment == null)
                {
                    /*
                     *
                     * String authCode = SampleAppStorage.getInstance(FragmentContainerActivity.this).getAuthCode();
                     * String publicKey = SampleAppStorage.getInstance(FragmentContainerActivity.this).getPublicKey();
                     *
                     * Log.d(TAG, "initFragment. authCode = "+ authCode);
                     * Log.d(TAG, "initFragment. publicKey = "+ publicKey);
                     * LPAuthenticationParams authParams = new LPAuthenticationParams();
                     * authParams.setAuthKey(authCode);
                     * authParams.addCertificatePinningKey(publicKey);
                     */
                    LPAuthenticationParams authParams             = new LPAuthenticationParams();
                    CampaignInfo           campaignInfo           = null;//SampleAppUtils.getCampaignInfo(this);
                    ConversationViewParams conversationViewParams = new ConversationViewParams().SetCampaignInfo(campaignInfo).SetReadOnlyMode(isReadOnly());
                    mConversationFragment = (ConversationFragment)LivePerson.GetConversationFragment(authParams, conversationViewParams);

                    if (isValidState())
                    {
                        // Pending intent for image foreground service
                        Intent notificationIntent = new Intent(CallBackInFragmentcontext, typeof(Activity_Message));
                        //notificationIntent.SetFlags(Intent.Flags);
                        PendingIntent pendingIntent = PendingIntent.GetActivity(CallBackInFragmentcontext, 0, notificationIntent, 0);
                        LivePerson.SetImageServicePendingIntent(pendingIntent);

                        // Notification builder for image upload foreground service
                        Notification.Builder uploadBuilder   = new Notification.Builder(CallBackInFragmentcontext);
                        Notification.Builder downloadBuilder = new Notification.Builder(CallBackInFragmentcontext);
                        uploadBuilder.SetContentTitle("Uploading image")
                        //.SetSmallIcon(Android.R.drawable.arrow_up_float)
                        .SetContentIntent(pendingIntent)
                        .SetProgress(0, 0, true);

                        downloadBuilder.SetContentTitle("Downloading image")
                        //.setSmallIcon(Android.R.drawable.arrow_down_float)
                        .SetContentIntent(pendingIntent)
                        .SetProgress(0, 0, true);

                        LivePerson.SetImageServiceUploadNotificationBuilder(uploadBuilder);
                        LivePerson.SetImageServiceDownloadNotificationBuilder(downloadBuilder);

                        var ft = SupportFragmentManager.BeginTransaction();
                        ft.Add(Resource.Id.frameLayout1, mConversationFragment, LivepersonFragment).CommitAllowingStateLoss();
                    }
                }
                else
                {
                    AttachFragment();
                }
            }
            catch (Java.Lang.Exception e) { throw e; }
        }
Example #2
0
 private void OnConverationStarted(ConversationFragment conversation, AgentController owner)
 {
     if (_conversations.IsPlayerConversation(conversation))
     {
         _inConversationWithPlayer = owner;
     }
 }
Example #3
0
        public ConversationNode(Vector2 position, Vector2 size, GUIStyle nodeStyle, GUIStyle selectedStyle, GUIStyle inPointStyle, GUIStyle outPointStyle, Action <ConnectionPoint> onClickInPoint, Action <ConnectionPoint> onClickOutPoint, Action <Node> onRemoveNode, GUID?guid = null)
            : base(position, size, nodeStyle, selectedStyle, inPointStyle, outPointStyle, onClickInPoint, onClickOutPoint, onRemoveNode, guid)
        {
            _unselectedSize = size;
            _selectedSize   = new Vector2(300.0f, 700.0f);

            Title    = "Sentence";
            Sentence = new ConversationFragment(false, _sentenceOptions);
        }
Example #4
0
        protected override void Deserialise(BinaryReader reader)
        {
            base.Deserialise(reader);

            Sentence = new ConversationFragment(reader);

            _outputEnumTemp    = Sentence.Output.ToString();
            _predicateEnumTemp = Sentence.IsAvailable.ToString();

            for (int idx = 0; idx < Sentence.OptionOutputData.Length; idx++)
            {
                _intTemp[idx]   = Sentence.OptionOutputData[idx].iVal.ToString();
                _floatTemp[idx] = Sentence.OptionOutputData[idx].fVal.ToString();
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Main);

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            // Create your application here
            var fragment = new ConversationFragment();

            fragment.Uri  = Intent.Data;
            toolbar.Title = Intent.Data.GetQueryParameter("title");
            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.container, fragment)
            .Commit();
        }