Ejemplo n.º 1
0
        public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.SignLayout, container, false);

            Button clearButton = view.FindViewById<Button> (Resource.Id.clearButton);
            Button sendButton = view.FindViewById<Button> (Resource.Id.sendButton);

            EditText remarks = view.FindViewById<EditText> (Resource.Id.txtRemarks);
            ToggleButton notification = view.FindViewById<ToggleButton> (Resource.Id.toggleNotifications);

            SignView signView = view.FindViewById<SignView> (Resource.Id.signView);

            mDialog = new ProgressDialog(this.Activity);
            mDialog.SetMessage("Sending...");
            mDialog.SetCancelable(false);

            clearButton.Click += delegate {
                signView.ClearCanvas();
            };

            sendButton.Click += delegate {
                using (MemoryStream stream = new MemoryStream())
                {
                    if (signView.CanvasBitmap().Compress(Bitmap.CompressFormat.Png, 100, stream))
                    {
                        byte[] image = stream.ToArray();
                        string base64signature = Convert.ToBase64String(image);
                        Backend.Current.send(base64signature, remarks.Text, notification.Activated, OnSendSuccess, OnSendFail);
                        mDialog.Show();
                    }
                }
            };

            return view;
        }
Ejemplo n.º 2
0
 public static ProgressDialog ShowStatus(Context cxt, string msg)
 {
     ProgressDialog status = new ProgressDialog(cxt);
     status.SetMessage(msg);
     status.Show();
     return status;
 }
Ejemplo n.º 3
0
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            //			Console.WriteLine("[{0}] OnCreateView Called: {1}", TAG, DateTime.Now.ToLongTimeString());
            View v = inflater.Inflate(Resource.Layout.fragment_photo, container, false);

            mImageView = v.FindViewById<ImageView>(Resource.Id.photoView);

            photoUrl = Activity.Intent.GetStringExtra(PhotoGalleryFragment.PHOTO_URL_EXTRA);

            photoUrl = photoUrl.Substring(0, photoUrl.Length-6) + ".jpg";
            photoFilename = new FlickrFetchr().GetFilenameFromUrl(photoUrl);

            ProgressDialog pg = new ProgressDialog(Activity);
            pg.SetMessage(Resources.GetString(Resource.String.loading_photo_message));
            pg.SetTitle(Resources.GetString(Resource.String.loading_photo_title));
            pg.SetCancelable(false);
            pg.Show();

            Task.Run(async () => {
                Bitmap image = await new FlickrFetchr().GetImageBitmapAsync(photoUrl, 0, new CancellationTokenSource().Token, photoFilename).ConfigureAwait(false);
                Activity.RunOnUiThread(() => {
                    mImageView.SetImageBitmap(image);
                    //Console.WriteLine("[{0}] File created: {1}", TAG, photoUrl);
                    pg.Dismiss();
                });
            });

            return v;
        }
		protected override void OnViewModelSet()
		{
			base.OnViewModelSet();

			// show a progress box if there is some work
			var events = ViewModel as EventsViewModel;
			if (events != null)
			{
				ProgressDialog progress = null;
				events.PropertyChanged += (sender, e) =>
				{
					if (e.PropertyName == "IsWorking")
					{
						if (events.IsWorking)
						{
							if (progress == null)
							{
								progress = new ProgressDialog(this);
								progress.SetProgressStyle(ProgressDialogStyle.Spinner);
								progress.SetMessage("Doing absolutely nothing in the background...");
								progress.Show();
							}
						}
						else
						{
							if (progress != null)
							{
								progress.Dismiss();
								progress = null;
							}
						}
					}
				};
			}
		}
Ejemplo n.º 5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            var groupName = Intent.GetStringExtra("name");
            Title = groupName;
            GroupName = groupName;

            _contactRepo = new ContactRepository(this);

            _progressDialog = new ProgressDialog(this);
            _progressDialog.SetMessage("Loading Contacts.  Please wait...");
            _progressDialog.Show();

            Task.Factory
                .StartNew(() =>
                    _contactRepo.GetAllMobile())
                .ContinueWith(task =>
                    RunOnUiThread(() =>
                    {
                        if (task.Result != null)
                            DisplayContacts(task.Result);
                        _progressDialog.Dismiss ();
                    }));
        }
		private async Task ConnectToRelay()
		{
			bool connected = false;

			var waitIndicator = new ProgressDialog(this) { Indeterminate = true };
			waitIndicator.SetCancelable(false);
			waitIndicator.SetMessage("Connecting...");
			waitIndicator.Show();

			try
			{
				var prefs = PreferenceManager.GetDefaultSharedPreferences(this);

				connected = await _remote.Connect(prefs.GetString("RelayServerUrl", ""), 
				                                  prefs.GetString("RemoteGroup", ""), 
				                                  prefs.GetString("HubName", ""));
			}
			catch (Exception)
			{
			}
			finally
			{
				waitIndicator.Hide();
			}

			Toast.MakeText(this, connected ? "Connected!" : "Unable to connect", ToastLength.Short).Show();
		}
Ejemplo n.º 7
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            Button start = FindViewById<Button>(Resource.Id.startButton);
            Button stop = FindViewById<Button>(Resource.Id.stopButton);

            ProgressDialog pd = new ProgressDialog(this)
            {
                Indeterminate = true,
            };

            pd.SetMessage("Waiting");

            pd.SetButton("cancel", (s, e) => Stop(pd));
            pd.SetIcon(Resource.Drawable.Icon);

            //pd.SetCancelable(false);

            Drawable myIcon = Resources.GetDrawable(Resource.Animation.progress_dialog_icon_drawable_animation);
            pd.SetIndeterminateDrawable(myIcon);

            start.Click += delegate { Start(pd); };
            stop.Click += delegate { Stop(pd); };
        }
Ejemplo n.º 8
0
    private async void SaveButton_Click(object sender, EventArgs ea)
    {
      var dialog = new ProgressDialog(this);
      dialog.SetMessage(Resources.GetString(Resource.String.Saving));
      dialog.SetCancelable(false);
      dialog.Show();

      try
      {
        Bindings.UpdateSourceForLastView();
        this.Model.ApplyEdit();
        var returnModel = await this.Model.SaveAsync();
        InitializeBindings(returnModel);
      }
      catch (Exception ex)
      {
        var alert = new AlertDialog.Builder(this);
        alert.SetMessage(string.Format(Resources.GetString(Resource.String.Error), ex.Message));
        alert.Show();
      }
      finally
      {
        dialog.Hide();
      }
    }
Ejemplo n.º 9
0
 public static ProgressDialog CreateProgressDialog(string message, Activity activity)
 {
     var mProgressDialog = new ProgressDialog(activity, Resource.Style.LightDialog);
     mProgressDialog.SetMessage(message);
     mProgressDialog.SetCancelable(false);
     mProgressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
     return mProgressDialog;
 }
Ejemplo n.º 10
0
		public void Show(Context context, string content)
		{
			var dialog = new ProgressDialog(context);
			dialog.SetMessage(content);
			dialog.SetCancelable(false);
			dialog.Show();
			System.Threading.Thread.Sleep (2000);
			dialog.Hide ();
		}
        public void OnClick(View V)
        {
            ProgressDialog progress = new ProgressDialog(this);
            try
            {
                switch(V.Id)
                {
                case Resource.Id.bSignIn :
                    {
                        isLogin=false;
                        Boolean blnValidate=  FieldValidation();
                        if (blnValidate==true)
                        {
                            progress.Indeterminate = true;
                            progress.SetProgressStyle(ProgressDialogStyle.Spinner);
                            progress.SetMessage("Contacting server. Please wait...");
                            progress.SetCancelable(true);
                            progress.Show();

                            var progressDialog = ProgressDialog.Show(this, "Please wait...", "Checking Login info...", true);

                            new Thread(new ThreadStart(delegate
                            {

                                RunOnUiThread(() => ValidateSqluserpwd(etUsername.Text.ToString() , etpwd.Text.ToString()));
                                if (isLogin== true){
                                    RunOnUiThread(() => Toast.MakeText(this, "Login detail found in system...", ToastLength.Short).Show());
                                }
                                RunOnUiThread(() => progressDialog.Hide());
                            })).Start();
                        }
                        break;
                    }
                case Resource.Id.tvforget :
                    {
                        var toast = Toast.MakeText(this,"Forget link clicked",ToastLength.Short);
                        toast.Show();
                        break;
                    }
                case Resource.Id.tvregister :
                    {
                        var myIntent = new Intent (this, typeof(MainActivity));
                        StartActivityForResult (myIntent, 0);
                        break;
                    }
                }
            }
            catch (NullReferenceException ex) {
                var toast = Toast.MakeText (this, ex.Message ,ToastLength.Short);
                toast.Show ();
            }
            finally
            {
                // Now hide the progress dialog
                progress.Dismiss();
            }
        }
Ejemplo n.º 12
0
	    public static void MakeCall(CallEntity callEntity, Activity activity)
	    {
            var category = callEntity.Category;
            var choice = callEntity.Choice ?? "";
            var detail = callEntity.Detail ?? "";

	        new AlertDialog.Builder(activity)
	            .SetTitle(category + " " + choice + " " + detail)
	            .SetMessage(Strings.CallSendMessage)
	            .SetPositiveButton(Strings.CallSend, delegate
	            {
                    ThreadPool.QueueUserWorkItem(o =>
                    {
                        activity.RunOnUiThread(() =>
                        {
                            dialog = new ProgressDialog(activity);
                            dialog.SetMessage(Strings.SpinnerDataSending);
                            dialog.SetCancelable(false);
                            dialog.Show();
                        });

                        try
                        {
                            ICall patientCall = new PatientCall();
                            // Assign the callid with the returned MongoDB id
                            callEntity._id = patientCall.MakeCall(callEntity);

                            activity.RunOnUiThread(() =>
                            {
                                // Call successfull, take the user to myCalls
                                activity.ActionBar.SelectTab(activity.ActionBar.GetTabAt(1));
                                SetNewCalls(callEntity);
                                dialog.Hide();
                            });
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("ERROR making call: " + ex.Message);

                            activity.RunOnUiThread(() =>
                            {
                                dialog.Hide();

                                new AlertDialog.Builder(activity).SetTitle(Strings.Error)
                                    .SetMessage(Strings.ErrorSendingCall)
                                    .SetPositiveButton(Strings.OK,
                                        delegate { }).Show();
                            });
                        }
              
                    });
             
	            })
            .SetNegativeButton(Strings.Cancel, delegate {/* Do nothing */ })
            .Show();
	    }
Ejemplo n.º 13
0
 protected override void OnPreExecute()
 {
     base.OnPreExecute();
     progDialog = new ProgressDialog(activity);
     progDialog.SetMessage("Logging Out...");
     progDialog.Indeterminate=false;
     progDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
     progDialog.SetCancelable(true);
     progDialog.Show();
 }
Ejemplo n.º 14
0
 public static ProgressDialog ShowProgressDialog(Activity activity, int messageResId, /*int titleResId,*/ bool allowCancel, ProgressDialogStyle style=ProgressDialogStyle.Spinner)
 {
     ProgressDialog dialog = new ProgressDialog(activity);
     dialog.SetProgressStyle(style);
     //dialog.SetTitle(titleResId);
     dialog.SetMessage(activity.Resources.GetString(messageResId));
     dialog.SetCancelable(allowCancel);
     dialog.SetCanceledOnTouchOutside(allowCancel);
     dialog.Show();
     return dialog;
 }
