Exemple #1
0
 private void continueToApplication()
 {
     Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
     transaction.Add(Resource.Id.device_controls, dc);
     transaction.Add(Resource.Id.settings, new SettingsFragment());
     transaction.Commit();
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.driver_container_book, container, false);

            lstBox            = view.FindViewById <ListView>(Resource.Id.boxlistview);
            txt_title_lst_box = view.FindViewById <TextView>(Resource.Id.txt_title_lst_box);

            transaction = this.FragmentManager.BeginTransaction();


            if (Arguments != null)
            {
                isDepot = Arguments.GetBoolean("isDepot");
            }

            if (isDepot)
            {
                txt_title_lst_box.Text = "Контейнеры на складе";
            }
            else
            {
                txt_title_lst_box.Text = "Контейнеры на машине";
            }
            ;

            GetBoxes();

            return(view);
        }
Exemple #3
0
 public AdapterUserActivity(Context Context, List <OrderAdapter> List, FragmentManager Manager)
 {
     this.manager = Manager.BeginTransaction();
     this.context = Context;
     this.orders  = List;
     listPosition = new List <int>();
 }
Exemple #4
0
        private void BNewBill_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            BillsNew NewBillDialog = new BillsNew();

            NewBillDialog.Show(transaction, "dialog fragment create new bill");
        }
        private void BtnFriends_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            FriendsDialog dialogFragment = new FriendsDialog(m_userID);

            dialogFragment.Show(transaction, "Friends_Dialog");
        }
