Example #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.ContactsPhone);
            layout            = FindViewById(Resource.Id.sample_main_layout);
            userService       = new UserService(appPreferences);
            isEnableSubScript = true;
            var toolbar = loadToolBar(Resource.String.contacts);

            toolbar.SetNavigationIcon(Resource.Drawable.config);
            toolbar.SetNavigationIcon(Resource.Drawable.back);
            mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);

            user       = new User();
            user.users = listContacts();

            showProgress();

            syncOnStart();
            searchInList();

            App      = App.Instance;
            xmppFace = new XmppFacade();

            //loadXmppConnect(this);

            if ((int)Build.VERSION.SdkInt < 23)
            {
                addressBook.RequestPermission().ContinueWith(t =>
                {
                    if (!t.Result)
                    {
                        Console.WriteLine("{0}", "Permission denied, check your manifest");
                        Toast.MakeText(Application.Context, "Permission denied, check your manifest", ToastLength.Short).Show();
                        return;
                    }
                });
            }
            else
            {
                ShowContacts(layout);
            }
        }
Example #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Configuration);
            VisibleProgress(Resource.Id.pbHeaderProgress, VISIBLE);

            this.App = App.Instance;
            //loadXmppConnect(this);
            xmppFace = new XmppFacade();

            var toolbar = loadToolBar(Resource.String.configurations);

            toolbar.SetNavigationIcon(Resource.Drawable.back);

            jbService = new JsonBuilderService();

            loadComponents();
            loadUser(appPreferences);
        }
Example #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.VoiceCall);
            this.callType = this.Intent.GetStringExtra("callType");
            if (friend == null)
            {
                if (this.callType.Equals("incoming"))
                {
                    friend          = new AppCore.User();
                    friend.Jid      = this.Intent.GetStringExtra("userChat");
                    friend.username = LegionUtils.GetUserNameClear(friend.Jid);
                }
                else
                {
                    friend = LegionUtils.getUserson(Intent.GetStringExtra("userChat"));
                }
            }
            App      = App.Instance;
            xmppFace = new XmppFacade();
            App.Xmpp.OnReceiveSessionAccept += (sender, e) =>
            {
                Log.Info("Success connection");
                timer.Interval = 1000;
                timer.Elapsed += OnTimedEvent;
                timer.Enabled  = true;
            };

            Layout       = (RelativeLayout)FindViewById(Resource.Id.layout);
            Bgconnection = (ImageView)FindViewById(Resource.Id.
                                                   bgconnection);
            avatar = (ImageView)FindViewById(Resource.Id.avatarFriend);
            if (friend.Photo != null)
            {
                Bitmap bitmap = xmppFace.Base64ToBitmap(friend.Photo);
                var    d      = new CircleDrawable(bitmap);
                avatar.SetBackgroundDrawable(d);
            }
            TxUserName      = (TextView)FindViewById(Resource.Id.userNameFriend);
            TxUserName.Text = friend.username;
            TxConnection    = (TextView)FindViewById(Resource.Id.time);

            LeaveButton = (ImageButton)FindViewById(Resource.Id.leaveButton);

            // Load native libraries.
            if (!Build.CpuAbi.ToLower().Contains("x86") && !Build.CpuAbi.ToLower().Contains("arm64"))
            {
                Java.Lang.JavaSystem.LoadLibrary("audioprocessing");
                Java.Lang.JavaSystem.LoadLibrary("audioprocessingJNI");
            }
            Java.Lang.JavaSystem.LoadLibrary("opus");
            Java.Lang.JavaSystem.LoadLibrary("opusJNI");
            Java.Lang.JavaSystem.LoadLibrary("vpx");
            Java.Lang.JavaSystem.LoadLibrary("vpxJNI");

            LeaveButton.Click += new EventHandler(LeaveButton_Click);

            Messaging.Log.Debug("VoiceCallActivity adding event handler Xmpp_OnReceiveSessionTerminate");
            //loadXmppConnect(this);
            //App.Instance.Xmpp.OnReceiveSessionTerminate += Xmpp_OnReceiveSessionTerminate;
            //App.Instance.Xmpp.OnReceiveSessionInitiate += Xmpp_OnReceiveSessionInitiate;


            if (!SignallingStarted)
            {
                StartSignalling();
            }

            if (!LocalMediaStarted)
            {
                StartLocalMedia();
            }
        }