private void InitView()
		{
			//设置标题栏
			var img_header_back = FindViewById<ImageView> (Resource.Id.img_header_back);
			img_header_back.Click += (sender, e) => 
			{
				SetResult(Result.Canceled);
				this.Finish();
				OverridePendingTransition(Android.Resource.Animation.SlideInLeft,Android.Resource.Animation.SlideOutRight);
			};
			var tv_back = FindViewById<TextView> (Resource.Id.tv_back);
			tv_back.Text = "返回";
			var tv_desc = FindViewById<TextView> (Resource.Id.tv_desc);
			tv_desc.Text = "选择银行卡";
			lv_bankType = FindViewById<ListView> (Resource.Id.lv_bankType);
			bankCardInfoListAdapter = new BankCardInfoListAdapter (this);

			lv_bankType.Adapter = bankCardInfoListAdapter;
			//设置滑动listview停止加载图片
			lv_bankType.SetOnScrollListener (new PauseOnScrollListener(Global.imageLoader,false,false));
			lv_bankType.SetSelector (Resource.Color.red);//设置被选中项颜色为红
			LoadTypeData ();
			//点击列表详细
			lv_bankType.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => 
			{
				var intent = new Intent();
				intent.PutExtra("choosebankTypeId",bankCardInfoListAdapter.GetItem(e.Position).BankCardTypeId);
				intent.PutExtra("choosebankImgUrl",bankCardInfoListAdapter.GetItem(e.Position).BankCardImageUrl);
				SetResult(Result.Ok,intent);
				this.Finish();
			};


		}
		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
			var registerButton = FindViewById<Button> (Resource.Id.registerButton);
			var unregisterButton = FindViewById<Button> (Resource.Id.unregisterButton);
			
			registerButton.Click += delegate {
				const string senders = "<Google Cloud Messaging Sender ID>";
				var intent = new Intent("com.google.android.c2dm.intent.REGISTER");
				intent.SetPackage("com.google.android.gsf");
				intent.PutExtra("app", PendingIntent.GetBroadcast(this, 0, new Intent(), 0));
				intent.PutExtra("sender", senders);
				StartService(intent);
			};

			unregisterButton.Click += delegate {
				var intent = new Intent("com.google.android.c2dm.intent.UNREGISTER");
				intent.PutExtra("app", PendingIntent.GetBroadcast(this, 0, new Intent(), 0));
				StartService(intent);
			};
		}
		private void InitView()
		{
			//设置标题栏
			var img_header_back = FindViewById<ImageView> (Resource.Id.img_header_back);
			img_header_back.Click += (sender, e) => 
			{
				SetResult(Result.Canceled);
				this.Finish();
				OverridePendingTransition(Android.Resource.Animation.SlideInLeft,Android.Resource.Animation.SlideOutRight);
			};
			var tv_back = FindViewById<TextView> (Resource.Id.tv_back);
			tv_back.Text = "关闭";
			var tv_desc = FindViewById<TextView> (Resource.Id.tv_desc);
			tv_desc.Text = "收费设置";
			//获取serviceType值
			serviceType = Intent.GetIntExtra("serviceType",0);
			//确定按钮
			btn_Confirm = FindViewById<Button> (Resource.Id.btn_Confirm);
			btn_Confirm.Click += (sender, e) => 
			{
				chargeYHour = edit_YHour.Text;
				chargeYDay = edit_YDay.Text;
				var intent = new Intent();
				intent.PutExtra("chargeYHour",chargeYHour);
				intent.PutExtra("chargeYDay",chargeYDay);
				//todo:调用webservice提交服务器
				SetResult(Result.Ok,intent);
				this.Finish();
			};

		}
Example #4
1
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.CheckinsFragment, container, false);

            listViewMovies = rootView.FindViewById<ListView> (Resource.Id.listViewMovies);

            adapter = new MoviesAdapter (Activity);
            listViewMovies.Adapter = adapter;

            listViewMovies.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
                Movie movie = adapter.GetMovie(e.Position);

                Intent intent = new Intent (Activity, typeof(MovieActivity));
                intent.PutExtra("movieId", movie.Id);
                intent.PutExtra("mode", "info");

                StartActivity(intent);
            };

            listViewMovies.ItemLongClick += delegate(object sender, AdapterView.ItemLongClickEventArgs e) {
                DeleteMovieDialogFragment dialog = new DeleteMovieDialogFragment();
                dialog.Movie = adapter.GetMovie(e.Position);

                dialog.Show(FragmentManager, "DeleteMovieDialogFragment");
            };

            movies = new CheckinShared.MovieDB ();
            checkins = new CheckinShared.CheckinDB ();

            // Toast.MakeText(Activity, movies.Count() + " películas en tu colección", ToastLength.Long).Show();

            RefreshList ();

            return rootView;
        }
Example #5
0
 private void SentencesButton_Click(object sender, EventArgs e)
 {
     Intent intent = new Intent(this, typeof(Screens.WordsScreens.WordsListScreen));
     intent.PutExtra("Parameter", "Sentences");
     intent.PutExtra("Title", GetString(Resource.String.SentencesList));
     StartActivity(intent);
 }
Example #6
0
        void OnConnect(object sender, EventArgs args)
        {
            var streamIntent = new Intent (this, typeof (GLActivity));
            streamIntent.PutExtra("HostName", hostNameTextEdit.Text);

            int port;
            if (!int.TryParse (portTextEdit.Text, out port))
            {
                new AlertDialog.Builder(this).SetMessage("Incorrect port").Show();
                return;
            }
            streamIntent.PutExtra("Port", port);

            double bufferingOffset;
            if (!double.TryParse(bufferingOffsetTextEdit.Text, out bufferingOffset))
            {
                new AlertDialog.Builder(this).SetMessage("Incorrect buffering offset").Show();
                return;
            }
            streamIntent.PutExtra("BufferingOffset", bufferingOffset);

            streamIntent.PutExtra("ShowDebugInfo", showDebugInfoCheckBox.Checked);

            StartActivity(streamIntent);
        }
Example #7
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.ItemId == 1) {
                Intent intent = new Intent (this, typeof(AddMovieToCatalogActivity));
                intent.PutExtra ("Name", catalog.Name);
                intent.PutExtra ("Id", catalog.Id);
                StartActivityForResult (intent, 16);
            } else if (item.ItemId == 2) {
                Animation rotation = AnimationUtils.LoadAnimation (this, Resource.Animation.Rotate);

                rotation.RepeatCount = Animation.Infinite;

                ImageView imageView = (ImageView)LayoutInflater.Inflate (Resource.Layout.RefreshImageView, null);
                imageView.StartAnimation (rotation);

                item.SetActionView (imageView);

                ActualizarLista ();

                Handler handler = new Handler ();
                handler.PostDelayed (() => {
                    imageView.ClearAnimation ();
                    item.SetActionView (null);
                }, 1000);
            } else if (item.ItemId == 3) {
                Intent intent = new Intent (this, typeof(AuthActivity));
                StartActivityForResult (intent, 13);
            } else if (item.ItemId == Android.Resource.Id.Home) {
                OnBackPressed ();
            }
            return base.OnOptionsItemSelected (item);
        }
 protected internal virtual void StartImagePagerActivity(int position)
 {
     var intent = new Intent(Activity, typeof(SimpleImageActivity));
     intent.PutExtra(Constants.Extra.FragmentIndex, (int)ImageFragments.Pager);
     intent.PutExtra(Constants.Extra.ImagePosition, position);
     StartActivity(intent);
 }
		protected override void OnCreate (Bundle savedInstanceState)
		{
			base.OnCreate (savedInstanceState);
			RequestWindowFeature (WindowFeatures.NoTitle);
			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.activity_warshall);

			initMatrix();
			displayFWMatrix();

			Intent i1 = Intent;
			title = i1.GetStringExtra("title");
			description = i1.GetStringExtra("description");
			complexity = i1.GetStringExtra("complexity");

			bDescription = FindViewById<Button>(Resource.Id.bDescription);
			bHelp = FindViewById<Button>(Resource.Id.bHelp);

			bHelp.Click += delegate {
				Toast.MakeText(this, TextsEN.getHelpByPosition(4), ToastLength.Long).Show();
			};
			bDescription.Click += delegate {
				Intent i2 = new Intent(this, typeof(DescriptionActivity));
				i2.PutExtra("title",title);
				i2.PutExtra("previous",3);
				i2.PutExtra("description",description);
				i2.PutExtra("complexity",complexity);
				StartActivity (i2);
			};

		}
