//define action for navigation menu selection void NavigationView_NavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs e) { switch (e.MenuItem.ItemId) { case (Resource.Id.nav_home): SupportActionBar.SetTitle(Resource.String.product_name); Toast.MakeText(this, "Home selected!", ToastLength.Short).Show(); ShowFragment(productsFragment); break; case (Resource.Id.nav_messages): SupportActionBar.SetTitle(Resource.String.cart_name); Toast.MakeText(this, "Cart Selected!", ToastLength.Short).Show(); ShowFragment(cartFragment); break; case (Resource.Id.nav_friends): // React on 'Friends' selection SupportActionBar.SetTitle(Resource.String.corrida_name); ShowFragment(corridaFinancieraFragment); break; } // Close drawer drawerLayout.CloseDrawers(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.frequently_asked_quest); mToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolBar); mWebViewer = FindViewById <Android.Webkit.WebView>(Resource.Id.webView); mProgressbar = FindViewById <ProgressBar>(Resource.Id.progressBar); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetTitle(Resource.String.menu_faq); // Makes Progress bar Visible var webclient = new MyClient(this); mWebViewer.SetWebViewClient(webclient); mWebViewer.ClearCache(true); mWebViewer.NestedScrollingEnabled = false; //mWebViewer. mWebViewer.Settings.JavaScriptEnabled = true; mWebViewer.LoadUrl("https://safari-shoppers.firebaseapp.com/faq.html"); }
protected override void OnCreate(Bundle savedInstanceState) { //Status Bar Color this.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds); Console.WriteLine("Status Bar Color! "); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); // Init toolbar var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.app_bar); SetSupportActionBar(toolbar); SupportActionBar.SetTitle(Resource.String.product_name); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); // Attach item selected handler to navigation view var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected; // Create ActionBarDrawerToggle button and add it to the toolbar var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.open_drawer, Resource.String.close_drawer); //Linea corregida de Set a Add porque era obsoleta drawerLayout.AddDrawerListener(drawerToggle); drawerToggle.SyncState(); homeFragment = new HomeFragment(); writeFragment = new WriteFragment(); productsFragment = new ProductsFragment(); cartFragment = new CartFragment(); corridaFinancieraFragment = new CorridaFinancieraFragment(); mStackFragment = new Stack <Fragment>(); //load default home screen //var ft = FragmentManager.BeginTransaction(); //ft.AddToBackStack(null); //ft.Add(Resource.Id.HomeFrameLayout, new HomeFragment()); //ft.Commit(); var trans = FragmentManager.BeginTransaction(); //trans.AddToBackStack(null); trans.Add(Resource.Id.HomeFrameLayout, cartFragment, "Carrito Compras"); trans.Hide(cartFragment); trans.Add(Resource.Id.HomeFrameLayout, corridaFinancieraFragment, "Corrida Financiera"); trans.Hide(corridaFinancieraFragment); trans.Add(Resource.Id.HomeFrameLayout, homeFragment, "Home"); trans.Hide(homeFragment); trans.Add(Resource.Id.HomeFrameLayout, writeFragment, "pesan"); trans.Hide(writeFragment); trans.Add(Resource.Id.HomeFrameLayout, productsFragment, "Productos"); trans.Commit(); mCurrentFragment = productsFragment; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.main); SupportToolbar toolbar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolbar); SupportActionBar ab = SupportActionBar; ab.SetHomeAsUpIndicator(Resource.Drawable.ic_menu); ab.SetDisplayHomeAsUpEnabled(true); _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerLayout); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); if (navigationView != null) { SetUpDrawerContent(navigationView); } TabLayout tabs = FindViewById <TabLayout>(Resource.Id.tabs); ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager); SetUpViewPager(viewPager); tabs.SetupWithViewPager(viewPager); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = inflater.Inflate(Resource.Layout.booking_new, null); miCounts = new Dictionary <MenuItem, int>(); newBooking = new Booking(); newPayment = new Payment(); newBooking.CustomerId = GenericFacade.UserId; newPayment.CustomerId = GenericFacade.UserId; Android.Support.V7.Widget.Toolbar toolbar = view.FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar_new_booking); toolbar.SetTitle(Resource.String.bookingNewDialogTitle); ((AppCompatActivity)Activity).SetSupportActionBar(toolbar); Android.Support.V7.App.ActionBar actionBar = ((AppCompatActivity)Activity).SupportActionBar; if (actionBar != null) { actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.SetHomeButtonEnabled(true); actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_clear_white); } Setup(); return(view); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); Android.Support.V7.App.ActionBar actionbar = SupportActionBar; actionbar.SetDisplayHomeAsUpEnabled(true); Drawable drawable = Resources.GetDrawable(Resource.Drawable.hamburger_icon); Bitmap bitmap = ((BitmapDrawable)drawable).Bitmap; Drawable newdrawable = new BitmapDrawable(Resources, Bitmap.CreateScaledBitmap(bitmap, 60, 60, true)); actionbar.SetHomeAsUpIndicator(newdrawable); actionbar.Title = "Dashboard"; drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); fragmentHolder = FindViewById <FrameLayout>(Resource.Id.frag_holder); navigationView.NavigationItemSelected += (sender, e) => { e.MenuItem.SetChecked(true); //react to click here and swap fragments or navigate drawerLayout.CloseDrawers(); }; setFragment(new Dashboard.DashboardFragment()); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.MainLayout); SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolBar); SupportActionBar actionBar = SupportActionBar; var fragmentTransaction = SupportFragmentManager.BeginTransaction(); fragmentTransaction.Add(Resource.Id.fragmentContainer, new UserListFragment()); fragmentTransaction.Commit(); fab = FindViewById <FloatingActionButton>(Resource.Id.fab); fab.Click += (sender, e) => { //SupportFragment myFragment = SupportFragmentManager.FindFragmentByTag("SingleUser"); if (AppData.singleUserPosition != -1) // Is -1 if on ListUserFragment { DeleteUser(); } else { var fragmentTransactionFab = SupportFragmentManager.BeginTransaction(); fragmentTransactionFab.Replace(Resource.Id.fragmentContainer, new CreateNewUserFragment()); fragmentTransactionFab.AddToBackStack(null); fragmentTransactionFab.Commit(); } }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); trailId = Intent.GetStringExtra("Trail ID"); stopId = Intent.GetStringExtra("Stop ID"); SetContentView(Resource.Layout.DetailStop); SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolBar); SupportActionBar ab = SupportActionBar; ab.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_small); ab.SetDisplayHomeAsUpEnabled(true); _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); if (navigationView != null) { SetUpDrawerContent(navigationView); } TabLayout tabs = FindViewById <TabLayout>(Resource.Id.tabs); ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager); SetUpViewPager(viewPager); tabs.SetupWithViewPager(viewPager); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.main_activity); SetFullscreen(); view = FindViewById(Resource.Id.main_parent_view); // 액션바 toolbar = FindViewById <Toolbar>(Resource.Id.main_toolbar); SetSupportActionBar(toolbar); actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_white); actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.Title = Resources.GetString(Resource.String.ApplicationName); actionBar.Show(); TabLayoutViewPager(); NaviView(); //var position = tabLayout.SelectedTabPosition; //viewPager.SetCurrentItem(0, true); actionBar.SetBackgroundDrawable(new ColorDrawable(Resources.GetColor(Resource.Color.tab1_actionbar_background))); tabLayout.Background = new ColorDrawable(Resources.GetColor(Resource.Color.tab1_tablayout_background)); tabLayout.SetSelectedTabIndicatorColor(Resources.GetColor(Resource.Color.tab1_tabindicator_background)); }
public TabLayoutOnTabSelectedListener(Context context, ViewPager viewPager, ActionBar actionBar, TabLayout tabLayout) { this.context = context; this.viewPager = viewPager; this.actionBar = actionBar; this.tabLayout = tabLayout; }
void ConnectControl() { //Image View //centerMarker = (ImageView)FindViewById(Resource.Id.centerMarker); rootView = (CoordinatorLayout)FindViewById(Resource.Id.rootView); drawerLayout = (Android.Support.V4.Widget.DrawerLayout)FindViewById(Resource.Id.drawerLayout); mainToolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.mainToolbar); //TextView PickUpLocationText = (TextView)FindViewById(Resource.Id.pickUpLocationText); DestinationLocationText = (TextView)FindViewById(Resource.Id.destinationLocationText); //Radio buttons PickUpRadio = (RadioButton)FindViewById(Resource.Id.pickUpRadio); DestinationRadio = (RadioButton)FindViewById(Resource.Id.destinationRadio); PickUpRadio.Click += PickUpRadio_Click; DestinationRadio.Click += DestinationRadio_Click; //Layouts layoutPickUp = (RelativeLayout)FindViewById(Resource.Id.layoutPickUp); layoutDestination = (RelativeLayout)FindViewById(Resource.Id.layoutDestination); //attache events layoutPickUp.Click += layoutPickUp_Click; layoutDestination.Click += layoutDestination_Click; SetSupportActionBar(mainToolbar); SupportActionBar.Title = ""; Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Mipmap.ic_menu_action); actionBar.SetDisplayHomeAsUpEnabled(true); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Holder); SupportToolbar toolbar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolbar); TabLayout tabs = FindViewById <TabLayout>(Resource.Id.tabs); ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager); SetUpViewPager(viewPager); tabs.SetupWithViewPager(viewPager); Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.Hide(); if (!IsMyServiceRunning(typeof(CheckService))) { StartService(new Android.Content.Intent(this, typeof(CheckService))); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.drawer_main); // Toolbar Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); // Drawer Layout drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.navigation_drawer_open, Resource.String.navigation_drawer_close); drawerLayout.AddDrawerListener(toggle); toggle.SyncState(); // Navigation View NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.SetNavigationItemSelectedListener(this); // Action Bar ActionBar actionBar = SupportActionBar; actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_manage); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.AddEdit); string mLoadView = Intent.Extras.Get("LoadView").ToString(); SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolBar); SupportActionBar ab = SupportActionBar; ab.SetDisplayShowTitleEnabled(false); //Get Fragment Title Holder mFragTitle = FindViewById <TextView>(Resource.Id.textFragmentTitle); //Get Fragment Holder mFrameLayout = Resource.Id.fragmentContainer; //instantiate fragments mAddBudgetFragment = new AddBudgetFragment(); mAddBudgetItemFrag = new AddBudgetItemFragment(); mAddMeetingFrag = new AddMeetingFragment(); mStackFrag = new Stack <SupportFragment>(); LoadView(mLoadView); }
private int CurrentSelectedNavigation(SupportFragment currentFragment) { SupportActionBar ab = SupportActionBar;//instantiate actionbar int returnValue = 0; if (currentFragment == mCheckoutFragment) { ab.SetTitle(Resource.String.checkout_title);//set title of actionbar returnValue = Resource.Id.nav_checkout; } else if (currentFragment == mProductsFragment) { ab.SetTitle(Resource.String.products_title); returnValue = Resource.Id.nav_products; } else if (currentFragment == mCustomersFragment) { ab.SetTitle(Resource.String.customers_title); returnValue = Resource.Id.nav_customers; } else if (currentFragment == mTransactionsFragment) { ab.SetTitle(Resource.String.transactions_title); returnValue = Resource.Id.nav_transactions; } else if (currentFragment == mSettingsFragment) { ab.SetTitle(Resource.String.settings_title); returnValue = Resource.Id.nav_settings; } return(returnValue); }
void ConnectControl() { //drawerlayout drawerLayout = (Android.Support.V4.Widget.DrawerLayout)FindViewById(Resource.Id.drawerLayout); //toolbar mainToolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.mainToolbar); SetSupportActionBar(mainToolbar); SupportActionBar.Title = ""; Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Mipmap.ic_menu_action); actionBar.SetDisplayHomeAsUpEnabled(true); //Textview pickupLocationText = (TextView)FindViewById(Resource.Id.pickupLocationText); destinationText = (TextView)FindViewById(Resource.Id.destinationText); //Buttons pickupRadio = (RadioButton)FindViewById(Resource.Id.pickupRadio); destinationRadio = (RadioButton)FindViewById(Resource.Id.destinationRadio); pickupRadio.Click += PickupRadio_Click; destinationRadio.Click += DestinationRadio_Click; //Layouts layoutPickup = (RelativeLayout)FindViewById(Resource.Id.layoutPickUp); layoutDestination = (RelativeLayout)FindViewById(Resource.Id.layoutDestination); layoutPickup.Click += LayoutPickup_Click; layoutDestination.Click += LayoutDestination_Click; //imageview centerMarker = (ImageView)FindViewById(Resource.Id.centerMarker); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.AddEdit); string mLoadView = Intent.Extras.Get("LoadView").ToString(); SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolBar); SupportActionBar ab = SupportActionBar; ab.SetDisplayHomeAsUpEnabled(true); ab.SetHomeButtonEnabled(true); ab.SetDisplayShowTitleEnabled(false); //Get Fragment Holder mFrameLayout = Resource.Id.fragmentContainer; //instantiate fragments mAddGroupFrag = new AddGroupFragment(); mAddPropertyFrag = new AddPropertyFragment(); mAddTenantFrag = new AddTenantFragment(); mStackFrag = new Stack <SupportFragment>(); LoadView(mLoadView); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); ActionBar actionBar = SupportActionBar; actionBar.SetDisplayHomeAsUpEnabled(true); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolBar); SupportActionBar ab = SupportActionBar; ab.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_small); ab.SetDisplayHomeAsUpEnabled(true); _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); if (navigationView != null) { SetUpDrawerContent(navigationView); } TabLayout tabs = FindViewById <TabLayout>(Resource.Id.tabs); ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager); SetUpViewPager(viewPager); tabs.SetupWithViewPager(viewPager); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.Dashboard); SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar); SetSupportActionBar(toolBar); SupportActionBar ab = SupportActionBar; ab.SetHomeAsUpIndicator(Resource.Drawable.ic_action_menu); ab.SetDisplayHomeAsUpEnabled(true); mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); NavigationView navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); if (navigationView != null) { SetUpDrawerContent(navigationView); } TabLayout tabs = FindViewById <TabLayout>(Resource.Id.tabs); ViewPager viewPager = FindViewById <ViewPager>(Resource.Id.viewpager); tabs.FillViewport = true; SetUpViewPager(viewPager); tabs.SetupWithViewPager(viewPager); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); toolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.toolbar); drawerLayout = (Android.Support.V4.Widget.DrawerLayout)FindViewById(Resource.Id.drawerLayout); navigationView = (Android.Support.Design.Widget.NavigationView)FindViewById(Resource.Id.navview); navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected; //Setup Tooolbar SetSupportActionBar(toolbar); SupportActionBar.Title = "Topics"; Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Drawable.menuaction); actionBar.SetDisplayHomeAsUpEnabled(true); // View Setups historyLayout = (LinearLayout)FindViewById(Resource.Id.historyLayout); spaceLayout = (LinearLayout)FindViewById(Resource.Id.spaceLayout); geographyLayout = (LinearLayout)FindViewById(Resource.Id.geograpyLayout); engineeringLayout = (LinearLayout)FindViewById(Resource.Id.engineeringLayout); programmingLayout = (LinearLayout)FindViewById(Resource.Id.programmingLayout); businessLayout = (LinearLayout)FindViewById(Resource.Id.businessLayout); // Click Event Handlers historyLayout.Click += HistoryLayout_Click; geographyLayout.Click += GeographyLayout_Click; spaceLayout.Click += SpaceLayout_Click; engineeringLayout.Click += EngineeringLayout_Click; programmingLayout.Click += ProgrammingLayout_Click; businessLayout.Click += BusinessLayout_Click; }
void ConnectControl() { //DrawerLayout drawerLayout = (Android.Support.V4.Widget.DrawerLayout)FindViewById(Resource.Id.drawerLayout); //ToolBar mainToolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.mainToolbar); SetSupportActionBar(mainToolbar); SupportActionBar.Title = ""; Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Mipmap.ic_menu_action); actionBar.SetDisplayHomeAsUpEnabled(true); //TextView pickupLocationText = (TextView)FindViewById(Resource.Id.pickupLocationText); destinationText = (TextView)FindViewById(Resource.Id.destinationText); tripStatusText = (TextView)FindViewById(Resource.Id.tripStatusText); driverNameText = (TextView)FindViewById(Resource.Id.driverNameText); //Buttons favouritePlacesButton = (Button)FindViewById(Resource.Id.favouritePlacesButton); locationSetButton = (Button)FindViewById(Resource.Id.locationSetButton); requestDriverButton = (Button)FindViewById(Resource.Id.requestDriverButton); pickupRadio = (RadioButton)FindViewById(Resource.Id.pickupRadio); destinationRadio = (RadioButton)FindViewById(Resource.Id.DestinationRadio); callDriverButton = (ImageButton)FindViewById(Resource.Id.callDriverButton); cancelTripButton = (ImageButton)FindViewById(Resource.Id.cancelTripButton); favouritePlacesButton.Click += FavouritePlacesButton_Click; locationSetButton.Click += LocationSetButton_Click; requestDriverButton.Click += RequestDriverButton_Click; pickupRadio.Click += PickupRadio_Click; destinationRadio.Click += DestinationRadio_Click; //Layouts layoutPickUp = (RelativeLayout)FindViewById(Resource.Id.layoutPickUp); layoutDestination = (RelativeLayout)FindViewById(Resource.Id.layoutDestination); layoutPickUp.Click += LayoutPickUp_Click; layoutDestination.Click += LayoutDestination_Click; //imageview centerMarker = (ImageView)FindViewById(Resource.Id.centerMarker); //Bottomsheet FrameLayout tripDetailsView = (FrameLayout)FindViewById(Resource.Id.tripdetails_bottomsheet); FrameLayout rideInfoSheet = (FrameLayout)FindViewById(Resource.Id.bottom_sheet_trip); tripDetailsBottonsheetBehaviour = BottomSheetBehavior.From(tripDetailsView); driverAssignedBottomSheetBehaviour = BottomSheetBehavior.From(rideInfoSheet); lv = FindViewById <ListView>(Resource.Id.lv); //BIND ADAPTER adapter = new CustomAdapter(this, GetSpacecrafts()); lv.Adapter = adapter; lv.ItemClick += lv_ItemClick; }
public static ActionBarDisplayOptions GetActionBarDisplayOptions(this ActionBar actionBar) { #if APPCOMPAT return((ActionBarDisplayOptions)actionBar.DisplayOptions); #else return(actionBar.DisplayOptions); #endif }
/// <summary> /// Must be call after SetContentView(); /// </summary> protected void SetupContentLayout() { toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(App.Resource.Id.toolbar); SetSupportActionBar(toolbar); Android.Support.V7.App.ActionBar actionBar = SupportActionBar; actionBar.SetDisplayShowTitleEnabled(false); }
private void initActionBar() { //Toolbar stuff toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); if (toolbar != null) { //initialize the drawer mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout_SearchClass); mDrawerList = FindViewById <ListView>(Resource.Id.drawerListView_SearchClass); //Toolbar will now take on default Action Bar characteristics SetSupportActionBar(toolbar); actionBar = SupportActionBar; mDrawerToggle = new ActionBarToggle(this, mDrawerLayout, Resource.String.drawer_opened, Resource.String.drawer_closed_schoolSearch); mDrawerLayout.AddDrawerListener(mDrawerToggle); //Set Action Bar Title actionBar.Title = "Select School"; actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.SetHomeButtonEnabled(true); actionBar.SetDisplayShowHomeEnabled(true); actionBar.SetDisplayShowTitleEnabled(true); mDrawerToggle.SyncState(); if (cBundle != null) { if (cBundle.GetString("DrawerState") == "Opened") { SupportActionBar.SetTitle(Resource.String.drawer_closed_schoolSearch); } } else { SupportActionBar.SetTitle(Resource.String.drawer_closed_schoolSearch); } //Setting Up items in list mDrawerListItems = new List <string>(Resources.GetStringArray(Resource.Array.drawer_list)); if (Settings.IsLoggedIn) { mDrawerListItems.Add("Logout"); } else { mDrawerListItems.Add("Login"); } ArrayAdapter <string> drawListAdapter = new ArrayAdapter <string>(this, Resource.Layout.menuListItem, mDrawerListItems); mDrawerList.Adapter = drawListAdapter; } }
private void GameButton_Click(object sender, NavigationView.NavigationItemSelectedEventArgs eventArgs) { SupportActionBar.SetTitle(Resource.String.game); GameFragment fragment = new GameFragment(); var fragmentTransaction = FragmentManager.BeginTransaction(); fragmentTransaction.Replace(Resource.Id.fragmentContainer, fragment); fragmentTransaction.Commit(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.menu_index_view_items, null); Toolbar toolbar = view.FindViewById <Toolbar>(Resource.Id.toolbar_menu_items); toolbar.SetTitle(Resource.String.menuItemDialogTitle); SetHasOptionsMenu(true); ((AppCompatActivity)Activity).SetSupportActionBar(toolbar); Android.Support.V7.App.ActionBar actionBar = ((AppCompatActivity)Activity).SupportActionBar; if (actionBar != null) { actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.SetHomeButtonEnabled(true); actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_clear_white); } int id = Arguments.GetInt("id"); int resId = Arguments.GetInt("resId"); if (id > 0 && resId > 0) { LibBookingService.Dtos.Restaurant restaurant = _restaurantFacade.FindById(resId).Result; //LibBookingService.Dtos.Restaurant restaurant = new LibBookingService.Dtos.Restaurant //{ // Id = 1, // CompanyId = 2, // Name = "Restaurant 1", // PhoneNo = "01429354096", // AddressStreet = "21 Restaurant Road", // AddressTown = "Hartlepool", // AddressCounty = "Cleveland", // AddressPostalCode = "TS248GX", // MenuItems = new List<MenuItem> // { // new MenuItem { Id = 4, Description = "A fresh bowl of caesar salad", Price = 4.38, ImageId = 4, Name = "Caesar Salad", DietInfo = new List<DietInfo> { new DietInfo { Name = "Vegan", Id = 2 } }, Types = new List<MenuItemType> { new MenuItemType { Id = 1, Name = "Starter" } } }, // new MenuItem { Id = 5, Description = null, Price = 3.59, ImageId = 5, Name = "Chocolate Fudge Cake", DietInfo = new List<DietInfo> { new DietInfo { Name = "Contains Dairy", Id = 4 } }, Types = new List<MenuItemType> { new MenuItemType { Id = 3, Name = "Dessert" }, new MenuItemType { Id = 4, Name = "Special" } } }, // new MenuItem { Id = 2, Description = "A fresh cod fillet served with thick cut chips and mushy peas", Price = 6.00, ImageId = 2, Name = "Fish and Chips", DietInfo = new List<DietInfo> { }, Types = new List<MenuItemType> { new MenuItemType { Id = 2, Name = "Main" } } } // } //}; RecyclerView recyclerView = view.FindViewById <RecyclerView>(Resource.Id.menu_index_view_item_types); recyclerView.SetLayoutManager(new LinearLayoutManager(Activity)); List <MenuItem> menuItems = restaurant.MenuItems.ToList(); menuItems = menuItems.Where(m => m.Types.Where(t => t.Id == id).Any()).ToList(); RestaurantMenuItemDialogAdapter adapter = new RestaurantMenuItemDialogAdapter(menuItems); recyclerView.SetAdapter(adapter); } return(view); }
protected override void OnCreate(Bundle savedInstanceState) { UserID = app.GetString("USERID", string.Empty); var _lang = app.GetString("Language", "en"); ChangeLanguage(_lang); base.OnCreate(savedInstanceState); _Action = Intent.GetStringExtra("Action"); progress = new ProgressbarSetup(); // Create your application here SetContentView(Resource.Layout.sale_dialog); mToolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolBar); Slide slide = new Slide(GravityFlags.Top); GetDataBind(); SetSupportActionBar(mToolbar); SupportActionBar ab = SupportActionBar; ab.SetDisplayHomeAsUpEnabled(true); SupportActionBar.Title = products.Product; mItems = FindViewById <EditText>(Resource.Id.edtQty); mSizes = FindViewById <EditText>(Resource.Id.edtSizes); mDone = FindViewById <Button>(Resource.Id.btnDone); mItems.InputType = Android.Text.InputTypes.Null; mSizes.InputType = Android.Text.InputTypes.Null; mSizes.FocusableInTouchMode = false; mItems.Clickable = false; mItems.Text = "1"; mSizes.Text = products.Sizes.Split(',')[0]; if (_Action == "Cart") { mDone.Text = Resources.GetString(Resource.String.add_to_cart); } else { setCalcTotalPrice(); //mDone.Text = Resources.GetString(Resource.String.btn_continue_payment); } mDone = FindViewById <Button>(Resource.Id.btnDone); mItems.TextChanged += (obj, sender) => { setCalcTotalPrice(); }; mDone.Click += MDone_Click; mItems.Click += MItems_Click; mSizes.Click += MSizes_Click; }
private void FnSetUpToolbar() { SetSupportActionBar(toolBar); SupportActionBar ab = SupportActionBar; //ab.SetHomeAsUpIndicator(Resource.Drawable.left_icon_thin); ab.SetDisplayShowHomeEnabled(true); ab.SetDisplayHomeAsUpEnabled(true); ab.Title = mIsCustomer ? "Select customer" : "Select runner"; }
private void FnSetUpToolBar() { mToolBar = FindViewById <SupportToolbar>(Resource.Id.toolbarTitle); SetSupportActionBar(mToolBar); SupportActionBar actionBar = SupportActionBar; actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.SetDisplayShowHomeEnabled(true); actionBar.Title = isEdit ? mProductName : "(" + mProductSize + ") " + mProductName; }
public void OnTabSelected(ActionBar.Tab tab, Android.Support.V4.App.FragmentTransaction ft) { switch (tab.Text) { case "ListView": ft.Replace(Android.Resource.Id.Content, new ListViewFragment()); break; case "RecyclerView": ft.Replace(Android.Resource.Id.Content, new RecyclerViewFragment()); break; case "ScrollView": ft.Replace(Android.Resource.Id.Content, new ScrollViewFragment()); break; } }
public void OnTabSelected(ActionBar.Tab tab, Android.Support.V4.App.FragmentTransaction ft) { if (fragment == null) { fragment = new SampleTabFragment(); var id = (int)Build.VERSION.SdkInt >= 14 ? Android.Resource.Id.Content : Resource.Id.action_bar_activity_content; ft.Add(id, fragment, "tag"); } else { ft.Attach(fragment); } }
protected void InitializeActionBar(Android.Support.V7.App.ActionBar ab) { mActionBar = ab; LayoutInflater mInflater = LayoutInflater.From (this); View mCustomView = mInflater.Inflate (Resource.Layout.ActionBar, null); ActionBarTitle = mCustomView.FindViewById<TextView> (Resource.Id.title); ActionBarBack = mCustomView.FindViewById<ImageButton> (Resource.Id.backButton); ActionBarAdd = mCustomView.FindViewById<ImageButton> (Resource.Id.addButton); ActionBarSearch = mCustomView.FindViewById<ImageButton> (Resource.Id.searchButton); ActionBarClose = mCustomView.FindViewById<ImageButton> (Resource.Id.closeButton); ActionBarDelete = mCustomView.FindViewById<ImageButton> (Resource.Id.deleteButton); ActionBarQuery = mCustomView.FindViewById<EditText>(Resource.Id.query); ActionBarBack.Click += (sender, e) => OnBackPressed (); var layout = new Android.Support.V7.App.ActionBar.LayoutParams (ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); mActionBar.SetCustomView (mCustomView, layout); mActionBar.SetDisplayShowCustomEnabled (true); }
public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { // When the given tab is selected, switch to the corresponding page in // the ViewPager. int pos = tab.Position; mViewPager.CurrentItem = pos; Fragment fragment = ((FragmentPagerAdapter) mViewPager.Adapter).GetItem(pos); if (fragment is FragmentListener) { ((FragmentListener) fragment).OnFragmentSelected(); } }
public void OnTabUnselected(ActionBar.Tab tab, Android.Support.V4.App.FragmentTransaction ft) { if (fragment != null) ft.Detach(fragment); }
public void OnTabReselected(ActionBar.Tab tab, Android.Support.V4.App.FragmentTransaction ft) { }
public void OnTabReselected(ActionBar.Tab tab, FragmentTransaction fragmentTransaction) { }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.main_activity); SetFullscreen(); view = FindViewById(Resource.Id.main_parent_view); // 액션바 toolbar = FindViewById<Toolbar>(Resource.Id.main_toolbar); SetSupportActionBar(toolbar); actionBar = SupportActionBar; actionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu_white); actionBar.SetDisplayHomeAsUpEnabled(true); actionBar.Title = Resources.GetString(Resource.String.ApplicationName); actionBar.Show(); TabLayoutViewPager(); NaviView(); //var position = tabLayout.SelectedTabPosition; //viewPager.SetCurrentItem(0, true); actionBar.SetBackgroundDrawable(new ColorDrawable(Resources.GetColor(Resource.Color.tab1_actionbar_background))); tabLayout.Background = new ColorDrawable(Resources.GetColor(Resource.Color.tab1_tablayout_background)); tabLayout.SetSelectedTabIndicatorColor(Resources.GetColor(Resource.Color.tab1_tabindicator_background)); }