Esempio n. 1
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);
			SetContentView(Resource.Layout.home_dashboard);

			LocalActivityManager localActMgr = new LocalActivityManager (this, false);
			localActMgr.DispatchCreate (bundle);
			tabHost = FindViewById<TabHost> (Resource.Id.tabhost);
			tabHost.Setup (localActMgr);

			MApplication.getInstance().userDashboardType = (int)Constants.LISTTYPE.ALERTS;
			CreateTab(typeof(AlertActivity), "alerts", GetString(Resource.String.alerts_title), Resource.Drawable.ic_tab_alerts, 0);
			CreateTab(typeof(BookingRequestsActivity), "bookingrequests", GetString(Resource.String.booking_requests_title), Resource.Drawable.ic_tab_bookingrequests, 1);
			CreateTab(typeof(ConfirmedRequestsActivity), "confirmedbookings", GetString(Resource.String.confirmed_booking_title), Resource.Drawable.ic_tab_confirmedbookings, 2);
			CreateTab(typeof(PastBookingActivity), "pastbookings", GetString(Resource.String.past_booking_title), Resource.Drawable.ic_tab_pasthistory, 3);

			getNumBooking = new GetNumberBooking (this);
			getNumBooking.actionGetNumBooking = this;
			getNumBooking.getNumBookingRequest ();

			homeDashBoardActivity = this;
			popupNoticeAlert = new PopupNoticeInfomation (this);
			popupNoticeAlert.noticeDelegate = this;

			popupNoticeRequest = new PopupNoticeInfomation (this);
			popupNoticeRequest.noticeDelegate = this;

			popupNoticeConfirm = new PopupNoticeInfomation (this);
			popupNoticeConfirm.noticeDelegate = this;

			popupNoticePast = new PopupNoticeInfomation (this);
			popupNoticePast.noticeDelegate = this;

			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPostNotifyAlertChange, new TCSelector (reloadDashBoard));
		}
Esempio n. 2
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            //Like the tabs issue, we have to create a local activity manager to enable us to use a mapview outside of mapactivity.
            //credits go to BahaiResearch.com on stackoverflow http://stackoverflow.com/questions/5109336/mapview-in-a-fragment-honeycomb
            localManager = new LocalActivityManager (Activity, true);
            localManager.DispatchCreate (savedInstanceState);
        }
        protected override void OnCreate (Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);

            SetContentView (Resource.Layout.AssignmentsTabsLayout);

            tabHost = FindViewById<TabHost> (Resource.Id.assingmentTabHost);
            //In order to use tabs outside of a TabActivity I have to use this local activity manager and dispatch create the savedInstanceState
            localManger = new LocalActivityManager (this, true);
            localManger.DispatchCreate (savedInstanceState);
            tabHost.Setup (localManger);

            TabHost.TabSpec assignmentsSpec = tabHost.NewTabSpec ("list");
            Intent assignmentIntent = new Intent (this, typeof (AssignmentsActivity));
            assignmentsSpec.SetContent (assignmentIntent);
            assignmentsSpec.SetIndicator ("list");

            TabHost.TabSpec mapViewSpec = tabHost.NewTabSpec ("map");
            Intent mapViewIntent = new Intent (this, typeof (MapViewActivity));
            mapViewSpec.SetContent (mapViewIntent);
            mapViewSpec.SetIndicator ("map");

            tabHost.AddTab (assignmentsSpec);
            tabHost.AddTab (mapViewSpec);

            tabHost.TabChanged += (sender, e) => {
                if (tabHost.CurrentTab == 0) {
                    MapData = null;
                }
            };

            try {
                if (savedInstanceState != null) {
                    if (savedInstanceState.ContainsKey (Constants.CurrentTab)) {
                        var currentTab = savedInstanceState.GetInt (Constants.CurrentTab, 0);
                        tabHost.CurrentTab = currentTab;
                    } else {
                        tabHost.CurrentTab = 0;
                    }
                    if (savedInstanceState.ContainsKey ("mapData")) {
                        MapData = (MapDataWrapper)savedInstanceState.GetSerializable ("mapData");
                    } else {
                        MapData = null;
                    }
                } else {
                    MapData = null;
                    tabHost.CurrentTab = 0;
                }
            } catch (Exception) {
                tabHost.CurrentTab = 0;
            }            
        }