Ejemplo n.º 15
0
 public DownloadFileHelper(Activity parent)
 {
     CallingActivity = parent;
     progress = new ProgressDialog(CallingActivity);
     progress.Indeterminate = false;
     progress.SetProgressStyle(ProgressDialogStyle.Horizontal);
     progress.SetMessage("Downloading. Please wait...");
     progress.SetCancelable(false);
     progress.Max = 100;
     //OnFinishDownloadHandle += new OnFinishDownload (FinishDownload);
 }
 private ProgressDialog CreateProgressDialog()
 {
     var progress = new ProgressDialog(this)
     {
         Indeterminate = true
     };
     progress.SetCancelable(false);
     progress.SetProgressStyle(ProgressDialogStyle.Spinner);
     progress.SetMessage("Contacting server. Please wait...");
     return progress;
 }
        public ExpenseFormArrayAdapter(Activity context)
            : base()
        {
            this.context = context;
            this.items = new List<SavedExpenseForm> ();
            mDialog = new ProgressDialog(this.context);
            mDialog.SetMessage("Loading...");
            mDialog.SetCancelable(false);

            Backend.Current.getExpenseForms(OnGetExpenseFormsSuccess, OnGetExpenseFormsFail);
            mDialog.Show ();
        }
Ejemplo n.º 18
0
 private void ShowProgressDialog(ProgressDialog progressDialog, string message, bool show)
 {
     if (show)
     {
         progressDialog.Indeterminate = true;
         progressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
         progressDialog.SetMessage(message);
         progressDialog.SetCancelable(false);
         progressDialog.Show();
     }
     else
         progressDialog.Hide();
 }
 public override void ShowProgressDialog(string message)
 {
     _context.RunOnUiThread(() => {
         if(_progressDialog != null)
         {
             _progressDialog.Dismiss ();
             _progressDialog= null;
         }
         _progressDialog = new ProgressDialog(_context);
         _progressDialog.SetMessage(message);
         _progressDialog.Show();
     });
 }
Ejemplo n.º 20
0
	public static void ShowProgressDialog(Activity context, string msg="Loading",  string title="",bool isCancle=false) {
		if(_mProgressDialog != null)	return;
		
		_mProgressDialog = new ProgressDialog(context);
		_mProgressDialog.SetProgressStyle(ProgressDialogStyle.Spinner);
		_mProgressDialog.SetTitle(title);
        _mProgressDialog.SetMessage(msg);
        _mProgressDialog.SetCancelable(isCancle);
	    if (!context.IsFinishing)
	    {
	        _mProgressDialog.Show();
	    }
	}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.ListImages);
            String tagService = Intent.GetStringExtra ("TagService");

            gallery = (Gallery)FindViewById <Gallery> (Resource.Id.gallery);
            images = new List<Bitmap> ();

            progressDialog = new ProgressDialog(this) { Indeterminate = true };
            progressDialog.SetTitle("Carga de Datos");
            progressDialog.SetMessage("Wait");

            searchImagesByTag (tagService);
        }
Ejemplo n.º 22
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _loginService = new LoginService();
            _progressDialog = new ProgressDialog(this) { Indeterminate = true };
            _progressDialog.SetTitle("Login In Progress");
            _progressDialog.SetMessage("Please wait...");

            loginSynchronously();
            //loginWithThread();
            //loginWithJavaThread();
            //loginWithThreadPool();
            //loginWithAsyncTask();
            //loginWithTaskLibrary();
        }
Ejemplo n.º 23
0
        private async void Botonregistrar_Click(object sender, EventArgs e)
        {
            progress = new Android.App.ProgressDialog(this.Context);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Registrando...Espere...");
            progress.SetCancelable(false);
            progress.Show();

            string dni    = txtdni.Text;
            string nombre = txtnombre.Text;
            string email  = txtEmail.Text;
            string telef  = txtTele_F.Text;
            string telec  = txtTele_C.Text;

            try
            {
                if (!string.IsNullOrEmpty(dni) || !string.IsNullOrEmpty(nombre) || !string.IsNullOrEmpty(email) || !string.IsNullOrEmpty(telef) || !string.IsNullOrEmpty(telec))
                {
                    //await
                    var dato = await controller.RegistraCliente(int.Parse(dni), nombre, email, int.Parse(telef), int.Parse(telec));

                    if (dato != null)
                    {
                        progress.Dismiss();
                        Toast.MakeText(this.Context, "Registrado Correctamente", ToastLength.Short).Show();
                        LimpiarCasillas();
                    }
                    else
                    {
                        progress.Dismiss();
                        Toast.MakeText(this.Context, "Error al Registrar", ToastLength.Short).Show();
                        LimpiarCasillas();
                    }
                }
                else
                {
                    progress.Dismiss();
                    Toast.MakeText(this.Context, "Campos vacios", ToastLength.Short).Show();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Ejemplo n.º 24
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.MyShop_ProductDetails);

			product_id = Intent.GetIntExtra("product_id",0);
			//setup background worker for data loading
			worker = new BackgroundWorker ();
			worker.DoWork += worker_DoWork;
			worker.WorkerSupportsCancellation = true;
			worker.RunWorkerCompleted += worker_RunWorkerCompleted;
			worker.RunWorkerAsync ();

			progress = new ProgressDialog(this);
			progress.Indeterminate = true;
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.SetMessage("Memuatkan data..");
			progress.SetCancelable(false);
			progress.Show();


			productImage = FindViewById<MultiImageView>(Resource.Id.productImage);
			tv_price = FindViewById <TextView> (Resource.Id.tv_price);
			tv_prodTitle = FindViewById <TextView> (Resource.Id.tv_prodTitle);
			wv_prodDesc = FindViewById <WebView> (Resource.Id.wv_prodDesc);
//			btn_addToCart = FindViewById <Button> (Resource.Id.btn_addToCart);
			btn_sellerInfo = FindViewById <Button> (Resource.Id.btn_sellerInfo);

     		var toolbar = FindViewById<V7Toolbar>(Resource.Id.toolbar);
			SetSupportActionBar (toolbar);
			toolbar.SetBackgroundColor (Color.ParseColor ("#9C27B0"));

			SupportActionBar.SetDisplayHomeAsUpEnabled (true);
			SupportActionBar.SetDisplayShowHomeEnabled (true);


			//call addToCart method
//			btn_addToCart.Click += (sender, e) => {
//				addToCart();
//			};

			btn_sellerInfo.Click += btnSellerInfo_click;

		}	
Ejemplo n.º 25
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.HomeLayout);

            // find our layout items
            addButton = FindViewById<Button> (Resource.Id.btnAddExpense);
            viewButton = FindViewById<Button> (Resource.Id.btnViewExpense);
            logoutButton = FindViewById<Button> (Resource.Id.btnLogout);
            lblWelcome = FindViewById<TextView> (Resource.Id.lblWelcome);

            mDialog = new ProgressDialog(this);
            mDialog.SetMessage("Logging out...");
            mDialog.SetCancelable(false);

            // Check if the user is logged in
            try {
                if (!Backend.Current.isAuthenticated ()) {
                    StartActivity (typeof(LoginActivity));
                }
                lblWelcome.Text = "Welcome " + Backend.Current.getFullName () + "!";
            } catch (Exception ex) {
                new AlertDialog.Builder(this)
                    .SetTitle("Error")
                    .SetMessage(ex.Message)
                    .SetPositiveButton("OK", delegate { })
                    .Show();
            }

            // set up the delegate actions for the buttons
            addButton.Click += delegate {
                StartActivity (typeof(MenuActivity));
            };

            viewButton.Click += delegate {
                StartActivity (typeof(ExpenseFormOverviewActivity));
            };

            logoutButton.Click += delegate {
                Backend.Current.logout(OnLogoutSuccess, OnLogoutFail);
                mDialog.Show ();
            };
        }
Ejemplo n.º 26
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            _progressDialog = new ProgressDialog(this);
            _progressDialog.SetMessage("Searching.  Please wait...");
            _progressDialog.Show();

            if (Intent.ActionSearch.Equals(Intent.Action))
            {
                string query = Intent.GetStringExtra(SearchManager.Query);

                Task.Factory
                    .StartNew(() =>
                        _productRepository.Search (query))
                    .ContinueWith(task =>
                        RunOnUiThread(() => RenderResults(task.Result)));
            }
        }
Ejemplo n.º 27
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.courseDetailToolBar);

            courseCode = Intent.GetStringExtra("courseCode") ?? "Data not available";

            //Defines the settings for progress bar
            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetTitle("Please Wait");
            progress.SetMessage("Getting Course Details");
            progress.SetCancelable(false);
            progress.Show();
            try
            {
                await Task.Run(() => CourseListFetcher(courseCode));

                await Task.Run(() => InstructorListFetcher(courseCode));

                progress.Hide();

                //listSample.Add("Getting Instructors");

                InitData();

                FindViews();
                //foreach (var item in listSample)
                //{
                //    Console.WriteLine("ListSample : " + item);
                //}
                //foreach (var item in userID)
                //{
                //    Console.WriteLine("UserIDs : " + item);
                //}
            }
            catch (System.Exception something)
            {
                progress.Hide();
                Console.WriteLine("Something : " + something);
                throw;
            }
        }
Ejemplo n.º 28
0
        public async Task getOrgData()
        {
            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");
            progress.Show();

            //dynamic value = new ExpandoObject();
            //value.OrgId = orgid;

            //   string json = JsonConvert.SerializeObject(value);
            try
            {
                string item = await restservice.OrgnizationList(this, "", location);

                //orgmodel[0].organizationName = "Select Orgnization";
                orgmodel = JsonConvert.DeserializeObject <List <OrgModel> >(item);
                orgmodel[0].organizationName = "Select Organization";
                for (int i = 0; i < orgmodel.Count; i++)
                {
                    OrgModel org = new OrgModel();
                    //org.organizationName=orgmodel[0].
                    org.organizationName = orgmodel[i].organizationName;
                    orgname.Add(org);
                }
                //  db.InsertMarkingList(orgmodel);

                progress.Dismiss();

                spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(Selectorg_ItemSelected);
                ArrayAdapter adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItem1, orgname);
                spinner.Adapter = adapter;

                //  getorglist()
            }

            catch (Exception ex)
            {
                progress.Dismiss();
            }
        }
