protected override void OnPostExecute(JsonResult result)
        {
            base.OnPostExecute(result);
            mode.Finish();
            if (mode != null)
            {
                mode.Dispose();
            }

            p.Dismiss();

            if (result.Success == true)
            {
                foreach (var x in tempFile)
                {
                    eventfile.Remove(x);
                }
                photosFragmentAdapter.NotifyDataSetChanged();
                Toast.MakeText(context, tempFile.Count + " file deleted", ToastLength.Short).Show();
            }
            else
            {
                AlertBox.Create("Error", result.Message, context);
            }
        }
Exemplo n.º 2
0
        private void BtnLogIn_Click(object sender, EventArgs e)
        {
            try
            {
                HideKeyBoard.hideSoftInput(this);
                string username = txtUserName.Text.Trim();
                string password = txtPassword.Text.Trim();

                if (username == "")
                {
                    AlertBox.Create("Error", "Please enter username.", this);
                    txtUserName.RequestFocus();
                    return;
                }
                if (password == "")
                {
                    AlertBox.Create("Error", "Please enter password.", this);
                    txtPassword.RequestFocus();
                    return;
                }

                new LogInWeClip(username, password, this).Execute();
            }
            catch (Java.Lang.Exception ex)
            {
                new CrashReportAsync("LoginActivity", "OnCreate", ex.Message + ex.StackTrace).Execute();
            }
        }
Exemplo n.º 3
0
        private void BtnLogIn_Click(object sender, EventArgs e)
        {
            try
            {
                HideKeyBoard.hideSoftInput(this);
                string profileName = txtUserName.Text.Trim();

                var userinfo = new UserInfo
                {
                    LoginType   = "E",
                    ProfileName = profileName,
                    UserName    = userName
                };

                if (profileName == "")
                {
                    AlertBox.Create("Error", "Please enter your name.", this);
                    txtUserName.RequestFocus();
                    return;
                }
                new LogInBackGround(userinfo, this).Execute();
            }
            catch (System.Exception ex)
            {
                new CrashReportAsync("AddUserName", "BtnLogIn_Click", ex.Message + ex.StackTrace).Execute();
            }
        }
Exemplo n.º 4
0
        protected override void OnPostExecute(Java.Lang.Object result)
        {
            base.OnPostExecute(result);
            p.Dismiss();
            if (result != null)
            {
                if (jResult != null)
                {
                    if (jResult.Success)
                    {
                        Builder builder = new Builder(this.postWeClip);
                        builder.SetTitle("Success");
                        builder.SetMessage("We Clip is creating, Ones done we will notify you.");
                        builder.SetPositiveButton("OK", (senderAlert, args) =>
                        {
                            postWeClip.Finish();
                        });
                        Dialog dialog = builder.Create();
                        dialog.Show();
                    }

                    if (jResult.Success == false)
                    {
                        AlertBox.Create("Message", jResult.Message, postWeClip);
                    }
                }
            }
        }
            protected override void OnPostExecute(Java.Lang.Object result)
            {
                base.OnPostExecute(result);

                if (result != null)
                {
                    var madapter = new CommentsAdapter(eventfeed, activity);
                    lvComment.Adapter     = madapter;
                    btnSendComment.Click += delegate
                    {
                        string comment = txtComment.Text.Trim();
                        if (comment == "")
                        {
                            AlertBox.Create("Error", "Please enter Comment", activity);
                            return;
                        }
                        ;
                        EventFeedModel model  = new EventFeedModel();
                        int            userID = 0;
                        int.TryParse(GlobalClass.UserID.ToString(), out userID);
                        model.UserID  = userID;
                        model.EventID = eventID;
                        model.Message = comment;
                        new PostFeedData(txtComment, model, lvComment, activity, eventID, madapter).Execute();
                    };
                }
                else
                {
                    AlertBox.Create("Error", "Error", activity);
                }
            }
Exemplo n.º 6
0
        protected override void OnPostExecute(Java.Lang.Object result)
        {
            base.OnPostExecute(result);
            progressDialog.Hide();

            if (result != null && jsonResult != null)
            {
                if (jsonResult.Success == true)
                {
                    Builder builder = new Builder(activity);
                    builder.SetTitle("Success");
                    builder.SetMessage("File has been uploaded.");
                    builder.SetPositiveButton("OK", (senderAlert, args) =>
                    {
                        Java.IO.File dir = new Java.IO.File(Android.OS.Environment.ExternalStorageDirectory + "/" + "TMMFOLDER");
                        if (dir.IsDirectory)
                        {
                            string[] children = dir.List();
                            for (int ff = 0; ff < children.Length; ff++)
                            {
                                new Java.IO.File(dir, children[ff]).Delete();
                            }
                        }
                        activity.Finish();
                    });
                    Dialog dialog = builder.Create();
                    dialog.Show();
                }
            }
            else
            {
                AlertBox.Create("Error", "Error occurred", activity);
            }
        }
