public void StopSharing()
 {
     Shared.Sharing = false;
     if (Shared.State == SharingShared.SharingState.DisplayPurposesOnly)
     {
         Shared.State = SharingShared.SharingState.DisplayPurposesOnly;
         RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());
     }
     else if (Shared.State == SharingShared.SharingState.PermissionDenied)
     {
         Shared.State = SharingShared.SharingState.PermissionDenied;
         RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());
     }
     else
     {
         Shared.State = SharingShared.SharingState.NotSharing;
         RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());
         if (String.IsNullOrEmpty(Shared.SessionUUID))
         {
             return;
         }
         Task.Run(async() =>
         {
             if (String.IsNullOrEmpty(Shared.SessionUUID))
             {
                 return;
             }
             await WebServices.TransactionsController.TerminateTransaction(Shared.SessionUUID);
         });
     }
     StopAnimation();
     ButtonLocked = false;
     Timer.Stop();
 }
        async public void StartSharing()
        {
            if (!Shared.CanStartSharing())
            {
                return;
            }
            Shared.State = SharingShared.SharingState.Authenticating;
            RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());
            var sharing = await Shared.ShareChard();

            if (sharing)
            {
                Shared.State = SharingShared.SharingState.Sharing;
                Timer.Start();
                Activity.RunOnUiThread(delegate
                {
                    //RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());
                    StartAnimation();
                });
            }
            else
            {
                Shared.State = SharingShared.SharingState.Failed;
                RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());
            }

            ButtonLocked = false;
        }
示例#3
0
        async public void StartSharing()
        {
            if (!Shared.CanStartSharing())
            {
                return;
            }

            Shared.State = SharingShared.SharingState.Authenticating;
            RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());

            var sharing = await Shared.ShareChard();

            if (sharing)
            {
                Shared.State = SharingShared.SharingState.Sharing;
                Timer.Start();
            }
            else
            {
                Shared.State = SharingShared.SharingState.Failed;
            }

            RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());

            ButtonLocked = false;
        }
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            RecyclerViewAdapter.SetListItems(Shared.GetMyCards(true));
            Activity.Title = DrawerShared.navigation_item_my_cards;
            return(view);
        }
        void AddOutletToCard(Outlet obj, bool dismiss)
        {
            Shared.SelectedCard.AddOutlet(obj);

            RecyclerViewAdapter.SetListItems(Shared.GetTableItems());
            IfEmpty(true);

            if (dismiss)
            {
                var convertedActiviy = (Activity as BaseActivity);
                convertedActiviy.PopFragmentOver();
            }
        }
示例#6
0
        public override View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            RecyclerViewAdapter.SetListItems(Shared.GetTableItems());

            Activity.Title = "Slink";

            HasOptionsMenu = true;

            BlurTheView(view);
            return(view);
        }
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            RecyclerViewAdapter.SetListItems(RealmServices.GetMyOutlets().ToList());

            Activity.Title = SettingsShared.navigation_item_my_outlets;


            RegisterForContextMenu(RecyclerView);

            return(view);
        }
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            var itemDecorator = new DividerItemDecoration(Activity, DividerItemDecoration.Vertical);

            itemDecorator.SetDrawable(ContextCompat.GetDrawable(Activity, Resource.Drawable.RecyclerViewWhiteDivider));
            RecyclerView.AddItemDecoration(itemDecorator);

            RecyclerViewAdapter.SetListItems(Shared.GetTableItems());

            Activity.Title = DrawerShared.navigation_item_settings;

            return(view);
        }
示例#9
0
        public override View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            RecyclerViewAdapter.SetListItems(Shared.GetTableItemsAndroid());

            //Activity.Title = "";

            HasOptionsMenu = true;

            Timer.Elapsed  -= Timer_Elapsed;
            Timer.Elapsed  += Timer_Elapsed;
            Timer.AutoReset = false;
            Timer.Interval  = 30000; //30 seconds

            return(view);
        }
        public override bool OnContextItemSelected(IMenuItem item)
        {
            var position = item.Order;

            var model = RecyclerViewAdapter.GetItemInList(position);

            if (model == null)
            {
                return(base.OnContextItemSelected(item));
            }

            switch (item.TitleFormatted.ToString().ToLower())
            {
            case "delete":
                RealmServices.DeleteOutlet(model);
                RecyclerViewAdapter.SetListItems(RealmServices.GetMyOutlets().ToList());
                break;

            default: break;
            }

            return(base.OnContextItemSelected(item));
        }