Пример #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            drawer        = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            navView       = FindViewById <NavigationView>(Resource.Id.nav_view);
            LoaderView    = FindViewById <RelativeLayout>(Resource.Id.LoaderView);
            LoaderImage   = FindViewById <ImageView>(Resource.Id.LoaderImage);
            LoaderView    = FindViewById <RelativeLayout>(Resource.Id.LoaderView);
            ListViewMarsh = FindViewById <ListView>(Resource.Id.ListViewMarsh);
            ListViewPO    = FindViewById <ListView>(Resource.Id.ListViewPO);
            ImageView DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu);

            DrawerImage.Click += DrawerImage_Click;

            AnimationLoader = (AnimationDrawable)LoaderImage.Drawable;
            AnimationLoader.Start();

            HeaderView = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false);

            navView.AddHeaderView(HeaderView);
            navView.NavigationItemSelected += NavView_NavigationItemSelected;
            new Thread(new ThreadStart(delegate //поток для загрузки данных
            {
                var user      = User.GetInstance(0, "", "", GetString(Resource.String.token));
                var marshruts = Marshruts.GetMarshruts();
                marshruts[0].GetPromPynkt();
                RunOnUiThread(() => ListViewMarsh.Adapter = new ArrayAdapter <Marshrut> (this, Android.Resource.Layout.SimpleListItem1, marshruts));
                RunOnUiThread(() => AnimationLoader.Stop());
                RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible);
            })).Start();
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.BronLayout);
            //---Переменные для работы NAvigationView
            drawer      = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            navView     = FindViewById <NavigationView>(Resource.Id.nav_view);
            DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu);
            LoaderView  = FindViewById <RelativeLayout>(Resource.Id.LoaderView);
            LoaderImage = FindViewById <ImageView>(Resource.Id.LoaderImage);
            //---Переменные для работы с Activity
            ListViewTrips  = FindViewById <ListView>(Resource.Id.ListViewTrips);
            SpinnerRouts   = FindViewById <Spinner>(Resource.Id.SpinnerRouts);
            SpinnerPoStart = FindViewById <Spinner>(Resource.Id.SpinnerPoStart);
            SpinnerPoEnd   = FindViewById <Spinner>(Resource.Id.SpinnerPoEnd);
            TextViewData   = FindViewById <TextView>(Resource.Id.TextViewData);

            TextViewData.Click          += TextViewData_Click;
            SpinnerRouts.ItemSelected   += SpinnerRouts_ItemSelected;
            SpinnerPoStart.ItemSelected += SpinnerPoStart_ItemSelected;
            SpinnerPoEnd.ItemSelected   += SpinnerPoEnd_ItemSelected;
            AnimationLoader              = (AnimationDrawable)LoaderImage.Drawable;
            AnimationLoader.Start();

            ListViewTrips.DividerHeight = 0;
            ListViewTripsParmetr        = ListViewTrips.LayoutParameters;
            ListViewTrips.ItemClick    += ListViewTrips_ItemClick;
            DrawerImage.Click          += DrawerImage_Click;
            HeaderView = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false);

            navView.AddHeaderView(HeaderView);
            navView.NavigationItemSelected += NavView_NavigationItemSelected;

            new Thread(new ThreadStart(delegate //поток для загрузки данных
            {
                ObratPO  = new List <IApi>();
                TripDate = DateTime.Today;
                RunOnUiThread(() => TextViewData.Text = TripDate.ToString("dd.MM.yyyy"));
                routs = Routs.GetMarshruts();
                routs[0].GetPromPynkt();
                for (int i = routs[0].PromPynkt.Count - 1; i >= 0; i--)
                {
                    ObratPO.Add(routs[0].PromPynkt[i]);
                }
                RunOnUiThread(() => SpinnerRouts.Adapter   = new RoutAdapter(this, routs));
                RunOnUiThread(() => SpinnerPoStart.Adapter = new PromPynktAdapter(this, routs[0].PromPynkt));
                RunOnUiThread(() => SpinnerPoEnd.Adapter   = new PromPynktAdapter(this, ObratPO));
                trips = Trips.GetTripsOnDate(TripDate.ToString("yyyy-MM-dd"), routs[0].PromPynkt[0].id.ToString(), ObratPO[0].id.ToString(), routs[0].id.ToString());
                ListViewTripsParmetr.Height = Convert.ToInt32(function.convertDpToPixel(90, this)) * trips.Count;
                RunOnUiThread(() => ListViewTrips.Adapter = new TripsAdapter(this, trips));
                RunOnUiThread(() => AnimationLoader.Stop());
                RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible);
            })).Start();
        }