Example #10
0
        /// <summary>
        /// adds the entry output data to the intent to be sent to a plugin
        /// </summary>
        public static void AddEntryToIntent(Intent intent, PwEntryOutput entry)
        {
            /*//add the entry XML
            not yet implemented. What to do with attachments?
            MemoryStream memStream = new MemoryStream();
            KdbxFile.WriteEntries(memStream, new[] {entry});
            string entryData = StrUtil.Utf8.GetString(memStream.ToArray());
            intent.PutExtra(Strings.ExtraEntryData, entryData);
            */
            //add the output string array (placeholders replaced taking into account the db context)
            Dictionary<string, string> outputFields = entry.OutputStrings.ToDictionary(pair => StrUtil.SafeXmlString(pair.Key), pair => pair.Value.ReadString());

            JSONObject jsonOutput = new JSONObject(outputFields);
            var jsonOutputStr = jsonOutput.ToString();
            intent.PutExtra(Strings.ExtraEntryOutputData, jsonOutputStr);

            JSONArray jsonProtectedFields = new JSONArray(
                (System.Collections.ICollection)entry.OutputStrings
                    .Where(pair => pair.Value.IsProtected)
                    .Select(pair => pair.Key)
                    .ToArray());
            intent.PutExtra(Strings.ExtraProtectedFieldsList, jsonProtectedFields.ToString());

            intent.PutExtra(Strings.ExtraEntryId, entry.Uuid.ToHexString());
        }
Example #11
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            var sharedPreferences = BaseContext.GetSharedPreferences ("CheckinAppPreferences", FileCreationMode.WorldWriteable);

            int user_id = sharedPreferences.GetInt ("user_id", 0);

            Console.WriteLine ("LoginActivity:user_id: " + user_id);

            SetContentView (Resource.Layout.Login);

            Button buttonLoginWithTwitter = FindViewById<Button> (Resource.Id.buttonLoginWithTwitter);
            Button buttonLoginWithFacebook = FindViewById<Button> (Resource.Id.buttonLoginWithFacebook);

            var self = this;

            buttonLoginWithTwitter.Click += (object sender, EventArgs e) => {
                Intent intent = new Intent (self, typeof(AuthActivity));
                intent.PutExtra ("callerActivity", "LoginActivity");
                intent.PutExtra ("authService", "Twitter");
                self.StartActivityForResult (intent, (int)RequestsConstants.AuthRequest);
            };

            buttonLoginWithFacebook.Click += (object sender, EventArgs e) => {
                Intent intent = new Intent (self, typeof(AuthActivity));
                intent.PutExtra ("callerActivity", "LoginActivity");
                intent.PutExtra ("authService", "Facebook");
                self.StartActivityForResult (intent, (int)RequestsConstants.AuthRequest);
            };
        }
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);
            Title = "C# Client Library Tests";

            RequestWindowFeature (WindowFeatures.Progress);

            SetContentView (Resource.Layout.Harness);

            this.runStatus = FindViewById<TextView> (Resource.Id.RunStatus);

            this.list = FindViewById<ExpandableListView> (Resource.Id.List);
            this.list.SetAdapter (new TestListAdapter (this, App.Listener));
            this.list.ChildClick += (sender, e) => {
                Intent testIntent = new Intent (this, typeof(TestActivity));

                GroupDescription groupDesc = (GroupDescription)this.list.GetItemAtPosition (e.GroupPosition);
                TestDescription desc = groupDesc.Tests.ElementAt (e.ChildPosition);

                testIntent.PutExtra ("name", desc.Test.Name);
                testIntent.PutExtra ("desc", desc.Test.Description);
                testIntent.PutExtra ("log", desc.Log);

                StartActivity (testIntent);
            };

            SetProgressBarVisibility (true);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            // Create your application here
            SetContentView (Resource.Layout.Login);

            EditText txtIPAddress = (EditText)FindViewById (Resource.Id.txtIPAddress);
            txtIPAddress.Text = this.GetPreference ("preference_q16_address");
            Button btnOk = (Button)FindViewById (Resource.Id.btnOk);
            btnOk.Click += (sender, e) =>
            {
                this.SetPreference("preference_q16_address", txtIPAddress.Text);
                var main = new Intent(this, typeof(MainActivity));
                main.PutExtra("address", txtIPAddress.Text);
                main.PutExtra("demo", false);
                StartActivity(main);
            };
            Button btnDemo = (Button)FindViewById (Resource.Id.btnDemo);
            btnDemo.Click += (sender, e) =>
            {
                var main = new Intent(this, typeof(MainActivity));
                main.PutExtra("address", "demo");
                main.PutExtra("demo", true);
                StartActivity(main);
            };
        }
 private void mainExistBTN_Click(object sender, EventArgs e)
 {
     Android.Content.Intent exist = new Android.Content.Intent(this, typeof(insertExistingActivity));
     exist.PutExtra("username", username);
     exist.PutExtra("currCell", n);
     StartActivity(exist);
 }
 private void mainNewBTN_Click(object sender, EventArgs e)
 {
     Android.Content.Intent newI = new Android.Content.Intent(this, typeof(insertActivity));
     newI.PutExtra("username", username);
     newI.PutExtra("currCell", n);
     StartActivity(newI);
 }
 // http://stackoverflow.com/questions/6827407/how-to-customize-share-intent-in-android/9229654#9229654
 private void initShareItent(String type)
 {
     bool found = false;
     Intent share = new Intent(Android.Content.Intent.ActionSend);
     share.SetType("image/jpeg");
     // gets the list of intents that can be loaded.    
     List<ResolveInfo> resInfo = PackageManager.QueryIntentActivities(share, 0).ToList();
     if (resInfo.Count > 0) {
         foreach (ResolveInfo info in resInfo) {
             if (info.ActivityInfo.PackageName.ToLower().Contains(type) ||
                 info.ActivityInfo.Name.ToLower().Contains(type)) {
                 share.PutExtra(Intent.ExtraSubject, "[Corpy] hi");
                 share.PutExtra(Intent.ExtraText, "Hi " + employee.Firstname);
                 //                    share.PutExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(myPath)) );
                 // class atrribute               
                 share.SetPackage(info.ActivityInfo.PackageName);
                 found = true;
                 break;
             }
         }
         if (!found)
             return;
         StartActivity(Intent.CreateChooser(share, "Select"));
     }
 } 
        private void _list_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var bm = ((HomeAdapter)_list.Adapter).GetRow(e.Position);
            var intent = new Intent();
            switch (bm.SortOrder)
            {
                case 0:
                    if (!String.IsNullOrEmpty(bm.Day))
                    {   // use date
                        intent.SetClass(this, typeof(SessionsActivity));
                        intent.PutExtra("SelectedDateTime", bm.Day);
                    }
                    else
                    {   // use session
                        intent.SetClass(this, typeof(SessionActivity));
                        intent.PutExtra("Code", bm.SessCode);
                    }
                    StartActivity(intent);
                    break;
                case 1:
                    intent.SetClass(this, typeof(SessionsActivity));
                    intent.PutExtra("SelectedDate", bm.Day);

                    StartActivity(intent);
                    break;
                case 2:
                    // for future use
                    break;
            }
        }