Exemple #6
0
 public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     if (_pager != null)
     {
         _pager.CurrentItem = tab.Position;
     }
 }
        protected override void OnCreate(Bundle bundle)
        {
            // Set our view from the "main" layout resource
            startPostingService();
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            // Initializing Elements
            Initialize();

            // Show the mapFragment
            // fm.BeginTransaction().Show(mapFrag);

            Android.App.FragmentTransaction t = FragmentManager.BeginTransaction();
            t.Show(mapFrag);
            t.Commit();

            // Checking Permissions
            if (ActivityCompat.CheckSelfPermission(this, Manifest.Permission.AccessFineLocation) != (int)Permission.Granted)
            {
                RequestLocationPermission();
            }
            else
            {
                mapFrag.GetMapAsync(this);

                // Starting Location Service
                App.StartLocationService();
            }
        }
        /// <summary>
        /// Initiates a map fragment
        /// </summary>
        private void InitMapFragment()
        {
            _locationManager = (LocationManager)GetSystemService(LocationService);

            Criteria criteriaForLocationService = new Criteria
            {
                Accuracy = Accuracy.Fine
            };
            IList <string> acceptableLocationProviders = _locationManager.GetProviders(criteriaForLocationService, true);

            if (acceptableLocationProviders.Any())
            {
                _locationProvider = acceptableLocationProviders.First();
            }
            else
            {
                _locationProvider = string.Empty;
            }

            _mapFragment = FragmentManager.FindFragmentByTag("map") as MapFragment;
            if (_mapFragment == null)
            {
                GoogleMapOptions mapOptions = new GoogleMapOptions()
                                              .InvokeMapType(GoogleMap.MapTypeNormal)
                                              .InvokeZoomControlsEnabled(true)
                                              .InvokeCompassEnabled(true);

                Android.App.FragmentTransaction fragTx = FragmentManager.BeginTransaction();
                _mapFragment = MapFragment.NewInstance(mapOptions);
                fragTx.Add(Resource.Id.MapFragment, _mapFragment, "map");
                fragTx.Commit();
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            //retrieve user object from IntroPage.cs
            currentUser = JsonConvert.DeserializeObject <User>(Intent.GetStringExtra("UserData"));

            //list of strings to use for the sliding tab interface, these are the titles of the different financial kpi's each with their own fragment
            names = new string[] { "ACFI Funding Data", "Agency Usage Data", "Bank Balance", "Brokerage Hours Data", "Home Care Package Data", "Income Data", "Salaries Wages Data" };

            //OnCreate takes a Bundle parameter, which is a dictionary for storing and passing state information
            //and objects between activities If the bundle is not null, this indicates the activity is restarting
            //and it should restore its state from the previous instance. "https:/docs.microsoft.com/en-us/xamarin/android/app-fundamentals/activity-lifecycle/"
            base.OnCreate(savedInstanceState);
            //Once on create has finished, android will call OnStart which will start the activity

            //sets the layout of the main menu to the ViewPager.axml file which is located in Resources/layout/
            SetContentView(Resource.Layout.ViewPager);

            //set up the sliding layout bar adapter from the class created in SlidingTabMenu.cs with string names assigned above
            SlidingTabMenu adapter = new SlidingTabMenu(SupportFragmentManager, names, true);

            //set the view pager and assign its adapter the sliding tab menu custom adapter
            ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager);

            viewPager.Adapter = adapter;
            //set the off screen page limit to 6 (the default = 1) as there are 7 kpi's, so 7 tabs, (say the user pulled data from the last tab and then went to the first tab,
            //the data from the last tab would go away and the user would have to repull the that data again if they go back to the last tab, this if if the page limit was 1), with no page limit
            //the data from other pages will not get erased if the user swaps to far away tabs
            viewPager.OffscreenPageLimit = 6;

            //back button to return to IntroPage.cs
            Button backBtn = FindViewById <Button>(Resource.Id.BackButton);

            backBtn.Click += delegate {
                //set the back btn image to a lighter shade of green
                backBtn.SetBackgroundResource(Resource.Drawable.BackButtonIconClicked);
                Intent nextPage = new Intent(BaseContext, typeof(IntroPage));
                nextPage.PutExtra("UserData", JsonConvert.SerializeObject(currentUser));//use intent class to send local user object to the next activity file to be used
                StartActivity(nextPage);
            };

            Button OptionsBtn = FindViewById <Button>(Resource.Id.OptionsButton);

            //set up the settings pop up window, go to Settings.cs for more, input all fragments from the sliding tab menu adapter, this is so all fragments can get updated when
            //settings are changed
            //current user object is used to check for saved shared preference settings for the user ID associated with this user
            Settings SettingsScreen = new Settings(currentUser, OptionsBtn, adapter.GetFragments());

            //open settings pop up window when options button is touched
            OptionsBtn.Click += delegate {
                //set the option btn image to a lighter shade of green
                OptionsBtn.SetBackgroundResource(Resource.Drawable.OptionsIconClicked);
                //fragment manager manages fragments in android, handles transactions between fragments,
                //a transaction is a way to add, replace or remove fragments
                //more info on fragments: https:/developer.android.com/guide/components/fragments
                //it represents a portion of the user interface such as a pop up window
                Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
                //show the dialog fragment which will be a pop up window
                SettingsScreen.Show(transaction, "dialog fragment");
            };
        }
Exemple #10
0
        private void AddLocation_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction       = FragmentManager.BeginTransaction();
            LocationAddFragment             AddLocationDialog = new LocationAddFragment();

            AddLocationDialog.Show(transaction, "dialog fragment create account");
        }
        private void BtnSettings_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction    = FragmentManager.BeginTransaction();
            CheckPasswordDialog             dialogFragment = new CheckPasswordDialog(m_userID, m_username, m_email);

            dialogFragment.Show(transaction, "Settings_Dialog");
        }
Exemple #12
0
        private void CurrentBills_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            BillsGraphMonth NewBillDialog = new BillsGraphMonth();

            NewBillDialog.Show(transaction, "dialog fragment bills graph month");
        }
Exemple #13
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_main);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.main_drawer);

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            var upNavigationEnabled = GetUpNavigationEnabled();

            var actionBar = SupportActionBar;

            if (upNavigationEnabled == true)
            {
            }
            else
            {
                actionBar.SetDisplayHomeAsUpEnabled(false);
                actionBar.SetHomeButtonEnabled(false);
            }

            MenuFragment detailFragment = new MenuFragment();

            Android.App.FragmentTransaction vv = FragmentManager.BeginTransaction();
            vv.Replace(Resource.Id.menu_content_fragment_holder, detailFragment);
            vv.Commit();
        }