Ejemplo n.º 29
0
 public override bool OnOptionsItemSelected(IMenuItem item)
 {
     switch (item.ItemId) {
         case global::Android.Resource.Id.Home:
             var intent = new Intent(this, typeof(MainActivity));
             intent.PutExtra ("defaultTab", 1);
             intent.AddFlags (ActivityFlags.ClearTop);
             StartActivity (intent);
             break;
         case Resource.Id.menuSaveGroup:
             _progressDialog = new ProgressDialog(this);
             _progressDialog.SetMessage("Saving SMS Group.  Please wait...");
             _progressDialog.Show();
             Task.Factory
                 .StartNew(SaveGroup)
                 .ContinueWith(task =>
                     RunOnUiThread(() =>
                             {
                                 _progressDialog.Dismiss ();
                                 var homeIntent = new Intent();
                                 homeIntent.PutExtra ("defaultTab", 1);
                                 homeIntent.AddFlags (ActivityFlags.ClearTop);
                                 homeIntent.SetClass (this, typeof(MainActivity));
                                 StartActivity(homeIntent);
                             }));
             break;
         case Resource.Id.menuCancelEdit:
             new AlertDialog.Builder(this)
                 .SetTitle ("Cancel")
                 .SetMessage ("Are you sure you want to cancel your changes for this SMS Group?")
                 .SetPositiveButton ("Yes", (o, e) => {
                         var homeIntent = new Intent();
                         homeIntent.PutExtra ("defaultTab", 1);
                         homeIntent.AddFlags (ActivityFlags.ClearTop);
                         homeIntent.SetClass (this, typeof(MainActivity));
                         StartActivity(homeIntent);
                     })
                 .SetNegativeButton ("No", (o, e) => { })
                 .Show ();
             break;
     }
     return true;
 }
Ejemplo n.º 30
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            var ListItemColor = FindViewById <ListView>(Resource.Id.ListItemColor);
            var txview        = FindViewById <TextView>(Resource.Id.txview);


            ListItemColor.Adapter = new CustomAdapters.ColorAdapter(this,

                                                                    Resource.Layout.ListItems,
                                                                    Resource.Id.textView2,
                                                                    Resource.Id.textView3,
                                                                    Resource.Id.imageView1
                                                                    );


            Data = new Complex();
            if (Data.res == null)
            {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Loading is Progress...");
                progress.SetCancelable(false);
                progress.Show();

                res = await Validate();

                Data.res = res;
                progress.Cancel();
            }
            else
            {
                res = Data.GetRes();
            }

            txview.Text = res;
        }
Ejemplo n.º 31
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            var groupId = Intent.GetIntExtra ("groupId", -1);
            GroupId = groupId;

            _progressDialog = new ProgressDialog(this);
            _progressDialog.SetMessage("Loading Contacts.  Please wait...");
            _progressDialog.Show();

            Task.Factory
                .StartNew(() =>
                    GetContacts(groupId))
                .ContinueWith(task =>
                    RunOnUiThread(() => {
                        DisplayContacts(task.Result);
                        _progressDialog.Dismiss ();
                    }));
        }
Ejemplo n.º 32
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.MyButton);

            button.Click += delegate {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Loading... Please wait...");
                progress.SetCancelable(false);
                progress.Show();
            };
        }
Ejemplo n.º 33
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Noticias);

            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Iniciando Sesion... Por Favor espere...");
            progress.SetCancelable(false);
            progress.Show();

            RunOnUiThread(() =>
            {
                lista         = FindViewById <ListView>(Resource.Id.listView1);
                Contenido con = new Contenido(this, Noticias.RegresarTodas());
                lista.Adapter = con;
                progress.Dismiss();
            });
        }
Ejemplo n.º 34
0
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View view = inflater.Inflate (Resource.Layout.MyShop_ProductDetails, container, false);

			//setup background worker for data loading
			worker = new BackgroundWorker ();
			worker.DoWork += worker_DoWork;
			worker.WorkerSupportsCancellation = true;
			worker.RunWorkerCompleted += worker_RunWorkerCompleted;
			worker.RunWorkerAsync ();

			progress = new ProgressDialog(Activity);
			progress.Indeterminate = true;
			progress.SetProgressStyle(ProgressDialogStyle.Spinner);
			progress.SetMessage("Memuatkan data..");
			progress.SetCancelable(false);
			progress.Show();


			productImage = view.FindViewById<MultiImageView>(Resource.Id.productImage);
			tv_price = view.FindViewById <TextView> (Resource.Id.tv_price);
			tv_prodTitle = view.FindViewById <TextView> (Resource.Id.tv_prodTitle);
			wv_prodDesc = view.FindViewById <WebView> (Resource.Id.wv_prodDesc);
			//			btn_addToCart = FindViewById <Button> (Resource.Id.btn_addToCart);
			btn_sellerInfo = view.FindViewById <Button> (Resource.Id.btn_sellerInfo);

//			var toolbar = FindViewById<V7Toolbar>(Resource.Id.toolbar);
//			SetSupportActionBar (toolbar);
//			SupportActionBar.SetDisplayHomeAsUpEnabled (true);


			//call addToCart method
			//			btn_addToCart.Click += (sender, e) => {
			//				addToCart();
			//			};

			btn_sellerInfo.Click += btnSellerInfo_click;

			return view;
		}
Ejemplo n.º 35
0
        private async void BotonConsultar_Click(object sender, EventArgs e)
        {
            progress = new Android.App.ProgressDialog(this.Context);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetMessage("Consultando...Espere...");
            progress.SetCancelable(false);
            progress.Show();

            if (!string.IsNullOrEmpty(txtnroTicket.Text))
            {
                var dato = await controller.ConsultaReserva(int.Parse(txtnroTicket.Text));

                if (dato != null)
                {
                    txtpelicula.Text      = dato.nombre_peli;
                    txtlocal.Text         = dato.nombre_local;
                    txtsala.Text          = dato.num_sala + "";
                    txtinicio.Text        = dato.inicio;
                    txtfin.Text           = dato.fin;
                    txtdnicliente.Text    = dato.dni;
                    txtnombrecliente.Text = dato.nom_cliente;


                    progress.Dismiss();
                }
                else
                {
                    progress.Dismiss();
                    Toast.MakeText(this.Context, "Reserva no encontrada", ToastLength.Long).Show();
                    LimpiarCasillas();
                }
            }
            else
            {
                progress.Dismiss();
                Toast.MakeText(this.Context, "Campo vacio", ToastLength.Long).Show();
            }
        }
Ejemplo n.º 36
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.LoginLayout);

            // Get our button from the layout resource,
            // and attach an event to it
            EditText txtEmail = FindViewById<EditText> (Resource.Id.txtEmail);
            EditText txtPassword = FindViewById<EditText> (Resource.Id.txtPassword);
            Button loginButton = FindViewById<Button> (Resource.Id.btnLogin);

            mDialog = new ProgressDialog(this);
            mDialog.SetMessage("Logging in...");
            mDialog.SetCancelable(false);

            loginButton.Click += delegate {
                mDialog.Show ();
                Backend.Current.login(txtEmail.Text, txtPassword.Text, OnLoginSuccess, OnLoginFail);
            };
        }
Ejemplo n.º 37
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.myButton);

            button.Click += async delegate
            {
                var    Client   = new SALLab13.ServiceClient();
                string EMail    = "*****@*****.**";          /* Aquí pon tu correo */
                string Password = "******";                 /* Aquí pon tu contraseña */

                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Por favor espera...");
                progress.SetCancelable(false);
                progress.Show();

                var Result = await Client.ValidateAsync(this, EMail, Password);

                Android.App.AlertDialog.Builder Builder =
                    new AlertDialog.Builder(this);
                progress.Cancel();

                AlertDialog Alert = Builder.Create();
                Alert.SetTitle("Resultado de la verificación");
                Alert.SetIcon(Resource.Drawable.dotnet);
                Alert.SetMessage(
                    $"{Result.Status}\n{Result.FullName}\n{Result.Token}");
                Alert.SetButton("Ok", (s, ev) => { });
                Alert.Show();
            };
        }
Ejemplo n.º 38
0
        private async Task <bool> ExisteUsuarioRegistrado()
        {
            clsServicioUsuario objServicioUsuario  = new clsServicioUsuario();
            clsUsuario         objUsuarioRespuesta = new clsUsuario();

            try
            {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Consultando Usuario");
                progress.SetCancelable(false);
                progress.Show();

                objUsuarioRespuesta = await objServicioUsuario.consultarUsuario(objUsuario.Id);

                if (objUsuarioRespuesta != null)
                {
                    objUsuario = objUsuarioRespuesta;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                progress.Cancel();
                alert.SetTitle("Alerta");
                alert.SetMessage("Ocurrió un problema al validar usuario registrado");

                RunOnUiThread(() => {
                    alert.Show();
                });
            }
            return(false);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //先初始化BMapManager
            DemoApplication app = (DemoApplication)this.Application;
            if (app.mBMapManager == null)
            {
                app.mBMapManager = new BMapManager(this);

                app.mBMapManager.Init(
                        new DemoApplication.MyGeneralListener());
            }
            SetContentView(Resource.Layout.activity_panorama_main);
            mPanoramaView = FindViewById<PanoramaView>(Resource.Id.panorama);
            //UI初始化
            mBtn = FindViewById<Button>(Resource.Id.button);
            mBtn.Visibility = ViewStates.Invisible;
            //道路名
            mRoadName = FindViewById<TextView>(Resource.Id.road);
            mRoadName.Visibility = ViewStates.Visible;
            mRoadName.Text = "百度全景";
            mRoadName.SetBackgroundColor(Color.Argb(200, 5, 5, 5));  //背景透明度
            mRoadName.SetTextColor(Color.Argb(255, 250, 250, 250));  //文字透明度
            mRoadName.TextSize = 22;
            //跳转进度条
            pd = new ProgressDialog(this);
            pd.SetMessage("跳转中……");
            pd.SetCancelable(true);//设置进度条是否可以按退回键取消 

            //初始化Searvice
            mService = PanoramaService.GetInstance(ApplicationContext);
            mCallback = new IPanoramaServiceCallbackImpl(this);
            //设置全景图监听
            mPanoramaView.SetPanoramaViewListener(this);

            //解析输入
            ParseInput();
        }
Ejemplo n.º 40
0
        private async void checkHealth()
        {
            try
            {
                var baseAddress = new Uri("https://private-anon-b578fa752f-blissrecruitmentapi.apiary-mock.com/health");

                using (var httpClient = new HttpClient {
                    BaseAddress = baseAddress
                })
                {
                    progress = new Android.App.ProgressDialog(this);
                    progress.Indeterminate = true;
                    progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                    progress.SetMessage("Loading...");
                    progress.SetCancelable(false);
                    progress.Show();
                    HttpResponseMessage response = await httpClient.GetAsync(httpClient.BaseAddress);

                    if (response.IsSuccessStatusCode)
                    {
                        progress.Dismiss();
                        var listScreen = new Intent(this, typeof(ListScreen));
                        StartActivity(listScreen);
                    }
                    else
                    {
                        progress.Dismiss();
                        var Retry = new Intent(this, typeof(RetryScreen));
                        StartActivity(Retry);
                    }
                }
            }
            catch (Exception ex)
            {
                return;
            }
        }
Ejemplo n.º 41
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.VacancyFragment);
            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            //SetSupportActionBar(toolbar);
            // View v = inflater.Inflate(Resource.Layout.VacancyFragment, container, false);
            MyVacancyRecyclerview = FindViewById <RecyclerView>(Resource.Id.vacancylist);
            progress = new Android.App.ProgressDialog(this);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait..");
            progress.Show();

            try
            {
                vacancy_ApI = RestService.For <Vacancy_API>("http://mg.mahendras.org");
                getVacancyList();
            }
            catch (Exception)
            {
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.myButton);

            button.Click += async delegate
            {
                progress = new ProgressDialog(this)
                {
                    Indeterminate = true
                };
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Carregando informações do tempo...");
                progress.SetCancelable(false);
                progress.Show();

                var _api           = new WeatherAPI();
                var currentWeather = await _api.GetWeather();

                Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                progress.Dismiss();
                alert.SetTitle("Aviso sobre o tempo");
                alert.SetMessage($"a temperatura atual é: {Math.Round(currentWeather.TempInCelsius, 0).ToString()}");
                alert.SetPositiveButton("OK", (sender, e) => { });

                Dialog dialog = alert.Create();
                dialog.Show();
            };
        }
