/// <summary> /// /// </summary> /// <param name="args"></param> /// <returns></returns> public static BluetoothFragment NewInstance(Bundle args) { BluetoothFragment fragment = new BluetoothFragment { Arguments = args }; return(fragment); }
public void OnPairDevice(object device, int state) { TapAndPairFragment tapAndPairFrag = FragmentManager.FindFragmentByTag <TapAndPairFragment>(FRAGMENT_TAG_NFC_PAIR); NfcUtilsFragment nfcUtilsFrag = FragmentManager.FindFragmentByTag <NfcUtilsFragment>(FRAGMENT_TAG_NFC_UTILS); BluetoothFragment bluetoothFrag = FragmentManager.FindFragmentByTag <BluetoothFragment>(FRAGMENT_TAG_BLUETOOTH); if (tapAndPairFrag != null && nfcUtilsFrag == null && bluetoothFrag == null) { tapAndPairFrag.OnPairDevice(device, state); } else if (tapAndPairFrag == null && nfcUtilsFrag != null && bluetoothFrag == null) { } else if (tapAndPairFrag == null && nfcUtilsFrag == null && bluetoothFrag != null) { } }
public void OnDeviceFound(object bluetoothDevice, object bluetoothClass) { TapAndPairFragment tapAndPairFrag = FragmentManager.FindFragmentByTag <TapAndPairFragment>(FRAGMENT_TAG_NFC_PAIR); NfcUtilsFragment nfcUtilsFrag = FragmentManager.FindFragmentByTag <NfcUtilsFragment>(FRAGMENT_TAG_NFC_UTILS); BluetoothFragment bluetoothFrag = FragmentManager.FindFragmentByTag <BluetoothFragment>(FRAGMENT_TAG_BLUETOOTH); if (tapAndPairFrag != null && nfcUtilsFrag == null && bluetoothFrag == null) { tapAndPairFrag.OnDeviceFound(bluetoothDevice, bluetoothClass); } else if (tapAndPairFrag == null && nfcUtilsFrag != null && bluetoothFrag == null) { } else if (tapAndPairFrag == null && nfcUtilsFrag == null && bluetoothFrag != null) { bluetoothFrag.OnDeviceFound(bluetoothDevice, bluetoothClass); } }
public void OnScanComplete() { TapAndPairFragment tapAndPairFrag = FragmentManager.FindFragmentByTag <TapAndPairFragment>(FRAGMENT_TAG_NFC_PAIR); NfcUtilsFragment nfcUtilsFrag = FragmentManager.FindFragmentByTag <NfcUtilsFragment>(FRAGMENT_TAG_NFC_UTILS); BluetoothFragment bluetoothFrag = FragmentManager.FindFragmentByTag <BluetoothFragment>(FRAGMENT_TAG_BLUETOOTH); if (tapAndPairFrag != null && nfcUtilsFrag == null && bluetoothFrag == null) { tapAndPairFrag.OnScanComplete(); } else if (tapAndPairFrag == null && nfcUtilsFrag != null && bluetoothFrag == null) { } else if (tapAndPairFrag == null && nfcUtilsFrag == null && bluetoothFrag != null) { bluetoothFrag.OnScanComplete(); } }
/// <summary> /// /// </summary> /// <param name="intent"></param> protected override void OnNewIntent(Intent intent) { TapAndPairFragment tapAndPairFrag = FragmentManager.FindFragmentByTag <TapAndPairFragment>(FRAGMENT_TAG_NFC_PAIR); NfcUtilsFragment nfcUtilsFrag = FragmentManager.FindFragmentByTag <NfcUtilsFragment>(FRAGMENT_TAG_NFC_UTILS); BluetoothFragment bluetoothFrag = FragmentManager.FindFragmentByTag <BluetoothFragment>(FRAGMENT_TAG_BLUETOOTH); if (tapAndPairFrag != null && nfcUtilsFrag == null && bluetoothFrag == null) { tapAndPairFrag.OnNewIntent(intent); } else if (tapAndPairFrag == null && nfcUtilsFrag != null && bluetoothFrag == null) { nfcUtilsFrag.OnNewIntent(intent); } else if (tapAndPairFrag == null && nfcUtilsFrag == null && bluetoothFrag != null) { } }
private void BluetoothUtilsButton_OnClick(object sender, EventArgs e) { BluetoothFragment bluetoothPairFrag = (BluetoothFragment)FragmentManager.FindFragmentByTag(FRAGMENT_TAG_BLUETOOTH); Bundle args = new Bundle(); //args.PutByteArray(this.ToString(), this.ToArray<byte>()); if (bluetoothPairFrag == null) { bluetoothPairFrag = BluetoothFragment.NewInstance(args); } FragmentManager.BeginTransaction() .Replace(Resource.Id.main_menu_container, bluetoothPairFrag, FRAGMENT_TAG_BLUETOOTH) .AddToBackStack(FRAGMENT_TAG_BLUETOOTH) .Commit(); //var intent = new Intent(Activity, typeof(BluetoothUtilsActivity)); //StartActivity(intent); }