Exemplo n.º 7
0
        private void BtnSubmit_Click(object sender, System.EventArgs e)
        {
            string code, password, confirmPassword;

            code            = txtCode.Text;
            password        = txtPassword.Text;
            confirmPassword = txtconfirmPassword.Text;

            if (code == "")
            {
                AlertBox.Create("Error", "Please enter code!", this);
                return;
            }
            if (password == "")
            {
                AlertBox.Create("Error", "Please enter password!", this);
                return;
            }
            if (confirmPassword == "")
            {
                AlertBox.Create("Error", "Please enter confirm password!", this);
                return;
            }
            if (password != confirmPassword)
            {
                AlertBox.Create("Error", "password and confirm password not matched!", this);
                return;
            }
            new restPassword(this, new Reset_AddNewPassword {
                code = code, Password = password, userID = Userid, ConfirmPassword = confirmPassword
            }, username).Execute();
        }
Exemplo n.º 8
0
        private void BtnAddAdmin_Click(object sender, EventArgs e)
        {
            try
            {
                List <EventAdmin> eventAdminList = new List <EventAdmin>();
                foreach (CoHost model in CoHostListItem.getCoHostList)
                {
                    if (model.isSelected())
                    {
                        var adminmodel = new EventAdmin
                        {
                            EventID  = eventID,
                            FriendID = model.CoHostUserID,
                            UserID   = Convert.ToInt64(GlobalClass.UserID)
                        };
                        eventAdminList.Add(adminmodel);
                    }
                }

                if (eventAdminList.Count > 0)
                {
                    new PostAdminData(eventAdminList, activity).Execute();
                }
                else
                {
                    AlertBox.Create("Error", "Select friend.", activity);
                }
            }
            catch (System.Exception ex)
            {
                new CrashReportAsync("", "", ex.StackTrace + ex.Message).Execute();
            }
        }
Exemplo n.º 9
0
 protected override void OnPostExecute(JsonResult result)
 {
     base.OnPostExecute(result);
     p.Dismiss();
     if (result != null)
     {
         AlertBox.Create("", result.Message, activity);
     }
 }
Exemplo n.º 10
0
            protected override void OnPostExecute(Java.Lang.Object result)
            {
                base.OnPostExecute(result);
                if (result != null && authentication != null && authentication.access_token != null && authentication.Success == true)
                {
                    GlobalClass.AccessToken = authentication.access_token;
                    GlobalClass.UserEmail   = authentication.EmailID;
                    GlobalClass.UserID      = authentication.UserID.ToString();
                    Log.Debug("AccessToken", GlobalClass.AccessToken);
                    Log.Debug("AccessTokenExpiresIn", authentication.expires_in.ToString());
                    var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                    var prefEditor = prefs.Edit();
                    prefEditor.PutString("Password", signInWithGooglePassword);
                    prefEditor.PutString("LoginUserName", authentication.LoginUserName);
                    prefEditor.PutString("EmailID", authentication.EmailID);
                    prefEditor.PutString("Access_Token", authentication.access_token);
                    prefEditor.PutString("UserID", authentication.UserID.ToString());
                    prefEditor.PutString("ProfilePic", authentication.ProfilePic.ToString());
                    prefEditor.PutString("UserName", authentication.UserName.ToString());
                    prefEditor.PutString("IsNotificationEnable", authentication.IsNotificationEnable == null ? "false" : authentication.IsNotificationEnable.ToString());
                    prefEditor.PutBoolean("IsPublic", Convert.ToBoolean(authentication.IsPublic));
                    prefEditor.PutString("PhoneNumber", authentication.PhoneNumber);
                    prefEditor.PutString("Bio", authentication.Bio);
                    prefEditor.PutInt("MaxImageForWeClip", authentication.MaxImageForWeClip);
                    prefEditor.PutLong("MaxVideoDuration", authentication.MaxVideoDurationInMinute);
                    prefEditor.PutInt("MaxVideoForWeclip", authentication.MaxVideoForWeclip);
                    prefEditor.PutLong("MaxVideoSize", authentication.MaxVideoSize);

                    if (authentication.DOB != null)
                    {
                        prefEditor.PutString("DOB", string.Format("{0: dd MMM yyyy}", authentication.DOB));
                    }
                    else
                    {
                        prefEditor.PutString("DOB", "N/A");
                    }
                    prefEditor.Commit();
                    var intent = new Intent(context, typeof(GCMRegistrationService));
                    context.StartService(intent);
                    context.StartActivity(typeof(MainActivity));
                    context.Finish();
                }
                else
                {
                    if (result != null && authentication != null && authentication.Success == false)
                    {
                        AlertBox.Create("Error", authentication.Message, context);
                    }
                    else
                    {
                        AlertBox.Create("Error", "Error occured", context);
                    }
                }
                progressDialog.Dismiss();
            }