Exemple #14
0
        private void BtnLogin_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            LoginDialog dialogFragment = new LoginDialog();

            dialogFragment.Show(transaction, "Login_Dialog");
        }
Exemple #15
0
 //  Methode om fragments te weergeven
 private void ShowFragment(Android.App.Fragment fragment)
 {
     Android.App.FragmentTransaction fragmentTransaction = FragmentManager.BeginTransaction();
     fragmentTransaction.Replace(Resource.Id.content_main, fragment)
     .AddToBackStack(null)
     .Commit();
 }
        private void InsertTrail(string start, string end, List <Location> path)
        {
            //Handle translating path values
            string coordinates = "";

            foreach (Location coord in path)
            {
                if (coordinates != "")
                {
                    coordinates += ";";
                }

                coordinates += coord.Latitude.ToString();
                coordinates += ",";
                coordinates += coord.Longitude.ToString();
            }

            //Create new dialog for trail submission
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();

            //length = CalcDistance();

            TrailSubmitDialog dialogFragment = new TrailSubmitDialog(distance, startCoord.Latitude.ToString() + "," + startCoord.Longitude.ToString(),
                                                                     endCoord.Latitude.ToString() + "," + endCoord.Longitude.ToString(), coordinates, m_username);

            dialogFragment.Show(transaction, "TrailSubmit_Dialog");
        }
        private void BtnCheckPasswordDialogConfirm_Click(object sender, EventArgs e)
        {
            DataAccess da = new DataAccess();

            if (txtboxCheckPassword.Text != "")
            {
                if (da.Check_Pass(m_userID, txtboxCheckPassword.Text))
                {
                    User user = new User(m_userID, m_username, txtboxCheckPassword.Text, m_email);
                    Toast.MakeText(this.Context, "Password accepted!", ToastLength.Long).Show();

                    Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
                    SettingsDialog dialogFragment = new SettingsDialog(user);

                    dialogFragment.Show(transaction, "Settings_Dialog");
                    Dismiss();
                }
                else
                {
                    Toast.MakeText(this.Context, "Incorrect password!", ToastLength.Long).Show();
                }
            }
            else
            {
                Toast.MakeText(this.Context, "Please enter a password.", ToastLength.Long).Show();
            }
        }
Exemple #18
0
        private void BtnSignUp_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            SignUpDialog dialogFragment = new SignUpDialog();

            dialogFragment.Show(transaction, "SignUp_Dialog");
        }
        private void ImageView_Click(object sender, EventArgs e)
        {
            if (entrega != null)
            {
                if (entrega.Image != null)
                {
                    Bundle bundle = new Bundle();
                    bundle.PutByteArray("imagem", entrega.Image);

                    Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
                    FragmentImageView dialog = new FragmentImageView();
                    dialog.Arguments = bundle;
                    dialog.Show(transaction, "dialog");
                }
            }
            else
            {
                if (bytes != null)
                {
                    Bundle bundle = new Bundle();
                    bundle.PutByteArray("imagem", bytes);

                    Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
                    FragmentImageView dialog = new FragmentImageView();
                    dialog.Arguments = bundle;
                    dialog.Show(transaction, "dialog");
                }
            }
        }
