示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="requestCode"></param>
        /// <returns></returns>
        public static TapAndPairFragment NewInstance(int requestCode)
        {
            Bundle args = new Bundle();

            args.PutInt(ARG_REQUEST_CODE, requestCode);
            TapAndPairFragment fragment = new TapAndPairFragment
            {
                Arguments = args
            };

            return(fragment);
        }
示例#2
0
        private void NfcPairButton_OnClick(object sender, EventArgs e)
        {
            TapAndPairFragment tapAndPairFrag = (TapAndPairFragment)FragmentManager.FindFragmentByTag(FRAGMENT_TAG_NFC_PAIR);

            if (tapAndPairFrag == null)
            {
                tapAndPairFrag = TapAndPairFragment.NewInstance((int)ActivityCode.NFCPairMenu);
            }

            FragmentManager.BeginTransaction()
            .Replace(Resource.Id.main_menu_container, tapAndPairFrag, FRAGMENT_TAG_NFC_PAIR)
            .AddToBackStack(FRAGMENT_TAG_NFC_PAIR)
            .Commit();
        }
示例#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)
            {
            }
        }
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="launchIntentAction"></param>
        private void LauchActivity(string launchIntentAction)
        {
            switch (launchIntentAction)
            {
            case "NFCPair":
            {
                TapAndPairFragment tapAndPairFrag = TapAndPairFragment.NewInstance((int)ActivityCode.NFCPair);
                FragmentManager.BeginTransaction()
                .Replace(Resource.Id.main_menu_container, tapAndPairFrag, FRAGMENT_TAG_NFC_PAIR)
                .Commit();
            }
            break;

            default:
                break;
            }
        }
示例#5
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);
            }
        }
示例#6
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();
            }
        }
示例#7
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)
            {
            }
        }