Example #18
0
		void LaunchClick (object sender, EventArgs e)
		{
			EditText txtChannel = FindViewById<EditText> (Resource.Id.txtChannel);
			if (String.IsNullOrWhiteSpace (txtChannel.Text.Trim ())) {
				ShowEmptyChannelAlert ();
			} else {
				ToggleButton tbSsl = FindViewById<ToggleButton> (Resource.Id.tbSsl);
				EditText txtCipher = FindViewById<EditText> (Resource.Id.txtCipher);

				var mainActivity = new Intent(this, typeof(MainActivity));

				mainActivity.PutExtra("Channel", txtChannel.Text.Trim());

				if(tbSsl.Checked)
				{
					mainActivity.PutExtra("SslOn", "true");
				}
				else{
					mainActivity.PutExtra("SslOn", "false");
				}

				mainActivity.PutExtra("Cipher", txtCipher.Text.Trim());
				StartActivity (mainActivity);
			}
		}
 public static void SendBroadcastForToastMessage(Context context, string messageToToast)
 {
     var toastIntent = new Intent(AppConstants.APPLICATION_COMMAND);
     toastIntent.PutExtra(AppConstants.COMMAND_TYPE_ID, (int)AppConstants.ApplicationCommandType.ShowToastMessage);
     toastIntent.PutExtra(AppConstants.TOAST_MESSAGE_KEY, messageToToast);
     context.SendBroadcast(toastIntent);
 }
		private void InitView()
		{
			//设置标题栏
			var img_header_back = FindViewById<ImageView> (Resource.Id.img_header_back);
			img_header_back.Click += (sender, e) => 
			{
				SetResult(Result.Canceled);
				this.Finish();
				OverridePendingTransition(Android.Resource.Animation.SlideInLeft,Android.Resource.Animation.SlideOutRight);
			};
			var tv_back = FindViewById<TextView> (Resource.Id.tv_back);
			tv_back.Text = "关闭";
			var tv_desc = FindViewById<TextView> (Resource.Id.tv_desc);
			tv_desc.Text = "设置服务范围";

			edit_startServiceArea = FindViewById<EditText> (Resource.Id.edit_startServiceArea);
			edit_endServiceArea = FindViewById<EditText> (Resource.Id.edit_endServiceArea);

			//获取serviceType值
			serviceType = Intent.GetIntExtra("serviceType",0);
			//确认按钮
			btn_Confirm = FindViewById<Button> (Resource.Id.btn_Confirm);
			btn_Confirm.Click += (sender, e) => 
			{
				startServiceArea = edit_startServiceArea.Text;
				endServiceArea = edit_endServiceArea.Text;
				var intent = new Intent();
				intent.PutExtra("startServiceArea",startServiceArea);
				intent.PutExtra("endServiceArea",endServiceArea);
				//todo:调用webservice提交服务器
				SetResult(Result.Ok,intent);
				this.Finish();
			};

		}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SDKInitializer.Initialize(ApplicationContext);
            GetLocation();
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

          
            var hotelListView = FindViewById<ListView>(Resource.Id.HotelListView);

            BindHotelView(this, hotelListView);

            hotelListView.ItemClick += (sender, args) =>
            {
                var postion = args.Position;
                var item = (HotelEntity)args.Parent.GetItemAtPosition(postion);

                var intent = new Intent(this, typeof(DetailsActivity));
                //设置意图传递的参数
                //intent.PutExtra("HOTELENTITY", item);
                intent.PutExtra("Name", item.Name);
                intent.PutExtra("Latitude", item.Latitude);
                intent.PutExtra("Longitude", item.Longitude);

                StartActivity(intent);
            };
        }
Example #22
0
        protected override void SendLog(Log log, Action onSuccess, Action onFail)
        {
            if (_settings.DevelopersEmail != null)
            {
                var email = new Intent(Intent.ActionSend);
                email.PutExtra(Intent.ExtraSubject, EMAIL_TITLE);
                email.PutExtra(Intent.ExtraText, log.Text);
                email.PutExtra(Intent.ExtraEmail, new[] { _settings.DevelopersEmail });

                if (!Directory.Exists(BitBrowserApp.Temp))
                    Directory.CreateDirectory(BitBrowserApp.Temp);
                string path = Path.Combine(BitBrowserApp.Temp, "info.xml");

                using (var stream = new FileStream(path, FileMode.OpenOrCreate
                    , FileAccess.ReadWrite, FileShare.None))
                using (var writer = new StreamWriter(stream))
                    writer.Write(log.Attachment);

                email.PutExtra(Intent.ExtraStream, Android.Net.Uri.Parse("file://" + path));
                email.SetType("plain/text");

                _screen.StartActivityForResult(email
                    , BaseScreen.ReportEmailRequestCode
                    , (resultCode, data) => onSuccess());
            }
            else
            {
                if (log.SendReport())
                    onSuccess();
                else
                    onFail();
            }
        }
        public void ComposeEmail(
            IEnumerable<string> to, IEnumerable<string> cc, string subject,
            string body, bool isHtml,
            IEnumerable<EmailAttachment> attachments)
        {
            // http://stackoverflow.com/questions/2264622/android-multiple-email-attachments-using-intent
            var emailIntent = new Intent(Intent.ActionSendMultiple);

            if (to != null)
            {
                emailIntent.PutExtra(Intent.ExtraEmail, to.ToArray());
            }
            if (cc != null)
            {
                emailIntent.PutExtra(Intent.ExtraCc, cc.ToArray());
            }
            emailIntent.PutExtra(Intent.ExtraSubject, subject ?? string.Empty);

            body = body ?? string.Empty;

            if (isHtml)
            {
                emailIntent.SetType("text/html");
                emailIntent.PutExtra(Intent.ExtraText, Html.FromHtml(body));
            }
            else
            {
                emailIntent.SetType("text/plain");
                emailIntent.PutExtra(Intent.ExtraText, body);
            }

            var attachmentList = attachments as IList<EmailAttachment> ?? attachments.ToList();
            if (attachmentList.Any())
            {
                var uris = new List<IParcelable>();

                DoOnActivity(activity =>
                {
                    foreach (var file in attachmentList)
                    {
                        var fileWorking = file;
                        File localfile;
                        using (var localFileStream = activity.OpenFileOutput(
                            fileWorking.FileName, FileCreationMode.WorldReadable))
                        {
                            localfile = activity.GetFileStreamPath(fileWorking.FileName);
                            fileWorking.Content.CopyTo(localFileStream);
                        }
                        localfile.SetReadable(true, false);
                        uris.Add(Uri.FromFile(localfile));
                        localfile.DeleteOnExit(); // Schedule to delete file when VM quits.
                    }
                });

                emailIntent.PutParcelableArrayListExtra(Intent.ExtraStream, uris);
            }

            // fix for GMail App 5.x (File not found / permission denied when using "StartActivity")
            StartActivityForResult(0, Intent.CreateChooser(emailIntent, string.Empty));
        }