Ejemplo n.º 43
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout);
            //LayoutInflater inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService);
            //View contentView = inflater.Inflate(Resource.Layout.Product, null, false);
            //drawerLayout.AddView(contentView);
            SetContentView(Resource.Layout.Product);
            RecieptDTO user = JsonConvert.DeserializeObject <RecieptDTO>(Intent.GetStringExtra("RecieptData"));
            //var extras = Intent.GetParcelableExtra("RecieptData") ?? String.Empty;
            string textRecieptName = user.Name;

            textRecieptID = user.RecieptID.ToString();
            TextView txtRecieptName     = FindViewById <TextView>(Resource.Id.recieptTxt);
            TextView txtProductName     = FindViewById <TextView>(Resource.Id.editProductName);
            TextView txtProductQuantity = FindViewById <TextView>(Resource.Id.editProductQuantity);

            txtRecieptName.Text = textRecieptName;
            SessionHelper sessionHelper = new SessionHelper(this);
            string        Username      = sessionHelper.GetSessionKey(SessionKeys.SESSION_USERNAME_KEY);
            string        UserID        = sessionHelper.GetSessionKey(SessionKeys.SESSION_USERID_KEY);
            string        AuthToken     = sessionHelper.GetSessionKey(SessionKeys.SESSION_TOKEN_KEY);

            ImageButton btnAddProduct = FindViewById <ImageButton>(Resource.Id.btnAddProduct);
            JsonValue   jsonProduct   = await HttpRequestHelper <ProductEntity> .GetRequest(ServiceTypes.GetProducts, "/" + AuthToken + "/" + textRecieptID);

            ParseRecieptJSON(jsonProduct);

            Button btnSendReceipt = FindViewById <Button>(Resource.Id.btnSendReceipt);

            btnSendReceipt.Click += BtnSendReceipt_Click;

            btnAddProduct.Click += async(sender, e) =>
            {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Adding product... Please wait...");
                progress.SetCancelable(false);
                progress.Show();
                try
                {
                    ProductDTO productDTO = new ProductDTO();
                    productDTO.AddedOn   = DateTime.Now.ToString();
                    productDTO.Name      = txtProductName.Text;
                    productDTO.Quantity  = txtProductQuantity.Text;
                    productDTO.RecieptID = Convert.ToInt32(textRecieptID);
                    ProductEntity productEntity = new ProductEntity {
                        AuthToken = AuthToken, productInfo = productDTO
                    };
                    JsonValue json = await HttpRequestHelper <ProductEntity> .POSTreq(ServiceTypes.AddProduct, productEntity);

                    ParseJSON(json);

                    JsonValue jsonProduct1 = await HttpRequestHelper <ProductEntity> .GetRequest(ServiceTypes.GetProducts, "/" + AuthToken + "/" + textRecieptID);

                    ParseRecieptJSON(jsonProduct1);
                    progress.Hide();
                }
                catch (Exception ex)
                {
                }
            };
        }
Ejemplo n.º 44
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            try
            {
                SetContentView(Resource.Layout.Login_Content);

                ActionBar.Hide();

                //Create Database
                db = new Database();
                db.createDatabaseInfo();

                //Load Data
                LoadData();

                var progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Loading ...");
                progress.SetCancelable(true);
                progress.Hide();

                var done       = FindViewById <Button>(Resource.Id.done);
                var namer      = FindViewById <EditText>(Resource.Id.namer);
                var signup     = FindViewById <Button>(Resource.Id.signup);
                var back       = FindViewById <ImageButton>(Resource.Id.back);
                var passworder = FindViewById <EditText>(Resource.Id.passworder);

                if (namer.Text.Length == 0 || passworder.Text.Length == 0)
                {
                    done.SetBackgroundResource(Resource.Drawable.signInButtonLight);
                }

                namer.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
                {
                    if (namer.Text.Length > 0)
                    {
                        done.SetBackgroundResource(Resource.Drawable.signInButton);
                    }
                    else
                    {
                        done.SetBackgroundResource(Resource.Drawable.signInButtonLight);
                    }
                };

                back.Click += delegate
                {
                    var intent = new Intent(this, typeof(IntroActivity));

                    var bundle1 = new Bundle();
                    intent.PutExtras(bundle1);

                    this.StartActivity(intent);
                };

                signup.Click += delegate
                {
                    var intent = new Intent(this, typeof(edit_profile_activity));

                    var bundle1 = new Bundle();
                    bundle1.PutString("comefrom", "login");
                    intent.PutExtras(bundle1);

                    this.StartActivity(intent);
                };

                done.Click += async delegate
                {
                    progress.Show();

                    try
                    {
                        string password = passworder.Text;
                        //password = password.Trim();

                        string name = namer.Text;
                        //name = name.Trim();


                        /*
                         * ASCIIEncoding encoding = new ASCIIEncoding();
                         * //string postData = "username" + user + "&password" + password;
                         *
                         *
                         * string info = "{\"name\""+":" + '"'+name+'"'+"}";
                         * byte[] data = Encoding.ASCII.GetBytes(info);
                         *
                         * WebRequest request = WebRequest.Create("http://51.140.38.46:8080/edit_profile_login");
                         * request.Method = "POST";
                         * request.ContentType = "application/x-www-form-urlencoded";
                         * request.ContentLength = data.Length;
                         *
                         * using (Stream stream = request.GetRequestStream())
                         * {
                         * stream.Write(data, 0, data.Length);
                         * }
                         *
                         * string responseContent = null;
                         *
                         * using (WebResponse response = request.GetResponse())
                         * {
                         * using (Stream stream = response.GetResponseStream())
                         * {
                         *  using (StreamReader sr99 = new StreamReader(stream))
                         *  {
                         *      responseContent = sr99.ReadToEnd();
                         *
                         *      Toast resp = Toast.MakeText(this, responseContent, ToastLength.Long);
                         *      resp.Show();
                         *
                         *
                         *  }
                         * }
                         * }
                         *
                         * if (responseContent == "Welcome back")
                         * {
                         *
                         *
                         *  var intent = new Intent(this, typeof(Profile));
                         *
                         *  var bundle1 = new Bundle();
                         *  bundle1.PutString("namerText", name);
                         *  intent.PutExtras(bundle1);
                         *  this.StartActivity(intent);
                         *
                         * }/*
                         * else { progress.Hide(); };
                         *
                         * }*/

                        try
                        {
                            string test = listSource[0].Name;

                            if (name == listSource[0].Name & password == listSource[0].Password)
                            {
                                try
                                {
                                    Toast resp = Toast.MakeText(this, "Welcome Back", ToastLength.Short);
                                    resp.Show();

                                    var intent = new Intent(this, typeof(ProgramHome));
                                    progress.Hide();
                                    this.StartActivity(intent);
                                }
                                catch (Exception e)
                                {
                                    System.Exception myException = e;
                                    Toast            error       = Toast.MakeText(this, e.Message, ToastLength.Short);
                                    error.Show();
                                }
                            }
                            else
                            {
                                try
                                {
                                    Toast resp = Toast.MakeText(this, "Username: "******", Password: "******"Create an Account", ToastLength.Short);
                            resp.Show();
                            progress.Hide();
                        }


                        /*
                         * else if (name != listSource[0].Name)
                         * {
                         * Toast resp = Toast.MakeText(this, "Unknown Username", ToastLength.Short);
                         * resp.Show();
                         * }
                         * else if (password != listSource[0].Password)
                         * {
                         * Toast resp = Toast.MakeText(this, "Unknown Password", ToastLength.Short);
                         * resp.Show();
                         * }*/
                    }

                    catch (Exception e)
                    {
                        System.Exception myException = e;
                        Toast            error       = Toast.MakeText(this, e.Message, ToastLength.Short);
                        error.Show();
                    }
                };
            }

            catch (Exception e)
            {
                System.Exception myException = e;
                Toast            error       = Toast.MakeText(this, e.Message, ToastLength.Short);
                error.Show();
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            _context = this;
            //first check if there are permsions to access files ext
            bool checks = true;


            #region << Check For Permisions >>

            // Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) || ActivityCompat.CheckSelfPermission(this, Manifest.Permission.AccessWifiState) || Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this, Manifest.Permission.Internet)

            if (Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this,
                                                                             Manifest.Permission.Internet) != (int)Permission.Granted)
            {
                if (ActivityCompat.ShouldShowRequestPermissionRationale(this, Manifest.Permission.Internet))
                {
                    ActivityCompat.RequestPermissions(this,
                                                      new String[] { Manifest.Permission.Internet, Manifest.Permission.Internet }, 1);
                    //  })).Show();
                }

                while (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.Internet) !=
                       (int)Permission.Granted)
                {
                    Thread.Sleep(100);
                }
            }


            if (Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this,
                                                                             Manifest.Permission.AccessWifiState) != (int)Permission.Granted)
            {
                if (ActivityCompat.ShouldShowRequestPermissionRationale(this, Manifest.Permission.AccessWifiState))
                {
                    ActivityCompat.RequestPermissions(this,
                                                      new String[] { Manifest.Permission.AccessWifiState, Manifest.Permission.AccessWifiState }, 1);
                    //  })).Show();
                }

                while (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.AccessWifiState) !=
                       (int)Permission.Granted)
                {
                    Thread.Sleep(100);
                }
            }

            if (Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this,
                                                                             Manifest.Permission.AccessNetworkState) != (int)Permission.Granted)
            {
                if (ActivityCompat.ShouldShowRequestPermissionRationale(this, Manifest.Permission.AccessNetworkState))
                {
                    ActivityCompat.RequestPermissions(this,
                                                      new String[] { Manifest.Permission.AccessNetworkState, Manifest.Permission.AccessNetworkState },
                                                      1);
                    //  })).Show();
                }

                while (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.AccessNetworkState) !=
                       (int)Permission.Granted)
                {
                    Thread.Sleep(100);
                }
            }

            if (Android.Support.V4.Content.ContextCompat.CheckSelfPermission(this,
                                                                             Manifest.Permission.ReadExternalStorage) !=
                (int)Permission.Granted)
            {
                // Camera permission has not been granted
                RequestReadWirtePermission();
                while (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.ReadExternalStorage) !=
                       (int)Permission.Granted)
                {
                    Thread.Sleep(100);
                }
            }

            #endregion << Check For Permisions  >>

            base.OnCreate(savedInstanceState);



            //request the app to be full screen

            RequestWindowFeature(WindowFeatures.NoTitle);
            this.Window.ClearFlags(Android.Views.WindowManagerFlags.Fullscreen); //to hide

            Rebex.Licensing.Key = "==AnKxIZnJ2NXyRRk/MrXLh5vsLbImP/JhMGERReY23qIk==";

            SetContentView(Resource.Layout.installer);

            refreshui();
            retrieveset();



            LoadPkg.Click += async delegate
            {
                try
                {
                    String[] types    = new String[] { ".pkg" };
                    FileData fileData = await CrossFilePicker.Current.PickFile(types);

                    if (fileData == null)
                    {
                        return; // user canceled file picking
                    }
                    //com.android.externalstorage.documents



                    System.Console.WriteLine("File name " + fileData.FileName);

                    new Thread(new ThreadStart(delegate
                    {
                        RunOnUiThread(() =>
                        {
                            progress = new ProgressDialog(this);
                            progress.Indeterminate = true;
                            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                            progress.SetMessage("Loading... Getting Path...");
                            progress.SetCancelable(false);
                            progress.Show();
                        });

                        FindFileByName(fileData.FileName);

                        System.Console.WriteLine("Found File, Path= " + PKGLocation);

                        RunOnUiThread(() =>
                        {
                            progress.Hide();
                            try
                            {
                                var pkgfile     = PS4_Tools.PKG.SceneRelated.Read_PKG(PKGLocation);
                                ImageView pbPkg = FindViewById <ImageView>(Resource.Id.PKGIcon);
                                pbPkg.SetImageBitmap(BytesToBitmap(pkgfile.Icon));
                                TextView lblPackageInfo = FindViewById <TextView>(Resource.Id.txtPKGInfo);
                                lblPackageInfo.Text     =
                                    pkgfile.PS4_Title + "\n" + pkgfile.PKG_Type.ToString() + "\n" +
                                    pkgfile.Param.TitleID;
                            }
                            catch (Exception ex)
                            {
                                MessageBox.Show("Invaild Package! or Path\n\n Location: " + PKGLocation);
                                // MessageBox.Show("Exception choosing file: " + ex.ToString() + "    " + PKGLocation);
                            }
                        });
                    })).Start();
                }

                catch (Exception ex)
                {
                    MessageBox.Show("Invaild Package! or Path\n\n Location: " + PKGLocation);
                    // MessageBox.Show("Exception choosing file: " + ex.ToString() + "    " + PKGLocation);
                }
            };

            set.Click += async delegate
            {
                try
                {
                    PKGLocation = manpath.Text;


                    var       pkgfile = PS4_Tools.PKG.SceneRelated.Read_PKG(PKGLocation);
                    ImageView pbPkg   = FindViewById <ImageView>(Resource.Id.PKGIcon);
                    pbPkg.SetImageBitmap(BytesToBitmap(pkgfile.Icon));
                    TextView lblPackageInfo = FindViewById <TextView>(Resource.Id.txtPKGInfo);
                    lblPackageInfo.Text =
                        pkgfile.PS4_Title + "\n" + pkgfile.PKG_Type.ToString() + "\n" +
                        pkgfile.Param.TitleID;
                }

                catch (Exception ex)
                {
                    MessageBox.Show("Invaild Package! or Path\n\n Location: " + PKGLocation);
                    // MessageBox.Show("Exception choosing file: " + ex.ToString() + "    " + PKGLocation);
                }
            };



            SendPayloadBtn.Click += delegate
            {
                new Thread(new ThreadStart(delegate
                {
                    using (Ftp client = new Ftp())
                    {
                        Rebex.Licensing.Key = "==AnKxIZnJ2NXyRRk/MrXLh5vsLbImP/JhMGERReY23qIk==";
                        try
                        {
                            // TextView IPAddressTextBox = FindViewById<TextView>(Resource.Id.IPAddressTextBox);
                            if (IPAddressTextBox.Text == "")
                            {
                                RunOnUiThread(() => { MessageBox.Show("Enter an IP Address"); });
                                return;
                            }


                            saveset();

                            //  string paths = GetPathToImage("sa");



                            // connect and login to the FTP
                            client.Connect(IPAddressTextBox.Text);
                            //TextView FTPPassword = FindViewById<TextView>(Resource.Id.FTPPassword);
                            //TextView FTPUsername = FindViewById<TextView>(Resource.Id.FTPUsername);
                            if (FTPPassword.Text == "" && FTPUsername.Text == "")
                            {
                                client.Login("anonymous", "DONT-LOOK@MYCODE");
                            }
                            else
                            {
                                client.Login(FTPUsername.Text, FTPPassword.Text);
                            }


                            client.Traversing += Traversing;
                            client.TransferProgressChanged += TransferProgressChanged;
                            client.DeleteProgressChanged   += DeleteProgressChanged;
                            client.ProblemDetected         += ProblemDetected;

                            if (!client.DirectoryExists(@"/user/app/"))
                            {
                                client.CreateDirectory(@"/user/app/");
                            }

                            if (client.FileExists(@"/user/app/temp.pkg"))
                            {
                                client.Delete(@"/user/app/temp.pkg", TraversalMode.NonRecursive);
                            }

                            client.ChangeDirectory(@"/user/app/");


                            client.PutFile(PKGLocation, "temp.pkg");

                            try
                            {
                                client.SendCommand("installpkg");
                            }
                            catch (Exception ex)
                            {
                                SetTex("installpkg Failed\n Are you sure your using Inifinx?");
                            }


                            SetTex("Package Sent");
                        }

                        catch (Exception ex)
                        {
                            RunOnUiThread(() => { MessageBox.Show(ex.Message); });
                        }



                        RunOnUiThread(() =>
                        {
                            Toast.MakeText(Application.Context, "Package Sent!", ToastLength.Short).Show();
                        });

                        client.Disconnect();
                    }
                })).Start();
            };

            /* }
             * else
             * {
             *   SendPayloadBtn.Visibility = ViewStates.Invisible;
             *   LoadPkg.Visibility = ViewStates.Invisible;
             * }*/
        }
