private void InitTextView( ) {
			tvTabmyAlarm = View.FindViewById<Button>(Resource.Id.tv_tab_myAlarm);
			tvTabotherAlarm = View.FindViewById<Button>(Resource.Id.tv_tab_otherAlarm);
			tvTabmyAlarm.SetTextColor(Resources.GetColor(Resource.Color.blue));

			tvTabmyAlarm.SetOnClickListener(this);
			tvTabotherAlarm.SetOnClickListener(this);
		}
			public Content (Context context, IAttributeSet attrs) : base (context, attrs)
			{
				mNavHider = () => SetNavVisibility (false);
				mText = new TextView (context);
				mText.SetTextSize (ComplexUnitType.Dip, 16);
				mText.Text = context.GetString (Resource.String.alert_dialog_two_buttons2ultra_msg);
				mText.Clickable = false;
				mText.SetOnClickListener (this);
				mText.SetTextIsSelectable (true);
				AddView (mText, new ViewGroup.LayoutParams (
					ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent));

				SetOnSystemUiVisibilityChangeListener (this);
			}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            //Thread.Sleep(10000); // Simulate a long loading process on app startup.
            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.activity_register_main);

            /*Setting flat name in Spinner control */
            Spinner spinner = FindViewById<Spinner> (Resource.Id.flatspinner);
            spinner.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs> (spinner_ItemSelected);
            var adapter = ArrayAdapter.CreateFromResource (
                this, Resource.Array.Flats_array, Android.Resource.Layout.SimpleSpinnerItem);

            adapter.SetDropDownViewResource (Android.Resource.Layout.SimpleSpinnerDropDownItem);
            spinner.Adapter = adapter;
            /*end*/

            /*create or open database*/
            myDb = new my_SqliteDatabaseHelper(this);
            /*end create or open database*/

            errorIcon = Resources.GetDrawable(Resource.Drawable.correcticon);
            correctIcon = Resources.GetDrawable(Resource.Drawable.erroricon);

            imageview_profile= FindViewById<ImageView> (Resource.Id.imageview_profile);

            etname = FindViewById<EditText> (Resource.Id.etname);
            etAge = FindViewById<EditText>(Resource.Id.etAge);
            etUsername  = FindViewById<EditText>(Resource.Id.etUsername);

            //etFlatNo  = FindViewById<EditText>(Resource.Id.etFlatNo);
            etpwd  = FindViewById<EditText>(Resource.Id.etpwd);
            etEmail  = FindViewById<EditText>(Resource.Id.etEmail);

            etEmail.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) =>
            {
                if (IsValidEmail(e.Text.ToString()))
                {
                    //change icon to green
                    etEmail.SetError("right", errorIcon);
                    //emailEditText.SetError(
                }
                else
                {
                    //emailEditText.set
                    etEmail.SetError("wrong", correctIcon);
                    //change icon to red
                }
            };

            bSignUp= FindViewById <Button>(Resource.Id.bSignUp);
            tvLoginLink = FindViewById<TextView> (Resource.Id.tvLoginLink);

            bSignUp.SetOnClickListener(this);
            tvLoginLink.SetOnClickListener (this);
            imageview_profile.SetOnClickListener (this);
            //bLogout.Click += DoClick ();
            //btSave.Click +=  DoClick ();
        }
Esempio n. 4
0
        private void SetupViews()
        {
            quantity = FindViewById<EditText>(Resource.Id.quantity);
            productName = FindViewById<TextView>(Resource.Id.product_name);
            productName.SetOnClickListener(this);

            returnable = FindViewById<TextView>(Resource.Id.returnable);
            returnable.SetOnClickListener(this);

            returnablePrice = FindViewById<TextView>(Resource.Id.returnable_price);

            var backspace = FindViewById<ImageButton>(Resource.Id.quantity_backspace);
            backspace.SetOnClickListener(this);

            highlightText = Resources.GetColor(Resource.Color.colorPrimary);
            standardText = Resources.GetColor(Resource.Color.primaryText);

            AddListenterToButtons(this);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.activity_Login);
            try
            {
                blnchkRemember=true;
                isLogin=false;
                var remeberCredentials = settingservice.GetSetting<bool>("RemeberCredentials");
                blnchkRemember=remeberCredentials ;

                hideControls(true);

                /*create or open database*/
                myDb = new my_SqliteDatabaseHelper(this);
                /*end create or open database*/

                errorIcon = Resources.GetDrawable(Resource.Drawable.correcticon);
                correctIcon = Resources.GetDrawable(Resource.Drawable.erroricon);

                // Create your application here
                bSignIn=FindViewById<Button>(Resource.Id.bSignIn);
                tvregister = FindViewById<TextView> (Resource.Id.tvregister);
                tvforget = FindViewById<TextView> (Resource.Id.tvforget);
                etUsername=FindViewById<EditText>(Resource.Id.etUsername);
                etpwd=FindViewById<EditText>(Resource.Id.etpwd);

                if (remeberCredentials==true)
                {
                    var savedusername = settingservice.GetSetting<string>("username");
                    var savedpassword = settingservice.GetSetting<string>("password");
                    if (savedusername != null)
                    {
                        etUsername.Text=savedusername.ToString();
                        etpwd.Text=savedpassword.ToString();
                    }
                }

                CheckBox checkbox = FindViewById<CheckBox>(Resource.Id.checkbox_remember_me);
                checkbox.Checked=blnchkRemember;

                //Gets TextView object instances
                shMsg = FindViewById<TextView> (Resource.Id.shMsg);

                //Gets ListView object instance
                listItems = FindViewById<ListView> (Resource.Id.listItems);

                //Add ItemClick event handler to ListView instance
                listItems.ItemClick += new EventHandler<AdapterView.ItemClickEventArgs> (item_Clicked);

                //Sets Database class message property to shMsg TextView instance
                shMsg.Text = myDb.sqldb_message;

                bSignIn.SetOnClickListener (this);
                tvregister.SetOnClickListener (this);
                tvforget.SetOnClickListener (this);

                checkbox.Click += (o, e) => {
                    if (checkbox.Checked)
                        //Toast.MakeText (this, "Selected", ToastLength.Short).Show ();
                        blnchkRemember=true;
                    else
                        //Toast.MakeText (this, "Not selected", ToastLength.Short).Show ();
                        blnchkRemember=false;
                };

            }
            catch (Exception ex) {
                var toast = Toast.MakeText (this, ex.Message ,ToastLength.Short);
                toast.Show ();
            }
        }