Example #24
0
        public static void HandleItemShowEpisodeClick(object item, Context context)
        {
            var pageLink = string.Empty;
            var canGoBackToSeriesHome = false;

            if (item is CalenderScheduleList calenderItem)
            {
                pageLink = calenderItem.PageLink;
            }
            else if (item is ShowList showItem)
            {
                pageLink = showItem.PageLink;
            }
            else if (item is SearchList searchItem)
            {
                pageLink = searchItem.PageLink;
            }
            else if (item is EpisodeList episodeItem)
            {
                pageLink = episodeItem.PageLink;
            }
            else if (item is SearchSuggestionsData searchSuggestion)
            {
                pageLink = searchSuggestion.ItemLink;
            }
            else if (item is GenresShow genreShow)
            {
                pageLink = genreShow.PageLink;
            }
            else if (item is ShowEpisodeDetails episodeDetailLink)
            {
                pageLink = episodeDetailLink.EpisodeLink;
                canGoBackToSeriesHome = true;
            }
            else if (item is SeriesDetails seriesDetailLink)
            {
                pageLink = seriesDetailLink.SeriesLink;
            }

            if (string.IsNullOrEmpty(pageLink))
            {
                Error.Instance.ShowErrorTip("Link is empty.", context);
                return;
            }
            if (pageLink.Contains("/serie/"))
            {
                // tv show detail
                var intent = new Android.Content.Intent(context, typeof(ShowDetailActivity));
                intent.PutExtra("itemLink", pageLink);
                context.StartActivity(intent);
            }
            else
            {
                // tv episode detail
                var intent = new Android.Content.Intent(context, typeof(EpisodeDetailActivity));
                intent.PutExtra("itemLink", pageLink);
                intent.PutExtra("canGoBackToSeriesHome", canGoBackToSeriesHome);
                context.StartActivity(intent);
            }
        }
Example #25
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.ListaLabs);
            var user = FindViewById <TextView>(Resource.Id.tvUSER);

            user.Text = Intent.GetStringExtra("dato");
            var token = Intent.GetStringExtra("token");

            CargaLista(token);
            var ListViewDatos = FindViewById <ListView>(Resource.Id.listView1);

            ListViewDatos.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                var intent = new Android.Content.Intent(this, typeof(LabInfo));
                intent.PutExtra("user", user.Text);

                intent.PutExtra("id", data.ListaCmp[e.Position].EvidenceID);
                intent.PutExtra("token", token);

                intent.PutExtra("labNom", Items[e.Position].Title);
                intent.PutExtra("labStatus", Items[e.Position].Status);
                //
                //Koush.UrlImageViewHelper.SetUrlDrawable(Widget, ImgUrl);

                StartActivity(intent);
            };
        }
Example #26
0
 void GridOnItemClick(object sender, AdapterView.ItemClickEventArgs itemClickEventArgs)
 {
     var intent = new Intent(Activity, typeof(FriendActivity));
     intent.PutExtra("Title", friends[itemClickEventArgs.Position].Title);
     intent.PutExtra("Image", friends[itemClickEventArgs.Position].Image);
     StartActivity(intent);
 }
 private void StartImagePagerActivity(int position)
 {
     Intent intent = new Intent(Activity, typeof(SimpleImageActivity));
     intent.PutExtra(Constants.Extra.FRAGMENT_INDEX, ImagePagerFragment.INDEX);
     intent.PutExtra(Constants.Extra.IMAGE_POSITION, position);
     StartActivity(intent);
 }
		public override void OnBindViewHolder (RecyclerView.ViewHolder holder, int position)
		{
			NewsAdapterWrapper Myholder = holder as NewsAdapterWrapper;
			Myholder.Titulo.Text = mPublicaciones [position].Titulo;
			Myholder.Subtitulo.Text = mPublicaciones [position].Subtitulo;
			Myholder.Fecha.Text = mPublicaciones [position].FechaPublicacion.ToString ();
			Koush.UrlImageViewHelper.SetUrlDrawable (Myholder.Imagen, mPublicaciones [position].Imagen.ToString ());
			Myholder.Detalle.Visibility = ViewStates.Gone;
			Myholder.Imagen.Click += (object sender, EventArgs e) => 
			{
				Intent IntentNews = new Intent(this.mContext,typeof(NewsDetailActivity));
				IntentNews.PutExtra ("TituloDetalle", mPublicaciones [position].Titulo);
				IntentNews.PutExtra ("SubtituloDetalle", mPublicaciones [position].Subtitulo);
				IntentNews.PutExtra ("FechaDetalle", mPublicaciones [position].FechaPublicacion.ToString ());
				IntentNews.PutExtra ("ContenidoDetalle", mPublicaciones [position].Contenido.Trim ());
				IntentNews.PutExtra ("ImagenDetalle", mPublicaciones [position].Imagen.ToString ());

				this.mContext.StartActivity (IntentNews);
			};
//			Myholder.Detalle.Click += (object sender, EventArgs e) => 
//			{
//				Intent IntentNews = new Intent(this.mContext,typeof(NewsDetailActivity));
//				IntentNews.PutExtra ("TituloDetalle", mPublicaciones [position].Titulo);
//				IntentNews.PutExtra ("SubtituloDetalle", mPublicaciones [position].Subtitulo);
//				IntentNews.PutExtra ("FechaDetalle", mPublicaciones [position].FechaPublicacion.ToString ());
//				IntentNews.PutExtra ("ContenidoDetalle", mPublicaciones [position].Contenido.Trim ());
//				IntentNews.PutExtra ("ImagenDetalle", mPublicaciones [position].Imagen.ToString ());
//				this.mContext.StartActivity (IntentNews);
//			};
		}
		void OnSaveClick(object sender, EventArgs e)
		{
			//
			// Retrieve the values the user entered into the UI
			//
			string name  = FindViewById<EditText>(Resource.Id.nameInput).Text;
			int    count = int.Parse(FindViewById<EditText>(Resource.Id.countInput).Text);

			var intent = new Intent();

			//
			// Load the new data into an Intent for transport back to the Activity that started this one.
			//
			intent.PutExtra("ItemName",  name );
			intent.PutExtra("ItemCount", count);

			//
			// Send the result code and data back (this does not end the current Activity)
			//
			SetResult(Result.Ok, intent);

			//
			// End the current Activity.
			//
			Finish();
		}
