예제 #1
0
        /// Method Name     : UIReference
        /// Author          : Sanket Prajapati
        /// Creation Date   : 23 Jan 2018
        /// Purpose         : Find all control
        /// Revision        :
        /// </summary>
        private void UIReference()
        {
            viewSwitcher                 = view.FindViewById <ViewSwitcher>(Resource.Id.viewSwitcher);
            linearLayoutDisplay          = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutDisplay);
            tvDisplayAddresstitle        = view.FindViewById <TextView>(Resource.Id.tvDisplayAddresstitle);
            tvDisplayOrigin              = view.FindViewById <TextView>(Resource.Id.tvDisplayOrigin);
            txtDisplayOriginAddress      = view.FindViewById <TextView>(Resource.Id.txtDisplayOriginAddress);
            tvDisplayDestination         = view.FindViewById <TextView>(Resource.Id.tvDisplayDestination);
            txtDisplayDestinationAddress = view.FindViewById <TextView>(Resource.Id.txtDisplayDestinationAddress);
            textViewUpdatesAddresses     = view.FindViewById <TextView>(Resource.Id.textViewUpdatesAddresses);

            linearLayoutEdit          = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutEdit);
            tvEditAddresstitle        = view.FindViewById <TextView>(Resource.Id.tvEditAddresstitle);
            tvEditOrigin              = view.FindViewById <TextView>(Resource.Id.tvEditOrigin);
            txtEditOriginAddress      = view.FindViewById <TextView>(Resource.Id.txtEditOriginAddress);
            tvEditDestination         = view.FindViewById <TextView>(Resource.Id.tvEditDestination);
            txtEditDestinationAddress = view.FindViewById <TextView>(Resource.Id.txtEditDestinationAddress);
            textViewSubmitChanges     = view.FindViewById <TextView>(Resource.Id.textViewSubmitChanges);

            tvViewEstimate           = view.FindViewById <TextView>(Resource.Id.tvViewEstimate);
            tvNext                   = view.FindViewById <TextView>(Resource.Id.textViewNext);
            tvback                   = view.FindViewById <TextView>(Resource.Id.tvback);
            btnBack                  = view.FindViewById <ImageButton>(Resource.Id.btnBack);
            linearLayoutBack         = view.FindViewById <LinearLayout>(Resource.Id.textViewBack);
            linearLayoutViewEstimate = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutViewEstimate);
        }
예제 #2
0
 private void Awake()
 {
     Instance     = this;
     bounds       = new Bounds(transform.position, new Vector2(BOUNDS_WIDTH, BOUNDS_HEIGHT));
     cameraFollow = true;
     state        = "playing";
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            HasOptionsMenu = true;

            var fragment = inflater.Inflate(Resource.Layout.frag_ViewLetters, container, false);

            _viewSwitcher = fragment.FindViewById <ViewSwitcher>(Resource.Id.viewLettersFrag_viewSwitcher);

            _lettersRecyclerView = fragment.FindViewById <RecyclerView>(Resource.Id.viewLettersFrag_lettersRecycler);
            var layoutManager = new LinearLayoutManager(fragment.Context, LinearLayoutManager.Vertical, false);

            _lettersRecyclerView.SetLayoutManager(layoutManager);

            var letters = IsDraftLettersViewer()
                ?   GetBaseApp().LetterManager.GetAllDraftLetters()
                : GetBaseApp().LetterManager.GettAllSentLetters();

            _adapter                        = new LetterAdapter(this, letters);
            _adapter.LetterClick           += OnLetterClicked;
            _adapter.CopyLetterSucceeded   += LetterCopied;
            _adapter.DeleteLetterSucceeded += LetterDeleted;
            _lettersRecyclerView.SetAdapter(_adapter);

            _emptyDraftLettersText      = fragment.FindViewById <TextView>(Resource.Id.viewLettersFrag_emptyText);
            _emptyDraftLettersText.Text = AndroidHelper.GetString(IsDraftLettersViewer()
                ? Resource.String.emptyDraftLettersText
                : Resource.String.emptySentLettersText);

            return(fragment);
        }
예제 #4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            this.SetContentView(Resource.Layout.Main);

            var playButton = this.FindViewById <Button>(Resource.Id.PlayPauseButton);
            var stopButton = this.FindViewById <Button>(Resource.Id.StopButton);
            var searchView = this.FindViewById <SearchView>(Resource.Id.SearchView);

            this.listView    = this.FindViewById <ListView>(Resource.Id.listView1);
            this.timeDisplay = this.FindViewById <TextView>(Resource.Id.TimeDisplay);
            this.adapter     = new SongResultsAdapter(this, new Song[0]);
            this.player      = new MediaPlayer();

            this.switcher       = this.FindViewById <ViewSwitcher>(Resource.Id.ViewSwitcher);
            this.loadingMessage = this.FindViewById <TextView>(Resource.Id.LoadingMessage);

            playButton.Click            += this.PlayButton_Click;
            stopButton.Click            += this.StopButton_Click;
            searchView.QueryTextSubmit  += this.SearchView_QueryTextSubmit;
            searchView.QueryTextChange  += this.SearchView_QueryTextChange;
            this.listView.ItemClick     += this.ListView_ItemClick;
            this.player.BufferingUpdate += this.Player_BufferingUpdate;
            this.player.Error           += this.Player_Error;

            this.ShowListViewMessage("Write in the search box to start.");
        }
예제 #5
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			this.SetContentView(Resource.Layout.Main);

			var playButton = this.FindViewById<Button>(Resource.Id.PlayPauseButton);
			var stopButton = this.FindViewById<Button>(Resource.Id.StopButton);
			var searchView = this.FindViewById<SearchView>(Resource.Id.SearchView);
			this.listView = this.FindViewById<ListView>(Resource.Id.listView1);
			this.timeDisplay = this.FindViewById<TextView>(Resource.Id.TimeDisplay);
			this.adapter = new SongResultsAdapter(this, new Song[0]);
			this.player = new MediaPlayer();
			
			this.switcher = this.FindViewById<ViewSwitcher>(Resource.Id.ViewSwitcher);
			this.loadingMessage = this.FindViewById<TextView>(Resource.Id.LoadingMessage);
			
			playButton.Click += this.PlayButton_Click;
			stopButton.Click += this.StopButton_Click;
			searchView.QueryTextSubmit += this.SearchView_QueryTextSubmit;
			searchView.QueryTextChange += this.SearchView_QueryTextChange;
			this.listView.ItemClick += this.ListView_ItemClick;
			this.player.BufferingUpdate += this.Player_BufferingUpdate;
			this.player.Error += this.Player_Error;

			this.ShowListViewMessage("Write in the search box to start.");
		}
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SortControl = new ViewSwitcher {
         SortItemsHeader = BookmarkingUCResource.ShowLabel
     };
     InitSortControl();
     TagsSortPanel.Controls.Add(SortControl);
     InitTags();
 }
예제 #7
0
        public Main()
        {
            InitializeComponent();
            var userControl = new AddScreen();

            ViewSwitcher         = new ViewSwitcher(groupBox1);
            Context.ViewSwitcher = ViewSwitcher;
            SwitchView(userControl);
        }
