public void SetFlagDisplay(int tabIndex) { Fragment fragment = null; switch (tabIndex) { case 0: fragment = ItemOneFragment.NewInstance(chatService); break; case 1: fragment = ItemTwoFragment.NewInstance(chatService); break; case 2: fragment = ItemThreeFragment.NewInstance(chatService); break; case 3: fragment = ItemFourFragment.NewInstance(chatService); break; case 4: fragment = ItemFiveFragment.NewInstance(chatService); break; } navigation.Menu.GetItem(tabIndex).SetChecked(true); if (fragment != null) { FragmentManager.BeginTransaction() .Replace(Resource.Id.content_frame, fragment) .Commit(); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Title = "마우스"; SetContentView(Resource.Layout.activity_main); navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation); navigation.SetOnNavigationItemSelectedListener(this); if (savedInstanceState == null) { Fragment fragment = ItemOneFragment.NewInstance(chatService); FragmentManager.BeginTransaction() .Replace(Resource.Id.content_frame, fragment) .Commit(); } //SetHasOptionsMenu(true); bluetoothAdapter = BluetoothAdapter.DefaultAdapter; receiver = new DiscoverableModeReceiver(); receiver.BluetoothDiscoveryModeChanged += (sender, e) => { this.InvalidateOptionsMenu(); }; if (bluetoothAdapter == null) { Toast.MakeText(this, "Bluetooth is not available.", ToastLength.Long).Show(); this.FinishAndRemoveTask(); } writeListener = new WriteListener(this); handler = new ChatHandler(this); }
public GestureTouch(ItemOneFragment frag) { this.frag = frag; }
public static ItemOneFragment NewInstance(BluetoothChatService bcs) { ItemOneFragment fragment = new ItemOneFragment(bcs); return(fragment); }