Пример #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            //MapView = FindViewById<WebView>(Resource.Id.MapView);
            drawer        = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            navView       = FindViewById <NavigationView>(Resource.Id.nav_view);
            LoaderView    = FindViewById <RelativeLayout>(Resource.Id.LoaderView);
            LoaderImage   = FindViewById <ImageView>(Resource.Id.LoaderImage);
            ListViewMarsh = FindViewById <ListView>(Resource.Id.ListViewMarsh);
            ListViewPO    = FindViewById <ListView>(Resource.Id.ListViewPO);
            ImageView DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu);

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

            DrawerImage.Click += DrawerImage_Click;
            ButtonBron.Click  += ButtonBron_Click;

            AnimationLoader = (AnimationDrawable)LoaderImage.Drawable;
            AnimationLoader.Start();

            HeaderView = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false);

            navView.AddHeaderView(HeaderView);
            navView.NavigationItemSelected += NavView_NavigationItemSelected;
            ListViewMarsh.ChoiceMode        = ChoiceMode.Single;
            ListViewMarsh.DividerHeight     = 0;
            ListViewMarsh.ItemClick        += ListViewMarsh_ItemClick;
            ListViewPO.DividerHeight        = 0;
            var paramMarsh = ListViewMarsh.LayoutParameters;
            var paramPO    = ListViewPO.LayoutParameters;

            //MapView.Settings.JavaScriptEnabled = true;
            new Thread(new ThreadStart(delegate //поток для загрузки данных
            {
                var user  = User.GetInstance(0, "", "", GetString(Resource.String.token));
                marshruts = Routs.GetMarshruts();
                foreach (var item in marshruts)
                {
                    item.GetPromPynkt();
                }
                //RunOnUiThread(() => MapView.LoadUrl("http://orion38.pro/maps/maps.php?url_map=" + marshruts[0].url_map));
                paramMarsh.Height = Convert.ToInt32(function.convertDpToPixel(45, this)) * marshruts.Count;
                paramPO.Height    = Convert.ToInt32(function.convertDpToPixel(35, this)) * (marshruts[0].PromPynkt.Count + 1);
                RunOnUiThread(() => ListViewMarsh.Adapter = new RoutAdapter(this, marshruts));
                RunOnUiThread(() => ListViewPO.Adapter    = new PromPynktAdapter(this, marshruts[0].PromPynkt));
                RunOnUiThread(() => AnimationLoader.Stop());
                RunOnUiThread(() => LoaderView.Visibility = ViewStates.Invisible);
            })).Start();
        }