예제 #8
0
		static System.Threading.Thread LoadThread; //Поток, отвечающий за загрузку расписания

		protected override void OnCreate (Bundle bundle)
		{
			context = this;
			groups = Resources.GetTextArray (Resource.Array.group_codes);

			base.OnCreate (bundle);

			SetContentView (Resource.Layout.Main);
			//RequestWindowFeature (WindowFeatures.NoTitle);
			text = FindViewById<TextView> (Resource.Id.text);
			Button today = FindViewById<Button> (Resource.Id.today);
			Button tomorrow = FindViewById<Button> (Resource.Id.tomorrow);
			Button OnDate = FindViewById<Button> (Resource.Id.toDate);
			spinner = FindViewById<Spinner> (Resource.Id.spinner1);
			viewSwitcher = FindViewById<ViewSwitcher> (Resource.Id.viewSwitcher1);
			DateTime dateToday = DateTime.Today;
			DateTime dateTomorrow = DateTime.Today.AddDays (1);
			DatePicker datePicker = FindViewById<DatePicker> (Resource.Id.datePicker);
			ConnectivityManager cm = (ConnectivityManager)GetSystemService (Context.ConnectivityService);

			spinner.SetSelection (loadingGroup ());

		
			//Обработчики нажатий кнопок

			today.Click += delegate { //На сегодня
				savingGroup (spinner.SelectedItemPosition);
				if (cm.ActiveNetworkInfo != null) { //Если присутствует соединение с интернетом - запустить функцию, 
					StartLoadingThread (dateToday);// получающую расписание с сайта
				} else {
					text.Text = "Проверьте соединение с интернетом";//Иначе, выводит ошибку
					viewSwitcher.ShowNext ();
				}

			};
			tomorrow.Click += delegate { //На завтра
				savingGroup (spinner.SelectedItemPosition);
				if (cm.ActiveNetworkInfo != null) {
					StartLoadingThread (dateTomorrow);
				} else {
					text.Text = "Проверьте соединение с интернетом";
					viewSwitcher.ShowNext ();
				}

			};
			OnDate.Click += delegate {//На дату
				savingGroup (spinner.SelectedItemPosition);
				if (cm.ActiveNetworkInfo != null) {
					StartLoadingThread (datePicker.DateTime);
				} else {
					text.Text = "Проверьте соединение с интернетом";
					viewSwitcher.ShowNext ();
				}

			};
		}
예제 #9
0
        /// Method Name     : FindLinerlayout
        /// Author          : Sanket Prajapati
        /// Creation Date   : 2 Dec 2017
        /// Purpose         : Find layout Control
        /// Revision        :
        /// </summary>
        private void FindLinerlayout()
        {
            viewSwitcher        = view.FindViewById <ViewSwitcher>(Resource.Id.viewSwitcher);
            linearLayoutDisplay = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutDisplay);
            linearLayoutEdit    = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutEdit);

            linearLayoutViewEstimate = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutViewEstimate);
            linearLayoutBack         = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutBack);
            btnBack = view.FindViewById <ImageButton>(Resource.Id.btnBack);
        }
예제 #10
0
        private void OpenSdvAndSetTappedDay(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                //ViewSwitcher.mainpage.addBitmapCacheToSDV();
                Thread.Sleep(150);
                ViewSwitcher.SwitchToSdv(sender);

                //ViewSwitcher.mainpage.removeBitmapCacheAfterAnimation();
            });
        }
예제 #11
0
        private void DayCard_ApptTap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            Storyboard storyboard = ((FrameworkElement)sender).Resources["tapFeedback"] as Storyboard;

            if (storyboard != null)
            {
                storyboard.Begin();
            }
            Thread.Sleep(1);
            ViewSwitcher.SetScrollToPa(((FrameworkElement)sender).DataContext as PocalAppointment);
            ViewSwitcher.From = ViewSwitcher.Sender.ApptTap;
        }
예제 #12
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            viewSwitcher = FindViewById<ViewSwitcher>(Resource.Id.viewSwitcher);
            var img1 = FindViewById<KenBurnsView>(Resource.Id.img1);
            img1.TransitionEnd += OnTransitionEnded;
            var img2 = FindViewById<KenBurnsView>(Resource.Id.img2);
            img2.TransitionEnd += OnTransitionEnded;
        }
예제 #13
0
        protected void InitFilterBlock()
        {
            var SortControl = new ViewSwitcher();

            var combobox = new ViewSwitcherCombobox();

            combobox.SortLabel = ProjectResource.ProjectsByLabel;
            combobox.HintText  = String.IsNullOrEmpty(Tag) ? String.Empty : Tag;

            combobox.ComboboxItems = new List <ViewSwitcherComboboxItem>();

            foreach (var label in Global.EngineFactory.GetTagEngine().GetTags())
            {
                combobox.ComboboxItems.Add(new ViewSwitcherComboboxItem
                {
                    SortLabel = label.Value,
                    SortUrl   = string.Format("projects.aspx?{0}={1}&{4}={2}{3}", UrlConstant.ProjectsFilter, ProjectFilter.ByLabel.ToString().ToLower(), HttpUtility.UrlEncode(label.Value), ShowClosedProjects ? "&view=all" : String.Empty, UrlConstant.ProjectsTag)
                });
            }

            SortControl.SortItems.Add(new ViewSwitcherLinkItem
            {
                IsSelected = ProjectFilter.My == CurrentFilter || ProjectFilter.Default == CurrentFilter ? true : false,
                SortUrl    = string.Format("projects.aspx?{0}={1}{2}", UrlConstant.ProjectsFilter, ProjectFilter.My.ToString().ToLower(), ShowClosedProjects ? "&view=all" : String.Empty),
                SortLabel  = ProjectResource.MyProjects
            });



            SortControl.SortItems.Add(new ViewSwitcherLinkItem()
            {
                IsSelected = ProjectFilter.Following == CurrentFilter ? true : false,
                SortUrl    = string.Format("projects.aspx?{0}={1}{2}", UrlConstant.ProjectsFilter, ProjectFilter.Following.ToString().ToLower(), ShowClosedProjects ? "&view=all" : String.Empty),
                SortLabel  = ProjectResource.ProjectsKeepTrack,
            });

            if (combobox.ComboboxItems.Count > 0)
            {
                SortControl.SortItems.Add(combobox);
            }

            SortControl.SortItems.Add(new ViewSwitcherLinkItem()
            {
                IsSelected = ProjectFilter.All == CurrentFilter ? true : false,
                SortUrl    = string.Format("projects.aspx?{0}={1}{2}", UrlConstant.ProjectsFilter, ProjectFilter.All.ToString().ToLower(), ShowClosedProjects ? "&view=all" : String.Empty),
                SortLabel  = ProjectResource.AllProjects
            });

            //SortControl.SortItemsHeader = ProjectsCommonResource.Show + ":";

            _tabsContainer.Controls.Add(SortControl);
        }
