Esempio n. 1
0
        /// Method use to set campaign list data into recycler view.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="recordType"></param>
        public void SetInboxList(List <EmailResponse> data)
        {
            if (mAdapter == null)
            {
                mAdapter            = new InboxAdapter(Activity);
                mAdapter.ItemClick += MAdapter_ItemClick;
                mAdapter.SetData(data);
                rvInbox.SetAdapter(mAdapter);
            }
            else
            {
                mAdapter.NotifyDataSetChanged();
            }

            if (mAdapter.GetData() != null && mAdapter.GetData().Count > 0)
            {
                rvInbox.Visibility       = ViewStates.Visible;
                tvPullRefresh.Visibility = ViewStates.Gone;
            }
            else
            {
                rvInbox.Visibility       = ViewStates.Gone;
                tvPullRefresh.Visibility = ViewStates.Visible;
            }
        }
Esempio n. 2
0
        private void LoadElements()
        {
            if (_inboxList != null && _inboxList.Any())
            {
                _inboxListView = _view.FindViewById <ListView>(Resource.Id.inboxListView);

                var notificationAdapter = new InboxAdapter(Activity, _inboxList);

                var inboxLayout = _view.FindViewById <LinearLayout>(Resource.Id.inboxListLayout);
                inboxLayout.Visibility      = ViewStates.Visible;
                _lottieAnimation.Visibility = ViewStates.Gone;

                _inboxListView.Adapter = notificationAdapter;
                notificationAdapter.NotifyDataSetChanged();
            }
            else
            {
                _emptyState                 = _view.FindViewById <LinearLayout>(Resource.Id.empty_state);
                _emptyState.Visibility      = ViewStates.Visible;
                _lottieAnimation.Visibility = ViewStates.Gone;
            }
            _lottieAnimation.Dispose();
            GarbageCollector();
        }