Пример #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.AboutLayout);

            drawer  = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            navView = FindViewById <NavigationView>(Resource.Id.nav_view);
            ImageView DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu);

            DrawerImage.Click += DrawerImage_Click;
            HeaderView         = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false);

            navView.AddHeaderView(HeaderView);
            navView.NavigationItemSelected += NavView_NavigationItemSelected;
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create the UI
            var v = OnCreateMainView(savedInstanceState);

            _drawer = new DrawerLayout(this);
            _drawer.AddView(v,
                            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));
            AddContentView(_drawer,
                           new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));

            // prep drawer if needed
            var navigationView = new NavigationView(this);
            var menu           = navigationView.Menu;

            if (OnPrepareSideMenu(menu))
            {
                navigationView.SetNavigationItemSelectedListener(this);
                _drawer.AddView(navigationView,
                                new DrawerLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                              ViewGroup.LayoutParams.MatchParent, (int)GravityFlags.Start));

                // set the header
                var header = OnCreateMenuHeaderView(LayoutInflater.From(this));
                if (header != null)
                {
                    navigationView.AddHeaderView(header);
                }

                // fetch the theme...
                var a = new TypedValue();
                Theme.ResolveAttribute(global::Android.Resource.Attribute.ColorBackground, a, true);
                if (a.Type >= DataType.FirstColorInt && a.Type <= DataType.LastColorInt)
                {
                    navigationView.SetBackgroundColor(new global::Android.Graphics.Color(a.Data));
                }

                // notify when drawer opens / closes
                _drawerToggle = OnCreateDrawerToggle(this, _drawer);
                _drawer.AddDrawerListener(_drawerToggle);

                SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(true);
            }
        }
Пример #6
0
        private void ConfigureNavigationViewHeader()
        {
            try
            {
                View viewHeader = LayoutInflater.Inflate(Resource.Layout.dashboardActivity_navigationView_header, null);

                ImageView imageviewUserAvatar   = viewHeader.FindViewById <ImageView>(Resource.Id.dashboardActivity_navigationView_header_imageview_userAvatar);
                TextView  textviewUserMatricule = viewHeader.FindViewById <TextView>(Resource.Id.dashboardActivity_navigationView_header_textview_userMatricule);

                imageviewUserAvatar.SetImageResource(Resource.Drawable.ic_account_circle_black_24dp);
                Android.Support.V4.Graphics.Drawable.DrawableCompat.SetTint(imageviewUserAvatar.Drawable, ContextCompat.GetColor(Application.Context, Resource.Color.primary_dark));
                textviewUserMatricule.Text = Settings.UserMatricule;

                m_navigationView.AddHeaderView(viewHeader);
            }
            catch (Exception e)
            {
                MobileCenter_Helper.ReportError(new FileAccessManager(), e, GetType().Name, MethodBase.GetCurrentMethod().Name);
            }
        }
Пример #7
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            if (Intent.HasExtra(Notifications.NotificationsSenderKey))
            {
                ViewModel.ViewConversationCommand.Execute(Intent.GetStringExtra(Notifications.NotificationsSenderKey));
            }
            var header = this.BindingInflate(Resource.Layout.navigation_header, null);

            header.FindViewById(Resource.Id.status).Click +=
                delegate {
                new AlertDialog.Builder(this).SetPositiveButton(Strings.SetStatus_Title,
                                                                (sender, args) => { ViewModel.ChangeStatusCommand.Execute(((AlertDialog)sender).FindViewById <TextView>(Resource.Id.input).Text); })
                .SetView(this.BindingInflate(Resource.Layout.dialog_change_status, null))
                .SetTitle(Strings.SetStatus_Title)
                .Show();
            };
            Mvx.GetSingleton <IMvxImageCache <Bitmap> >().RequestImage(ViewModel.Character.Image).ContinueWith(task => {
                var drawable      = RoundedBitmapDrawableFactory.Create(Resources, task.Result);
                drawable.Circular = true;
                header.FindViewById <ImageView>(Resource.Id.icon).SetImageDrawable(drawable);
            });
            NavigationView.AddHeaderView(header);
        }