예제 #14
0
        private void UIControlRefrence()
        {
            relativeLayoutEdit      = _view.FindViewById <RelativeLayout>(Resource.Id.relativeLayoutEdit);
            imageViewNameEdit       = _view.FindViewById <ImageView>(Resource.Id.imageViewNameEdit);
            textViewDisplayName     = _view.FindViewById <TextView>(Resource.Id.textViewDisplayName);
            textViewDisplayGender   = _view.FindViewById <TextView>(Resource.Id.textViewDisplayGender);
            textViewDisplayClass    = _view.FindViewById <TextView>(Resource.Id.textViewDisplayClass);
            linearLayoutDisplayName = _view.FindViewById <LinearLayout>(Resource.Id.linearLayoutDisplayName);
            viewSwitcherName        = _view.FindViewById <ViewSwitcher>(Resource.Id.viewSwitcherName);

            editTextEditName = _view.FindViewById <EditText>(Resource.Id.editTextEditName);
            editTextClass    = _view.FindViewById <EditText>(Resource.Id.editTextClass);


            relativeLayoutInfoEdit = _view.FindViewById <RelativeLayout>(Resource.Id.relativeLayoutInfoEdit);
            imageViewInfoEdit      = _view.FindViewById <ImageView>(Resource.Id.imageViewInfoEdit);
            viewSwitcherInfo       = _view.FindViewById <ViewSwitcher>(Resource.Id.viewSwitcherInfo);

            textViewDisplayContactNo = _view.FindViewById <TextView>(Resource.Id.textViewDisplayContactNo);
            textViewDisplayAddress   = _view.FindViewById <TextView>(Resource.Id.textViewDisplayAddress);
            textViewDisplayEmail     = _view.FindViewById <TextView>(Resource.Id.textViewDisplayEmail);
            textViewDisplayBirthDate = _view.FindViewById <TextView>(Resource.Id.textViewDisplayBirthDate);
            linearLayoutDisplayInfo  = _view.FindViewById <LinearLayout>(Resource.Id.linearLayoutDisplayInfo);

            textViewEditBirthDate = _view.FindViewById <TextView>(Resource.Id.textViewEditBirthDate);

            editTextEditAddress = _view.FindViewById <EditText>(Resource.Id.editTextEditAddress);
            editTextEditStreet  = _view.FindViewById <EditText>(Resource.Id.editTextEditStreet);
            editTextEditCity    = _view.FindViewById <EditText>(Resource.Id.editTextEditCity);
            editTextEditState   = _view.FindViewById <EditText>(Resource.Id.editTextEditState);
            editTextEditCountry = _view.FindViewById <EditText>(Resource.Id.editTextEditCountry);

            editTextEditPostalCode = _view.FindViewById <EditText>(Resource.Id.editTextEditPostalCode);
            editTextEditEmail      = _view.FindViewById <EditText>(Resource.Id.editTextEditEmail);
            editTextEditContactNo  = _view.FindViewById <EditText>(Resource.Id.editTextEditContactNo);

            btnCancel     = _view.FindViewById <Button>(Resource.Id.btnCancel);
            btnSave       = _view.FindViewById <Button>(Resource.Id.btnSave);
            btnAudited    = _view.FindViewById <Button>(Resource.Id.btnAudited);
            textViewTitle = _view.FindViewById <TextView>(Resource.Id.textViewTitle);

            radioGroup        = _view.FindViewById <RadioGroup>(Resource.Id.radioGroup);
            radiobuttonMale   = _view.FindViewById <RadioButton>(Resource.Id.radiobuttonMale);
            radiobuttonFemale = _view.FindViewById <RadioButton>(Resource.Id.radiobuttonFemale);

            textViewchooseFile     = _view.FindViewById <TextView>(Resource.Id.textViewchooseFile);
            textViewFileName       = _view.FindViewById <TextView>(Resource.Id.textViewFileName);
            buttonUpload           = _view.FindViewById <Button>(Resource.Id.buttonUpload);
            linearLayoutFileUpload = _view.FindViewById <LinearLayout>(Resource.Id.linearLayoutFileUpload);
            textViewSignOut        = _view.FindViewById <TextView>(Resource.Id.textViewSignOut);
        }
예제 #15
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            viewSwitcher = FindViewById <ViewSwitcher>(Resource.Id.viewSwitcher);
            var img1 = FindViewById <KenBurnsView>(Resource.Id.img1);

            img1.TransitionEnd += OnTransitionEnded;
            var img2 = FindViewById <KenBurnsView>(Resource.Id.img2);

            img2.TransitionEnd += OnTransitionEnded;
        }
예제 #16
0
        public override void InitUserControl()
        {
            var singleBookmarkUserControl = LoadControl(BookmarkUserControlPath.SingleBookmarkUserControlPath) as BookmarkInfoBase;

            singleBookmarkUserControl.Bookmark     = Bookmark;
            singleBookmarkUserControl.UserBookmark = UserBookmark;
            BookmarkInfoHolder.Controls.Add(singleBookmarkUserControl);

            var SortControl = new ViewSwitcher();

            SortControl.TabItems.Add(new ViewSwitcherTabItem()
            {
                TabName    = BookmarkingUCResource.BookmarkedBy,
                DivID      = "BookmarkedByPanel",
                IsSelected = ServiceHelper.SelectedTab == 0,
                SkipRender = true
            });

            SortControl.TabItems.Add(new ViewSwitcherTabItem()
            {
                TabName    = BookmarkingUCResource.Comments + String.Format(" ({0})", CommentsCount),
                DivID      = "BookmarkCommentsPanel",
                IsSelected = ServiceHelper.SelectedTab == 1,
                SkipRender = true
            });


            BookmarkInfoTabsContainer.Controls.Add(SortControl);


            //Init comments
            using (var c = LoadControl(BookmarkUserControlPath.CommentsUserControlPath) as CommentsUserControl)
            {
                c.BookmarkID       = this.Bookmark.ID;
                c.BookmarkComments = ServiceHelper.GetBookmarkComments(this.Bookmark);
                c.InitComments();
                CommentsHolder.Controls.Add(c);
            }
            if (Bookmark != null)
            {
                var userBookmarks = Bookmark.UserBookmarks;
                if (userBookmarks != null && userBookmarks.Count > 0)
                {
                    //Init added by list
                    AddedByRepeater.DataSource = userBookmarks;
                    AddedByRepeater.DataBind();
                }
            }
        }
예제 #17
0
        public virtual void SetupCtrl(BaseFragment fragment)
        {
            baseFragment = fragment;

            header      = FindViewById <TextView>(Resource.Id.baseViewer_header);
            header.Text = ViewerTitle();

            viewSwitcher = FindViewById <ViewSwitcher>(Resource.Id.baseViewer_viewSwitcher);
            emptyText    = FindViewById <TextView>(Resource.Id.baseViewer_emptyText);

            var layoutManager = new LinearLayoutManager(fragment.Context, LinearLayoutManager.Vertical, false);

            recycler = FindViewById <RecyclerView>(Resource.Id.baseViewer_recycler);
            recycler.SetLayoutManager(layoutManager);
        }
        protected virtual void CleanUpReferencesToViewOrContext()
        {
            recycler?.GetAdapter()?.Dispose();
            recycler?.Dispose();
            viewSwitcher = null;
            header       = null;
            emptyText    = null;

            if (loadMoreButton != null)
            {
                loadMoreButton.Click -= NextButon_Click;
            }

            loadMoreButton = null;
            LoadMoreClick  = null;
        }
예제 #19
0
        public void Setup()
        {
            Views = new List <RectTransform>();

            var fixture = AssetDatabase.LoadAssetAtPath <GameObject>("Assets/Shopify/UIToolkit/Components/ViewSwitcher/View Switcher Example.prefab");

            ViewSwitcherPrefab        = GameObject.Instantiate(fixture, Vector3.zero, Quaternion.identity);
            Subject                   = ViewSwitcherPrefab.GetComponentInChildren <ViewSwitcher>();
            Subject.AnimationDuration = AnimationDuration;

            foreach (Transform child in Subject.Container.transform)
            {
                Views.Add(child.GetComponent <RectTransform>());
            }

            Views.ForEach((x) => Subject.RegisterView(x));
        }
예제 #20
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            HasOptionsMenu = true;

            //Inflate fragment
            var fragment = inflater.Inflate(Resource.Layout.frag_FavoriteLegislators, container, false);

            viewSwitcher   = fragment.FindViewById <ViewSwitcher>(Resource.Id.favortieLegislatorsFrag_viewSwitcher);
            emptyText      = fragment.FindViewById <TextView>(Resource.Id.favortieLegislatorsFrag_emptyText);
            emptyText.Text = EmptyText();

            //Setup legislatorsViewer
            _legislatorsViewer = fragment.FindViewById <LegislatorsViewer>(Resource.Id.favortieLegislatorsFrag_legislatorsViewer);
            _legislatorsViewer.SetupCtrl(this, new List <Legislator>(), false);

            return(fragment);
        }
예제 #21
0
 public override bool OnKeyUp(Keycode keyCode, KeyEvent e)
 {
     //При нажатии физической кнопки назад, возвращает на главный экран
     if (keyCode == Keycode.Back)
     {
         ViewSwitcher viewSwitcher = FindViewById <ViewSwitcher> (Resource.Id.viewSwitcher1);
         if (viewSwitcher.CurrentView != viewSwitcher.GetChildAt(0))
         {
             viewSwitcher.ShowPrevious();
         }
         return(true);
     }
     else
     {
         return(base.OnKeyUp(keyCode, e));
     }
 }
