Example #1
0
        private void UpdateViewState()
        {
            if (_loadingLayout.Visibility == ViewStates.Visible)
            {
                AnimUtil.FadeOutView(_loadingLayout, AnimUtil.LengthShort);
            }

            _emptyLayout.Visibility = ViewStates.Gone;

            _offlineLayout.Visibility = _serverNode == null
                ? ViewStates.Visible
                : ViewStates.Gone;

            if (_authSource.GetView().Count == 0)
            {
                _emptyLayout.Visibility = ViewStates.Visible;
            }
            else
            {
                if (_authList.Visibility == ViewStates.Invisible)
                {
                    AnimUtil.FadeInView(_authList, AnimUtil.LengthShort, false, delegate
                    {
                        _authList.RequestFocus();
                    });
                }
                else
                {
                    _authList.RequestFocus();
                }
            }
        }
Example #2
0
        private void CheckEmptyState()
        {
            if (_loadingLayout.Visibility == ViewStates.Visible)
            {
                AnimUtil.FadeOutView(_loadingLayout, AnimUtil.LengthShort);
            }

            _emptyLayout.Visibility = ViewStates.Gone;

            if (_authSource.GetView().Count == 0)
            {
                _emptyLayout.Visibility = ViewStates.Visible;
            }
            else
            {
                if (_authList.Visibility == ViewStates.Invisible)
                {
                    AnimUtil.FadeInView(_authList, AnimUtil.LengthShort, false, delegate
                    {
                        _authList.RequestFocus();
                    });
                }
                else
                {
                    _authList.RequestFocus();
                }
            }
        }
        private void OnReady()
        {
            if (_authListAdapter.Items.Count == 0)
            {
                AnimUtil.FadeInView(_emptyLayout, 200);
            }
            else
            {
                AnimUtil.FadeOutView(_emptyLayout, 200);
            }

            var anim = new AlphaAnimation(0f, 1f)
            {
                Duration = 200
            };

            anim.AnimationEnd += (sender, e) =>
            {
                _authList.Visibility = ViewStates.Visible;
                _authList.RequestFocus();
            };

            _authList.StartAnimation(anim);
            _loadingLayout.Visibility = ViewStates.Invisible;
        }
Example #4
0
        private void UpdateViewState()
        {
            if (_loadingLayout.Visibility == ViewStates.Visible)
            {
                AnimUtil.FadeOutView(_loadingLayout, 200);
            }

            _emptyLayout.Visibility = ViewStates.Gone;

            _offlineLayout.Visibility = _serverNode == null
                ? ViewStates.Visible
                : ViewStates.Gone;

            if (_authSource.GetView().Count == 0)
            {
                _emptyLayout.Visibility = ViewStates.Visible;
            }
            else
            {
                if (_authList.Visibility == ViewStates.Invisible)
                {
                    var anim = new AlphaAnimation(0f, 1f)
                    {
                        Duration = 200
                    };

                    anim.AnimationEnd += delegate
                    {
                        _authList.Visibility = ViewStates.Visible;
                        _authList.RequestFocus();
                    };

                    _authList.StartAnimation(anim);
                }
                else
                {
                    _authList.RequestFocus();
                }
            }
        }
 private void CheckEmptyState()
 {
     if (!_authSource.GetView().Any())
     {
         _emptyLayout.Visibility = ViewStates.Visible;
         _authList.Visibility    = ViewStates.Invisible;
     }
     else
     {
         _emptyLayout.Visibility = ViewStates.Invisible;
         _authList.Visibility    = ViewStates.Visible;
         _authList.RequestFocus();
     }
 }
Example #6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View outerView = base.OnCreateView(inflater, container, savedInstanceState);
            View view      = inflater.Inflate(Resource.Layout.fragment_weather_list, outerView as ViewGroup, true);

            recyclerView = outerView.FindViewById <WearableRecyclerView>(Resource.Id.recycler_view);
            // use this setting to improve performance if you know that changes
            // in content do not change the layout size of the RecyclerView
            recyclerView.HasFixedSize = true;
            recyclerView.EdgeItemsCenteringEnabled = true;

            recyclerView.RequestFocus();

            return(outerView);
        }
Example #7
0
        public async void OnMessageReceived(IMessageEvent messageEvent)
        {
            switch (messageEvent.Path)
            {
            case ListCapability:
            {
                var json = Encoding.UTF8.GetString(messageEvent.GetData());
                _authenticatorListAdapter.Items = JsonConvert.DeserializeObject <List <WearAuthenticatorResponse> >(json);

                if (_authenticatorListAdapter.Items.Count == 0)
                {
                    AnimUtil.FadeInView(_emptyLayout, 200);
                }
                else
                {
                    AnimUtil.FadeOutView(_emptyLayout, 200);
                }

                _authenticatorListAdapter.NotifyDataSetChanged();

                var anim = new AlphaAnimation(0f, 1f)
                {
                    Duration = 200
                };

                anim.AnimationEnd += (sender, e) =>
                {
                    _authList.Visibility = ViewStates.Visible;
                    _authList.RequestFocus();
                };

                _authList.StartAnimation(anim);
                _loadingLayout.Visibility = ViewStates.Invisible;

                break;
            }

            case RefreshCapability:
                await Refresh();

                break;
            }
        }