Esempio n. 4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
			RequestWindowFeature (WindowFeatures.ActionBar);
            SetContentView(Resource.Layout.user_dashboard_layout);

			ActionBar.NavigationMode = ActionBarNavigationMode.Standard;
			ActionBar.SetTitle(Resource.String.dash_board_title);
			ActionBar.SetDisplayShowTitleEnabled (false);
			ActionBar.SetDisplayHomeAsUpEnabled(false);
			ActionBar.SetDisplayShowHomeEnabled (true);

			changeStatusPopup = new ChangeStatusPopup (this);
			changeStatusPopup.changeStatusDelegate = this;

			imgIconStatus = FindViewById<ImageView> (Resource.Id.imgIconStatus);
			tvStatus = FindViewById<TextView> (Resource.Id.tvExpertStatus);
			var llStatus = FindViewById<LinearLayout> (Resource.Id.llStatus);
			llStatus.Click += (sender, e) => {
				changeStatusPopup.ShowStatus(MApplication.getInstance().iExpertStatus);
			};

			SetExpertStatus ();

			LocalActivityManager localActMgr = new LocalActivityManager (this, false);
			localActMgr.DispatchCreate (bundle);
			tabHost = FindViewById<TabHost> (Resource.Id.tabhost);
			tabHost.Setup (localActMgr);

			if (MApplication.getInstance ().isConsultant) {
				CreateTab(typeof(HomeDashBoard), "home", GetString(Resource.String.dash_board_title), Resource.Drawable.ic_tab_home, (int)TabHomeSpec.Home);
				CreateTab (typeof(MyProfileActivity), "my_profile", GetString(Resource.String.my_profile_title), Resource.Drawable.ic_tab_my_profile, (int)TabHomeSpec.Status);
				CreateTab (typeof(MyProfileActivity), "my_profile", GetString(Resource.String.my_profile_title), Resource.Drawable.ic_tab_my_profile, (int)TabHomeSpec.MyProfile);
			} else {
				llStatus.Visibility = ViewStates.Gone;
				CreateTab(typeof(HomeDashBoard), "home", GetString(Resource.String.dash_board_title), Resource.Drawable.ic_tab_home, (int)TabHome.Home);
				CreateTab(typeof(SearchResultActivity), "search", GetString(Resource.String.search_tab_title), Resource.Drawable.ic_tab_search, (int)TabHome.Search);
				CreateTab (typeof(ListFavoriteActivity), "list_favorite", GetString(Resource.String.favorites_title), Resource.Drawable.ic_tab_listfavorite, (int)TabHome.ListFavorite);
				CreateTab (typeof(MyProfileActivity), "my_profile", GetString(Resource.String.my_profile_title), Resource.Drawable.ic_tab_my_profile, (int)TabHome.MyProfile);
			}

			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kPushAvailabilityStatus, new TCSelector (OnPushAvailabilityStatus));
        }
Esempio n. 5
0
        public override Android.Views.View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate (Resource.Layout.AddLayout, container, false);

            TabHost tabhost = view.FindViewById<TabHost> (Android.Resource.Id.TabHost);
            LocalActivityManager mLocalActivityManager = new LocalActivityManager(this.Activity, false);
            mLocalActivityManager.DispatchCreate(savedInstanceState);
            tabhost.Setup(mLocalActivityManager);

            TabHost.TabSpec spec;     // Resusable TabSpec for each tab
            Intent intent;            // Reusable Intent for each tab

            // Create an Intent to launch an Activity for the tab (to be reused)
            intent = new Intent(this.Activity, typeof(DomesticActivity));
            intent.AddFlags (ActivityFlags.NewTask);
            intent.AddFlags (ActivityFlags.ForwardResult);

            // Initialize a TabSpec for each tab and add it to the TabHost
            spec = tabhost.NewTabSpec ("domestic");
            spec.SetIndicator ("Domestic", Resources.GetDrawable (Resource.Drawable.Icon));
            spec.SetContent (intent);
            tabhost.AddTab (spec);

            // Do the same for the other tabs
            intent = new Intent(this.Activity, typeof (AbroadActivity));
            intent.AddFlags (ActivityFlags.NewTask);
            intent.AddFlags (ActivityFlags.ForwardResult);

            spec = tabhost.NewTabSpec ("abroad");
            spec.SetIndicator ("Abroad", Resources.GetDrawable (Resource.Drawable.Icon));
            spec.SetContent (intent);
            tabhost.AddTab (spec);

            tabhost.CurrentTab = 0;

            return view;
        }