예제 #22
0
 /// Method Name     : FindViewSwicherAndEdittextviewandLinerlayot
 /// Author          : Sanket Prajapati
 /// Creation Date   : 2 Dec 2017
 /// Purpose         : Finds Control
 /// Revision        :
 /// </summary>
 private void FindViewSwicherAndEdittextviewandLinerlayot()
 {
     viewSwitcher           = view.FindViewById <ViewSwitcher>(Resource.Id.viewSwitcher);
     tvEditServiceDatetitle = view.FindViewById <TextView>(Resource.Id.tvEditServiceDatetitle);
     linearLayoutDisplay    = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutDisplay);
     linearLayoutEdit       = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutEdit);
     tvChangeDates          = view.FindViewById <TextView>(Resource.Id.textViewChangeDates);
     tvSubmitChanges        = view.FindViewById <TextView>(Resource.Id.textViewSubmitChanges);
     lnViewBack             = view.FindViewById <LinearLayout>(Resource.Id.textViewBack);
     tvNext = view.FindViewById <TextView>(Resource.Id.textViewNext);
     tvtitleDiscriptions = view.FindViewById <TextView>(Resource.Id.tvtitleDiscriptions);
     tvServiceDatetitle  = view.FindViewById <TextView>(Resource.Id.tvServiceDatetitle);
     tvViewEstimate      = view.FindViewById <TextView>(Resource.Id.tvViewEstimate);
     textViewChangeDates = view.FindViewById <TextView>(Resource.Id.textViewChangeDates);
     tvback  = view.FindViewById <TextView>(Resource.Id.tvback);
     btnBack = view.FindViewById <ImageButton>(Resource.Id.btnBack);
     linearLayoutViewEstimate = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutViewEstimate);
 }
예제 #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UserMakerContainer.Options.IsPopup = true;

            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "usermaker_script", WebPath.GetPath("usercontrols/users/usermaker/js/usermaker.js"));
            Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "ajaxupload_script", WebPath.GetPath("js/ajaxupload.3.5.js"));

            var script = " StudioUserMaker.NewUserDialogTitle = '" + CustomNamingPeople.Substitute <Resources.Resource>("NewUserDialogTitle").HtmlEncode().ReplaceSingleQuote() + "';";

            script += " StudioUserMaker.EditUserDialogTitle = '" + Resources.Resource.EditUserDialogTitle.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.AddButton = '" + Resources.Resource.AddButton.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.SaveButton = '" + Resources.Resource.SaveButton.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.SignUpButton = '" + Resources.Resource.LoginRegistryButton.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.MaleStatus = '" + Resources.Resource.MaleSexStatus.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.FemaleStatus = '" + Resources.Resource.FemaleSexStatus.ReplaceSingleQuote() + "';";
            script += " StudioUserMaker.InfoPanelID = '" + UserMakerContainer.ClientID + "_InfoPanel';";

            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "usermaker_init_script", script, true);
            AjaxPro.Utility.RegisterTypeForAjax(this.GetType());

            _jqueryDateMask.Value = DateTimeExtension.DateMaskForJQuery;

            UserMakerContainer.Options.InfoMessageText = "";
            UserMakerContainer.Options.InfoType        = Web.Controls.InfoType.Alert;

            var PropertiesTabs = new ViewSwitcher();

            PropertiesTabs.TabItems.Add(new ViewSwitcherTabItem
            {
                TabName    = Resources.Resource.GeneralProperties,
                DivID      = "idMajorProperties",
                IsSelected = true,
                SkipRender = true
            });

            PropertiesTabs.TabItems.Add(new ViewSwitcherTabItem
            {
                TabName    = Resources.Resource.PersonalProperties,
                DivID      = "idSocialProperties",
                SkipRender = true
            });

            idTabsContainer.Controls.Add(PropertiesTabs);
        }
예제 #24
0
 private void UIReferences()
 {
     ViewSwitcher          = view.FindViewById <ViewSwitcher>(Resource.Id.viewSwitcher);
     relativeLayoutDisplay = view.FindViewById <RelativeLayout>(Resource.Id.relativeLayoutDisplay);
     relativeLayoutEdit    = view.FindViewById <RelativeLayout>(Resource.Id.relativeLayoutEdit);
     tvUpdates             = view.FindViewById <TextView>(Resource.Id.textViewUpdates);
     textViewEditHeading   = view.FindViewById <TextView>(Resource.Id.textViewEditHeading);
     textViewHeading       = view.FindViewById <TextView>(Resource.Id.textViewHeading);
     tvSubmitChanges       = view.FindViewById <TextView>(Resource.Id.textViewSubmitChanges);
     linearLayoutBack      = view.FindViewById <LinearLayout>(Resource.Id.textViewBack);
     tvNext = view.FindViewById <TextView>(Resource.Id.textViewNext);
     tvtitleDiscriptions = view.FindViewById <TextView>(Resource.Id.tvtitleDiscriptions);
     tvWMMtitle          = view.FindViewById <EditText>(Resource.Id.tvWMMtitle);
     textViewUpdates     = view.FindViewById <TextView>(Resource.Id.textViewUpdates);
     txtWMM = view.FindViewById <EditText>(Resource.Id.txtWMM);
     txtWMM.SetSelection(0);
     tvViewEstimate           = view.FindViewById <TextView>(Resource.Id.tvViewEstimate);
     tvback                   = view.FindViewById <TextView>(Resource.Id.tvback);
     linearLayoutViewEstimate = view.FindViewById <LinearLayout>(Resource.Id.linearLayoutViewEstimate);
     btnBack                  = view.FindViewById <ImageButton>(Resource.Id.btnBack);
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var fragment = inflater.Inflate(Resource.Layout.ctrl_BaseViewer, container, false);

            header = fragment.FindViewById <TextView>(Resource.Id.baseViewer_header);
            //header.Text = ViewerTitle();
            header.Visibility = ViewStates.Gone;

            viewSwitcher = fragment.FindViewById <ViewSwitcher>(Resource.Id.baseViewer_viewSwitcher);
            emptyText    = fragment.FindViewById <TextView>(Resource.Id.baseViewer_emptyText);

            var layoutManager = new LinearLayoutManager(fragment.Context, LinearLayoutManager.Vertical, false);

            recycler = fragment.FindViewById <RecyclerView>(Resource.Id.baseViewer_recycler);
            recycler.SetLayoutManager(layoutManager);

            loadMoreButton        = fragment.FindViewById <FloatingActionButton>(Resource.Id.baseViewer_recyclerNextButton);
            loadMoreButton.Click += NextButon_Click;

            return(fragment);
        }
예제 #26
0
        static System.Threading.Thread LoadThread; //Поток, отвечающий за загрузку расписания

        protected override void OnCreate(Bundle bundle)
        {
            context = this;
            groups  = Resources.GetTextArray(Resource.Array.group_codes);

            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);
            //RequestWindowFeature (WindowFeatures.NoTitle);
            text = FindViewById <TextView> (Resource.Id.text);
            Button today    = FindViewById <Button> (Resource.Id.today);
            Button tomorrow = FindViewById <Button> (Resource.Id.tomorrow);
            Button OnDate   = FindViewById <Button> (Resource.Id.toDate);

            spinner      = FindViewById <Spinner> (Resource.Id.spinner1);
            viewSwitcher = FindViewById <ViewSwitcher> (Resource.Id.viewSwitcher1);
            DateTime            dateToday    = DateTime.Today;
            DateTime            dateTomorrow = DateTime.Today.AddDays(1);
            DatePicker          datePicker   = FindViewById <DatePicker> (Resource.Id.datePicker);
            ConnectivityManager cm           = (ConnectivityManager)GetSystemService(Context.ConnectivityService);

            spinner.SetSelection(loadingGroup());


            //Обработчики нажатий кнопок

            today.Click += delegate {              //На сегодня
                savingGroup(spinner.SelectedItemPosition);
                if (cm.ActiveNetworkInfo != null)  //Если присутствует соединение с интернетом - запустить функцию,
                {
                    StartLoadingThread(dateToday); // получающую расписание с сайта
                }
                else
                {
                    text.Text = "Проверьте соединение с интернетом";                    //Иначе, выводит ошибку
                    viewSwitcher.ShowNext();
                }
            };
            tomorrow.Click += delegate {             //На завтра
                savingGroup(spinner.SelectedItemPosition);
                if (cm.ActiveNetworkInfo != null)
                {
                    StartLoadingThread(dateTomorrow);
                }
                else
                {
                    text.Text = "Проверьте соединение с интернетом";
                    viewSwitcher.ShowNext();
                }
            };
            OnDate.Click += delegate {            //На дату
                savingGroup(spinner.SelectedItemPosition);
                if (cm.ActiveNetworkInfo != null)
                {
                    StartLoadingThread(datePicker.DateTime);
                }
                else
                {
                    text.Text = "Проверьте соединение с интернетом";
                    viewSwitcher.ShowNext();
                }
            };
        }