Example #30
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.Itens);

            List<ItemPedido> itensPedido = new List<ItemPedido>();
            EditText nome = FindViewById<EditText> (Resource.Id.et_nome);
            EditText preco = FindViewById<EditText> (Resource.Id.et_preco);
            EditText quantidade = FindViewById<EditText> (Resource.Id.et_quantidade);
            Button addItem = FindViewById<Button> (Resource.Id.bt_adicionar_item);
            Button finalizar = FindViewById<Button> (Resource.Id.bt_finalizar);
            ListView itens = FindViewById<ListView> (Resource.Id.list_item);
            float total = 0;

            addItem.Click += (object sender, EventArgs e) => {
                if (nome.Text.Trim() == "" && preco.Text.Trim() == "" && quantidade.Text.Trim() == ""){
                    Toast.MakeText(this, "Preencha os campos acima", ToastLength.Long).Show();
                } else {
                    itensPedido.Add(new ItemPedido(nome.Text, float.Parse(preco.Text), int.Parse(quantidade.Text), 1));
                    itens.Adapter = new AdapterItensMain (this, itensPedido);
                    total =  total + (float.Parse(preco.Text) * int.Parse(quantidade.Text));
                }
            };

            finalizar.Click += (object sender, EventArgs e) => {
                itens.Adapter = new AdapterItens (this, itensPedido);
                Intent intent = new Intent(this, typeof(MainActivity));
                intent.PutExtra("itens", JsonConvert.SerializeObject(itensPedido));
                intent.PutExtra("total", total.ToString());
                StartActivity(intent);
                Finish();
            };
        }
 void GoMainActivity()
 {
     var intent = new Intent(this, typeof(MainActivity));
     intent.PutExtra("Name", m_name.Text);
     intent.PutExtra("Pass", m_pass.Text);
     StartActivity(intent);
 }
        void ProcessHttpRequest(HttpListenerContext context)
        {
            try {
                string barcodeFormatStr = context.Request?.QueryString? ["format"] ?? "QR_CODE";
                string barcodeValue     = context?.Request?.QueryString? ["value"] ?? "";
                string barcodeUrl       = context?.Request?.QueryString? ["url"] ?? "";

                // Pass along the querystring values
                var intent = new Android.Content.Intent(this, typeof(MainActivity));
                intent.PutExtra("FORMAT", barcodeFormatStr);
                intent.PutExtra("VALUE", barcodeValue);
                intent.PutExtra("URL", barcodeUrl);
                intent.AddFlags(ActivityFlags.NewTask);

                // Start the activity to show the values
                StartActivity(intent);

                // Return a success
                context.Response.StatusCode        = (int)HttpStatusCode.OK;
                context.Response.StatusDescription = "OK";
                context.Response.Close();
            } catch (Exception e) {
                Console.WriteLine("Error " + e.Message);

                context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
                context.Response.Close();
            }
        }
        void ProcessHttpRequest (HttpListenerContext context)
        {
            try {
                string barcodeFormatStr = context.Request?.QueryString? ["format"] ?? "QR_CODE";
                string barcodeValue = context?.Request?.QueryString? ["value"] ?? "";
                string barcodeUrl = context?.Request?.QueryString? ["url"] ?? "";

                // Pass along the querystring values
                var intent = new Android.Content.Intent (this, typeof (MainActivity));
                intent.PutExtra ("FORMAT", barcodeFormatStr);
                intent.PutExtra ("VALUE", barcodeValue);
                intent.PutExtra ("URL", barcodeUrl);
                intent.AddFlags (ActivityFlags.NewTask);

                // Start the activity to show the values
                StartActivity (intent);

                // Return a success 
                context.Response.StatusCode = (int)HttpStatusCode.OK;
                context.Response.StatusDescription = "OK";
                context.Response.Close ();

            } catch (Exception e) {
                Console.WriteLine ("Error " + e.Message);

                context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
                context.Response.Close ();
            }
        }
Example #34
0
        public void AddEvent(string name, DateTime startTime, DateTime endTime)
        {
            Intent intent = new Intent(Intent.ActionInsert);
            intent.SetData(Android.Provider.CalendarContract.Events.ContentUri);

            // Add Event Details
            intent.PutExtra(Android.Provider.CalendarContract.ExtraEventBeginTime, DateTimeJavaDate(startTime));
            intent.PutExtra(Android.Provider.CalendarContract.ExtraEventEndTime, DateTimeJavaDate(endTime));
            intent.PutExtra(Android.Provider.CalendarContract.EventsColumns.AllDay, false);
            //			intent.PutExtra(Android.Provider.CalendarContract.EventsColumns.EventLocation, ""); TODO: event location
            intent.PutExtra(Android.Provider.CalendarContract.EventsColumns.Description, "UTS:HELPS Workshop");
            intent.PutExtra(Android.Provider.CalendarContract.EventsColumns.Title, name);

            // open "Add to calendar" screen
            Forms.Context.StartActivity(intent);

            //			TODO: add event directly
            //			https://github.com/xamarin/monodroid-samples/blob/master/CalendarDemo/EventListActivity.cs
            //
            //			ContentValues eventValues = new ContentValues ();
            //			eventValues.Put (CalendarContract.Events.InterfaceConsts.CalendarId, ?? ?);
            //			eventValues.Put (CalendarContract.Events.InterfaceConsts.Title, "Test Event");
            //			eventValues.Put (CalendarContract.Events.InterfaceConsts.Description, "This is an event created from Mono for Android");
            //			eventValues.Put (CalendarContract.Events.InterfaceConsts.Dtstart, GetDateTimeMS (2011, 12, 15, 10, 0));
            //			eventValues.Put (CalendarContract.Events.InterfaceConsts.Dtend, GetDateTimeMS (2011, 12, 15, 11, 0));
            //
            //			eventValues.Put(CalendarContract.Events.InterfaceConsts.EventTimezone, "UTC");
            //			eventValues.Put(CalendarContract.Events.InterfaceConsts.EventEndTimezone, "UTC");
            //
            //			var uri = ContentResolver.Insert (CalendarContract.Events.ContentUri, eventValues);
            //			Console.WriteLine ("Uri for new event: {0}", uri);
        }
        /// <summary>
        /// Cargamos la informacion en Data para no perder la informacion.
        /// </summary>
        private async void LoadData()
        {
            // Si no existe un token intentamos recargar la informacion
            if (string.IsNullOrWhiteSpace(Data.Token))
            {
                // Recuperamos la informaicon pasada desde la otra actividad
                Data.FullName = Intent.GetStringExtra("FullName");
                Data.Token    = Intent.GetStringExtra("Token");

                // Recuperamos la lista de las evidencias
                var ServiceClient = new ServiceClient();

                try
                {
                    Data.EvidenceList = await ServiceClient.GetEvidencesAsync(Data.Token);
                }
                catch (Exception ex)
                {
                    // Creamos un dialogo para mostrar la excepcion
                    ErrorDialog(ex.Message);
                    Data.EvidenceList = new List <HackAtHome.Entities.Evidence>();
                }
            }

            // Cargamos la informacion en el layout
            var FullNameTextView = FindViewById <TextView>(Resource.Id.textViewFullName);

            FullNameTextView.Text = Data.FullName;

            // Cargamos la informacion en el ListView
            var EvidenceAdapter = new EvidenceAdapter(
                this, Data.EvidenceList, Resource.Layout.EvidenceListItem,
                Resource.Id.textViewEvidenceTitle, Resource.Id.textViewEvidenceStatus
                );

            EvidenceListView         = FindViewById <ListView>(Resource.Id.listViewEvidence);
            EvidenceListView.Adapter = EvidenceAdapter;

            // Restauramos el estado del ListView si existe
            if (Data.EvidenceListState != null)
            {
                EvidenceListView.OnRestoreInstanceState(Data.EvidenceListState);
            }

            // Establecemos la accion al hacer click en un elemento de la lista
            EvidenceListView.ItemClick += (s, ev) =>
            {
                var Intent = new Android.Content.Intent(this, typeof(EvidenceDetailActivity));
                Intent.PutExtra("FullName", Data.FullName);
                Intent.PutExtra("Token", Data.Token);

                // Recuperamos los datos de la lista
                var Evidence = EvidenceAdapter[ev.Position];
                Intent.PutExtra("EvidenceID", Evidence.EvidenceID);
                Intent.PutExtra("EvidenceTitle", Evidence.Title);
                Intent.PutExtra("EvidenceStatus", Evidence.Status);
                StartActivity(Intent);
            };
        }
