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; }
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; } }
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(); } } }