Ejemplo n.º 46
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.PagoServicios);

            spinnerCuentaOrigen  = FindViewById <Spinner>(Resource.Id.spiCuentaOrigenPagoServicio);
            txtTipoSuministro    = FindViewById <EditText>(Resource.Id.txtTipoSuministroPagoServicio);
            btnRealizarPagos     = FindViewById <Button>(Resource.Id.btnRealizarPagoServicio);
            txtNumeroSuministro  = FindViewById <EditText>(Resource.Id.txtSuministroPagoServicio);
            txtMontoPago         = FindViewById <EditText>(Resource.Id.txtMontoPagoServicio);
            lblSaldoCuentaOrigen = FindViewById <TextView>(Resource.Id.lblSaldoCuentaPagoServicio);
            mToolBar             = FindViewById <SupportToolbar>(Resource.Id.toolbar4);
            SetSupportActionBar(mToolBar);

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

            SupportActionBar.SetTitle(mPagoServicios);

            //Guardar temporalmente varaibles pantalla
            strIdentificacion  = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario);
            strCuentaJson      = Intent.GetStringExtra(clsConstantes.strCuentaJson);
            imageUrl           = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario);
            strIdUsuario       = Intent.GetStringExtra(clsConstantes.strIdUsuario);
            strFacturaServicio = Intent.GetStringExtra(clsConstantes.strFacturaServicio);
            strCooperativa     = Intent.GetStringExtra(clsConstantes.strCooperativas);

            lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa);

            string[] arrRespuesta = strCuentaJson.Split('|');
            string   strCuentas   = arrRespuesta[0];
            string   strTarjetas  = arrRespuesta[1];

            lstCuentas = JsonConvert.DeserializeObject <List <clsCuenta> >(strCuentas);

            objCabeceraFacturaServicio = JsonConvert.DeserializeObject <clsCabeceraFacturaServicio>(strFacturaServicio);


            spinnerCuentaOrigen.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
            List <string> lstCuentasString = new List <string>();

            foreach (clsCuenta objCuenta in lstCuentas)
            {
                if (!lstCuentasString.Contains(objCuenta.numero_cuenta))
                {
                    lstCuentasString.Add(objCuenta.numero_cuenta);
                }
            }
            var adapter1 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, lstCuentasString);

            adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            spinnerCuentaOrigen.Adapter = adapter1;

            txtTipoSuministro.Text   = objCabeceraFacturaServicio.tipo_suministro;
            txtNumeroSuministro.Text = objCabeceraFacturaServicio.numero_suministro;
            txtMontoPago.Text        = objCabeceraFacturaServicio.detalle_factura.FindLast(x => x.detalle_item.ToLower().Contains("total")).valor_detalle.ToString();

            btnRealizarPagos.Click += async(sender, e) =>
            {
                if (String.IsNullOrEmpty(txtMontoPago.Text) ||
                    String.IsNullOrEmpty(txtNumeroSuministro.Text))
                {
                    Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                    alert.SetTitle("Alerta");
                    alert.SetMessage("Faltan campos por llenar");

                    RunOnUiThread(() => {
                        alert.Show();
                    });
                }

                else
                {
                    progress = new Android.App.ProgressDialog(this);
                    progress.Indeterminate = true;
                    progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                    progress.SetMessage("Realizando Pago");
                    progress.SetCancelable(true);
                    progress.Show();

                    string           strNumeroSuministro = objCabeceraFacturaServicio.numero_suministro;
                    string           strTipoServicio     = objCabeceraFacturaServicio.tipo_suministro;
                    clsTransferencia objTransferencia    = llenarDatosTransferencia();
                    string           strRespuesta        = await objServicioTransferencia.realizarPagoServicios(strIdentificacion, strNumeroSuministro, strTipoServicio, objTransferencia, objCooperativa);

                    if (!strRespuesta.ToLower().Contains("Alerta"))
                    {
                        strCuentaJson = await clsActividadesGenericas.modificarCuentaJson(strIdentificacion, strIdUsuario, lstCooperativas);

                        var intent = new Intent(this, typeof(ActivityMenu));
                        intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion);
                        intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl);
                        intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario);
                        intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson);
                        intent.PutExtra(clsConstantes.strCooperativas, strCooperativa);
                        StartActivity(intent);
                        this.Finish();
                    }
                    else
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                        progress.Cancel();
                        alert.SetTitle("Alerta");
                        alert.SetMessage("No se pudo procesar el pago");

                        RunOnUiThread(() => {
                            alert.Show();
                        });
                    }
                }
            };
        }
Ejemplo n.º 47
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            Android.Util.Log.Debug("Lab11Log", "Activity - On Create");

            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            var txview = FindViewById <TextView>(Resource.Id.txview);

            Data = (Complex)this.FragmentManager.FindFragmentByTag("Data");

            if (Data == null)
            {
                Data = new Complex();
                var FragmentTrans = this.FragmentManager.BeginTransaction();
                FragmentTrans.Add(Data, "Data");
                FragmentTrans.Commit();
            }

            if (Data.res == null)
            {
                progress = new Android.App.ProgressDialog(this);
                progress.Indeterminate = true;
                progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                progress.SetMessage("Loading is Progress...");
                progress.SetCancelable(false);
                progress.Show();

                text = await Validate();

                progress.Cancel();
                Data.res = text;
            }
            else
            {
                text = Data.ToRes();
            }

            txview.Text = text;

            if (savedInstanceState != null)
            {
                Counter = savedInstanceState.GetInt("CounterValue", 0);
                Android.Util.Log.Debug("Lab11Log", "Activity A - Recovery Instance State");
            }


            FindViewById <Button>(Resource.Id.StartActivity).Click += (sender, e) =>
            {
                var ActivityIntent =
                    new Android.Content.Intent(this, typeof(SecondActivity));
                StartActivity(ActivityIntent);
            };

            var ClickCounter =
                FindViewById <Button>(Resource.Id.ClicksCounter);

            ClickCounter.Text =
                Resources.GetString((Resource.Id.ClicksCounter));

            ClickCounter.Text += $"\n{Data.ToString()}";

            ClickCounter.Click += (sender, e) =>
            {
                Counter++;
                ClickCounter.Text =
                    Resources.GetString(Resource.String.ClicksCounter_Text);

                Data.Real++;
                Data.Ima++;


                ClickCounter.Text += $"\n{Data.ToString()}";
            };
        }