Example #36
0
        private void StartInsertTask()
        {
            Android.Content.Intent intent = new Android.Content.Intent(this.BaseContext, typeof(InsertTaskActivity));
            intent.PutExtra("identifier", GetNewIdentifier());
            intent.PutExtra("access_token", _accessToken);

            StartActivityForResult(intent, ACTIVITY_RESULT_INSERT_TASK);
        }
Example #37
0
        private async void LoadData()
        {
            if (string.IsNullOrWhiteSpace(Data.Token))
            {
                Data.FullName = Intent.GetStringExtra("FullName");
                Data.Token    = Intent.GetStringExtra("Token");


                var ServiceClient = new ServiceClient();

                try
                {
                    Data.EvidenceList = await ServiceClient.GetEvidencesAsync(Data.Token);
                }
                catch (Exception ex)
                {
                    ErrorDialog(ex.Message);
                    Data.EvidenceList = new List <HackAtHome.Entities.Evidence>();
                }
            }


            var FullNameTextView = FindViewById <TextView>(Resource.Id.textViewFullName);

            FullNameTextView.Text = Data.FullName;


            var EvidenceAdapter = new EvidencesAdapter(
                this, Data.EvidenceList, Resource.Layout.EvidenceListItem,
                Resource.Id.textViewEvidenceTitle, Resource.Id.textViewEvidenceStatus
                );



            EvidenceListView         = FindViewById <ListView>(Resource.Id.listViewEvidence);
            EvidenceListView.Adapter = EvidenceAdapter;


            if (Data.EvidenceListState != null)
            {
                EvidenceListView.OnRestoreInstanceState(Data.EvidenceListState);
            }


            EvidenceListView.ItemClick += (s, ev) =>
            {
                var Intent = new Android.Content.Intent(this, typeof(EvidenceDetailActivity));
                Intent.PutExtra("FullName", Data.FullName);
                Intent.PutExtra("Token", Data.Token);

                var Evidence = EvidenceAdapter[ev.Position];
                Intent.PutExtra("EvidenceID", Evidence.EvidenceID);
                Intent.PutExtra("EvidenceTitle", Evidence.Title);
                Intent.PutExtra("EvidenceStatus", Evidence.Status);
                StartActivity(Intent);
            };
        }
Example #38
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.insert);

            TextView helloText = FindViewById <TextView>(Resource.Id.textView4);

            Button insertBTN = FindViewById <Button>(Resource.Id.button1);

            Button takePicBTN = FindViewById <Button>(Resource.Id.button2);

            imageView = FindViewById <ImageView>(Resource.Id.imageView1);

            username = Intent.GetStringExtra("username") ?? string.Empty;
            n        = Intent.GetIntExtra("currCell", 1);//todo

            helloText.Text = "Hello " + username + ",  Fill the properties below:";

            takePicBTN.Click += (object sender, EventArgs e) =>
            {
                Intent intent = new Intent(MediaStore.ActionImageCapture);
                StartActivityForResult(intent, 0);
            };

            insertBTN.Click += async(object sender, EventArgs e) =>
            {
                RadioGroup  radioGroupWeath  = FindViewById <RadioGroup>(Resource.Id.radioGroup1);
                RadioButton radioButtonWeath = FindViewById <RadioButton>(radioGroupWeath.CheckedRadioButtonId);

                RadioGroup  radioGroupColor  = FindViewById <RadioGroup>(Resource.Id.radioGroup2);
                RadioButton radioButtonColor = FindViewById <RadioButton>(radioGroupColor.CheckedRadioButtonId);

                RadioGroup  radioGroupType  = FindViewById <RadioGroup>(Resource.Id.radioGroup3);
                RadioButton radioButtonType = FindViewById <RadioButton>(radioGroupType.CheckedRadioButtonId);

                try
                {
                    SqlConnection connection = new SqlConnection(
                        "Data Source = smartclosetdatabase.database.windows.net; Initial Catalog = smartclosetdb; User ID = HAGATZAR; Password = SCAMO236###; Connect Timeout = 30; Encrypt = True; TrustServerCertificate = False; ApplicationIntent = ReadWrite; MultiSubnetFailover = False;");
                    connection.Open();
                    SqlCommand command = new SqlCommand("INSERT INTO ITEMS (COLOR, WEATHER, TYPE, FIRSTINSERT, LASTACT, IMAGE, NUMOFSELECTS, INCLOSET, USERNAME, CELLNUM) VALUES( '" + radioButtonColor.Text + "' , '" + radioButtonWeath.Text + "' , '" + radioButtonType.Text + "' ,GetDate(),GetDate(), @picArr ,0,1, '" + username + "',(select min(CELLNUM) from (SELECT CELLNUM FROM CELLS except (SELECT CELLNUM FROM ITEMS WHERE username = '******' and incloset = 1)) diff));", connection);
                    command.Parameters.Add("@picArr", SqlDbType.VarBinary, picArr.Length).Value = picArr;
                    SqlDataReader reader = command.ExecuteReader();
                }
                catch (SqlException err)
                {
                    // Console.WriteLine(err); //todo
                }
                Android.Content.Intent done = new Android.Content.Intent(this, typeof(DoneActivity));
                done.PutExtra("username", username);
                done.PutExtra("currCell", n);
                StartActivity(done);
            };
        }
Example #39
0
 private void StartDetailsActivity()
 {
     if (_taskToStartActivity.IsOutside)
     {
         Android.Content.Intent intent = new Android.Content.Intent(BaseContext, typeof(TaskDetailActivity));
         intent.PutExtra("identifier", _taskToStartActivity.Identifier);
         intent.PutExtra("title", _taskToStartActivity.Title);
         intent.PutExtra("access_token", _accessToken);
         _taskToStartActivity = null;
         StartActivity(intent);
     }
 }
Example #40
0
        private void LvEvidences_Click(object sender, AdapterView.ItemClickEventArgs e)
        {
            Evidence ev = lstEvidencias.Lista.ElementAt <Evidence>(e.Position);

            var intent = new Android.Content.Intent(this, typeof(DetailEvidenceActivity));

            intent.PutExtra("Token", Token);
            intent.PutExtra("FullName", FullName);
            intent.PutExtra("EvidenceID", ev.EvidenceID);
            intent.PutExtra("Title", ev.Title);
            intent.PutExtra("Status", ev.Status);

            StartActivity(intent);
        }
Example #41
0
        private void EvidenceListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var serviceClient = new ServiceClient();
            var evidence      = (evidenceListView.Adapter as EvidencesAdapter)[e.Position];

            var newIntent = new Android.Content.Intent(this, typeof(EvidenceDetailActivity));

            newIntent.PutExtra("Title", evidence.Title);
            newIntent.PutExtra("Status", evidence.Status);
            newIntent.PutExtra("EvidenceID", evidence.EvidenceID);
            newIntent.PutExtra("FullName", fullName);
            newIntent.PutExtra("Token", token);
            StartActivity(newIntent);
        }
        private void ListEvidencias_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var service  = new HackAtHome.SAL.ServiceClient();
            var evidence = (listEvidencias.Adapter as EvidencesAdapter)[e.Position];

            var intenDetalleItem = new Android.Content.Intent(this, typeof(EvidenciaItemDetalle));

            intenDetalleItem.PutExtra("Title", evidence.Title);
            intenDetalleItem.PutExtra("Status", evidence.Status);
            intenDetalleItem.PutExtra("EvidenceID", evidence.EvidenceID);
            intenDetalleItem.PutExtra("FullName", Nombre);
            intenDetalleItem.PutExtra("Token", token);
            StartActivity(intenDetalleItem);
        }