Пример #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.issue_layout);
            rnd           = new System.Random();
            includeClosed = false;
            if (Intent.GetStringExtra("Kind") == "Project Issues")
            {
                myIssues = false;
            }
            else
            {
                myIssues = true;
            }
            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetTitle(Resource.String.Issues);
            if (myIssues)
            {
                toolbar.SetTitle(Resource.String.MyIssues);
            }
            SetSupportActionBar(toolbar);

            //Enable support action bar to display hamburger
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_white_18dp);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            drawerLayout        = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            navigationView      = FindViewById <NavigationView>(Resource.Id.nav_view);
            rightNavigationView = FindViewById <NavigationView>(Resource.Id.right_nav_view);

            LayoutInflater inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService);
            View           v        = inflater.Inflate(Resource.Layout.drawer_header, null);

            TVUserFullName = v.FindViewById <TextView>(Resource.Id.user_full_name);
            TVUserFullName.SetBackgroundColor(Android.Graphics.Color.Argb(200, rnd.Next(0, 255), rnd.Next(0, 255), rnd.Next(0, 255)));

            TVUserFullName.Text = RedMineManager.currUser.firstname + " " + RedMineManager.currUser.lastname ?? "Firstname Lastname";
            navigationView.AddHeaderView(v);
            navigationView.NavigationItemSelected += (sender, e) =>
            {
                e.MenuItem.SetChecked(true);
                switch (e.MenuItem.ItemId)
                {
                case Resource.Id.nav_my_issues:
                    Intent i0 = new Intent(this, typeof(IssueActivity));
                    i0.PutExtra("Kind", "My Issues");
                    StartActivity(i0);
                    break;

                case Resource.Id.nav_projects:
                    if (RedMineManager.currUser.status == 1)
                    {
                        Intent i4 = new Intent(this, typeof(MainActivity.MainActivity));
                        StartActivity(i4);
                    }
                    else
                    {
                        Toast.MakeText(this, Resources.GetString(Resource.String.PermissionError), ToastLength.Short).Show();
                    }
                    break;

                case Resource.Id.settings:
                    Intent i = new Intent(this, typeof(SettingsActivity.SettingsActivity));
                    i.PutExtra("Domen", RedMineManager.client.BaseUrl.ToString());
                    StartActivity(i);
                    break;

                case Resource.Id.administration:
                    if (RedMineManager.currUser.status == 1)
                    {
                        Intent i2 = new Intent(this, typeof(VerifiedUserActivity));
                        StartActivity(i2);
                    }
                    else
                    {
                        Toast.MakeText(this, Resources.GetString(Resource.String.PermissionError), ToastLength.Short).Show();
                    }
                    break;

                case Resource.Id.log_out:
                    LoginActivity.CredentialsStore.Delete();
                    Intent i3 = new Intent(this, typeof(LoginActivity.LoginActivity));
                    Finish();
                    StartActivity(i3);
                    break;

                case Resource.Id.exit:
                    Finish();
                    break;
                }
                drawerLayout.CloseDrawers();
            };

            BNew = new ImageView(this);
            LinearLayout LLControls = FindViewById <LinearLayout>(Resource.Id.right_controls);

            BNew.SetImageResource(Resource.Drawable.ic_add_white_18dp);
            LLControls.AddView(BNew);
            BNew.Click += delegate
            {
                Intent i = new Intent(this, typeof(IssueEditorActivity));
                i.PutExtra("IsNew", true);
                i.PutExtra("Issue", Newtonsoft.Json.JsonConvert.SerializeObject(new Issue {
                    tracker = new Tracker(), assigned_to = new AssignedTo(), author = new Author(), priority = new Priority(), status = new Status(), project = new IssuesContainer.Project()
                }));
                i.PutExtra("ProjectId", Intent.GetIntExtra("ProjectId", 0));
                StartActivityForResult(i, 0);
            };
            int g = Intent.GetIntExtra("ProjectId", 0);

            issues          = RedMineManager.Get <IssuesContainer>("/issues.json?assigned_to_id=me&nometa=1");
            BNew.Visibility = ViewStates.Gone;


            if (Intent.GetStringExtra("Kind") == "Project Issues")
            {
                issues          = RedMineManager.Get <IssuesContainer>("/projects/" + g + "/issues.json?nometa=1");
                BNew.Visibility = ViewStates.Visible;
            }

            SetLayout();
            SetRightNavPanel();

            refresh = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh);
            refresh.SetDistanceToTriggerSync(1);
            refresh.SetColorSchemeResources(Resource.Color.colorAccent, Resource.Color.colorPrimary);
            refresh.Refresh += delegate
            {
                Thread t = new Thread(() =>
                {
                    GetIssuesByFilters(includeClosed, myIssues, Intent.GetIntExtra("ProjectId", 0));
                    RunOnUiThread(() =>
                    {
                        Recreate();
                        refresh.Refreshing = false;
                    });
                });
                t.Start();
            };
        }