Exemplo n.º 11
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                SetContentView(Resource.Layout.AddDefaultEventPic);
                Toolbar  toolbar       = (Toolbar)FindViewById(Resource.Id.toolbar);
                TextView toolbar_title = (TextView)this.FindViewById(Resource.Id.toolbar_title);
                SetSupportActionBar(toolbar);
                SupportActionBar.Title = "";
                toolbar_title.Text     = "Take a picture";
                orientationManager     = new OrientationManager(this, SensorDelay.Normal, this);
                if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
                {
                    Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
                    Window.SetStatusBarColor(new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.primaryDark)));
                }

                EventID                    = Intent.GetLongExtra("strCapture", 0);
                EventCreatorID             = Intent.GetLongExtra("strCreatorId", 0);
                IsDefault                  = Intent.GetBooleanExtra("strIsDefaultEvent", false);
                camera_preview             = FindViewById <FrameLayout>(Resource.Id.camera_previewE);
                btnPhotos                  = FindViewById <Button>(Resource.Id.btnPhotosE);
                btnCamera                  = FindViewById <Button>(Resource.Id.btnCameraE);
                btnCapture                 = FindViewById <ImageButton>(Resource.Id.ivImageCapturebtnE);
                ivGalleryPhotoVideoUpload  = FindViewById <ImageButton>(Resource.Id.ivImageCaptureGalleryUploadE);
                btnSwitchCamera            = FindViewById <ImageButton>(Resource.Id.btnSwitchCameraE);
                btnFlash                   = FindViewById <ImageButton>(Resource.Id.btnFlashE);
                ivImageCaptureCameraUpload = FindViewById <ImageButton>(Resource.Id.ivImageCaptureCameraUploadE);
                rvCamera                   = FindViewById <RelativeLayout>(Resource.Id.rvCameraViewE);
                rvGalleryView              = FindViewById <RelativeLayout>(Resource.Id.rvGalleryViewE);
                ivSelectedImage            = FindViewById <ImageView>(Resource.Id.ivSelectedImageE);
                llCaptureView              = FindViewById <LinearLayout>(Resource.Id.llCaptureViewE);
                btnPhotos.SetTextColor(Color.Rgb(217, 217, 217));
                btnCamera.SetTextColor(Color.Rgb(0, 208, 150));
                btnPhotos.Click                 += BtnPhotos_Click;
                btnCamera.Click                 += BtnCamera_Click;
                btnCapture.Click                += BtnCapture_Click;
                btnSwitchCamera.Click           += BtnSwitchCamera_Click;
                btnFlash.Click                  += BtnFlash_Click;
                ivGalleryPhotoVideoUpload.Click += IvGalleryPhotoVideoUpload_Click;
                if (EventID == 0)
                {
                    AlertBox.Create("Error", "Error occurred!", this);
                    return;
                }

                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);
            }
            catch (Java.Lang.Exception ex)
            {
                new CrashReportAsync("ImageCapture", "OnCreate", ex.Message + ex.StackTrace).Execute();
            }
        }
Exemplo n.º 12
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                var prefs = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                MaxImageForWeClip = prefs.GetInt("MaxImageForWeClip", 0);
                MaxVideoMinute    = prefs.GetLong("MaxVideoDuration", 0);
                MaxVideoForWeclip = prefs.GetInt("MaxVideoForWeclip", 0);

                SetContentView(Resource.Layout.EventGalleryView);
                Toolbar  toolbar       = (Toolbar)FindViewById(Resource.Id.toolbar);
                TextView toolbar_title = (TextView)this.FindViewById(Resource.Id.toolbar_title);

                SetSupportActionBar(toolbar);
                SupportActionBar.Title = "";
                Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);

                if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
                {
                    Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
                    Window.SetStatusBarColor(new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.primaryDark)));
                }
                EventID        = Intent.GetLongExtra("strEventGallery", 0);
                IsDefaultEvent = Intent.GetBooleanExtra("strDefultEvent", false);
                if (EventID == 0)
                {
                    AlertBox.Create("Error", "Error occurred!", this);
                    return;
                }

                gvEventPhoto = FindViewById <GridView>(Resource.Id.gvEventPhotos);
                noOfImage    = FindViewById <TextView>(Resource.Id.etNoOfImage);
                ivNext       = FindViewById <ImageView>(Resource.Id.ivCreateWeClipNext);
                ivBack       = FindViewById <ImageView>(Resource.Id.ivCreateWeClipBack);

                ivNext.Click           += IvNext_Click;
                ivBack.Click           += IvBack_Click;
                gvEventPhoto.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.Multiple;
                if (IsDefaultEvent == false)
                {
                    toolbar_title.Text = "Create WeClip";
                    new GetEventFile(gvEventPhoto, this, noOfImage, EventID).Execute();
                }
                else
                {
                    toolbar_title.Text = "Edit my story";
                    new GetDefultEventFile(gvEventPhoto, this, noOfImage, EventID).Execute();
                }
            }
            catch (Exception ex)
            {
                new CrashReportAsync("EventGalleryView", "OnCreate", ex.Message + ex.StackTrace).Execute();
            }
        }
 private void IvGalleryPhotoVideoUpload_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(uploadImagePath))
     {
         AlertBox.Create("Error", "Select file from gallery or capture image", this);
         return;
     }
     else
     {
         new UploadEventFileBackGround(this, EventID, uploadImagePath).Execute();
     }
 }