Example #43
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            var go = new Android.Content.Intent(this, typeof(ViewDetails));

            go.PutExtra("Id", events[position].ID);
            StartActivity(go);
        }
Example #44
0
        /// <summary>
        /// Start to select photo.
        /// </summary>
        /// <param name="requestCode"> identity of the requester activity. </param>
        public void ForResult(int requestCode)
        {
            if (engine == null)
            {
                throw new ExceptionInInitializerError(LoadEngine.INITIALIZE_ENGINE_ERROR);
            }

            Activity activity = Activity;

            if (activity == null)
            {
                return; // cannot continue;
            }
            mSelectionSpec.MimeTypes = MimeTypes;
            mSelectionSpec.Engine    = engine;
            Intent intent = new Intent(activity, typeof(ImageSelectActivity));

            intent.PutExtra(ImageSelectActivity.EXTRA_SELECTION_SPEC, mSelectionSpec);
            //        intent.putExtra(ImageSelectActivity.EXTRA_ENGINE, (Serializable) engine);

            intent.PutParcelableArrayListExtra(ImageSelectActivity.EXTRA_RESUME_LIST, mResumeList.AsIParcelableList());

            Fragment fragment = Fragment;

            if (fragment != null)
            {
                fragment.StartActivityForResult(intent, requestCode);
            }
            else
            {
                activity.StartActivityForResult(intent, requestCode);
            }
            hasInitPicker = false;
        }
Example #45
0
            public void OnClick(View v)
            {
                var videoPlayerActivity = new Android.Content.Intent(activity, typeof(VideoPlayerActivity));

                videoPlayerActivity.PutExtra("VideoUrl", JsonConvert.SerializeObject(weclipVideoInfo));
                activity.StartActivity(videoPlayerActivity);
            }
Example #46
0
        private void ReceiveMessage()
        {
            while (true)
            {
                string     hostName         = Dns.GetHostName();     // Retrive the Name of HOST
                IPAddress  ip               = IPAddress.Parse(Dns.GetHostByName(hostName).AddressList[0].ToString());
                IPEndPoint remoteIPEndPoint = new IPEndPoint(ip, port);
                byte[]     content          = udpClient.Receive(ref remoteIPEndPoint);

                if (content.Length > 0)
                {
                    string message = Encoding.ASCII.GetString(content);

                    if (message == "300")
                    {
                        // udpClient.Close();
                        StartActivity(typeof(TrwaAkcja));
                    }
                    else if (message == "100" || message == "200")
                    {
                        Android.Content.Intent myIntent = new Android.Content.Intent(this, typeof(PierwszyEkran2));
                        myIntent.PutExtra("key", message);

                        StartActivity(myIntent);
                    }
                    else if (message == "400")
                    {
                        message = "Ile możesz zaoszczędzić kupująć drugi produkt Polsatu Cyfrowego?\n    A) 10% \n    B) 20% " +
                                  "\n    C) 40% \n    D) 50% ";
                    }
                }
            }
        }
Example #47
0
        public void PermissionsGranted(int p0)
        {
            string TargetName = Intent.GetStringExtra("Target_Name");
            Intent Wactivity  = new Android.Content.Intent(this, typeof(WikitudeActivity));

            Wactivity.PutExtra("targetname", TargetName);
            StartActivity(Wactivity);
        }
Example #48
0
        private void SearchAddHouse()
        {
            var searchactivity = new Android.Content.Intent(this, typeof(HouseSearchActivity));

            searchactivity.PutExtra("User_email", user_email);
            this.StartActivity(searchactivity);
            OverridePendingTransition(Resource.Animation.abc_slide_in_bottom, Resource.Animation.abc_slide_out_bottom);
        }
Example #49
0
        private void AddSmarWatch()
        {
            var addsmartwatch = new Android.Content.Intent(this, typeof(AddSmartWatchActivity));

            addsmartwatch.PutExtra("User_email", user_email);
            this.StartActivity(addsmartwatch);
            OverridePendingTransition(Resource.Animation.abc_slide_in_bottom, Resource.Animation.abc_slide_out_bottom);
        }
Example #50
0
        private void RegisterHouse()
        {
            var houseregistration = new Android.Content.Intent(this, typeof(HouseRegistrationActivity));

            houseregistration.PutExtra("User_email", user_email);
            this.StartActivity(houseregistration);
            OverridePendingTransition(Resource.Animation.abc_slide_in_bottom, Resource.Animation.abc_slide_out_bottom);
        }
Example #51
0
                protected override void OnPostExecute(WeClipVideo result)
                {
                    base.OnPostExecute(result);
                    p.Dismiss();
                    var videoPlayerActivity = new Android.Content.Intent(activity, typeof(VideoPlayerActivity));

                    videoPlayerActivity.PutExtra("VideoUrl", JsonConvert.SerializeObject(weclipVideo));
                    activity.StartActivity(videoPlayerActivity);
                }
Example #52
0
 private async void mainDoneBTN_ClickAsync(object sender, EventArgs e)
 {
     if (n != 1)
     {
         await BluetoothHandler.sendAsync(9 - n);
     }
     Android.Content.Intent main2 = new Android.Content.Intent(this, typeof(MainActivity2));
     main2.PutExtra("username", username);
     StartActivity(main2);
 }
Example #53
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Evidences);

            string Token    = Intent.GetStringExtra("Token");
            string FullName = Intent.GetStringExtra("FullName");

            var TextViewFullName = FindViewById <TextView>(Resource.Id.textViewFullName);

            TextViewFullName.Text = FullName;

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

            if (Data == null)
            {
                Data = new ObjectFragment();
                var FragmentTransaction = this.FragmentManager.BeginTransaction();
                FragmentTransaction.Add(Data, "Data");
                FragmentTransaction.Commit();

                var Client = new ServiceClient();
                Data.Evidences = await Client.GetEvidencesAsync(Token);
            }

            var ListViewEvidences = FindViewById <ListView>(Resource.Id.listViewEvidences);

            ListViewEvidences.Adapter = new EvidencesAdapter(this, Data.Evidences, Resource.Layout.EvidenceItem, Resource.Id.textViewTitle, Resource.Id.textViewStatus);

            ListViewEvidences.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                var Evidence = Data.Evidences[e.Position];

                var Intent = new Android.Content.Intent(this, typeof(EvidenceDetailsActivity));
                Intent.PutExtra("Token", Token);
                Intent.PutExtra("FullName", FullName);
                Intent.PutExtra("EvidenceID", Evidence.EvidenceID);
                Intent.PutExtra("Title", Evidence.Title);
                Intent.PutExtra("Status", Evidence.Status);
                StartActivity(Intent);
            };
        }
Example #54
0
        private async void ValidateUser(object sender, EventArgs e)
        {
            var Button = FindViewById <Button>(Resource.Id.ValidateButton);

            Button.Enabled = false;

            var Email    = FindViewById <EditText>(Resource.Id.EmailEditText);
            var Password = FindViewById <EditText>(Resource.Id.PasswordEditText);
            var Result   = await HackAtHomeService.AutenticateAsync(Email.Text, Password.Text);

            try
            {
                if (Result.Status == Status.Success)
                {
                    var MicrosoftEvidence = new LabItem
                    {
                        Email    = Email.Text,
                        Lab      = "Hack@Home",
                        DeviceId = Android.Provider.Settings
                                   .Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId)
                    };

                    var MicrosoftClient = new MicrosoftService();
                    await MicrosoftClient.SendEvidence(MicrosoftEvidence);

                    var Intent = new Android.Content.Intent(this, typeof(MainActivity));
                    Intent.PutExtra("Name", Result.FullName);
                    Intent.PutExtra("Token", Result.Token);
                    StartActivity(Intent);
                }
                else
                {
                    HelperMessage.MakeAlert(this, "Error", "Usuario no válido");
                }
            }
            catch (Exception ex)
            {
                HelperMessage.MakeAlert(this, "Error", ex.Message);
            }

            Button.Enabled = true;
        }