예제 #27
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            ActionBar.NavigationMode = ActionBarNavigationMode.Tabs;
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            ActionBar.Tab tab = ActionBar.NewTab();
            tab.SetText(Resources.GetString(Resource.String.calcTab));
            tab.TabSelected += (sender, args) =>
            {
                // Do something when tab is selected
            };
            ActionBar.AddTab(tab);

            tab = ActionBar.NewTab();
            tab.SetText(Resources.GetString(Resource.String.convertTab));
            tab.TabSelected += (sender, args) =>
            {
                // Do something when tab is selected
            };
            ActionBar.AddTab(tab);

            Button button0 = FindViewById <Button>(Resource.Id.Button0);
            Button button1 = FindViewById <Button>(Resource.Id.Button1);
            Button button2 = FindViewById <Button>(Resource.Id.Button2);
            Button button3 = FindViewById <Button>(Resource.Id.Button3);
            Button button4 = FindViewById <Button>(Resource.Id.Button4);
            Button button5 = FindViewById <Button>(Resource.Id.Button5);
            Button button6 = FindViewById <Button>(Resource.Id.Button6);
            Button button7 = FindViewById <Button>(Resource.Id.Button7);
            Button button8 = FindViewById <Button>(Resource.Id.Button8);
            Button button9 = FindViewById <Button>(Resource.Id.Button9);

            Button buttonAddition       = FindViewById <Button>(Resource.Id.ButtonAdd);
            Button buttonDivision       = FindViewById <Button>(Resource.Id.ButtonDiv);
            Button buttonFraction       = FindViewById <Button>(Resource.Id.ButtonFraction);
            Button buttonMultiplication = FindViewById <Button>(Resource.Id.ButtonMulti);
            Button buttonNegation       = FindViewById <Button>(Resource.Id.ButtonNegate);
            Button buttonSqrt           = FindViewById <Button>(Resource.Id.ButtonSqrt);
            Button buttonSubstraction   = FindViewById <Button>(Resource.Id.ButtonSub);
            Button buttonEqual          = FindViewById <Button>(Resource.Id.ButtonEqual);
            Button buttonBackspace      = FindViewById <Button>(Resource.Id.ButtonBackspace);
            Button buttonComma          = FindViewById <Button>(Resource.Id.ButtonComma);

            Button buttonC = FindViewById <Button>(Resource.Id.ButtonC);

            TextView resultField = FindViewById <TextView>(Resource.Id.textView1);
            TextView txt         = FindViewById <TextView>(Resource.Id.TextView);

            Button sin  = FindViewById <Button>(Resource.Id.sin);
            Button asin = FindViewById <Button>(Resource.Id.asin);
            Button cos  = FindViewById <Button>(Resource.Id.cos);
            Button acos = FindViewById <Button>(Resource.Id.acos);
            Button tan  = FindViewById <Button>(Resource.Id.tan);
            Button atan = FindViewById <Button>(Resource.Id.atan);
            Button ctg  = FindViewById <Button>(Resource.Id.ctg);
            Button actg = FindViewById <Button>(Resource.Id.actg);
            Button ln   = FindViewById <Button>(Resource.Id.ln);  // e
            Button log  = FindViewById <Button>(Resource.Id.log); // 10
            Button pi   = FindViewById <Button>(Resource.Id.pi);
            Button exp  = FindViewById <Button>(Resource.Id.exp);
            Button pov  = FindViewById <Button>(Resource.Id.pov);
            Button rand = FindViewById <Button>(Resource.Id.rand);
            Button mod  = FindViewById <Button>(Resource.Id.mod);
            Button div  = FindViewById <Button>(Resource.Id.div);

            #region button[0-9] handlers

            button0.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 0;
                _lastKeyInput     = Keys.Digit;
            };

            button1.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 1;
                _lastKeyInput     = Keys.Digit;
            };

            button2.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 2;
                _lastKeyInput     = Keys.Digit;
            };

            button3.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 3;
                _lastKeyInput     = Keys.Digit;
            };

            button4.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 4;
                _lastKeyInput     = Keys.Digit;
            };

            button5.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 5;
                _lastKeyInput     = Keys.Digit;
            };

            button6.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 6;
                _lastKeyInput     = Keys.Digit;
            };

            button7.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 7;
                _lastKeyInput     = Keys.Digit;
            };

            button8.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 8;
                _lastKeyInput     = Keys.Digit;
            };

            button9.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Operator)
                {
                    resultField.Text = "";
                }
                resultField.Text += 9;
                _lastKeyInput     = Keys.Digit;
            };

            #endregion

            buttonAddition.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign)
                {
                    parameters.Add(resultField.Text);
                    txt.Text        += resultField.Text + "+";
                    resultField.Text = "";

                    if (parameters.Count == 2)
                    {
                        double[] p = this.Parse(parameters);
                        double   r = op.Calculate(p);
                        resultField.Text = r.ToString();
                        parameters.Clear();
                        parameters.Add(r.ToString());
                    }

                    if (op == null || op.GetType() != typeof(Addition))
                    {
                        op = new Addition();
                    }
                    _lastKeyInput = Keys.Operator;
                    return;
                }

                if (_lastKeyInput == Keys.Operator)
                {
                    if (op == null || op.GetType() != typeof(Addition))
                    {
                        op       = new Addition();
                        txt.Text = ReplaceLastChar(txt.Text, '+');
                    }
                    _lastKeyInput = Keys.Operator;
                }
            };

            buttonSubstraction.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign)
                {
                    parameters.Add(resultField.Text);
                    txt.Text        += resultField.Text + "-";
                    resultField.Text = "";

                    if (parameters.Count == 2)
                    {
                        double[] p = this.Parse(parameters);
                        double   r = op.Calculate(p);
                        resultField.Text = r.ToString();
                        parameters.Clear();
                        parameters.Add(r.ToString());
                    }

                    if (op == null || op.GetType() != typeof(Subtraction))
                    {
                        op = new Subtraction();
                    }
                    _lastKeyInput = Keys.Operator;
                    return;
                }

                if (_lastKeyInput == Keys.Operator)
                {
                    if (op == null || op.GetType() != typeof(Subtraction))
                    {
                        op       = new Subtraction();
                        txt.Text = ReplaceLastChar(txt.Text, '-');
                    }
                    _lastKeyInput = Keys.Operator;
                }
            };

            buttonMultiplication.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign)
                {
                    parameters.Add(resultField.Text);
                    txt.Text        += resultField.Text + "*";
                    resultField.Text = "";

                    if (parameters.Count == 2)
                    {
                        double[] p = this.Parse(parameters);
                        double   r = op.Calculate(p);
                        resultField.Text = r.ToString();
                        parameters.Clear();
                        parameters.Add(r.ToString());
                    }

                    if (op == null || op.GetType() != typeof(Multiplication))
                    {
                        op = new Multiplication();
                    }

                    _lastKeyInput = Keys.Operator;
                    return;
                }

                if (_lastKeyInput == Keys.Operator)
                {
                    if (op == null || op.GetType() != typeof(Multiplication))
                    {
                        op       = new Multiplication();
                        txt.Text = ReplaceLastChar(txt.Text, '*');
                    }
                    _lastKeyInput = Keys.Operator;
                }
            };

            buttonDivision.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign)
                {
                    parameters.Add(resultField.Text);
                    txt.Text        += resultField.Text + "/";
                    resultField.Text = "";

                    if (parameters.Count == 2)
                    {
                        double[] p = this.Parse(parameters);
                        double   r = op.Calculate(p);
                        resultField.Text = r.ToString();
                        parameters.Clear();
                        parameters.Add(r.ToString());
                    }
                    if (op == null || op.GetType() != typeof(Division))
                    {
                        op = new Division();
                    }

                    _lastKeyInput = Keys.Operator;
                    return;
                }

                if (_lastKeyInput == Keys.Operator)
                {
                    if (op == null || op.GetType() != typeof(Division))
                    {
                        op       = new Division();
                        txt.Text = ReplaceLastChar(txt.Text, '/');
                    }
                    _lastKeyInput = Keys.Operator;
                }
            };

            buttonEqual.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign)
                {
                    parameters.Add(resultField.Text);
                    txt.Text = string.Empty;
                    if (parameters.Count == 2)
                    {
                        double r = op.Calculate(this.Parse(parameters));
                        resultField.Text = r.ToString();
                    }
                    _lastKeyInput = Keys.Equal;
                    return;
                }

                if (_lastKeyInput == Keys.Operator)
                {
                    txt.Text         = "";
                    resultField.Text = op.Calculate(double.Parse(parameters[0]), double.Parse(resultField.Text)).ToString();
                    parameters.Clear();
                    _lastKeyInput = Keys.Equal;
                    return;
                }

                if (_lastKeyInput == Keys.Equal && op != null)
                {
                    resultField.Text = op.Calculate(double.Parse(resultField.Text), double.Parse(resultField.Text)).ToString();
                    _lastKeyInput    = Keys.Equal;
                }
            };

            buttonNegation.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign || _lastKeyInput == Keys.Equal)
                {
                    //if (op == null || op.GetType() != typeof(Negation))
                    //   op = new Negation();

                    resultField.Text = new Negation().Calculate(double.Parse(resultField.Text)).ToString();
                    //resultField.Text = op.Calculate(double.Parse(resultField.Text)).ToString();
                    _lastKeyInput = Keys.Sign;
                }
            };

            buttonSqrt.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit ||
                    _lastKeyInput == Keys.Sign ||
                    _lastKeyInput == Keys.Equal)
                {
                    resultField.Text = new Sqrt().Calculate(double.Parse(resultField.Text)).ToString();
                }
            };

            buttonFraction.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign || _lastKeyInput == Keys.Equal)
                {
                    resultField.Text = new Fraction().Calculate(double.Parse(resultField.Text)).ToString();
                }
            };

            buttonBackspace.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Equal)
                {
                    if (!(string.IsNullOrEmpty(resultField.Text)))
                    {
                        resultField.Text = resultField.Text.Substring(0, resultField.Text.Length - 1);
                    }
                }
            };

            buttonComma.Click += (object sender, EventArgs e) =>
            {
                if (_lastKeyInput == Keys.Digit || _lastKeyInput == Keys.Sign || _lastKeyInput == Keys.Equal)
                {
                    if (!(string.IsNullOrEmpty(resultField.Text)))
                    {
                        resultField.Text += '.';
                        _lastKeyInput     = Keys.DecimalPoint;
                    }
                    else
                    {
                        resultField.Text += "0.";
                    }
                }
                _lastKeyInput = Keys.DecimalPoint;
            };

            buttonC.Click += (object sender, EventArgs e) =>
            {
                op = null;
                resultField.Text = string.Empty;
                txt.Text         = string.Empty;
                parameters.Clear();
            };

            ViewSwitcher viewSwitcher = FindViewById <ViewSwitcher>(Resource.Id.viewSwitcher);
            LinearLayout calcView1    = FindViewById <LinearLayout>(Resource.Id.calcView1);
            LinearLayout calcView2    = FindViewById <LinearLayout>(Resource.Id.calcView2);
            Button       functions    = FindViewById <Button>(Resource.Id.functions);
            Button       standart     = FindViewById <Button>(Resource.Id.standart);

            functions.Click += (object sender, EventArgs e) =>
            {
                if (viewSwitcher.CurrentView != calcView2)
                {
                    viewSwitcher.ShowNext();
                }
            };

            standart.Click += (object sender, EventArgs e) =>
            {
                if (viewSwitcher.CurrentView == calcView2)
                {
                    viewSwitcher.ShowPrevious();
                }
            };
        }