Esempio n. 6
0
 public void InitDropDown(ListItem l)
 {
     int j = 0;
     Initials = new List<TextView> ();
     foreach (BonLijst.Participant dude in l.Deelnemers) {
         string[] subnames = dude.name.Split (' ');
         string initials;
         if (subnames.Length == 1) {
             if (subnames [0].Length == 1) {
                 initials = subnames [0] [0].ToString () + ".";
             } else {
                 initials = subnames [0] [0].ToString () + subnames [0] [1].ToString () + ".";
             }
         } else {
             initials = subnames [0] [0].ToString () + "." + subnames [1] [0].ToString () + ".";
         }
         TextView initialTextView = new TextView (Application.Context);
         initialTextView.Text = initials;
         initialTextView.SetTextColor (Android.Graphics.Color.Black);
         initialTextView.TextSize = 30;
         initialTextView.SetPadding(16, 16, 16, 16);
         //initialTextView.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams);
         initialTextView.SetOnClickListener(this);
         Initials.Add (initialTextView);
         DropDown.AddView(initialTextView);
         j++;
     }
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var rootView = inflater.Inflate(Resource.Layout.fragment, null);

            var containerMap = (FrameLayout) rootView.FindViewById(Resource.Id.container_map);
            var mapView = base.OnCreateView(inflater, container, savedInstanceState);
            containerMap.AddView(mapView,
                new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));

            var map = Map;
            map.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(48.35, 31.16), 5.5f));
            map.UiSettings.RotateGesturesEnabled = false;
            map.SetOnMapClickListener(this);
            map.SetOnMarkerClickListener(this);

            map.Clear();
            _spots.Clear();
            var icon = BitmapDescriptorFactory.FromResource(Resource.Drawable.pin);
            foreach (var spot in SpotsArray)
            {
                var mo = new MarkerOptions();
                mo.SetPosition(spot.Position);
                mo.SetIcon(icon);
                mo.SetTitle(spot.Name);
                mo.SetSnippet("foo");
                var marker = map.AddMarker(mo);

                _spots.Add(marker.Id, new AnnotationModel(marker, spot));
            }

            _infoWindowContainer = rootView.FindViewById(Resource.Id.container_popup);

            // Subscribe to resize pop-up window
            _infoWindowLayoutListener = new InfoWindowLayoutListener();
            _infoWindowContainer.ViewTreeObserver.AddOnGlobalLayoutListener(_infoWindowLayoutListener);
            OverlayLayoutParams = (AbsoluteLayout.LayoutParams) _infoWindowContainer.LayoutParameters;

            textView = (TextView) _infoWindowContainer.FindViewById(Resource.Id.textview_title);
            _button = (Button) _infoWindowContainer.FindViewById(Resource.Id.foo);
            _button.SetOnClickListener(this);

            return rootView;
        }
Esempio n. 8
0
        /// <summary>
        /// ������ϷTitle�Ͷ�Ӧʡ���б�
        /// </summary>
        public void SetGameTitle()
        {
            txtTitle.Text = Barrier.Title;
            List<Barrier> list = ShengDaoList.ToList();
            list.Sort(delegate(Barrier a, Barrier b) { return (new Random()).Next(-1, 1); });
            glShengList.RemoveAllViews();
            foreach (var item in list)
            {
                TextView textView = new TextView(this);

                GridLayout.LayoutParams m = new GridLayout.LayoutParams();
                m.Width = GridLayout.LayoutParams.WrapContent;
                m.Height = GridLayout.LayoutParams.WrapContent;
                if (Resources.DisplayMetrics.Density == 1)
                {
                    m.SetMargins(10, 10, 10, 10);
                    textView.SetTextSize(Android.Util.ComplexUnitType.Sp, 22);
                }
                else
                {
                    m.SetMargins(5, 5, 5, 5);
                }
                textView.LayoutParameters = m;
                textView.SetTextColor(Android.Graphics.Color.White);
                textView.SetBackgroundResource(Resource.Drawable.game_sheng);
                textView.Gravity = GravityFlags.Center;
                textView.Text = item.Name;
                textView.Id = item.Id;
                textView.SetOnClickListener(this);

                glShengList.AddView(textView);
            }
            switch (Barrier.Id)
            {
                case 0:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_jian);
                    break;
                case 1:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_ling);
                    break;
                case 2:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_qian);
                    break;
                case 3:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_yao);
                    break;
                case 4:
                    imgPeople.SetImageResource(Resource.Drawable.game_people_ye);
                    break;
            }
        }