Exemplo n.º 14
0
        private void BtnSumitForgotPassword_Click(object sender, EventArgs e)
        {
            string username = txtForgotUsername.Text;

            HideKeyBoard.hideSoftInput(this);
            if (username == "")
            {
                AlertBox.Create("Error", "Please enter username!", this);
                return;
            }
            new callForgotPassword(this, username).Execute();
        }
Exemplo n.º 15
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                SetContentView(Resource.Layout.ThemeView);
                Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);

                Toolbar  toolbar       = (Toolbar)FindViewById(Resource.Id.toolbar);
                TextView toolbar_title = (TextView)this.FindViewById(Resource.Id.toolbar_title);

                SetSupportActionBar(toolbar);

                if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
                {
                    Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
                    Window.SetStatusBarColor(new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.primaryDark)));
                }

                SupportActionBar.Title = "";
                toolbar_title.Text     = "Select theme";
                imageViewNext          = FindViewById <ImageView>(Resource.Id.ivSelectThemeNext);
                imageViewBack          = FindViewById <ImageView>(Resource.Id.ivSelectThemeBack);
                //strEventData = this.Intent.GetStringExtra("strMusicView") ?? null;

                strEventData = this.Intent.GetStringExtra("strEventGalleryView") ?? null;


                if (!string.IsNullOrEmpty(strEventData))
                {
                    wcHolder           = JsonConvert.DeserializeObject <WeClipInfo>(strEventData);
                    gvTheme            = FindViewById <GridView>(Resource.Id.gvTheme);
                    gvTheme.ChoiceMode = ChoiceMode.Single;
                    gvTheme.SetDrawSelectorOnTop(true);
                    imageViewNext.Click += ImageViewNext_Click;
                    imageViewBack.Click += ImageViewBack_Click;
                    new GetThemeFile(this, gvTheme, wcHolder).Execute();
                }
                else
                {
                    AlertBox.Create("Error", "Error occured", this);
                    return;
                }
            }
            catch (System.Exception ex)
            {
                new CrashReportAsync("Theme", "OnCreate", ex.Message + ex.StackTrace).Execute();
            }
        }
Exemplo n.º 16
0
        private void ImageViewNext_Click(object sender, EventArgs e)
        {
            if (wcHolder.ThemeID == 0)
            {
                AlertBox.Create("Error", "Please select theme", this);
                return;
            }

            var    data   = JsonConvert.SerializeObject(wcHolder);
            Intent intent = new Intent(this, typeof(PostWeClip));

            intent.PutExtra("strMusicView", data);
            StartActivity(intent);
            this.Finish();
        }
Exemplo n.º 17
0
        private void IvCreateWeClip_Click(object sender, EventArgs e)
        {
            wcHolder.Tag   = etWecliptag.Text;
            wcHolder.Title = etWeClipTitle.Text;

            if (wcHolder.Title.Trim() == "")
            {
                AlertBox.Create("Error", "Please enter title.", this);
                return;
            }
            HideKeyBoard.hideSoftInput(this);
            CreateWeClip createWeClip = new CreateWeClip(this, wcHolder);

            createWeClip.Execute();
        }
        protected override void OnResume()
        {
            base.OnResume();
            if (CameraHelper.CheckCameraAvailability(this))
            {
                InitializeCamera();
            }
            else
            {
                AlertBox.Create("", "Your device does not seem to have camera.", this);
            }

            if (orientationManager != null)
            {
                orientationManager.Enable();
            }
        }
Exemplo n.º 19
0
 protected override void OnPostExecute(JsonResult result)
 {
     dialog.Dismiss();
     base.OnPostExecute(result);
     if (result != null)
     {
         var del = (from x in friendReq where x.ID == getRequestedFriend_Result.ID select x).FirstOrDefault();
         if (del != null)
         {
             friendReq.Remove(del);
         }
         frienRequestAdapter.NotifyDataSetChanged();
     }
     else
     {
         AlertBox.Create("Error", "Error", activity);
     }
 }
Exemplo n.º 20
0
 protected override void OnPostExecute(Java.Lang.Object result)
 {
     base.OnPostExecute(result);
     p.Dismiss();
     if (result != null)
     {
         if (jResult.Success == true)
         {
             AlertBox.Create("Success", "Send Successfully", activity);
         }
         else
         {
             AlertBox.Create("Error", "Error occured", activity);
         }
     }
     else
     {
         AlertBox.Create("Error", "Error occured", activity);
     }
 }