예제 #28
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.AddFlags(WindowManagerFlags.KeepScreenOn);

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

            FindViewById <Button>(Resource.Id.paCloseB).Click += (sender, e) => {
                Finish();
            };

            FindViewById <Button>(Resource.Id.paExitAppB).Click += (sender, e) => {
                int count = 0;

                count += MainDatabase.CountItemsToSync <Attendance>();
                count += MainDatabase.CountItemsToSync <CompetitorData>();
                count += MainDatabase.CountItemsToSync <ContractData>();
                count += MainDatabase.CountItemsToSync <CoterieData>();
                count += MainDatabase.CountItemsToSync <DistributionData>();
                count += MainDatabase.CountItemsToSync <Pharmacy>();
                count += MainDatabase.CountItemsToSync <Employee>();

                count += MainDatabase.CountItemsToSync <GPSData>();

                count += MainDatabase.CountItemsToSync <Hospital>();
                count += MainDatabase.CountItemsToSync <HospitalData>();

                //var monthFinanceDatas = MainDatabase.GetItemsToSync<FinanceDataByMonth>();
                //var quarterFinanceDatas = MainDatabase.GetItemsToSync<FinanceDataByQuarter>();
                //var monthSaleDatas = MainDatabase.GetItemsToSync<SaleDataByMonth>();
                //var quarterSaleDatas = MainDatabase.GetItemsToSync<SaleDataByQuarter>();

                count += MainDatabase.CountItemsToSync <MessageData>();

                count += MainDatabase.CountItemsToSync <PresentationData>();
                count += MainDatabase.CountItemsToSync <PromotionData>();
                count += MainDatabase.CountItemsToSync <ResumeData>();
                count += MainDatabase.CountItemsToSync <RouteItem>();

                count += MainDatabase.CountItemsToSync <RouteItem>();

                count += MainDatabase.CountItemsToSync <PhotoData>();

                if (count > 0)
                {
                    new AlertDialog.Builder(this)
                    .SetTitle(Resource.String.warning_caption)
                    .SetMessage("Перед выходом необходимо синхронизировать все данные!!!")
                    .SetCancelable(true)
                    .SetPositiveButton("OK", (caller, arguments) => {
                        if (caller is Dialog)
                        {
                            (caller as Dialog).Dismiss();
                        }
                    })
                    .Show();
                }
                else
                {
                    GetSharedPreferences(MainActivity.C_MAIN_PREFS, FileCreationMode.Private)
                    .Edit()
                    .PutString(SigninDialog.C_USERNAME, string.Empty)
                    .Commit();
                    MainDatabase.Dispose();
                    Finish();
                }
            };

            Content = FindViewById <LinearLayout>(Resource.Id.paAttendanceByWeekLL);
            Table   = FindViewById <ListView>(Resource.Id.paAttendanceByWeekTable);

            int weeksCount = 14;

            Dates = new DateTimeOffset[weeksCount];
            var header = (LinearLayout)LayoutInflater.Inflate(Resource.Layout.AttendanceByWeekTableHeader, Table, false);

            (header.GetChildAt(0) as TextView).Text = @"Недели";
            for (int w = 0; w < weeksCount; w++)
            {
                Dates[w] = DateTimeOffset.UtcNow.AddDays(-7 * (weeksCount - 1 - w));
                var hView = header.GetChildAt(w + 1);
                if (hView is TextView)
                {
                    (hView as TextView).Text = Helper.GetIso8601WeekOfYear(Dates[w].UtcDateTime.Date).ToString();
                }
            }
            Content.AddView(header, 1);

            var shared = GetSharedPreferences(MainActivity.C_MAIN_PREFS, FileCreationMode.Private);

            FindViewById <TextView>(Resource.Id.paUsernameTV).Text = shared.GetString(SigninDialog.C_USERNAME, string.Empty);

            var agentUUID = shared.GetString(SigninDialog.C_AGENT_UUID, string.Empty);

            try {
                var agent = MainDatabase.GetItem <Agent>(agentUUID);
                FindViewById <TextView>(Resource.Id.paShortNameTV).Text = agent.shortName;
            } catch (Exception ex) {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }

            SearchSwitcher = FindViewById <ViewSwitcher>(Resource.Id.paSearchVS);
            SearchSwitcher.SetInAnimation(this, Android.Resource.Animation.SlideInLeft);
            SearchSwitcher.SetOutAnimation(this, Android.Resource.Animation.SlideOutRight);

            SearchImage        = FindViewById <ImageView>(Resource.Id.paSearchIV);
            SearchImage.Click += (sender, e) => {
                if (CurrentFocus != null)
                {
                    var imm = (InputMethodManager)GetSystemService(InputMethodService);
                    imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, HideSoftInputFlags.None);
                }

                SearchSwitcher.ShowNext();
            };

            SearchEditor = FindViewById <EditText>(Resource.Id.paSearchET);

            SearchEditor.AfterTextChanged += (sender, e) => {
                var text = e.Editable.ToString();

                (Table.Adapter as AttendanceByWeekAdapter).SetSearchText(text);
            };
        }
