Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static NfcUtilsFragment NewInstance(string nfcTag)
        {
            var nfcUtilsFrag = new NfcUtilsFragment {
                Arguments = new Bundle()
            };

            _nfcTag = nfcTag;
            return(nfcUtilsFrag);
        }
Exemplo n.º 2
0
        private void NfcUtilsButton_OnClick(object sender, EventArgs e)
        {
            NfcUtilsFragment nfcUtilsPairFrag = (NfcUtilsFragment)FragmentManager.FindFragmentByTag(FRAGMENT_TAG_NFC_UTILS);

            if (nfcUtilsPairFrag == null)
            {
                nfcUtilsPairFrag = NfcUtilsFragment.NewInstance(_activity.NfcTag);
            }

            FragmentManager.BeginTransaction()
            .Replace(Resource.Id.main_menu_container, nfcUtilsPairFrag, FRAGMENT_TAG_NFC_UTILS)
            .AddToBackStack(FRAGMENT_TAG_NFC_UTILS)
            .Commit();
        }
Exemplo n.º 3
0
        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)
            {
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        /// <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)
            {
            }
        }