Exemplo n.º 21
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                SetContentView(Resource.Layout.PostWeClip);
                Toolbar  toolbar       = (Toolbar)FindViewById(Resource.Id.toolbar);
                TextView toolbar_title = (TextView)this.FindViewById(Resource.Id.toolbar_title);
                SetSupportActionBar(toolbar);
                SupportActionBar.Title = "";
                toolbar_title.Text     = "Post WeClip";
                if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
                {
                    Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
                    Window.SetStatusBarColor(new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.primaryDark)));
                }
                etWeClipTitle    = FindViewById <EditText>(Resource.Id.etWeClipTitle);
                etWecliptag      = FindViewById <EditText>(Resource.Id.etWeClipTags);
                ivCreateWeClip   = FindViewById <ImageButton>(Resource.Id.ivPostWeClipCreate);
                ivPostWeClipBack = FindViewById <ImageButton>(Resource.Id.ivPostWeClipBack);
                strWeClipdata    = this.Intent.GetStringExtra("strMusicView") ?? null;

                if (!string.IsNullOrEmpty(strWeClipdata))
                {
                    wcHolder                = JsonConvert.DeserializeObject <WeClipInfo>(strWeClipdata);
                    ivCreateWeClip.Click   += IvCreateWeClip_Click;
                    ivPostWeClipBack.Click += IvPostWeClipBack_Click;
                }
                else
                {
                    AlertBox.Create("Error", "Error occured.", this);
                    return;
                }
            }
            catch (Exception ex)
            {
                new CrashReportAsync("PostWeClip", "OnCreate", ex.Message + ex.StackTrace).Execute();
            }
        }
Exemplo n.º 22
0
        private void btnRegister_click(object sender, EventArgs e)
        {
            HideKeyBoard.hideSoftInput(this);

            if (string.IsNullOrEmpty(txtPhone.Text))
            {
                AlertBox.Create("Error", "Please enter phone number.", this);
                txtPhone.RequestFocus();
                return;
            }

            if (string.IsNullOrEmpty(txtPassword.Text))
            {
                AlertBox.Create("Error", "Please enter password.", this);
                txtPassword.RequestFocus();
                return;
            }

            if (string.IsNullOrEmpty(txtConfirmPassword.Text))
            {
                AlertBox.Create("Error", "Please enter confirm password.", this);
                txtConfirmPassword.RequestFocus();
                return;
            }
            if (txtPassword.Text != txtConfirmPassword.Text)
            {
                AlertBox.Create("Error", "Password and confirm password does not match.", this);
                txtPassword.RequestFocus();
                return;
            }

            RegistrationModel reg = new RegistrationModel();

            reg.Password        = txtPassword.Text;
            reg.DeviceID        = "";
            reg.ConfirmPassword = txtConfirmPassword.Text;
            reg.PhoneNumber     = txtPhone.Text;
            new RegistrationInBackGround(reg, this).Execute();
        }
        private void BtnChangePassword_Click(object sender, EventArgs e)
        {
            if (etoldPassword.Text == "")
            {
                AlertBox.Create("Error", "Please enter old password", Activity);
                return;
            }

            if (etnewPassword.Text == "")
            {
                AlertBox.Create("Error", "Please enter new password", Activity);
                return;
            }

            if (etnewPassword.Text != etConfirmPassword.Text)
            {
                AlertBox.Create("Error", "Password and confirm password does not match", Activity);
                return;
            }
            new PostChangePassword(Activity, new ChangePasswordBindingModel {
                OldPassword = etoldPassword.Text, NewPassword = etnewPassword.Text, ConfirmPassword = etConfirmPassword.Text
            }).Execute();
        }
 protected override void OnPostExecute(Java.Lang.Object result)
 {
     base.OnPostExecute(result);
     if (result != null && jsonResult != null)
     {
         if (jsonResult.Success == true)
         {
             AlertBox.Create("Success", "Data updated", activity);
             var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
             var prefEditor = prefs.Edit();
             prefEditor.PutString("UserName", objUP.UserName);
             prefEditor.PutString("Bio", objUP.Bio);
             prefEditor.Commit();
             drawerUsername.Text = objUP.UserName;
             progressDialog.Hide();
         }
     }
     else
     {
         AlertBox.Create("Error", "Faile to updated", activity);
         progressDialog.Hide();
     }
 }
        // Initialize Camera
        private void InitializeCamera()
        {
            _camera = CameraHelper.GetCameraInstance((int)_cameraFacing);
            if (_camera != null)
            {
                //CameraHelper.SetCameraDisplayOrientation(this, 0, _camera);
                SurfaceOrientation displayRotation = this.WindowManager.DefaultDisplay.Rotation;

                // Create our Preview view and set it as the content of our activity.
                _preview = new CameraPreview(this, _camera, (int)_cameraFacing, displayRotation);

                //IList<Android.Hardware.Camera.Size> sizes = _camera.GetParameters().SupportedPreviewSizes;
                //_camera.GetParameters().SetPreviewSize(sizes[0].Width, sizes[0].Height);

                camera_preview.AddView(_preview);

                SetFlash();
            }
            else
            {
                AlertBox.Create("", "Could not access camera!", this);
            }
        }