예제 #29
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.AddFlags(WindowManagerFlags.KeepScreenOn);

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

            FindViewById <Button>(Resource.Id.raCloseB).Click += (s, e) => {
                MainDatabase.Dispose();
                Finish();
            };

            PharmacyTable            = FindViewById <ListView>(Resource.Id.raPharmacyTable);
            PharmacyTable.ItemClick += (sender, e) => {
                var ll      = (ListView)sender;
                var adapter = (RoutePharmacyAdapter)ll.Adapter;
                adapter.SwitchVisibility(e.Position);

                var row = LayoutInflater.Inflate(Resource.Layout.RouteItem, RouteTable, false);
                row.SetTag(Resource.String.Position, e.Position);

                RouteSearchItem item;
                if (string.IsNullOrEmpty(SearchEditor.Text))
                {
                    item = RouteSearchItems[e.Position];
                }
                else
                {
                    item = SearchedItems[e.Position];
                }

                //TODO: rename vars
                using (var trans = MainDatabase.BeginTransaction()){
                    var newRouteItem = MainDatabase.Create2 <RouteItem>();
                    newRouteItem.Pharmacy = item.UUID;
                    newRouteItem.Order    = RouteTable.ChildCount;
                    newRouteItem.Date     = SelectedDate;
                    trans.Commit();
                    row.SetTag(Resource.String.RouteItemUUID, newRouteItem.UUID);
                }
                row.SetTag(Resource.String.PharmacyUUID, item.UUID);

                row.FindViewById <TextView>(Resource.Id.riPharmacyTV).Text = item.Name;
                row.SetTag(Resource.String.RouteItemOrder, RouteTable.ChildCount);
                row.FindViewById <TextView>(Resource.Id.riOrderTV).Text = (RouteTable.ChildCount + 1).ToString();

                row.FindViewById <ImageView>(Resource.Id.riDeleteIV).Click += RowDelete_Click;
                row.LongClick += Row_LongClick;
                row.Drag      += Row_Drag;

                RouteTable.AddView(row);
            };

            RouteSearchItemsSource = new List <RouteSearchItem>();
            var pharmacies = MainDatabase.GetItems <Pharmacy>();

            foreach (var item in pharmacies)
            {
                RouteSearchItemsSource.Add(
                    new RouteSearchItem(
                        item.UUID,
                        string.IsNullOrEmpty(item.GetName()) ? string.Empty : item.GetName(),
                        string.IsNullOrEmpty(item.Subway) ? string.Empty : MainDatabase.GetItem <Subway>(item.Subway).name,
                        string.IsNullOrEmpty(item.Region) ? string.Empty : MainDatabase.GetItem <Region>(item.Region).name,
                        string.IsNullOrEmpty(item.Brand) ? string.Empty : item.Brand,
                        string.IsNullOrEmpty(item.Address) ? string.Empty : item.Address
                        )
                    );
            }
            SearchedItems  = new List <RouteSearchItem>();
            SearchSwitcher = FindViewById <ViewSwitcher>(Resource.Id.raSearchVS);
            SearchSwitcher.SetInAnimation(this, Android.Resource.Animation.SlideInLeft);
            SearchSwitcher.SetOutAnimation(this, Android.Resource.Animation.SlideOutRight);

            SearchImage        = FindViewById <ImageView>(Resource.Id.raSearchIV);
            SearchImage.Click += (sender, e) => {
                if (CurrentFocus != null)
                {
                    var imm = (InputMethodManager)GetSystemService(InputMethodService);
                    imm.HideSoftInputFromWindow(CurrentFocus.WindowToken, HideSoftInputFlags.None);
                }

                SearchSwitcher.ShowNext();
            };

            SearchEditor = FindViewById <EditText>(Resource.Id.raSearchET);

            SearchEditor.AfterTextChanged += (sender, e) => {
                var text = e.Editable.ToString();

                if (string.IsNullOrEmpty(text))
                {
                    foreach (var item in RouteSearchItems)
                    {
                        item.Match = string.Empty;
                    }
                    PharmacyTable.Adapter = new RoutePharmacyAdapter(this, RouteSearchItems);
                    return;
                }

                var w = new SDiag.Stopwatch();
                w.Start();
                SearchedItems = new List <RouteSearchItem>();
                var matchFormat = @"Совпадение: {0}";
                var culture     = CultureInfo.GetCultureInfo("ru-RU");
                // 2 поиск
                foreach (var item in RouteSearchItems)
                {
                    if (item.IsVisible)
                    {
                        //item.Subway = null;
                        if (culture.CompareInfo.IndexOf(item.Subway, text, CompareOptions.IgnoreCase) >= 0)
                        {
                            item.Match = string.Format(matchFormat, @"метро=" + item.Subway);
                            SearchedItems.Add(item);
                            //if (SearchedItems.Count > C_ITEMS_IN_RESULT) break;
                            continue;
                        }

                        if (culture.CompareInfo.IndexOf(item.Region, text, CompareOptions.IgnoreCase) >= 0)
                        {
                            item.Match = string.Format(matchFormat, @"район=" + item.Region);
                            SearchedItems.Add(item);
                            //if (SearchedItems.Count > C_ITEMS_IN_RESULT) break;
                            continue;
                        }

                        if (culture.CompareInfo.IndexOf(item.Brand, text, CompareOptions.IgnoreCase) >= 0)
                        {
                            item.Match = string.Format(matchFormat, @"бренд=" + item.Brand);
                            SearchedItems.Add(item);
                            //if (SearchedItems.Count > C_ITEMS_IN_RESULT) break;
                            continue;
                        }

                        if (culture.CompareInfo.IndexOf(item.Address, text, CompareOptions.IgnoreCase) >= 0)
                        {
                            item.Match = string.Format(matchFormat, @"адрес");
                            SearchedItems.Add(item);
                            //if (SearchedItems.Count > C_ITEMS_IN_RESULT) break;
                            continue;
                        }
                    }
                }
                w.Stop();
                SDiag.Debug.WriteLine(@"Search: поиск={0}", w.ElapsedMilliseconds);

                PharmacyTable.Adapter = new RoutePharmacyAdapter(this, SearchedItems);
            };

            RouteTable = FindViewById <LinearLayout>(Resource.Id.raRouteTable);

            FindViewById <Button>(Resource.Id.raSelectDateB).Click += (sender, e) => {
                DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime date) {
                    SDiag.Debug.WriteLine("DatePicker:{0}", date.ToLongDateString());
                    SDiag.Debug.WriteLine("DatePicker:{0}", new DateTimeOffset(date));
                    SelectedDate = new DateTimeOffset(date, new TimeSpan(0, 0, 0));;
                    RefreshTables();
                });
                frag.Show(FragmentManager, DatePickerFragment.TAG);
            };

            Info      = FindViewById <TextView>(Resource.Id.raInfoTV);
            Info.Text = string.Format(@"Период планирования: {0} недели ({1} дней)", Helper.WeeksInRoute, Helper.WeeksInRoute * 5);

            var switcher = FindViewById <ViewSwitcher>(Resource.Id.raSwitchViewVS);

            FindViewById <ImageView>(Resource.Id.raSwitchIV).Click += (sender, e) => {
                SDiag.Debug.WriteLine(@"switcher:{0}; Resource{1}", switcher.CurrentView.Id, Resource.Id.raContainerVP);
                if (switcher.CurrentView.Id != Resource.Id.raContainerVP)
                {
                    Info.Text = string.Format(
                        @"Период планирования: {0} недели ({1} дней). Номер недели: {2}",
                        Helper.WeeksInRoute, Helper.WeeksInRoute * 5, 1
                        );
                    var pager = FindViewById <ViewPager>(Resource.Id.raContainerVP);
                    pager.AddOnPageChangeListener(this);
                    pager.Adapter = new RoutePagerAdapter(SupportFragmentManager);
                }
                else
                {
                    Info.Text = string.Format(@"Период планирования: {0} недели ({1} дней)", Helper.WeeksInRoute, Helper.WeeksInRoute * 5);
                }
                switcher.ShowNext();
            };
        }
