protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.RequestQuotation); SetTitleBack(); textBuyPolice = FindViewById <TextView>(Resource.Id.textBuyPolice); textBenefits = FindViewById <TextView>(Resource.Id.textBenefits); textQuarterlyPolicy = FindViewById <TextView>(Resource.Id.textQuarterlyPolicy); textDiscounts = FindViewById <TextView>(Resource.Id.textDiscounts); textBonuses = FindViewById <TextView>(Resource.Id.textBonuses); textSettlement = FindViewById <TextView>(Resource.Id.textSettlement); textHelp = FindViewById <TextView>(Resource.Id.textHelp); editSurname = FindViewById <TextInputLayout>(Resource.Id.editSurname); editName = FindViewById <TextInputLayout>(Resource.Id.editName); editMark = FindViewById <TextInputLayout>(Resource.Id.editMark); editModel = FindViewById <TextInputLayout>(Resource.Id.editModel); editYear = FindViewById <TextInputLayout>(Resource.Id.editYear); editRegistrationNumber = FindViewById <TextInputLayout>(Resource.Id.editRegistrationNumber); buttonSendRequest = FindViewById <Button>(Resource.Id.buttonSendRequest); menuFragment = new MenuFragment(); var partialMenuSetup = SupportFragmentManager.BeginTransaction(); partialMenuSetup.Add(Resource.Id.fragmentMenu, menuFragment, "MenuFragment"); partialMenuSetup.Commit(); InitControls(); }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView(Resource.Layout.action_bar_fragment_menu); // Make sure the two menu fragments are created. var fm = SupportFragmentManager; var ft = fm.BeginTransaction(); mFragment1 = (MenuFragment)fm.FindFragmentByTag("f1"); if (mFragment1 == null) { mFragment1 = new MenuFragment(); ft.Add(mFragment1, "f1"); } mFragment2 = (Menu2Fragment)fm.FindFragmentByTag("f2"); if (mFragment2 == null) { mFragment2 = new Menu2Fragment(); ft.Add(mFragment2, "f2"); } ft.Commit(); // Watch check box clicks. mCheckBox1 = (CheckBox)FindViewById(Resource.Id.menu1); mCheckBox1.Click += OnClickListener_OnClick; mCheckBox2 = (CheckBox)FindViewById(Resource.Id.menu2); mCheckBox2.Click += OnClickListener_OnClick; mCheckBox3 = (CheckBox)FindViewById(Resource.Id.menu3); mCheckBox3.Click += OnClickListener_OnClick; mHasOptionsMenu = (CheckBox)FindViewById(Resource.Id.has_options_menu); mHasOptionsMenu.Click += OnClickListener_OnClick; mMenuVisibility = (CheckBox)FindViewById(Resource.Id.menu_visibility); mMenuVisibility.Click += OnClickListener_OnClick; // Make sure fragments start out with correct visibility. UpdateFragmentVisibility(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.AppInfo); SetTitleBack(); textBuyPolice = FindViewById <TextView>(Resource.Id.textBuyPolice); textBasicConditions = FindViewById <TextView>(Resource.Id.textBasicConditions); textSeeYourRating = FindViewById <TextView>(Resource.Id.textSeeYourRating); textLessCost = FindViewById <TextView>(Resource.Id.textLessCost); textGetBonuses = FindViewById <TextView>(Resource.Id.textGetBonuses); textDeclareInsuranceEvent = FindViewById <TextView>(Resource.Id.textDeclareInsuranceEvent); textFindCar = FindViewById <TextView>(Resource.Id.textFindCar); textDownloadAppTitle = FindViewById <TextView>(Resource.Id.textDownloadAppTitle); buttonDownload = FindViewById <Button>(Resource.Id.buttonDownload); menuFragment = new MenuFragment(); var partialMenuSetup = SupportFragmentManager.BeginTransaction(); partialMenuSetup.Add(Resource.Id.fragmentMenu, menuFragment, "MenuFragment"); partialMenuSetup.Commit(); InitControls(); }
private void LoadFragment(int id) { Fragment fragment = null; switch (id) { case Resource.Id.menu_home: fragment = HomeFragment.NewInstance(); break; case Resource.Id.menu_library: fragment = LibraryFragment.NewInstance(); break; case Resource.Id.menu_search: fragment = SearchFragment.NewInstance(); break; case Resource.Id.menu_menu: fragment = MenuFragment.NewInstance(); break; } if (fragment == null) { return; } FragmentManager.BeginTransaction().Replace(Resource.Id.content_frame, fragment).Commit(); }
private void SetupContainerFragments() { taskFrame = FindViewById <FrameLayout>(Resource.Id.content_frame_task); chatFrame = FindViewById <FrameLayout>(Resource.Id.content_frame_chat); menuFrame = FindViewById <FrameLayout>(Resource.Id.content_frame_menu); //task var fragmentTxHome = SupportFragmentManager.BeginTransaction(); TaskFragment = TaskFragment.NewInstance(); TaskFragment.DataContext = ViewModel.TaskViewModel; fragmentTxHome.Replace(Resource.Id.content_frame_task, TaskFragment); fragmentTxHome.Commit(); //chat var fragmentTxChat = SupportFragmentManager.BeginTransaction(); ChatFragment = ChatHistoryFragment.NewInstance(); ChatFragment.DataContext = ViewModel.ChatViewModel; fragmentTxChat.Replace(Resource.Id.content_frame_chat, ChatFragment); fragmentTxChat.Commit(); //menu var fragmentTxMenu = SupportFragmentManager.BeginTransaction(); MenuFragment = MenuFragment.NewInstance(); MenuFragment.DataContext = ViewModel.MenuViewModel; fragmentTxMenu.Replace(Resource.Id.content_frame_menu, MenuFragment); fragmentTxMenu.Commit(); }
protected override void OnCreate(Bundle bundle) { //SetTheme(Resource.Style.Theme_Custom); base.OnCreate(bundle); //#if DEBUG // var vmPolicy = new StrictMode.VmPolicy.Builder(); // StrictMode.SetVmPolicy(vmPolicy.DetectActivityLeaks().PenaltyLog().Build()); //#endif try { _needWeatherUpdate = true; if (bundle == null) { Log.Debug("OnCreate"); } //SetTitle(Resource.String.WeatherTitle); SetContentView(Resource.Layout.activity_main); _menu = FindViewById(Resource.Id.tlbMenu); _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.viewDrawerLayout); _progressBar = FindViewById <ProgressBar>(Resource.Id.spLoading); _txtLocation = FindViewById <TextView>(Resource.Id.txtLocation); _txtLocation?.SetOnClickListener(new ClickListener(view => { if (_tooltipWindow != null && !_tooltipWindow.IsDisposed && !_tooltipWindow.IsTooltipShown && (_tooltipWindow.TooltipText?.Length > 0 || _tooltipWindow.TooltipTextFormatted?.Length() > 0)) { _tooltipWindow.ShowToolTip(view); } })); CheckActionAppwidGetConfigure(Intent); _imgAlert = FindViewById <ImageView>(Resource.Id.imgAlert); SetAlertInvisible(); _menuFragment = CreateMenuFragment(); _contentFragment = CreateContentFragment(); using (var ft = FragmentManager.BeginTransaction()) { ft.Replace(Resource.Id.viewMenu, _menuFragment); ft.Replace(Resource.Id.viewContent, _contentFragment); ft.Commit(); } _cancellationTokenSource = new CancellationTokenSource(); } catch (Exception ex) { Log.Error(ex); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Main); scrollMainContainer = FindViewById <ScrollView>(Resource.Id.scrollMainContainer); layoutSelectedParkingData = FindViewById <LinearLayout>(Resource.Id.layoutSelectedParkingData); textCurrentLocationAddress = FindViewById <TextView>(Resource.Id.textCurrentLocationAddress); textParkingStartDescription = FindViewById <TextView>(Resource.Id.textParkingStartDescription); textParkingStartTimeNumber = FindViewById <TextView>(Resource.Id.textParkingStartTimeNumber); textParkingStartTimeType = FindViewById <TextView>(Resource.Id.textParkingStartTimeType); textParkingWorkTimeDescription = FindViewById <TextView>(Resource.Id.textParkingWorkTimeDescription); textParkingWeekendDescription = FindViewById <TextView>(Resource.Id.textParkingWeekendDescription); textSum = FindViewById <TextView>(Resource.Id.textSum); textBalanceTitle = FindViewById <TextView>(Resource.Id.textBalanceTitle); buttonReplenish = FindViewById <Button>(Resource.Id.buttonReplenish); textStatusTitle = FindViewById <TextView>(Resource.Id.textStatusTitle); layoutPlanParking = FindViewById <RelativeLayout>(Resource.Id.layoutPlanParking); textStatus = FindViewById <TextView>(Resource.Id.textStatus); layoutParkingStartPlanning = FindViewById <RelativeLayout>(Resource.Id.layoutParkingStartPlanning); buttonPlanSession = FindViewById <Button>(Resource.Id.buttonPlanSession); textWaitParkingSessionTitle = FindViewById <TextView>(Resource.Id.textWaitParkingSessionTitle); layoutParkingNumber = FindViewById <RelativeLayout>(Resource.Id.layoutParkingNumber); textParkingNumberTitle = FindViewById <TextView>(Resource.Id.textParkingNumberTitle); textParkingNumber = FindViewById <TextView>(Resource.Id.textParkingNumber); layoutSessionStartTime = FindViewById <RelativeLayout>(Resource.Id.layoutSessionStartTime); textSessionStartTimeTitle = FindViewById <TextView>(Resource.Id.textSessionStartTimeTitle); textSessionStartTime = FindViewById <TextView>(Resource.Id.textSessionStartTime); layoutSessionUsedTime = FindViewById <RelativeLayout>(Resource.Id.layoutSessionUsedTime); textSessionUsedTimeTitle = FindViewById <TextView>(Resource.Id.textSessionUsedTimeTitle); textSessionUsedTime = FindViewById <TextView>(Resource.Id.textSessionUsedTime); layoutFirstHourCost = FindViewById <RelativeLayout>(Resource.Id.layoutFirstHourCost); textFirstHourCost = FindViewById <TextView>(Resource.Id.textFirstHourCost); layoutHourCost = FindViewById <RelativeLayout>(Resource.Id.layoutHourCost); textHourCost = FindViewById <TextView>(Resource.Id.textHourCost); layoutButtonsContainer = FindViewById <RelativeLayout>(Resource.Id.layoutButtonsContainer); buttonChangeZone = FindViewById <Button>(Resource.Id.buttonChangeZone); buttonCancelSession = FindViewById <Button>(Resource.Id.buttonCancelSession); textAutoParkingTitle = FindViewById <TextView>(Resource.Id.textAutoParkingTitle); switchAutoParking = FindViewById <Switch>(Resource.Id.switchAutoParking); textAutoParkingDescription = FindViewById <TextView>(Resource.Id.textAutoParkingDescription); layoutSessionEndTime = FindViewById <RelativeLayout>(Resource.Id.layoutSessionEndTime); textSessionEndTimeTitle = FindViewById <TextView>(Resource.Id.textSessionEndTimeTitle); textSessionEndTime = FindViewById <TextView>(Resource.Id.textSessionEndTime); menuFragment = new MenuFragment(); var partialMenuSetup = SupportFragmentManager.BeginTransaction(); partialMenuSetup.Add(Resource.Id.fragmentMenu, menuFragment, "MenuFragment"); partialMenuSetup.Commit(); InitControls(); }
private MenuFragment CreateMenuFragment() { var fragment = new MenuFragment { OptionMenuClickHandler = OnOptionMenuClick, }; //var args = new Bundle(); //args.PutBoolean(MenuFragment.ExistsAppWidgetArgName, _widgetId.HasValue); //fragment.Arguments = args; return(fragment); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.PlanSession); SetTitleBack(); mapView = FindViewById <MapView>(Resource.Id.map); mapView.OnCreate(savedInstanceState); mapCurrentLocation = FindViewById <LinearLayout>(Resource.Id.mapCurrentLocation); mapCurrentLocationImg = FindViewById <ImageView>(Resource.Id.mapCurrentLocationImg); mapLocationMarker = FindViewById <ImageView>(Resource.Id.mapLocationMarker); layoutSelectedParkingData = FindViewById <LinearLayout>(Resource.Id.layoutSelectedParkingData); textParkingZoneNumber = FindViewById <TextView>(Resource.Id.textParkingZoneNumber); textCurrentLocationAddress = FindViewById <TextView>(Resource.Id.textCurrentLocationAddress); textParkingStartDescription = FindViewById <TextView>(Resource.Id.textParkingStartDescription); textParkingStartTimeNumber = FindViewById <TextView>(Resource.Id.textParkingStartTimeNumber); textParkingStartTimeType = FindViewById <TextView>(Resource.Id.textParkingStartTimeType); textParkingWorkTimeDescription = FindViewById <TextView>(Resource.Id.textParkingWorkTimeDescription); textParkingWeekendDescription = FindViewById <TextView>(Resource.Id.textParkingWeekendDescription); buttonPlanSession = FindViewById <Button>(Resource.Id.buttonPlanSession); textCurrentLocationTitle = FindViewById <TextView>(Resource.Id.textCurrentLocationTitle); textCurrentUserAddress = FindViewById <TextView>(Resource.Id.textCurrentUserAddress); layoutSessionStartTime = FindViewById <RelativeLayout>(Resource.Id.layoutSessionStartTime); textStartSessionTitle = FindViewById <TextView>(Resource.Id.textStartSessionTitle); textMinusTime = FindViewById <TextView>(Resource.Id.textMinusTime); textPlusTime = FindViewById <TextView>(Resource.Id.textPlusTime); textTimeHoursTen = FindViewById <TextView>(Resource.Id.textTimeHoursTen); textTimeHours = FindViewById <TextView>(Resource.Id.textTimeHours); textTimeMinutesTen = FindViewById <TextView>(Resource.Id.textTimeMinutesTen); textTimeMinutes = FindViewById <TextView>(Resource.Id.textTimeMinutes); textButtonStart = FindViewById <TextView>(Resource.Id.textButtonStart); textButtonCancel = FindViewById <TextView>(Resource.Id.textButtonCancel); menuFragment = new MenuFragment(); var partialMenuSetup = SupportFragmentManager.BeginTransaction(); partialMenuSetup.Add(Resource.Id.fragmentMenu, menuFragment, "MenuFragment"); partialMenuSetup.Commit(); InitControls(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //this.Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen); //this.Window.RequestFeature(WindowFeatures.NoTitle); Current = this; this.SetContentView(); this._menuFrag = new MenuFragment(); var fm = this.SupportFragmentManager; var trans = fm.BeginTransaction(); trans.Replace(this._menuFrameLayoutId, this._menuFrag, "Test"); //trans.AddToBackStack("Test"); trans.Commit(); }
protected override void OnDestroy() { try { UnsubscribeEvents(); if (_cancellationTokenSource != null) { _cancellationTokenSource.Cancel(); _cancellationTokenSource.Dispose(); _cancellationTokenSource = null; } _selectedWidgetId = null; _widgetId = null; _serviceConnection?.Dispose(); _serviceConnection = null; _serviceReceiver?.Dispose(); _serviceReceiver = null; if (_menuFragment != null) { _menuFragment.OptionMenuClickHandler = null; } _menuFragment?.Dispose(); _menuFragment = null; _contentFragment?.Dispose(); _contentFragment = null; TooltipWindowDispose(); } catch (Exception ex) { Log.Debug(ex); } AppSettings.GcCollect(); //HARDCODE: base.OnDestroy(); AppSettings.GcCollect(true, Log); //HARDCODE: }
public override void SetContentView(int layoutResId) { base.SetContentView(layoutResId); LegacyBar = FindViewById <LegacyBar.Library.Bar.LegacyBar>(Resource.Id.ActionBar); if (LegacyBar != null) { LegacyBar.Title = Title; LegacyBar.Theme = LegacyBarTheme.HoloBlack; LegacyBar.SetHomeAction(new ActionLegacyBarAction(this, () => _slidingMenu.Toggle(true), Resource.Drawable.Menu)); if (RefreshCommand != null) { LegacyBar.AddAction(new ActionLegacyBarAction(this, () => RefreshCommand.Execute(null), Resource.Drawable.Refresh)); } _slidingMenu = new SlidingMenu(this) { Mode = MenuMode.Left, TouchModeAbove = DisableMenuSwipe ? TouchMode.None : TouchMode.Fullscreen, BehindOffset = 50, BehindWidth = 400, ShadowWidth = 20, ShadowDrawableRes = Resource.Drawable.SlidingMenuShadow, SecondaryShadowDrawableRes = Resource.Drawable.SlidingMenuShadowRight }; _slidingMenu.SetBackgroundColor(Color.Black); _slidingMenu.AttachToActivity(this, SlideStyle.Content); _slidingMenu.SetMenu(Resource.Layout.MenuFrame); var menuFragment = new MenuFragment(); menuFragment.ViewModel = new MenuViewModel(((ViewModelBase)ViewModel).Messenger); SupportFragmentManager.BeginTransaction() .Replace(Resource.Id.MenuFrame, menuFragment).Commit(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Screen2); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Home"); tab.TabSelected += (sender, args) => { Fragment frag1 = new PrincipalFragment(); var t = this.FragmentManager.BeginTransaction(); t.Replace(Resource.Id.frmFragment1, frag1); t.Commit(); Fragment frag = new MenuFragment(); this.FragmentManager.BeginTransaction().Replace(Resource.Id.frmFragment, frag).Commit(); }; ActionBar.AddTab(tab); ActionBar.Tab tab2 = ActionBar.NewTab(); tab2.SetText("Configuraciones"); tab2.TabSelected += (sender, args) => { Fragment frag1 = new MenuFragment(); this.FragmentManager.BeginTransaction().Replace(Resource.Id.frmFragment1, frag1).Commit(); Fragment frag = new PrincipalFragment(); var t = this.FragmentManager.BeginTransaction(); t.Replace(Resource.Id.frmFragment, frag); t.Commit(); }; ActionBar.AddTab(tab2); //AddTab("Favorites",new MenuFragment()); }
private void AddTab(string tabText, Fragment view) { var tab = this.ActionBar.NewTab(); tab.SetText(tabText); tab.TabSelected += delegate(object sender, ActionBar.TabEventArgs e) { var myf = new MenuFragment(); Fragment frag = new MenuFragment(); this.FragmentManager.BeginTransaction().Replace(Resource.Id.frmFragment, frag); }; tab.TabUnselected += delegate(object sender, ActionBar.TabEventArgs e) { }; this.ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.action_bar_fragment_menu); // Make sure the two menu fragments are created. var fm = SupportFragmentManager; var ft = fm.BeginTransaction(); mFragment1 = (MenuFragment)fm.FindFragmentByTag("f1"); if (mFragment1 == null) { mFragment1 = new MenuFragment(); ft.Add(mFragment1, "f1"); } mFragment2 = (Menu2Fragment)fm.FindFragmentByTag("f2"); if (mFragment2 == null) { mFragment2 = new Menu2Fragment(); ft.Add(mFragment2, "f2"); } ft.Commit(); // Watch check box clicks. mCheckBox1 = (CheckBox)FindViewById(Resource.Id.menu1); mCheckBox1.Click += OnClickListener_OnClick; mCheckBox2 = (CheckBox)FindViewById(Resource.Id.menu2); mCheckBox2.Click += OnClickListener_OnClick; mCheckBox3 = (CheckBox)FindViewById(Resource.Id.menu3); mCheckBox3.Click += OnClickListener_OnClick; mHasOptionsMenu = (CheckBox)FindViewById(Resource.Id.has_options_menu); mHasOptionsMenu.Click += OnClickListener_OnClick; mMenuVisibility = (CheckBox)FindViewById(Resource.Id.menu_visibility); mMenuVisibility.Click += OnClickListener_OnClick; // Make sure fragments start out with correct visibility. UpdateFragmentVisibility(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.AutoParking); SetTitleBack(); buttonOrderInstallation = FindViewById <Button>(Resource.Id.buttonOrderInstallation); buttonGetFree = FindViewById <Button>(Resource.Id.buttonGetFree); textAutoParkingTitle = FindViewById <TextView>(Resource.Id.textAutoParkingTitle); textAutoParkingCost = FindViewById <TextView>(Resource.Id.textAutoParkingCost); textAutoParkingDescription = FindViewById <TextView>(Resource.Id.textAutoParkingDescription); menuFragment = new MenuFragment(); var partialMenuSetup = SupportFragmentManager.BeginTransaction(); partialMenuSetup.Add(Resource.Id.fragmentMenu, menuFragment, "MenuFragment"); partialMenuSetup.Commit(); InitControls(); }
void SetupViewBindings() { menuFragment = new MenuFragment(); menuFragment.MenuItemClick = MenuItemClick; var tx = FragmentManager.BeginTransaction(); tx.Add(Resource.Id.flMenuContainer, menuFragment); tx.Commit(); MenuItemClick("Home"); var user = CrossSettings.Current.GetValueOrDefaultJson <User>("User"); CrossPushNotifications.Current.Register(new string[] { user.Id }); ShowHelpIfNecessary(TutorialHelper.Welcome, () => { ShowHelpIfNecessary(TutorialHelper.FindFavorites); }); dlDrawer.DrawerOpened += (sender, e) => { ShowHelpIfNecessary(TutorialHelper.Menu); }; }
public void UpdateNavigatiomView() => MenuFragment.UpdateNavigatiomView();