Exemplo n.º 26
0
        private void IvNext_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsDefaultEvent == false)
                {
                    selectedItem = ListOfEventFiles.listOfEventFiles.Where(x => x.isSelected() == true).ToList();
                }

                else
                {
                    selectedItem = ListOfDefultEventFiles.listOfEventFiles.Where(x => x.isSelected() == true).ToList();
                }

                selectedMedia = new List <ImageInfo>();

                double totalduration = 0;

                var ImageSelected = (from x in selectedItem where x.IsVideo == false select x).Count();
                var VideoSelected = (from x in selectedItem where x.IsVideo == true select x).Count();


                foreach (var file in selectedItem)
                {
                    if (file.IsVideo == false)
                    {
                        file.Duration = 0.05;
                    }
                    totalduration = totalduration + file.Duration;
                }

                if (selectedItem.Count < GlobalClass.MinNoOfSelectedFile)
                {
                    AlertBox.Create("Error", "Please select atleast 3 files!", this);
                    return;
                }

                if (totalduration > MaxVideoMinute)
                {
                    Android.App.AlertDialog.Builder alertDialog = new Android.App.AlertDialog.Builder(this);
                    alertDialog.SetMessage("Upgrade to WeClip Premium and create movies with even more photos.");
                    alertDialog.SetPositiveButton("Go PREMIUM", (senderAlert, args) =>
                    {
                        Intent intent1 = new Intent(this, typeof(PackageActivity));
                        StartActivity(intent1);
                    });
                    alertDialog.SetNegativeButton("NO THANKS", (senderAlert, args) =>
                    {
                        alertDialog.Dispose();
                    });
                    alertDialog.Show();
                    return;
                }

                if (ImageSelected > MaxImageForWeClip)
                {
                    Android.App.AlertDialog.Builder alertDialog = new Android.App.AlertDialog.Builder(this);
                    alertDialog.SetMessage("Upgrade to WeClip Premium and create movies with even more photos.");
                    alertDialog.SetPositiveButton("Go PREMIUM", (senderAlert, args) =>
                    {
                        Intent intent1 = new Intent(this, typeof(PackageActivity));
                        StartActivity(intent1);
                    });
                    alertDialog.SetNegativeButton("NO THANKS", (senderAlert, args) =>
                    {
                        alertDialog.Dispose();
                    });
                    alertDialog.Show();
                    return;
                }


                if (VideoSelected > MaxVideoForWeclip)
                {
                    Android.App.AlertDialog.Builder alertDialog = new Android.App.AlertDialog.Builder(this);
                    alertDialog.SetMessage("Upgrade to WeClip Premium and create movies with even more videos.");
                    alertDialog.SetPositiveButton("Go PREMIUM", (senderAlert, args) =>
                    {
                        Intent intent1 = new Intent(this, typeof(PackageActivity));
                        StartActivity(intent1);
                    });
                    alertDialog.SetNegativeButton("NO THANKS", (senderAlert, args) =>
                    {
                        alertDialog.Dispose();
                    });
                    alertDialog.Show();
                    return;
                }

                foreach (var data in selectedItem)
                {
                    imageInfo          = new ImageInfo();
                    imageInfo.IsVideo  = data.IsVideo;
                    imageInfo.Filename = data.FileName;
                    selectedMedia.Add(imageInfo);
                }

                //WeClipInfo wc_holder = new WeClipInfo();
                //wc_holder.MediaFile = selectedMedia;
                //wc_holder.EventID = EventID;
                //wc_holder.IsDefault = IsDefaultEvent;
                //var jasondata = JsonConvert.SerializeObject(wc_holder);
                //Intent intent = new Intent(this, typeof(MusicView));
                //intent.PutExtra("strEventGalleryView", jasondata);
                //StartActivity(intent);
                //this.Finish();

                WeClipInfo wc_holder = new WeClipInfo();
                wc_holder.MediaFile = selectedMedia;
                wc_holder.EventID   = EventID;
                wc_holder.IsDefault = IsDefaultEvent;
                var    jasondata = JsonConvert.SerializeObject(wc_holder);
                Intent intent    = new Intent(this, typeof(ThemeActivity));
                intent.PutExtra("strEventGalleryView", jasondata);
                StartActivity(intent);
                this.Finish();
            }
            catch (System.Exception ex)
            {
                new CrashReportAsync("EventGalleryView", "IvNext_Click", ex.Message + ex.StackTrace).Execute();
            }
        }