Ejemplo n.º 48
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.PagoTarjetas);

            spinnerCuentaOrigenPagoTarjeta = FindViewById <Spinner>(Resource.Id.spiCuentaOrigenPagoTarjeta);
            spinnerNumeroTarjeta           = FindViewById <Spinner>(Resource.Id.spiNumeroTarjetaPago);
            btnRealizarPagoTarjeta         = FindViewById <Button>(Resource.Id.btnRealizarPagoTarjeta);
            txtTipoTarjetaSeleccionada     = FindViewById <EditText>(Resource.Id.txtTipoTarjetaSeleccionada);
            txtMontoPagoTarjeta            = FindViewById <EditText>(Resource.Id.txtMontoPagoTarjeta);
            lblSaldoCuentaOrigen           = FindViewById <TextView>(Resource.Id.lblSaldoCuentaPagoTarjeta);

            mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar6);
            SetSupportActionBar(mToolBar);

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

            SupportActionBar.SetTitle(mPagoTarjeta);

            //Guardar temporalmente varaibles pantalla
            strIdentificacion = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario);
            strCuentaJson     = Intent.GetStringExtra(clsConstantes.strCuentaJson);
            imageUrl          = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario);
            strIdUsuario      = Intent.GetStringExtra(clsConstantes.strIdUsuario);
            strCooperativa    = Intent.GetStringExtra(clsConstantes.strCooperativas);

            lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa);

            string[] arrRespuesta = strCuentaJson.Split('|');
            string   strCuentas   = arrRespuesta[0];
            string   strTarjetas  = arrRespuesta[1];

            lstCuentas  = JsonConvert.DeserializeObject <List <clsCuenta> >(strCuentas);
            lstTarjetas = JsonConvert.DeserializeObject <List <clsTarjetaCedito> >(strTarjetas);

            //spinner tarjeta credito
            spinnerNumeroTarjeta.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelectedTarjeta);
            List <string> lstTarjetasString = new List <string>();

            foreach (clsTarjetaCedito objTarjeta in lstTarjetas)
            {
                if (!lstTarjetasString.Contains(objTarjeta.numero_tarjeta))
                {
                    lstTarjetasString.Add(objTarjeta.numero_tarjeta);
                }
            }
            var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, lstTarjetasString);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);

            spinnerNumeroTarjeta.Adapter = adapter;

            //spinner cuenta de origen
            spinnerCuentaOrigenPagoTarjeta.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelectedCuenta);
            List <string> lstCuentasString = new List <string>();

            foreach (clsCuenta objCuenta in lstCuentas)
            {
                if (!lstCuentasString.Contains(objCuenta.numero_cuenta))
                {
                    lstCuentasString.Add(objCuenta.numero_cuenta);
                }
            }
            var adapter1 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, lstCuentasString);

            adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);

            spinnerCuentaOrigenPagoTarjeta.Adapter = adapter1;

            //Boton realizar pago de tarjeta
            btnRealizarPagoTarjeta.Click += async delegate
            {
                if (String.IsNullOrEmpty(txtMontoPagoTarjeta.Text) ||
                    String.IsNullOrEmpty(txtTipoTarjetaSeleccionada.Text))
                {
                    Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                    alert.SetTitle("Alerta");
                    alert.SetMessage("Faltan campos por llenar");

                    RunOnUiThread(() => {
                        alert.Show();
                    });
                }

                else
                {
                    //Se mestra el cuadro de cargando
                    progress = new Android.App.ProgressDialog(this);
                    progress.Indeterminate = true;
                    progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                    progress.SetMessage("Realizando Transferencia");
                    progress.SetCancelable(false);
                    progress.Show();

                    clsTransferencia objTransferencia = llenarDatosTransferencia();
                    string           strRespuesta     = await objServicioTransferencia.realizarPagoTarjeta(strIdentificacion, strNumeroTarjeta, objTransferencia, dblPagoMinimo, objCooperativaEmisor, objCooperativaBeneficiario);

                    if (!strRespuesta.ToLower().Contains("Alerta"))
                    {
                        strCuentaJson = await clsActividadesGenericas.modificarCuentaJson(strIdentificacion, strIdUsuario, lstCooperativas);

                        var intent = new Intent(this, typeof(ActivityMenu));
                        intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion);
                        intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl);
                        intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario);
                        intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson);
                        intent.PutExtra(clsConstantes.strCooperativas, strCooperativa);
                        StartActivity(intent);
                        this.Finish();
                    }
                }
            };
        }
Ejemplo n.º 49
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.ConsultaServicio);

            spiTipoConsultaServicio       = FindViewById <Spinner>(Resource.Id.spiTipoConsultaServicio);
            btnConsultarPagos             = FindViewById <Button>(Resource.Id.btnConsultarServicio);
            txtSuministroConsultaServicio = FindViewById <EditText>(Resource.Id.txtSuministroConsultaServicio);
            mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar8);
            SetSupportActionBar(mToolBar);

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

            SupportActionBar.SetTitle(mPagoServicios);

            //Guardar temporalmente varaibles pantalla
            strIdentificacion = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario);
            strCuentaJson     = Intent.GetStringExtra(clsConstantes.strCuentaJson);
            imageUrl          = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario);
            strIdUsuario      = Intent.GetStringExtra(clsConstantes.strIdUsuario);
            strCooperativa    = Intent.GetStringExtra(clsConstantes.strCooperativas);

            spiTipoConsultaServicio.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
            var adapter = ArrayAdapter.CreateFromResource(
                this, Resource.Array.servicio_array, Android.Resource.Layout.SimpleDropDownItem1Line);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            spiTipoConsultaServicio.Adapter = adapter;

            btnConsultarPagos.Click += async delegate
            {
                if (String.IsNullOrEmpty(txtSuministroConsultaServicio.Text))
                {
                    Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                    alert.SetTitle("Alerta");
                    alert.SetMessage("Faltan campos por llenar");

                    RunOnUiThread(() => {
                        alert.Show();
                    });
                }
                else
                {
                    progress = new Android.App.ProgressDialog(this);
                    progress.Indeterminate = true;
                    progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                    progress.SetMessage("Consultando Factura");
                    progress.SetCancelable(false);
                    progress.Show();

                    string strNumeroSuministro = txtSuministroConsultaServicio.Text.ToUpper();
                    string strFacturaServicio  = await objServicioConsulta.consultarServicios(strIdentificacion, strNumeroSuministro, strTipoServicio);

                    if (!strFacturaServicio.ToUpper().Contains("ERROR"))
                    {
                        var intent = new Intent(this, typeof(ActivityFacturaServicio));
                        intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion);
                        intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl);
                        intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario);
                        intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson);
                        intent.PutExtra(clsConstantes.strFacturaServicio, strFacturaServicio);
                        intent.PutExtra(clsConstantes.strCooperativas, strCooperativa);
                        StartActivity(intent);
                        this.Finish();
                    }
                    else
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                        alert.SetTitle("Alerta");
                        alert.SetMessage(strFacturaServicio);


                        RunOnUiThread(() => {
                            alert.Show();
                        });

                        progress.Cancel();
                    }
                }
            };
        }
Ejemplo n.º 50
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                SetContentView(Resource.Layout.RegistroNuevaCuenta);
                spinnerCooperativa             = FindViewById <Spinner>(Resource.Id.spiCooperativaAgregarCuenta);
                btnAgregarCuenta               = FindViewById <Button>(Resource.Id.btnAgregarCuenta);
                txtIdentificacionAgregarCuenta = FindViewById <EditText>(Resource.Id.txtIdentificacionAgregarCuenta);
                mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar7);
                SetSupportActionBar(mToolBar);

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

                //Guardar temporalmente varaibles pantalla
                strIdentificacion = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario);
                strCuentaJson     = Intent.GetStringExtra(clsConstantes.strCuentaJson);
                imageUrl          = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario);
                strIdUsuario      = Intent.GetStringExtra(clsConstantes.strIdUsuario);
                strCooperativa    = Intent.GetStringExtra(clsConstantes.strCooperativas);

                lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa);

                spinnerCooperativa.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
                foreach (clsCooperativa objCooperativa in lstCooperativas)
                {
                    if (!lstCooperativasString.Contains(objCooperativa.nombreCooperativa))
                    {
                        lstCooperativasString.Add(objCooperativa.nombreCooperativa);
                    }
                }
                var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, lstCooperativasString);
                adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
                spinnerCooperativa.Adapter = adapter;

                btnAgregarCuenta.Click += async delegate
                {
                    if (String.IsNullOrEmpty(txtIdentificacionAgregarCuenta.Text))
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                        progress.Cancel();
                        alert.SetTitle("Alerta");
                        alert.SetMessage("Faltan campos por llenar");

                        RunOnUiThread(() => {
                            alert.Show();
                        });
                    }

                    else
                    {
                        progress = new Android.App.ProgressDialog(this);
                        progress.Indeterminate = true;
                        progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                        progress.SetMessage("Agregando cuenta");
                        progress.SetCancelable(true);
                        progress.Show();

                        string strRespuesta = await objServicioCuenta.consultarCuentasRegistradas(strIdentificacion, objCooperativa);

                        if (!strRespuesta.ToUpper().Contains("ERROR"))
                        {
                            if (await objServicioCuenta.registrarCooperativa(strIdUsuario, idCooperativaSeleccionada))
                            {
                                strCuentaJson = objServicioCuenta.unirCuentasJson(strCuentaJson, strRespuesta, idCooperativaSeleccionada);
                                var intent = new Intent(this, typeof(ActivityMenu));
                                intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion);
                                intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl);
                                intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario);
                                intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson);
                                intent.PutExtra(clsConstantes.strCooperativas, strCooperativa);
                                StartActivity(intent);
                                this.Finish();
                            }
                        }
                        else
                        {
                            Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                            progress.Cancel();
                            alert.SetTitle("Alerta");
                            alert.SetMessage("Ocurrió un problema al conectar con la cooperativa");

                            RunOnUiThread(() => {
                                alert.Show();
                            });
                        }
                    }
                };
            }
            catch (Exception)
            {
                Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                alert.SetTitle("Alerta");
                alert.SetMessage("Ocurrió un problema al cargar la pantalla");

                RunOnUiThread(() => {
                    alert.Show();
                });
            }
        }