Esempio n. 6
0
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (view != null)
            {
                ViewGroup parent = (ViewGroup)view.Parent;
                if(parent != null)
                {
                    parent.RemoveView (view);
                }
            }

            try
            {
                if ( layoutId == 0 || layoutId != UI.Resource.Layout.FrgMap)
                {
                    layoutId = UI.Resource.Layout.FrgMap;
                }

                view = inflater.Inflate (layoutId,container,false);

                // if savedInstanceState is not null then the device has been rotated
                // So get out of this sub as quickly as possible
                if (savedInstanceState != null)
                    return view;

                if (view != null)
                {
                    tabHost = view.FindViewById<TabHost> (Resource.Id.historyTabHost);
                    localManger = new LocalActivityManager (Activity, true);
                    localManger.DispatchCreate (savedInstanceState);
                    tabHost.Setup (localManger);

                    var NormalMapIndicator = CreateTab ("Normal",Resource.Drawable.ic_action_map_dark);
                    TabHost.TabSpec NormalMapTab = tabHost.NewTabSpec ("Normal");
                    NormalMapTab.SetIndicator (NormalMapIndicator);
                    NormalMapTab.SetContent (new TabContent (new TextView (tabHost.Context)));

                    var SatelliteMapIndicator = CreateTab (_activity.GetString(Resource.String.MapTypeSatellite),Resource.Drawable.ic_action_map_dark);
                    TabHost.TabSpec SatelliteChartTab = tabHost.NewTabSpec ("Satellite");
                    SatelliteChartTab.SetIndicator (SatelliteMapIndicator);
                    SatelliteChartTab.SetContent (new TabContent(new TextView(tabHost.Context)));

                    var TerrainMapIndicator = CreateTab (_activity.GetString(Resource.String.MapTypeTerrain),Resource.Drawable.ic_action_map_dark);
                    TabHost.TabSpec terrainMapTab = tabHost.NewTabSpec ("Terrain");
                    terrainMapTab.SetIndicator (TerrainMapIndicator);
                    terrainMapTab.SetContent (new TabContent(new TextView(tabHost.Context)));

                    var HybridMapIndicator = CreateTab (_activity.GetString(Resource.String.MapTypeHybrid),Resource.Drawable.ic_action_map_dark);
                    TabHost.TabSpec HybridMapTab = tabHost.NewTabSpec ("Hybrid");
                    HybridMapTab.SetIndicator (HybridMapIndicator);
                    HybridMapTab.SetContent (new TabContent(new TextView(tabHost.Context)));

                    tabHost.AddTab (NormalMapTab);
                    tabHost.AddTab (SatelliteChartTab);
                    tabHost.AddTab (terrainMapTab);
                    tabHost.AddTab (HybridMapTab);


                    tabHost.TabChanged += (sender, e) => {
                        switch (tabHost.CurrentTab) {
                            case 0:
                                // Normal Map has been clicked
                                _map.MapType = GoogleMap.MapTypeNormal;
                                break;

                            case 1:
                                // Satellite has been clicked
                                _map.MapType = GoogleMap.MapTypeSatellite;
                                break;

                            case 2:
                                // Terrain Map has been clicked
                                _map.MapType = GoogleMap.MapTypeTerrain;
                                break;

                            case 3:
                                // Hybrid Map has been clicked
                                _map.MapType = GoogleMap.MapTypeHybrid;
                                break;

                            default:
                                DataAccessLayer.ExceptionWriter.WriteLogFile("ERROR","Error in MainFragment Line 324: Just define the tab, bro");
                                break;
                        }

                    };



                }

            }
            catch(Exception ex)
            {
                DataAccessLayer.ExceptionWriter.WriteLogFile(ex);
            }
            return view;

        }