Exemplo n.º 27
0
        protected override void OnPostExecute(Java.Lang.Object result)
        {
            base.OnPostExecute(result);
            //    progressDialog.Dismiss();
            if (result != null && authentication != null && authentication.access_token != null && authentication.Success == true)
            {
                GlobalClass.AccessToken = authentication.access_token;
                GlobalClass.UserEmail   = authentication.EmailID;
                GlobalClass.UserID      = authentication.UserID.ToString();
                Log.Debug("AccessToken", GlobalClass.AccessToken);
                Log.Debug("AccessTokenExpiresIn", authentication.expires_in.ToString());
                var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                var prefEditor = prefs.Edit();
                prefEditor.PutString("Password", password);
                prefEditor.PutString("LoginUserName", authentication.LoginUserName);
                prefEditor.PutString("EmailID", authentication.EmailID);
                prefEditor.PutString("Access_Token", authentication.access_token);
                prefEditor.PutString("UserID", authentication.UserID.ToString());
                prefEditor.PutString("ProfilePic", authentication.ProfilePic.ToString());
                prefEditor.PutString("UserName", authentication.UserName.ToString());
                prefEditor.PutString("IsNotificationEnable", authentication.IsNotificationEnable == null ? "false" : authentication.IsNotificationEnable.ToString());
                prefEditor.PutBoolean("IsPublic", Convert.ToBoolean(authentication.IsPublic));
                prefEditor.PutString("PhoneNumber", authentication.PhoneNumber);
                prefEditor.PutString("Bio", authentication.Bio);
                prefEditor.PutInt("MaxImageForWeClip", authentication.MaxImageForWeClip);
                prefEditor.PutLong("MaxVideoDuration", authentication.MaxVideoDurationInMinute);
                prefEditor.PutInt("MaxVideoForWeclip", authentication.MaxVideoForWeclip);
                prefEditor.PutLong("MaxVideoSize", authentication.MaxVideoSize);

                prefEditor.PutBoolean("RegisterEmail", false);
                prefEditor.PutBoolean("RegisterPhone", false);

                if (authentication.DOB != null)
                {
                    prefEditor.PutString("DOB", string.Format("{0: dd MMM yyyy}", authentication.DOB));
                }
                else
                {
                    prefEditor.PutString("DOB", "N/A");
                }
                prefEditor.Commit();

                var intent = new Intent(context, typeof(GCMRegistrationService));
                context.StartService(intent);

                context.StartActivity(typeof(MainActivity));
                context.Finish();
            }
            else
            {
                if (result != null && authentication != null && authentication.Success == false)
                {
                    if (authentication.status == "verify_account")
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(context);
                        alert.SetInverseBackgroundForced(true);
                        alert.SetTitle("Verify account");
                        alert.SetMessage(authentication.Message);
                        alert.SetPositiveButton("YES", (senderAlert, args) =>
                        {
                            var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                            var prefEditor = prefs.Edit();
                            prefEditor.PutString("LoginUserName", userName);
                            prefEditor.Commit();
                            context.StartActivity(new Intent(Application.Context, typeof(AddUserName)));
                            context.Finish();
                        });

                        alert.SetNegativeButton("NO", (senderAlert, args) =>
                        {
                            alert.Dispose();
                        });
                        Android.App.Dialog dialog = alert.Create();
                        dialog.Show();
                    }
                    else
                    {
                        AlertBox.Create("Error", authentication.Message, context);
                        var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                        var prefEditor = prefs.Edit();
                        prefEditor.Clear();
                        prefEditor.Commit();
                    }
                }
                else
                {
                    AlertBox.Create("Error", "Error occured", context);
                    var prefs      = Application.Context.GetSharedPreferences("WeClip", FileCreationMode.Private);
                    var prefEditor = prefs.Edit();
                    prefEditor.Clear();
                    prefEditor.Commit();
                }
            }
        }