Ejemplo n.º 51
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.layout_complaince, null);

            task_id_to_send = Arguments.GetString("task_id") ?? string.Empty;

            referencecardview = view.FindViewById <CardView>(Resource.Id.referncecardview);
            Description       = view.FindViewById <EditText>(Resource.Id.comment);
            descrip_text      = view.FindViewById <TextView>(Resource.Id.c_descrip);
            name_text         = view.FindViewById <TextView>(Resource.Id.c_name);
            detail_text       = view.FindViewById <TextView>(Resource.Id.c_detail);
            markby_text       = view.FindViewById <TextView>(Resource.Id.c_markby);
            deadline_text     = view.FindViewById <TextView>(Resource.Id.c_deadline);
            createdby_text    = view.FindViewById <TextView>(Resource.Id.c_createdby);
            creationdate_text = view.FindViewById <TextView>(Resource.Id.c_creationdate);
            camera            = view.FindViewById <ImageButton>(Resource.Id.camera_btn);
            video             = view.FindViewById <ImageButton>(Resource.Id.video_btn);
            create_by_call    = view.FindViewById <ImageButton>(Resource.Id.create_by_call);
            mark_by_call      = view.FindViewById <ImageButton>(Resource.Id.mark_by_call);
            microphone        = view.FindViewById <ImageButton>(Resource.Id.micro_btn);
            linear1           = view.FindViewById <LinearLayout>(Resource.Id.ll1);
            linear2           = view.FindViewById <LinearLayout>(Resource.Id.ll2);
            linear3           = view.FindViewById <LinearLayout>(Resource.Id.ll3);
            ll_task_desc      = view.FindViewById <LinearLayout>(Resource.Id.ll_task_desc);
            task_desc         = view.FindViewById <TextView>(Resource.Id.task_desc);
            Image_no          = view.FindViewById <TextView>(Resource.Id.image_no);
            Video_no          = view.FindViewById <TextView>(Resource.Id.video_no);
            Audio_no          = view.FindViewById <TextView>(Resource.Id.audio_no);
            comment_micro     = view.FindViewById <ImageView>(Resource.Id.comment_micro);
            Submit_Btn        = view.FindViewById <Button>(Resource.Id.submit);
            uploadimage       = view.FindViewById <TextView>(Resource.Id.uploaded_no1);
            uploadvideo       = view.FindViewById <TextView>(Resource.Id.uploaded_no2);
            uploadaudio       = view.FindViewById <TextView>(Resource.Id.uploaded_no3);
            Gridview1         = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView1);
            Gridview2         = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView2);
            Gridview3         = view.FindViewById <ExpandableHeightGridView>(Resource.Id.gridView3);

            progress = new Android.App.ProgressDialog(Activity);
            progress.Indeterminate = true;
            progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
            progress.SetCancelable(false);
            progress.SetMessage("Please wait...");

            referencecardview.Click += delegate
            {
                ReferenceAttachmentActivity reference         = new ReferenceAttachmentActivity();
                Android.Support.V4.App.FragmentTransaction ft = FragmentManager.BeginTransaction();
                //ft.Replace(Resource.Id.container, reference);
                ft.Hide(FragmentManager.FindFragmentByTag("ComplainceFragment"));
                ft.Add(Resource.Id.container, reference);
                ft.AddToBackStack(null);
                ft.SetTransition(FragmentTransaction.TransitFragmentOpen);
                ft.Commit();
                Bundle bundle = new Bundle();
                bundle.PutString("TaskId", task_id_to_send);
                reference.Arguments = bundle;
            };

            create_by_call.Click += delegate
            {
                try
                {
                    var hasTelephony = Activity.PackageManager.HasSystemFeature(PackageManager.FeatureTelephony);
                    if (hasTelephony)
                    {
                        //var uri = Android.Net.Uri.Parse("tel:" +creat_by_num);
                        var uri    = Android.Net.Uri.Parse("tel:" + "9984059984");
                        var intent = new Intent(Intent.ActionDial, uri);
                        Activity.StartActivity(intent);
                    }
                }
                catch (System.Exception e) { }
            };

            mark_by_call.Click += delegate
            {
                try
                {
                    var hasTelephony = Activity.PackageManager.HasSystemFeature(PackageManager.FeatureTelephony);
                    if (hasTelephony)
                    {
                        // var uri = Android.Net.Uri.Parse("tel:" +mark_by_num);
                        var uri    = Android.Net.Uri.Parse("tel:" + "9984059984");
                        var intent = new Intent(Intent.ActionDial, uri);
                        Activity.StartActivity(intent);
                    }
                }
                catch (System.Exception e) { }
            };

            Gridview1.setExpanded(true);
            //Gridview1.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
            //Gridview1.SetMultiChoiceModeListener(new MultiChoiceModeListener1(Activity));

            Gridview2.setExpanded(true);
            //Gridview2.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
            //Gridview2.SetMultiChoiceModeListener(new MultiChoiceModeListener2(Activity));

            Gridview3.setExpanded(true);
            //Gridview3.ChoiceMode = (ChoiceMode)AbsListViewChoiceMode.MultipleModal;
            //Gridview3.SetMultiChoiceModeListener(new MultiChoiceModeListener3(Activity));


            //if (ic.connectivity())
            //{
            getDataFromServer();
            //}
            //else
            // {

            //}
            //attachmentData = db.GetComp_Attachments(task_id_to_send);
            //if (attachmentData != null)
            //{
            //    for (int i = 0; i < attachmentData.Count; i++)
            //    {
            //        if (attachmentData[i].file_type.Equals("Image"))
            //        {
            //            imagelist.Add(attachmentData[i]);

            //        }
            //        else if (attachmentData[i].file_type.Equals("Video"))
            //        {
            //            videolist.Add(attachmentData[i]);
            //        }
            //        else if (attachmentData[i].file_type.Equals("Audio"))
            //        {
            //            audiolist.Add(attachmentData[i]);
            //        }
            //    }
            //    adapter1 = new GridViewAdapter_Image(Activity, imagelist);
            //    Gridview1.Adapter = adapter1;

            //    adapter2 = new GridViewAdapter_Video(Activity, videolist);
            //    Gridview2.Adapter = adapter2;

            //    adapter3 = new GridViewAdapter_Audio(Activity, audiolist);
            //    Gridview3.Adapter = adapter3;

            //}



            camera.Click += delegate
            {
                Click_Type = "Camera";
                CheckForShapeData_Camera();
            };

            video.Click += delegate
            {
                Click_Type = "Video";
                CheckForShapeData_Video();
            };

            microphone.Click += delegate
            {
                if (audio_comp_lst.Count < aud_max)
                {
                    if (shapes1 != null)
                    {
                        if (CheckForShape())
                        {
                            recording();
                        }
                        else
                        {
                            Toast.MakeText(Activity, "you are outside marked area", ToastLength.Long).Show();
                        }
                    }
                    else
                    {
                        recording();
                    }
                }
            };

            Submit_Btn.Click += delegate
            {
                Submit_Method();
            };
            comment_micro.Click += delegate
            {
                CheckMicrophone();
            };

            return(view);
        }
Ejemplo n.º 52
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Transferencia);

            spinnerCuentaOrigen           = FindViewById <Spinner>(Resource.Id.spiCuentaOrigenTrasnfer);
            spinnerCooperativasDestino    = FindViewById <Spinner>(Resource.Id.spiCooperativaDestinoTrasnfer);
            spinnerTipoCuenta             = FindViewById <Spinner>(Resource.Id.spiTipoCuenta);
            spinnerTipoIdentificacion     = FindViewById <Spinner>(Resource.Id.spiTipoIdentificacion);
            btnRealizarTransferencia      = FindViewById <Button>(Resource.Id.btnRealizarTransfer);
            txtIdentificacionBeneficiario = FindViewById <EditText>(Resource.Id.txtIdentificacionBeneficiarioTransfer);
            txtCuentaBeneficiario         = FindViewById <EditText>(Resource.Id.txtCuentaDestinoTransfer);
            txtMontoTransferencia         = FindViewById <EditText>(Resource.Id.txtMontoTransfer);
            txtMotivoTransferencia        = FindViewById <EditText>(Resource.Id.txtMotivoTransfer);

            mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbar3);
            SetSupportActionBar(mToolBar);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetTitle(mTransferencia);

            //Guardar temporalmente varaibles pantalla
            strIdentificacion = Intent.GetStringExtra(clsConstantes.strIdentificacionUsuario);
            strCuentaJson     = Intent.GetStringExtra(clsConstantes.strCuentaJson);
            imageUrl          = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario);
            strIdUsuario      = Intent.GetStringExtra(clsConstantes.strIdUsuario);
            strCooperativa    = Intent.GetStringExtra(clsConstantes.strCooperativas);

            string[] arrRespuesta = strCuentaJson.Split('|');
            string   strCuentas   = arrRespuesta[0];
            string   strTarjetas  = arrRespuesta[1];

            lstCuentas      = JsonConvert.DeserializeObject <List <clsCuenta> >(strCuentas);
            lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa);

            //spinner cooperativas
            spinnerCooperativasDestino.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelectedCooeprativa);

            foreach (clsCooperativa objCooperativa in lstCooperativas)
            {
                if (!lstCooperativasString.Contains(objCooperativa.nombreCooperativa))
                {
                    lstCooperativasString.Add(objCooperativa.nombreCooperativa);
                }
            }
            var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, lstCooperativasString);

            adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            spinnerCooperativasDestino.Adapter = adapter;

            //spinner cuenta de origen OJO
            spinnerCuentaOrigen.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
            List <string> lstCuentasString = new List <string>();

            foreach (clsCuenta objCuenta in lstCuentas)
            {
                if (!lstCuentasString.Contains(objCuenta.numero_cuenta))
                {
                    lstCuentasString.Add(objCuenta.numero_cuenta);
                }
            }

            var adapter1 = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, lstCuentasString);

            adapter1.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            spinnerCuentaOrigen.Adapter = adapter1;

            //spinner tipo cuenta
            spinnerTipoCuenta.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
            var adapter2 = ArrayAdapter.CreateFromResource(
                this, Resource.Array.tipo_cuentas_array, Android.Resource.Layout.SimpleDropDownItem1Line);

            adapter2.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            spinnerTipoCuenta.Adapter = adapter2;

            //spinner tipo identificacion
            spinnerTipoIdentificacion.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
            var adapter3 = ArrayAdapter.CreateFromResource(
                this, Resource.Array.tipo_identificaciones_array, Android.Resource.Layout.SimpleDropDownItem1Line);

            adapter3.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
            spinnerTipoIdentificacion.Adapter = adapter3;

            btnRealizarTransferencia.Click += async delegate
            {
                if (String.IsNullOrEmpty(txtMontoTransferencia.Text) ||
                    String.IsNullOrEmpty(txtCuentaBeneficiario.Text) ||
                    String.IsNullOrEmpty(txtIdentificacionBeneficiario.Text))
                {
                    Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                    alert.SetTitle("Alerta");
                    alert.SetMessage("Faltan campos por llenar");

                    RunOnUiThread(() => {
                        alert.Show();
                    });
                }

                else
                {
                    //Se mestra el cuadro de cargando
                    progress = new Android.App.ProgressDialog(this);
                    progress.Indeterminate = true;
                    progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                    progress.SetMessage("Realizando Transferencia");
                    progress.SetCancelable(true);
                    progress.Show();

                    //Se realiza la transferencia
                    string strMensaje = await realizarTransferencia();

                    strCuentaJson = await clsActividadesGenericas.modificarCuentaJson(strIdentificacion, strIdUsuario, lstCooperativas);

                    if (strMensaje.ToUpper().Contains("ALERTA"))
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                        alert.SetTitle("Alerta");
                        alert.SetMessage(strMensaje.Replace("Alerta:", ""));
                        alert.SetMessage(strMensaje.Replace("alerta:", ""));

                        RunOnUiThread(() => {
                            alert.Show();
                        });
                        progress.Cancel();
                    }
                    else
                    {
                        //Cuando se completa la transferencia
                        var intent = new Intent(this, typeof(ActivityMenu));
                        intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacion);
                        intent.PutExtra(clsConstantes.strURLImagenUsuario, imageUrl);
                        intent.PutExtra(clsConstantes.strIdUsuario, strIdUsuario);
                        intent.PutExtra(clsConstantes.strCuentaJson, strCuentaJson);
                        intent.PutExtra(clsConstantes.strCooperativas, strCooperativa);
                        StartActivity(intent);
                        this.Finish();
                    }
                }
            };
        }
        public void buscaryabrir(string termino)
        {
            RunOnUiThread(() =>
            {
#pragma warning disable CS0618 // El tipo o el miembro est�n obsoletos
                alerta = new ProgressDialog(this);
#pragma warning restore CS0618 // El tipo o el miembro est�n obsoletos
#pragma warning restore CS0618 // El tipo o el miembro est�n obsoletos
                alerta.SetCanceledOnTouchOutside(false);
                alerta.SetCancelable(false);
                alerta.SetTitle("Buscando resultados...");
                alerta.SetMessage("Por favor espere");
                alerta.Show();
            });
            try
            {
                //  RunOnUiThread(() => progreso.Progress = 50);
                VideoSearch src     = new VideoSearch();
                var         results = src.SearchQuery(termino, 1);
                if (results.Count > 0)
                {
                    var listatitulos = results.Select(ax => WebUtility.HtmlDecode(RemoveIllegalPathCharacters(ax.Title.Replace("&quot;", "").Replace("&amp;", "")))).ToList();
                    var listalinks   = results.Select(ax => ax.Url).ToList();
                    RunOnUiThread(() =>
                    {
                        ListView lista   = new ListView(this);
                        lista.ItemClick += (o, e) =>
                        {
                            var posicion    = 0;
                            posicion        = e.Position;
                            Intent intentoo = new Intent(this, typeof(customdialogact));

                            intentoo.PutExtra("index", posicion.ToString());
                            intentoo.PutExtra("color", "DarkGray");
                            intentoo.PutExtra("titulo", listatitulos[posicion]);
                            if (!isserver)
                            {
                                intentoo.PutExtra("ipadress", Mainmenu.gettearinstancia().ip);
                            }
                            else
                            {
                                intentoo.PutExtra("ipadress", "localhost");
                            }

                            intentoo.PutExtra("url", listalinks[posicion]);
                            intentoo.PutExtra("imagen", @"https://i.ytimg.com/vi/" + listalinks[posicion].Split('=')[1] + "/mqdefault.jpg");
                            StartActivity(intentoo);
                        };
                        adapterlistaremoto adapt = new adapterlistaremoto(this, listatitulos, listalinks);
                        lista.Adapter            = adapt;

                        new Android.App.AlertDialog.Builder(this)
                        .SetTitle("Resultados de la busqueda")
                        .SetView(lista).SetPositiveButton("Cerrar", (dd, fgf) => { })
                        .Create()
                        .Show();
                    });
                }
                RunOnUiThread(() =>
                {
                    alerta.Dismiss();
                });
            }
            catch (Exception)
            {
                RunOnUiThread(() => Toast.MakeText(this, "No se encotraron resultados", ToastLength.Long).Show());
                alerta.Dismiss();
            }
        }