예제 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.RegisterTypeForAjax(typeof(BookmarkingUserControl));
            Utility.RegisterTypeForAjax(typeof(SingleBookmarkUserControl));

            BookmarkPageCounter = string.IsNullOrEmpty(Request["size"]) ? 20 : Convert.ToInt32(Request["size"]);

            var createBookmark = LoadControl(BookmarkUserControlPath.CreateBookmarkUserControlPath) as CreateBookmarkUserControl;

            CreateBookmarkPanel.Controls.Add(createBookmark);

            var removePopup = LoadControl(BookmarkingRemoverFromFavouritePopup.Location) as BookmarkingRemoverFromFavouritePopup;

            BookmarkingRemoveFromFavouritePopupContainer.Controls.Add(removePopup);

            InitSettings();

            var SortControl = new ViewSwitcher {
                SortItemsHeader = BookmarkingUCResource.ShowLabel
            };

            _serviceHelper.InitServiceHelper(SortControl);
            BookmarkingSortPanel.Controls.Add(SortControl);

            if (Bookmarks == null)
            {
                Bookmarks = _serviceHelper.GetBookmarks(BookmarkPageCounter);
            }

            if (Bookmarks == null || Bookmarks.Count == 0)
            {
                var hidePanelsFlag = false;

                var currentUser = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);

                var emptyScreenControl = new EmptyScreenControl
                {
                    ImgSrc   = WebImageSupplier.GetAbsoluteWebPath("bookmarks_icon.png", BookmarkingSettings.ModuleId),
                    Describe = currentUser.IsVisitor() ? BookmarkingUCResource.EmptyScreenTextVisitor : BookmarkingUCResource.EmptyScreenText
                };

                var displayMode = BookmarkingBusinessFactory.GetDisplayMode();

                if (displayMode.Equals(BookmarkDisplayMode.SearchBookmarks))
                {
                    hidePanelsFlag = true;

                    emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                }
                else
                {
                    var sortBy = Request.QueryString[BookmarkingRequestConstants.SortByParam];
                    if (string.IsNullOrEmpty(sortBy) ||
                        BookmarkingRequestConstants.MostRecentParam.Equals(sortBy) ||
                        BookmarkingRequestConstants.PopularityParam.Equals(sortBy))
                    {
                        hidePanelsFlag = true;

                        emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenCaption;

                        if (BookmarkingPermissionsCheck.PermissionCheckCreateBookmark())
                        {
                            emptyScreenControl.ButtonHTML = String.Format("<a class='link underline blue plus' href='CreateBookmark.aspx'>{0}</a>", BookmarkingUCResource.EmptyScreenLink);
                        }
                    }
                    else
                    {
                        emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                    }
                }

                BookmarksHolder.Controls.Add(emptyScreenControl);
                if (hidePanelsFlag)
                {
                    BookmarkingSortPanel.Visible = false;
                    CreateBookmarkPanel.Visible  = false;
                    BookmarksMainPanel.Visible   = false;
                }
            }
            else
            {
                LoadBookmarks(Bookmarks);
            }
            InitScripts();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Utility.RegisterTypeForAjax(typeof(BookmarkingUserControl));
            Utility.RegisterTypeForAjax(typeof(SingleBookmarkUserControl));
            Utility.RegisterTypeForAjax(typeof(CommentsUserControl));

            var createBookmark = LoadControl(BookmarkUserControlPath.CreateBookmarkUserControlPath) as CreateBookmarkUserControl;

            CreateBookmarkPanel.Controls.Add(createBookmark);

            var removePopup = LoadControl(BookmarkingRemoverFromFavouritePopup.Location) as BookmarkingRemoverFromFavouritePopup;

            BookmarkingRemoveFromFavouritePopupContainer.Controls.Add(removePopup);

            InitSettings();

            var SortControl = new ViewSwitcher {
                SortItemsHeader = BookmarkingUCResource.ShowLabel
            };

            ServiceHelper.InitServiceHelper(SortControl);
            BookmarkingSortPanel.Controls.Add(SortControl);

            if (Bookmarks == null)
            {
                Bookmarks = ServiceHelper.GetBookmarks();
            }

            if (Bookmarks == null || Bookmarks.Count == 0)
            {
                var hidePanelsFlag     = false;
                var emptyScreenControl = new EmptyScreenControl
                {
                    ImgSrc   = WebImageSupplier.GetAbsoluteWebPath("bookmarks_icon.png", BookmarkingSettings.ModuleId),
                    Describe = BookmarkingUCResource.EmptyScreenText
                };

                if (ServiceHelper.DisplayMode.Equals(BookmarkingServiceHelper.BookmarkDisplayMode.SearchBookmarks))
                {
                    hidePanelsFlag = true;

                    emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                }
                else
                {
                    var sortBy = Request.QueryString[BookmarkingRequestConstants.SortByParam];
                    if (string.IsNullOrEmpty(sortBy) ||
                        BookmarkingRequestConstants.MostRecentParam.Equals(sortBy) ||
                        BookmarkingRequestConstants.PopularityParam.Equals(sortBy))
                    {
                        hidePanelsFlag = true;

                        emptyScreenControl.Header     = BookmarkingUCResource.EmptyScreenCaption;
                        emptyScreenControl.ButtonHTML = String.Format("<a class='linkAddMediumText' href='CreateBookmark.aspx'>{0}</a>", BookmarkingUCResource.EmptyScreenLink);
                    }
                    else
                    {
                        emptyScreenControl.Header = BookmarkingUCResource.EmptyScreenSearchCaption;
                    }
                }

                BookmarksHolder.Controls.Add(emptyScreenControl);
                if (hidePanelsFlag)
                {
                    BookmarkingSortPanel.Visible = false;
                    CreateBookmarkPanel.Visible  = false;
                    BookmarksMainPanel.Visible   = false;
                }
            }
            else
            {
                LoadBookmarks(Bookmarks);
            }
        }
 public void InitServiceHelper(ViewSwitcher sortControl)
 {
     _sortControl = sortControl;
 }
 public void InitServiceHelper(ViewSwitcher SortControl)
 {
     this._sortControl = SortControl;
 }