Пример #9
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.main_layout);
            rnd     = new System.Random();
            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetTitle(Resource.String.Projects);
            SetSupportActionBar(toolbar);

            //Enable support action bar to display hamburger
            SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_white_18dp);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            drawerLayout   = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);

            LayoutInflater inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService);
            View           v        = inflater.Inflate(Resource.Layout.drawer_header, null);

            TVUserFullName = v.FindViewById <TextView>(Resource.Id.user_full_name);
            TVUserFullName.SetBackgroundColor(Android.Graphics.Color.Argb(200, rnd.Next(0, 255), rnd.Next(0, 255), rnd.Next(0, 255)));

            TVUserFullName.Text = RedMineManager.currUser.firstname + " " + RedMineManager.currUser.lastname ?? "Firstname Lastname";
            navigationView.AddHeaderView(v);
            navigationView.NavigationItemSelected += (sender, e) =>
            {
                e.MenuItem.SetChecked(true);
                switch (e.MenuItem.ItemId)
                {
                case Resource.Id.nav_my_issues:
                    Intent i0 = new Intent(this, typeof(IssueActivity.IssueActivity));
                    i0.PutExtra("Kind", "My Issues");
                    StartActivity(i0);
                    break;

                case Resource.Id.nav_projects:
                    if (RedMineManager.currUser.status == 1)
                    {
                        Intent i4 = new Intent(this, typeof(MainActivity));
                        StartActivity(i4);
                    }
                    else
                    {
                        Toast.MakeText(this, Resources.GetString(Resource.String.PermissionError), ToastLength.Short).Show();
                    }
                    break;

                case Resource.Id.settings:
                    Intent i = new Intent(this, typeof(SettingsActivity.SettingsActivity));
                    i.PutExtra("Domen", RedMineManager.client.BaseUrl.ToString());
                    StartActivity(i);
                    break;

                case Resource.Id.administration:
                    if (RedMineManager.currUser.status == 1)
                    {
                        Intent i2 = new Intent(this, typeof(VerifiedUserActivity));
                        StartActivity(i2);
                    }
                    else
                    {
                        Toast.MakeText(this, Resources.GetString(Resource.String.PermissionError), ToastLength.Short).Show();
                    }
                    break;

                case Resource.Id.log_out:
                    LoginActivity.CredentialsStore.Delete();
                    Intent i3 = new Intent(this, typeof(LoginActivity.LoginActivity));
                    Finish();
                    StartActivity(i3);
                    break;

                case Resource.Id.exit:
                    Finish();
                    break;
                }
                drawerLayout.CloseDrawers();
            };

            LinearLayout LLControls = FindViewById <LinearLayout>(Resource.Id.right_controls);
            Thread       load       = new Thread(() =>
            {
                LVProjects = FindViewById <ExpandableListView>(Resource.Id.list_projects);
                SetData();
                RunOnUiThread(() =>
                {
                    ImageView BNewProject = new ImageView(this);
                    BNewProject.SetImageResource(Resource.Drawable.ic_add_white_18dp);
                    if (RedMineManager.currUser.status != 1)
                    {
                        BNewProject.Visibility = ViewStates.Gone;
                    }
                    LLControls.AddView(BNewProject);
                    BNewProject.Click += delegate
                    {
                        Intent i = new Intent(this, typeof(NewProjectActivity));
                        i.PutExtra("IsNew", true);
                        StartActivityForResult(i, 0);
                    };

                    LVProjects.GroupClick += (object sender, ExpandableListView.GroupClickEventArgs e) =>
                    {
                        if (mAdapter.GetChildrenCount(e.GroupPosition) == 0)
                        {
                            Intent i = new Intent(this, typeof(OneProjectActivity));
                            i.PutExtra("Kind", "Project Issues");
                            i.PutExtra("ProjectId", (int)mAdapter.GetGroup(e.GroupPosition));
                            StartActivity(i);
                        }
                        else
                        if (!LVProjects.IsGroupExpanded(e.GroupPosition))
                        {
                            LVProjects.ExpandGroup(e.GroupPosition);
                        }
                        else
                        {
                            LVProjects.CollapseGroup(e.GroupPosition);
                        }
                    };

                    LVProjects.ChildClick += (object sender, ExpandableListView.ChildClickEventArgs e) =>
                    {
                        Intent i = new Intent(this, typeof(OneProjectActivity));
                        i.PutExtra("Kind", "Project Issues");
                        i.PutExtra("ProjectId", (int)mAdapter.GetChild(e.GroupPosition, e.ChildPosition));
                        StartActivity(i);
                    };
                });
            });

            load.Start();

            SwipeRefreshLayout refresh = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh);

            refresh.SetDistanceToTriggerSync(50);
            refresh.SetColorSchemeResources(Resource.Color.colorAccent, Resource.Color.colorPrimary);
            refresh.Refresh += delegate
            {
                Thread t = new Thread(() =>
                {
                    SetData();
                    RunOnUiThread(() =>
                    {
                        Recreate();
                        refresh.Refreshing = false;
                    });
                });
                t.Start();
            };
        }