Example #55
0
 private async void onClick(int curCell)
 {
     //await BluetoothHandler.sendAsync(cellArr[curCell - 1] - 1);
     try
     {
         SqlConnection connection = new SqlConnection(
             "Data Source = smartclosetdatabase.database.windows.net; Initial Catalog = smartclosetdb; User ID = HAGATZAR; Password = SCAMO236###; Connect Timeout = 30; Encrypt = True; TrustServerCertificate = False; ApplicationIntent = ReadWrite; MultiSubnetFailover = False;");
         connection.Open();
         SqlCommand    command = new SqlCommand("UPDATE items SET incloset = 1, lastact=GetDate(), cellnum = (select min(CELLNUM) from (SELECT CELLNUM FROM CELLS except (SELECT CELLNUM FROM ITEMS WHERE username = '******' and incloset = 1)) diff)  WHERE ide = '" + idArr[curCell - 1] + "' ; ", connection);
         SqlDataReader reader  = command.ExecuteReader();
     }
     catch (SqlException err)
     {
         Console.WriteLine(err); //todo
     }
     Android.Content.Intent done = new Android.Content.Intent(this, typeof(DoneActivity));
     done.PutExtra("username", username);
     done.PutExtra("currCell", n);
     StartActivity(done);
 }
Example #56
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.Evidence);
            //Get String Extra
            string Token    = Intent.GetStringExtra("Token");
            string UserName = Intent.GetStringExtra("UserName");
            //Set Txt User Name value UserName
            var TextUserName = FindViewById <TextView>(Resource.Id.TextViewUserName);

            TextUserName.Text = UserName;

            Data = (EvidencesFragment)this.FragmentManager.FindFragmentByTag("Data");
            if (Data == null)
            {
                Data = new EvidencesFragment();
                ServiceClient   ServiceClient = new ServiceClient();
                List <Evidence> EvidencesList = await ServiceClient.GetEvidencesAsync(Token);

                var FragmentTransaction = this.FragmentManager.BeginTransaction();
                Data.EvidencesList = EvidencesList;
                FragmentTransaction.Add(Data, "Data");
                FragmentTransaction.Commit();
            }
            var ListEvidences = FindViewById <ListView>(Resource.Id.ListViewEvidences);

            ListEvidences.Adapter = new EvidencesAdapter(this, Data.EvidencesList, Resource.Layout.EvidenceItem, Resource.Id.TextViewTitleEvidence, Resource.Id.TextViewStatusEvidence);

            ListEvidences.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
            {
                EvidencesAdapter AdapterEv    = (EvidencesAdapter)ListEvidences.Adapter;
                Evidence         SelectedItem = AdapterEv[e.Position];
                var EvidenceDetailIntent      = new Android.Content.Intent(this, typeof(EvidenceDetailActivity));
                EvidenceDetailIntent.PutExtra("EvidenceID", SelectedItem.EvidenceID);
                EvidenceDetailIntent.PutExtra("EvidenceTitle", SelectedItem.Title);
                EvidenceDetailIntent.PutExtra("EvidenceStatus", SelectedItem.Status);
                EvidenceDetailIntent.PutExtra("UserName", UserName);
                EvidenceDetailIntent.PutExtra("Token", Token);
                StartActivity(EvidenceDetailIntent);
            };
        }
Example #57
0
 private void List_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
 {
     if (lista[e.Position].Wyszukiwanie.Split(':')[0] == "Uczestnik")
     {
         var NxtAct = new Android.Content.Intent(this, typeof(UserActivity));
         NxtAct.PutExtra("Show", false);
         NxtAct.PutExtra("Email", lista[e.Position].Wyszukiwanie.Split(':')[1]);
         NxtAct.PutExtra("expo_id", lista[e.Position].Expo);
         NxtAct.PutExtra("Search", lista[e.Position].Wyszukiwanie);
         StartActivity(NxtAct);
     }
     else if (lista[e.Position].Wyszukiwanie.Split(':')[0] == "Wystawca")
     {
         var NxtAct1 = new Android.Content.Intent(this, typeof(CompanyActivity));
         NxtAct1.PutExtra("Show", false);
         NxtAct1.PutExtra("Email", lista[e.Position].Wyszukiwanie.Split(':')[1]);
         NxtAct1.PutExtra("expo_id", lista[e.Position].Expo);
         NxtAct1.PutExtra("Search", lista[e.Position].Wyszukiwanie);
         StartActivity(NxtAct1);
     }
 }
        public async void OnCreateGamePress(View view)
        {
            SetFormEnabled(false);

            var newGame = new Common.Game()
            {
                Name     = GameNameEditText.Text,
                Password = GamePasswordEditText.Text,
                GameMode = GameMode.Assassins
            };

            // Create game
            Common.Game game = await CsClient.CreateGameAsync(newGame);

            // Launch join game activity so that we can join our new game
            var    intent = new Android.Content.Intent(this, typeof(JoinGameActivity));
            Bundle extras = new Bundle();

            intent.PutExtra("GameId", game.Id);
            intent.PutExtra("GamePassword", game.Password);
            StartActivity(intent, extras);
        }
Example #59
0
        private void List_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            var NxtAct = new Android.Content.Intent(this, typeof(MyExposExpoActivity));

            NxtAct.PutExtra("name", expos[e.Position].Name_Expo);
            NxtAct.PutExtra("id", expos[e.Position].Id);
            NxtAct.PutExtra("adres", expos[e.Position].Adres);
            NxtAct.PutExtra("opis", expos[e.Position].Description);
            NxtAct.PutExtra("photo", expos[e.Position].Photo);
            NxtAct.PutExtra("DS", expos[e.Position].DataTargowStart.ToString());
            NxtAct.PutExtra("DE", expos[e.Position].DataTargowEnd.ToString());
            StartActivity(NxtAct);
        }
        public void StartUI(object sender, EventArgs e)
        {
            CardEngineBase engine;
            string UIQualifiedName;
            string engineQualifiedName;
            string entityQualifiedName;
            string resourceQualifiedName;

            View item = sender as View;
            Type itemType = Type.GetType(item.Tag.ToString());

            switch (item.Tag.ToString())
            {
            case "AreeUI":
                UIQualifiedName = "Tabelle.AreeUI, Tabelle.Android";
                engineQualifiedName = "Tabelle.AreeEngine, Tabelle.Android";
                entityQualifiedName = "Tabelle.AreeEntity, Tabelle.Android";
                resourceQualifiedName = "Prototipo.Resource, Prototipo.Android";
                engine = CardEngineFactory.CreateEngine(engineQualifiedName, entityQualifiedName);

                Intent intent = new Intent (this, Type.GetType (UIQualifiedName));
                intent.PutExtra ("ENGINE", Utility.DataContractSerialize (engine, false));
                intent.PutExtra ("RESOURCE", resourceQualifiedName);
                intent.PutExtra ("ACTION", (int)CardAction.Read);

                this.StartActivity(intent);

                break;
            default:
                break;
            }
        }