Exemple #20
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            var drawerToggle = new Android.Support.V7.App.ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close);

            drawerLayout.SetDrawerListener(drawerToggle);
            drawerToggle.SyncState();
            navigationView = FindViewById <NavigationView>(Resource.Id.nav_view);
            setupDrawerContent(navigationView);
            //var profile = FindViewById<ImageView>(Resource.Id.imageView1);
            //profile.SetImageResource(Resource.Drawable.person);


            //added newly
            Android.App.FragmentTransaction transaction = this.FragmentManager.BeginTransaction();
            HomeFragment home = new HomeFragment();

            transaction.Replace(Resource.Id.framelayout, home).AddToBackStack(null).Commit();
            //HomeFragment home = new HomeFragment();
            // transaction.Add(Resource.Id.framelayout, home).Commit();
            //SupportActionBar.SetDisplayHomeAsUpEnabled = true;
        }
        void LoadFragment(int id)
        {
            Android.App.Fragment fragment = null;
            switch (id)
            {
            case Resource.Id.homeIcon:
                fragment = HomeFragment.NewInstance("", "");
                break;

            case Resource.Id.appointmentIcon:
                fragment = AppointmentFragment.NewInstance("", "");
                break;

            case Resource.Id.preorderIcon:
                fragment = PreOrderFragment.NewInstance("", "");
                break;

            case Resource.Id.accountIcon:
                fragment = AccountFragment.NewInstance("", "");
                break;
            }

            if (fragment == null)
            {
                return;
            }

            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            transaction.Replace(Resource.Id.frame_container, fragment);
            transaction.AddToBackStack(null);
            transaction.Commit();

            //FragmentManager.BeginTransaction().Replace(Resource.Id.frame_container, fragment).Commit();
        }
        private void BtnSearch_Click(object sender, EventArgs e)
        {
            //Create new dialog for trail search
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            TrailSearchDialog dialogFragment            = new TrailSearchDialog();

            dialogFragment.Show(transaction, "TrailSubmit_Dialog");
        }
        private void LvLikedTrails_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            LikedTrailsDialog dialogFragment            = new LikedTrailsDialog(int.Parse(Users[e.Position].m_id), Users[e.Position].m_username);

            dialogFragment.Show(transaction, "LikedTrails_Dialog");
            Dismiss();
        }
Exemple #24
0
 public EventListAdapter(Context Context, List <EventModel> List, FragmentManager Manager)
 {
     this.manager      = Manager.BeginTransaction();
     this.context      = Context;
     this.events       = List;
     this.Message      = "";
     this.listPosition = new List <int>();
 }
        private void BtnLiked_Click(object sender, EventArgs e)
        {
            //Create new dialog for trail search
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            LikedTrailsDialog dialogFragment            = new LikedTrailsDialog(m_userID);

            dialogFragment.Show(transaction, "LikedTrails_Dialog");
        }
        /// <summary>
        /// Adds log fragment
        /// to activity
        /// </summary>
        private void AddLogFragment()
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            LogFragment fragment = new LogFragment();

            transaction.Replace(Resource.Id.framelog, fragment);
            transaction.Commit();
        }
Exemple #27
0
        private void MBtnSignIn_Click(object sender, EventArgs e)
        {
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            dialog_SignIn signInDialog = new dialog_SignIn();

            signInDialog.Show(transaction, "dialog fragment");
            signInDialog.mOnSignInComplete += SignInDialog_mOnSignInComplete;
        }
Exemple #28
0
        private void ImageButton_Click(object sender, EventArgs e)
        {
            FragmentTransaction    ft             = FragmentManager.BeginTransaction();
            DefectAddImageFragment defectAddImage = DefectAddImageFragment.NewInstance(ref defect);

            ft.Replace(Resource.Id.container1, defectAddImage);
            ft.Commit();
        }
Exemple #29
0
        private void DetailsButton_Click(object sender, EventArgs e)
        {
            FragmentTransaction      ft = FragmentManager.BeginTransaction();
            DefectAddDetailsFragment defectAddDetailsFragment = new DefectAddDetailsFragment();

            ft.Replace(Resource.Id.container1, defectAddDetailsFragment);
            ft.Commit();
        }
        private void BtnAddFriends_Click(object sender, EventArgs e)
        {
            //Create new dialog for user search
            Android.App.FragmentTransaction transaction = FragmentManager.BeginTransaction();
            UserSearchDialog dialogFragment             = new UserSearchDialog(m_userID);

            dialogFragment.Show(transaction, "UserSearch_Dialog");
            Dismiss();
        }
 public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
 {
     if (_pager != null)
     {
         _pager.CurrentItem = tab.Position;
     }
 }
 public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
 {
 }