Esempio n. 7
0
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {

            if (view != null)
            {
                ViewGroup parent = (ViewGroup)view.Parent;
                if(parent != null)
                {
                    parent.RemoveView (view);
                }
            }

            try
            {
                if ( layoutId == 0)
                    layoutId = UI.Resource.Layout.FrgChart;

                view = inflater.Inflate (layoutId,container,false);

                // if savedInstanceState is not null then the device has been rotated
                // So get out of this sub as quickly as possible
                if (savedInstanceState != null)
                    return view;

                if (view != null)
                {
                    tabHost = view.FindViewById<TabHost> (Resource.Id.historyTabHost);
                    localManger = new LocalActivityManager (Activity, true);
                    localManger.DispatchCreate (savedInstanceState);
                    tabHost.Setup (localManger);
                    var columnChartIndicator = CreateTab (_activity.GetString(Resource.String.ColumnChart),Resource.Drawable.ic_action_chart);
                    TabHost.TabSpec columnChartTab = tabHost.NewTabSpec ("ColumnChart");
                    columnChartTab.SetIndicator (columnChartIndicator);
                    columnChartTab.SetContent (new TabContent (new TextView (tabHost.Context)));

                    var lineChartIndicator = CreateTab (_activity.GetString(Resource.String.LineChart),Resource.Drawable.ic_action_chart);
                    TabHost.TabSpec lineChartTab = tabHost.NewTabSpec ("LineChart");
                    lineChartTab.SetIndicator (lineChartIndicator);
                    lineChartTab.SetContent (new TabContent(new TextView(tabHost.Context)));

                    tabHost.AddTab (columnChartTab);
                    tabHost.AddTab (lineChartTab);

                    tabHost.TabChanged += (sender, e) => {
                        switch (tabHost.CurrentTab) {
                            case 0:
                                // ColumnChart has been clicked
                                _stateFragment.RunColumnChart ();

                                break;
                            case 1:
                                // LineChart has been clicked
                                _stateFragment.RunLineChart ();

                                break;
                            default:
                                DataAccessLayer.ExceptionWriter.WriteLogFile("ERROR","Error in MainFragment Line 324: Just define the tab, bro");
                                break;
                        }

                    };



                }

            }
            catch(Exception ex)
            {
                DataAccessLayer.ExceptionWriter.WriteLogFile(ex);
            }
            return view;

        }
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView (inflater, container, savedInstanceState);

            historyViewModel = ServiceContainer.Resolve<HistoryViewModel> ();
            menuViewModel = ServiceContainer.Resolve<MenuViewModel> ();

            var view = inflater.Inflate (Resource.Layout.HistoryFragmentLayout, null, true);

            searchText = view.FindViewById<EditText> (Resource.Id.historySearchText);
            searchText.TextChanged += (sender, e) => {
                if (historySearchAdapter != null) {
                    historySearchAdapter.FilterItems (searchText.Text);
                    historySearchAdapter.NotifyDataSetChanged ();
                }
            };
            var clearSearch = view.FindViewById<ImageButton> (Resource.Id.historyClearSearch);
            clearSearch.Click += (sender, e) => searchText.Text = string.Empty;

            tabHost = view.FindViewById<TabHost> (Resource.Id.historyTabHost);
            historyListView = view.FindViewById<ListView> (Resource.Id.historyListView);

            localManger = new LocalActivityManager (Activity, true);
            localManger.DispatchCreate (savedInstanceState);
            tabHost.Setup (localManger);

            var dateIndicator = CreateTab ("DATE");
            TabHost.TabSpec dateTab = tabHost.NewTabSpec ("Date");
            dateTab.SetIndicator (dateIndicator);
            dateTab.SetContent (new TabContent (new TextView (tabHost.Context)));

            var callsIndicator = CreateTab ("CALLS");
            TabHost.TabSpec callsTab = tabHost.NewTabSpec ("Calls");
            callsTab.SetIndicator (callsIndicator);
            callsTab.SetContent (new TabContent(new TextView(tabHost.Context)));

            var assignmentIndicator = CreateTab ("ASSIGNMENTS");
            TabHost.TabSpec assignments = tabHost.NewTabSpec ("Assignments");
            assignments.SetIndicator (assignmentIndicator);
            assignments.SetContent (new TabContent (new TextView(tabHost.Context)));

            tabHost.AddTab (dateTab);
            tabHost.AddTab (callsTab);
            tabHost.AddTab (assignments);

            tabHost.TabChanged += (sender, e) => {
                if (History != null) {
                    switch (tabHost.CurrentTab) {
                        case 0:
                            historySearchAdapter = new HistoryListAdapter (Activity, Resource.Layout.HistoryItemLayout, History.OrderBy (h => h.Date).ToList ());
                            break;
                        case 1:
                            historySearchAdapter = new HistoryListAdapter (Activity, Resource.Layout.HistoryItemLayout, History.Where (h => h.Type == AssignmentHistoryType.PhoneCall).ToList ());
                            break;
                        default:
                            historySearchAdapter = new HistoryListAdapter (Activity, Resource.Layout.HistoryItemLayout, History.Where (h => h.Type == AssignmentHistoryType.Assignment).ToList ());
                            break;
                    }
                    historySearchAdapter.Assignment = Assignment;
                    historyListView.Adapter = historySearchAdapter; 
                }
            };
            if (History != null) {
                historySearchAdapter = new HistoryListAdapter (Activity, Resource.Layout.HistoryItemLayout, History.OrderBy (a => a.Date).ToList ());
                historySearchAdapter.Assignment = Assignment;
                historyListView.Adapter = historySearchAdapter;
            }

            historyListView.ItemClick += (sender, e) => {
                var intent = new Intent (Activity, typeof (SummaryHistoryActivity));
                historyViewModel.SelectedAssignmentHistory = History.ElementAtOrDefault (e.Position);
                menuViewModel.MenuIndex = 0;
                StartActivity (intent);
            };

            return view;
        }