Ejemplo n.º 54
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            string strJsonCuenta = string.Empty;

            try
            {
                base.OnCreate(savedInstanceState);

                SetContentView(Resource.Layout.RegistroDatosCuenta);

                spinner           = FindViewById <Spinner>(Resource.Id.spiCooperativa);
                btnSiguiente      = FindViewById <Button>(Resource.Id.btnSiguiente);
                txtIdentificacion = FindViewById <EditText>(Resource.Id.txtIdentificacionRegistroDatosCuenta);
                imgFotoPerfil     = FindViewById <ImageView>(Resource.Id.imgFoto);

                objUsuario.Id                 = Intent.GetStringExtra(clsConstantes.strIdUsuario);
                objUsuario.displayName        = Intent.GetStringExtra(clsConstantes.strNombreUsuario);
                objUsuario.birthday           = Intent.GetStringExtra(clsConstantes.strFechaNacimiento);
                objUsuario.relationshipStatus = Intent.GetStringExtra(clsConstantes.strEstadoCivilUsuario);
                objUsuario.gender             = Intent.GetStringExtra(clsConstantes.strGeneroUsuario);
                objUsuario.imageUrl           = Intent.GetStringExtra(clsConstantes.strURLImagenUsuario);
                strCooperativa                = Intent.GetStringExtra(clsConstantes.strCooperativas);

                lstCooperativas = JsonConvert.DeserializeObject <List <clsCooperativa> >(strCooperativa);

                spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected);
                foreach (clsCooperativa objCooperativa in lstCooperativas)
                {
                    if (!lstCooperativasString.Contains(objCooperativa.nombreCooperativa))
                    {
                        lstCooperativasString.Add(objCooperativa.nombreCooperativa);
                    }
                }
                var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, lstCooperativasString);
                adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleDropDownItem1Line);
                spinner.Adapter = adapter;

                btnSiguiente.Click += async(sender, e) =>
                {
                    if (String.IsNullOrEmpty(txtIdentificacion.Text))
                    {
                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                        progress.Cancel();
                        alert.SetTitle("Alerta");
                        alert.SetMessage("Faltan campos por llenar");

                        RunOnUiThread(() => {
                            alert.Show();
                        });
                    }

                    else
                    {
                        string strIdentificacionCliente = txtIdentificacion.Text;

                        progress = new Android.App.ProgressDialog(this);
                        progress.Indeterminate = true;
                        progress.SetProgressStyle(Android.App.ProgressDialogStyle.Spinner);
                        progress.SetMessage("Conectando con la cooperativa");
                        progress.SetCancelable(false);
                        progress.Show();

                        strJsonCuenta = await objServicioCuenta.consultarCuentasRegistradas(strIdentificacionCliente, objCooperativa);

                        if (strJsonCuenta.Length != 0 && !strJsonCuenta.ToUpper().Contains("ERROR"))
                        {
                            var intent = new Intent(this, typeof(ActivityPIN));
                            intent.PutExtra(clsConstantes.strIdUsuario, objUsuario.Id);
                            intent.PutExtra(clsConstantes.strNombreUsuario, objUsuario.displayName);
                            intent.PutExtra(clsConstantes.strFechaNacimiento, objUsuario.birthday);
                            intent.PutExtra(clsConstantes.strEstadoCivilUsuario, objUsuario.relationshipStatus);
                            intent.PutExtra(clsConstantes.strGeneroUsuario, objUsuario.gender);
                            intent.PutExtra(clsConstantes.strURLImagenUsuario, objUsuario.imageUrl);
                            intent.PutExtra(clsConstantes.strIdentificacionUsuario, strIdentificacionCliente);
                            intent.PutExtra(clsConstantes.strIdentificacionCooperativa, spinner.SelectedItemId.ToString());
                            intent.PutExtra(clsConstantes.strTipoTransaccion, clsConstantes.strNuevaCuenta);
                            intent.PutExtra(clsConstantes.idCooperativa, idCooperativa);
                            intent.PutExtra(clsConstantes.strCuentaJson, strJsonCuenta);
                            intent.PutExtra(clsConstantes.strCooperativas, strCooperativa);
                            StartActivity(intent);
                            this.Finish();
                        }
                        else
                        {
                            Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);

                            alert.SetTitle("Alerta");
                            alert.SetMessage(strJsonCuenta);

                            RunOnUiThread(() => {
                                alert.Show();
                            });

                            progress.Cancel();
                        }
                    }
                };


                var imageBitmap = GetImageBitmapFromUrl(objUsuario.imageUrl);
                imgFotoPerfil.SetImageBitmap(imageBitmap);
            }
            catch (Exception)
            {
                Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                progress.Cancel();
                alert.SetTitle("Alerta");
                alert.SetMessage("Ocurió un problema al cargar la pantalla");

                RunOnUiThread(() => {
                    alert.Show();
                });
            }
        }
        public void cargarresults()
        {
            try
            {
                RunOnUiThread(() =>
                {
#pragma warning disable CS0618 // El tipo o el miembro están obsoletos
                    alerta = new ProgressDialog(this);
#pragma warning restore CS0618 // El tipo o el miembro están obsoletos
                    alerta.SetTitle("Buscando videos sugeridos");
                    alerta.SetMessage("Por favor espere...");
                    alerta.SetCancelable(false);
                    alerta.Create();
                    alerta.Show();
                });

                YoutubeSearch.VideoSearch             buscar  = new YoutubeSearch.VideoSearch();
                List <YoutubeSearch.VideoInformation> results = new List <YoutubeSearch.VideoInformation>();
                if (YoutubePlayerServerActivity.gettearinstancia() != null)
                {
                    if (YoutubePlayerServerActivity.gettearinstancia().sugerencias.Count > 0)
                    {
                        results = YoutubePlayerServerActivity.gettearinstancia().sugerencias;
                    }
                    else
                    {
                        results = buscar.SearchQuery("", 1);
                        YoutubePlayerServerActivity.gettearinstancia().sugerencias = results;
                    }
                }
                else
                if (Mainmenu.gettearinstancia() != null)
                {
                    if (Mainmenu.gettearinstancia().sugerencias.Count > 0)
                    {
                        results = Mainmenu.gettearinstancia().sugerencias;
                    }
                    else
                    {
                        results = buscar.SearchQuery("", 1);
                        Mainmenu.gettearinstancia().sugerencias = results;
                    }
                }



                List <PlaylistElement> listafake = new List <PlaylistElement>();
                foreach (var data in results)
                {
                    listafake.Add(new PlaylistElement
                    {
                        Name = WebUtility.HtmlDecode(data.Title),
                        Link = data.Url
                    });
                }
                RunOnUiThread(() =>
                {
                    adaptadorcartas adap = new adaptadorcartas(listafake, this);
                    adap.ItemClick      += (aa, aaa) =>
                    {
                        RunOnUiThread(() =>
                        {
                            var elemento   = listafake[aaa.Position];
                            Intent intento = new Intent(this, typeof(customdialogact));

                            intento.PutExtra("url", elemento.Link);
                            intento.PutExtra("titulo", elemento.Name);
                            intento.PutExtra("imagen", "http://i.ytimg.com/vi/" + elemento.Link.Split('=')[1] + "/mqdefault.jpg");
                            StartActivity(intento);
                        });
                    };
                    listasugerencias.SetAdapter(adap);
                    alerta.Dismiss();

                    if (listafake.Count > 0)
                    {
                        secciones[3].Visibility = ViewStates.Visible;
                    }
                    else
                    {
                        secciones[3].Visibility = ViewStates.Gone;
                    }
                });
            }
            catch (Exception)
            {
                RunOnUiThread(() => alerta.Dismiss());
            }
        }