Exemplo n.º 28
0
        private void ImgCreateEvent_Click(object sender, EventArgs e)
        {
            try
            {
                HideKeyBoard.hideSoftInput(this);
                if (eventTitle.Text.Trim() == "")
                {
                    AlertBox.Create("Error", "Please enter event title.", this);
                    return;
                }

                if (eventDate.Text.Trim() == "")
                {
                    AlertBox.Create("Error", "Please enter event date.", this);
                    return;
                }

                model.UserID    = Convert.ToInt64(GlobalClass.UserID);
                model.EventName = eventTitle.Text;

                if (eventDate.Text != "")
                {
                    model.EventDate = DateTime.ParseExact(eventDate.Text, "dd MMM yyyy", cultureInfo);
                }

                if (eventTime.Text != "")
                {
                    string StartTimeInput = eventTime.Text;
                    var    timeFromInput  = DateTime.ParseExact(StartTimeInput, "H:m", cultureInfo);
                    model.EventStartTime = timeFromInput;
                }

                else
                {
                    model.EventStartTime = null;
                }

                model.EventLocation    = eventLocation.Text;
                model.EventDescription = EventInfo.Text == null ? "" : EventInfo.Text;

                int selectedId = rgPrivacy.CheckedRadioButtonId;
                var rbselected = FindViewById <RadioButton>(selectedId);

                if (rbselected.Text == "Public")
                {
                    category = "Public";
                }
                else
                {
                    category = "Personal";
                }
                model.EventCategory = category;
                Intent intent = new Intent(this, typeof(EventCreateAddEventProfilePic));
                intent.PutExtra("strCreateEvent", JsonConvert.SerializeObject(model));
                this.StartActivity(intent);
                this.Finish();
            }
            catch (Exception ex)
            {
                new CrashReportAsync("CreateEvent", "ImgCreateEvent_Click", ex.Message + ex.StackTrace).Execute();
            }
        }
 public bool OnActionItemClicked(ActionMode mode, IMenuItem item)
 {
     AlertBox.Create("Delete", "Are you sure", activity);
     return(true);
 }
Exemplo n.º 30
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);
                SetContentView(Resource.Layout.VideoPlayer);
                Toolbar  toolbar       = (Toolbar)FindViewById(Resource.Id.toolbar);
                TextView toolbar_title = (TextView)FindViewById(Resource.Id.toolbar_title);
                pDialog = FindViewById <ProgressBar>(Resource.Id.progessbar);
                SetSupportActionBar(toolbar);

                Window.SetSoftInputMode(SoftInput.StateAlwaysHidden);

                if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Lollipop)
                {
                    Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
                    Window.SetStatusBarColor(new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.primaryDark)));
                }

                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);

                var url          = Intent.GetStringExtra("VideoUrl") ?? null;
                var urlFromEvent = Intent.GetStringExtra("VideoUrlFromEvent") ?? null;
                urlFromTheme = Intent.GetStringExtra("VideoUrlFromTheme") ?? null;


                if (url != null && url != "")
                {
                    SupportActionBar.Title = "";
                    toolbar_title.Text     = "WeClip";
                    videoInfo     = JsonConvert.DeserializeObject <WeClipVideo>(url);
                    videoUri      = Android.Net.Uri.Parse(videoInfo.VideoFileUrl);
                    EventName     = videoInfo.EventName;
                    EventDate     = videoInfo.EventDate;
                    videoFileName = videoInfo.VideoFileName;
                    videoUrl      = videoInfo.VideoFileUrl;

                    shareTitle = videoInfo.EventName;
                    shareDate  = videoInfo.EventDate != null?videoInfo.EventDate.ToString() : "";

                    sharePath = videoInfo.VideoFileUrl;
                }
                else if (!string.IsNullOrEmpty(urlFromEvent))
                {
                    SupportActionBar.Title = "";
                    toolbar_title.Text     = "Event Video";
                    EventvideoInfo         = JsonConvert.DeserializeObject <EventFiles>(urlFromEvent);
                    videoUri      = Android.Net.Uri.Parse(EventvideoInfo.FileUrl);
                    EventName     = EventvideoInfo.EventName;
                    videoFileName = EventvideoInfo.FileName;
                    videoUrl      = EventvideoInfo.FileUrl;
                    shareTitle    = EventvideoInfo.EventName;
                    shareDate     = "";
                    sharePath     = EventvideoInfo.FileUrl;
                }

                else if (!string.IsNullOrEmpty(urlFromTheme))
                {
                    SupportActionBar.Title = "";
                    videoInfo          = JsonConvert.DeserializeObject <WeClipVideo>(urlFromTheme);
                    toolbar_title.Text = videoInfo.EventName;
                    videoUri           = Android.Net.Uri.Parse(videoInfo.VideoFileUrl);
                    videoFileName      = videoInfo.VideoFileName;
                    videoUrl           = videoInfo.VideoFileUrl;

                    shareTitle = videoInfo.EventName;
                    shareDate  = videoInfo.EventDate != null?videoInfo.EventDate.ToString() : "";

                    sharePath = videoInfo.VideoFileUrl;
                }

                if (videoUri == null)
                {
                    AlertBox.Create("Alert", "Error in WeClip source.", this);
                    return;
                }
                if (getfileFromPath(videoFileName))
                {
                    videoUri = localFileUrl;
                }

                llVideoView   = FindViewById <LinearLayout>(Resource.Id.llVideoView);
                playerSurface = FindViewById <SurfaceView>(Resource.Id.playerSurface);

                vidHolder = playerSurface.Holder;
                vidHolder.AddCallback(this);

                pDialog.Visibility = ViewStates.Visible;

                mediaController = new Android.Widget.MediaController(this);
            }
            catch (System.Exception ex)
            {
            }
        }