Пример #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.BronForm);
            //---Переменные для работы NAvigationView
            drawer      = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            navView     = FindViewById <NavigationView>(Resource.Id.nav_view);
            DrawerImage = FindViewById <ImageView>(Resource.Id.Button_menu);
            LoaderView  = FindViewById <RelativeLayout>(Resource.Id.LoaderView);
            LoaderImage = FindViewById <ImageView>(Resource.Id.LoaderImage);
            //---Переменные для работы Activity
            m1                 = FindViewById <Button>(Resource.Id.m1);
            m2                 = FindViewById <Button>(Resource.Id.m2);
            m3                 = FindViewById <Button>(Resource.Id.m3);
            m4                 = FindViewById <Button>(Resource.Id.m4);
            m5                 = FindViewById <Button>(Resource.Id.m5);
            m6                 = FindViewById <Button>(Resource.Id.m6);
            m7                 = FindViewById <Button>(Resource.Id.m7);
            m8                 = FindViewById <Button>(Resource.Id.m8);
            m9                 = FindViewById <Button>(Resource.Id.m9);
            m10                = FindViewById <Button>(Resource.Id.m10);
            m11                = FindViewById <Button>(Resource.Id.m11);
            m12                = FindViewById <Button>(Resource.Id.m12);
            m14                = FindViewById <Button>(Resource.Id.m14);
            ButtonBron         = FindViewById <Button>(Resource.Id.ButtonBron);
            SpinnerTypeTicket  = FindViewById <Spinner>(Resource.Id.SpinnerTypeTicket);
            SpinnerSpots       = FindViewById <Spinner>(Resource.Id.SpinnerSpots);
            TextViewSelectRout = FindViewById <TextView>(Resource.Id.TextViewSelectRout);
            TextViewData       = FindViewById <TextView>(Resource.Id.TextViewData);
            TextViewCost       = FindViewById <TextView>(Resource.Id.TextViewCost);
            TextViewPoStart    = FindViewById <TextView>(Resource.Id.TextViewPoStart);
            TextViewPoEnd      = FindViewById <TextView>(Resource.Id.TextViewPoEnd);
            EditTextFIO        = FindViewById <EditText>(Resource.Id.EditTextFIO);
            EditTextPhone      = FindViewById <EditText>(Resource.Id.EditTextPhone);
            FinishLayout       = FindViewById <RelativeLayout>(Resource.Id.FinishLayout);
            ButtonBronFinish   = FindViewById <Button>(Resource.Id.ButtonBronFinish);
            ButtonFullFinish   = FindViewById <Button>(Resource.Id.ButtonFullFinish);
            //----------------------------

            FinishLayout.Visibility = ViewStates.Invisible;
            ButtonBronFinish.Click += ButtonBronFinish_Click;
            ButtonFullFinish.Click += ButtonFullFinish_Click;;
            AnimationLoader         = (AnimationDrawable)LoaderImage.Drawable;
            AnimationLoader.Start();

            DrawerImage.Click += DrawerImage_Click;
            HeaderView         = LayoutInflater.From(this).Inflate(Resource.Layout.drawer_header, null, false);

            navView.AddHeaderView(HeaderView);
            navView.NavigationItemSelected += NavView_NavigationItemSelected;
            EditTextPhone.TextChanged      += EditTextPhone_TextChanged;
            ButtonBron.Click += ButtonBron_Click;

            RoutsID     = Intent.GetStringExtra("RoutsID");
            TripID      = Intent.GetStringExtra("TripID");
            TripDate    = Intent.GetStringExtra("TripDate");
            StartPOText = Intent.GetStringExtra("StartPOText");
            StartPOId   = Intent.GetStringExtra("StartPOId");
            EndPOText   = Intent.GetStringExtra("EndPOText");
            EndPOId     = Intent.GetStringExtra("EndPOId");

            TextViewPoStart.Text = StartPOText;
            TextViewPoEnd.Text   = EndPOText;

            //---Массив мест
            SpisokForSpinnerSpots = new List <int>();
            ObratPO = new List <IApi>();
            spots   = new List <Button>();
            spots.Add(m1);
            spots.Add(m2);
            spots.Add(m3);
            spots.Add(m4);
            spots.Add(m5);
            spots.Add(m6);
            spots.Add(m7);
            spots.Add(m8);
            spots.Add(m9);
            spots.Add(m10);
            spots.Add(m11);
            spots.Add(m12);
            spots.Add(m14);

            new Thread(new ThreadStart(delegate //поток для загрузки данных
            {
                bilets = TypeBilets.GetTypeBilets();
                routs  = Routs.GetMarshruts();
                foreach (var item in routs)
                {
                    if (item.id.ToString() == RoutsID)
                    {
                        SelectRout = item;
                        break;
                    }
                }
                GetsSpots = Trips.GetMesta(Convert.ToInt32(TripID), Convert.ToInt32(RoutsID), Convert.ToInt32(StartPOId), Convert.ToInt32(EndPOId));
                RunOnUiThread(() => CheckSvMestaOnShema(GetsSpots, spots, SpisokForSpinnerSpots));
                RunOnUiThread(() => SpinnerSpots.Adapter      = new SpotsAdapter(this, SpisokForSpinnerSpots));
                RunOnUiThread(() => SpinnerTypeTicket.Adapter = new TicketAdapter(this, bilets));
                cost = Prices.GetPrice(Convert.ToInt32(StartPOId), Convert.ToInt32(EndPOId), Convert.ToInt32(RoutsID));
                if (bilets[0].fix == 1)
                {
                    cost = bilets[0].cost.ToString();
                }
                else
                {
                    cost = (Convert.ToDouble(cost) * bilets[0].cost).ToString();
                }
                RunOnUiThread(() => TextViewCost.Text       = cost);
                RunOnUiThread(() => TextViewSelectRout.Text = SelectRout.name);
                RunOnUiThread(() => TextViewData.Text       = DateTime.ParseExact(TripDate, "yyyy-MM-dd", CultureInfo.InvariantCulture).ToString("dd.MM.yyyy"));
                RunOnUiThread(() => AnimationLoader.Stop());
                RunOnUiThread(() => LoaderView.Visibility           = ViewStates.Invisible);
                RunOnUiThread(() => SpinnerTypeTicket.ItemSelected += SpinnerTypeTicket_ItemSelected);
            })).Start();
        }