Ejemplo n.º 1
0
        public override async void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            _swipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            _swipeRefreshLayout.SetOnRefreshListener(this);
            _swipeRefreshLayout.Post(() =>
            {
                _swipeRefreshLayout.Refreshing = true;
            });
            _swipeRefreshLayout.PostDelayed(() =>
            {
                System.Diagnostics.Debug.Write("PostDelayed方法已经完成");
                _swipeRefreshLayout.Refreshing = false;
            }, 3000);
            _recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(this.Activity));
            kbArticlesList = await listKbArticleLocal();

            if (kbArticlesList.Count > 0)
            {
                initRecycler();
            }
            else
            {
                kbArticlesList = await listKbArticlesServer();

                if (kbArticlesList.Count > 0)
                {
                    initRecycler();
                }
            }
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var rootView = inflater.Inflate(Resource.Layout.RecyclerViewFragment, container, false);

            RecyclerView = rootView.FindViewById <RecyclerView> (Resource.Id.recyclerView);

            LayoutManager = GetLayoutManager();
            RecyclerView.SetLayoutManager(LayoutManager);
            ItemAnimator = GetItemAnimator();
            RecyclerView.SetItemAnimator(ItemAnimator);

            SwipeRefreshLayout = rootView.FindViewById <SwipeRefreshLayout> (Resource.Id.swipe_refresh_layout);

            if (EnablePullToRefresh)
            {
                SwipeRefreshLayout.SetOnRefreshListener(this);
            }

            //adds item divider lines if ShowDividers == true
            if (ShowDividers)
            {
                RecyclerView.AddItemDecoration(new DividerItemDecoration(Activity, DividerItemDecoration.VerticalList));
            }

            Adapter = TypedAdapter = CreateAdapter();
            RecyclerView.ScrollToPosition(0);
            RecyclerView.SetAdapter(Adapter);

            //start to load the data that will populate the RecyclerView
            loadData();

            return(rootView);
        }
Ejemplo n.º 3
0
        protected override void InitViews()
        {
            FindViewById <TextView>(Resource.Id.tv_title).Text = string.Format("{0}教学报表", currReportInfo.Item3);

            tv_btn1 = FindViewById <TextView>(Resource.Id.tv_btn1);
            tv_btn2 = FindViewById <TextView>(Resource.Id.tv_btn2);
            tv_btn3 = FindViewById <TextView>(Resource.Id.tv_btn3);

            mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);
            mRecyclerView       = FindViewById <RecyclerView>(Resource.Id.recycler_view);
            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));

            linearLayoutManager = new LinearLayoutManager(CurrActivity);
            mAdapter            = new RenewReportAdapter(CurrContext, teachReportList);
            mRecyclerView.SetLayoutManager(linearLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            mAdapter.NotifyDataSetChanged();

            mSwipeRefreshLayout.SetOnRefreshListener(this);
            //mSwipeRefreshLayout.SetOnScrollChangeListener(this);

            //mAdapter.SetOnItemClickListener(this);

            RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this);

            mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener));

            arrowDown   = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
            arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);

            SetClassStatusImg(FindViewById <ImageButton>(Resource.Id.imgBtn_lessonIng), "init");
        }
Ejemplo n.º 4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.LogTimeEntriesListFragment, container, false);

            view.FindViewById <TextView> (Resource.Id.EmptyTextTextView).SetFont(Font.RobotoLight);

            experimentEmptyView         = view.FindViewById <View> (Resource.Id.ExperimentEmptyMessageView);
            emptyMessageView            = view.FindViewById <View> (Resource.Id.EmptyMessageView);
            welcomeMessage              = view.FindViewById <TextView> (Resource.Id.WelcomeTextView);
            noItemsMessage              = view.FindViewById <TextView> (Resource.Id.EmptyTitleTextView);
            layoverView                 = view.FindViewById <View> (Resource.Id.LayoverView);
            layoverView.Click          += (sender, e) => { };
            layoverDismissButton        = view.FindViewById <Button> (Resource.Id.LayoverButton);
            layoverDismissButton.Click += OnAllrightButtonClicked;
            recyclerView                = view.FindViewById <RecyclerView> (Resource.Id.LogRecyclerView);
            recyclerView.SetLayoutManager(new LinearLayoutManager(Activity));
            swipeLayout = view.FindViewById <SwipeRefreshLayout> (Resource.Id.LogSwipeContainer);
            swipeLayout.SetOnRefreshListener(this);
            coordinatorLayout = view.FindViewById <CoordinatorLayout> (Resource.Id.logCoordinatorLayout);
            StartStopBtn      = view.FindViewById <StartStopFab> (Resource.Id.StartStopBtn);
            timerComponent    = ((MainDrawerActivity)Activity).Timer; // TODO: a better way to do this?
            HasOptionsMenu    = true;

            var settingsStore = ServiceContainer.Resolve <SettingsStore> ();
            var authManager   = ServiceContainer.Resolve <AuthManager> ();

            if (settingsStore.ShowOverlay || !authManager.OfflineMode)
            {
                layoverView.Visibility = ViewStates.Gone;
            }

            return(view);
        }
Ejemplo n.º 5
0
        protected override void InitViews()
        {
            llAdd          = FindViewById <LinearLayout>(Resource.Id.ll_add);
            tvTeacherCount = FindViewById <TextView>(Resource.Id.tv_teachercount);

            mSwipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.refresher);
            mRecyclerView       = FindViewById <RecyclerView>(Resource.Id.recycler_view);

            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));

            linearLayoutManager = new LinearLayoutManager(CurrActivity);
            mAdapter            = new TeacherScopeAdapter(CurrContext, teachScopeList);
            mRecyclerView.SetLayoutManager(linearLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            mAdapter.NotifyDataSetChanged();

            mSwipeRefreshLayout.SetOnRefreshListener(this);
            //mSwipeRefreshLayout.SetOnScrollChangeListener(this);

            //mAdapter.SetOnItemClickListener(this);

            RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this);

            mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener));
        }
Ejemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ActionBar.SetDisplayHomeAsUpEnabled(true);

            SetContentView(Resource.Layout.activity_portal_view_connections);

            var following = FindViewById(Resource.Id.portal_following);

            followingList = following.FindViewById <RecyclerView>(Resource.Id.list);
            var followingEmpty = following.FindViewById(Resource.Id.empty);

            swiper = FindViewById <SwipeRefreshLayout>(Resource.Id.swiper);
            swiper.SetOnRefreshListener(this);

            var followers = FindViewById(Resource.Id.portal_followers);

            followersList = followers.FindViewById <RecyclerView>(Resource.Id.list);
            var followersEmpty = followers.FindViewById(Resource.Id.empty);


            followingList.SetAdapter(followingAdapter = new Adapter());
            followingAdapter.emptyView    = followingEmpty;
            followingAdapter.deleteAction = OnDeleteFollowing;

            followersList.SetAdapter(followerAdapter = new Adapter());
            followerAdapter.emptyView    = followersEmpty;
            followerAdapter.deleteAction = OnDeleteFollower;
        }
        protected override void OnElementChanged(ElementChangedEventArgs <PullToRefreshContentView> e)
        {
            base.OnElementChanged(e);

            if (refresher != null)
            {
                return;
            }

            refresher = new SwipeRefreshLayout(Xamarin.Forms.Forms.Context);
            refresher.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
            refresher.SetColorSchemeResources(Resource.Color.xam_purple);

            refresher.SetOnRefreshListener(this);
            //This gets called when we pull down to refresh to trigger command
            refresher.Refresh += (object sender2, EventArgs e2) => {
                var command = this.Element.RefreshCommand;
                if (command == null)
                {
                    return;
                }

                command.Execute(null);
            };

            //HACK as I need to add the sub group to the content group...
            //var text = new Android.Widget.ListView (Xamarin.Forms.Forms.Context);
            //text.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
            //text.Text = "Hello world";

            //refresher.AddView (text);

            refresher.SetBackgroundColor(Android.Graphics.Color.Red);
            SetNativeControl(refresher);
        }
Ejemplo n.º 8
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.browsePage, container, false);



            topRated = view.FindViewById <RecyclerView>(Resource.Id.topRated);
            InitTopRatedRecyclerView();

            popular = view.FindViewById <RecyclerView>(Resource.Id.popular);
            InitPopularRecyclerView();


            nowPlaying = view.FindViewById <RecyclerView>(Resource.Id.nowPlaying);
            InitNowPlayingRecyclerView();

            swipeRefresh = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefresh);
            swipeRefresh.SetOnRefreshListener(new SwipeRefreshListener(async() =>
            {
                await viewModel.Refresh(() =>
                {
                    Locator.Get <IUIDispatcher>().RunOnUiThread(() =>
                    {
                        swipeRefresh.Refreshing = false;
                        topRated.ScrollToPosition(0);
                        popular.ScrollToPosition(0);
                        nowPlaying.ScrollToPosition(0);
                    });
                });
            }));


            return(view);
        }
Ejemplo n.º 9
0
        protected override void InitView()
        {
            // Use this to return your custom view for this Fragment
            // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
            ToastUtil.ToastShort(Activity, position.ToString());
            srlBlog = FindViewById <SwipeRefreshLayout>(Resource.Id.srl_blog);
            //srlBlog = view.FindViewById<SwipeRefreshLayout>(Resource.Id.srl_blog);
            recyclerview_blog = FindViewById <RecyclerView>(Resource.Id.recyclerview_blog);
            srlBlog.SetColorSchemeResources(Resource.Color.colorPrimary);
            recyclerview_blog.SetLayoutManager(new  LinearLayoutManager(this.Activity));

            blogPresenter   = new BlogPresenter(this);
            adapter         = new BlogAdapter();
            loadMoreWrapper = new LoadMoreWrapper(adapter);
            recyclerview_blog.SetAdapter(loadMoreWrapper);

            emptyView = this.Activity.LayoutInflater.Inflate(Resource.Layout.empty, (ViewGroup)recyclerview_blog.Parent, false);
            failView  = this.Activity.LayoutInflater.Inflate(Resource.Layout.fail, (ViewGroup)recyclerview_blog.Parent, false);

            srlBlog.SetOnRefreshListener(this);
            failView.SetOnClickListener(this);
            emptyView.SetOnClickListener(this);
            loadMoreWrapper.SetOnLoadMoreListener(this);

            recyclerview_blog.Post(async() =>
            {
                await blogPresenter.GetLocalBlog(pageSize, position);
            });
        }
Ejemplo n.º 10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Main);

            balanceView      = FindViewById <TextView>(Resource.Id.balanceView);
            transactionsView =
                FindViewById <ListView>(Resource.Id.transactionListView);
            deviceSpinner             = FindViewById <Spinner>(Resource.Id.deviceSpinner);
            transactionsRefreshLayout =
                FindViewById <SwipeRefreshLayout>(
                    Resource.Id.transactionRefreshLayout);

            transactionsRefreshLayout.SetOnRefreshListener(this);

            transactionAdaptor       = new TransactionAdaptor(this);
            transactionsView.Adapter = transactionAdaptor;

            deviceAdaptor               = new DeviceAdaptor(this);
            deviceSpinner.Adapter       = deviceAdaptor;
            deviceSpinner.Enabled       = false;
            deviceSpinner.ItemSelected += DeviceSelected;

            if (Account.IsBalanceSet)
            {
                balanceView.Text = Account.Balance.ToString();
            }

            statementHandler = new StatementHandler(this);
            UpdateStatement();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 初始化页面控件
        /// </summary>
        protected void InitViews(View view)
        {
            tv_year          = view.FindViewById <TextView>(Resource.Id.tv_year);
            tv_district      = view.FindViewById <TextView>(Resource.Id.tv_district);
            tv_title_payment = view.FindViewById <TextView>(Resource.Id.tv_title_payment);

            //添加按钮的事件监控
            tv_year.SetOnClickListener(this);
            tv_district.SetOnClickListener(this);

            mRecyclerView = (RecyclerView)view.FindViewById(Resource.Id.recycler_view);
            //adapter展示列表数据
            linearLayoutManager = new LinearLayoutManager(CurrActivity);
            mAdapter            = new BudgeAdapter(CurrActivity, paymentList);
            mRecyclerView.SetLayoutManager(linearLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            mAdapter.NotifyDataSetChanged();

            RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this);

            mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener));

            //搜索条件弹框
            popYear     = null;
            popDistrict = null;

            //初始化查询类型
            dataType = 1;

            //下拉刷新
            mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher);
            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));
            mSwipeRefreshLayout.SetOnRefreshListener(this);
        }
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            answerId   = Intent.GetIntExtra("answerId", 0);
            questionId = Intent.GetIntExtra("questionId", 0);
            SetToolBarNavBack();
            StatusBarUtil.SetColorStatusBars(this);
            SetToolBarTitle("»Ø´ðÆÀÂÛ");
            //ÏÔʾͼƬÅäÖÃ
            options = new DisplayImageOptions.Builder()
                      .ShowImageForEmptyUri(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnFail(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnLoading(Resource.Drawable.icon_user)
                      .CacheInMemory(true)
                      .BitmapConfig(Bitmap.Config.Rgb565)
                      .CacheOnDisk(true)
                      // .Displayer(new DisplayerImageCircle(20))
                      .Build();
            edit_content = FindViewById <EditText>(Resource.Id.edit_content);
            btn_submit   = FindViewById <Button>(Resource.Id.btn_submit);
            userToken    = UserTokenUtil.GetToken(this);
            //btn_submit.enabvle
            btn_submit.Click += (s, e) =>
            {
                Add();
            };
            edit_content.TextChanged += (s, e) =>
            {
                string temp = edit_content.Text.TrimStart().TrimEnd();
                if (!string.IsNullOrEmpty(temp))
                {
                    btn_submit.Enabled = true;
                    if (atUserName != null && atUserName.Length > 0 && temp.Contains(atUserName))
                    {
                        isAt = true;
                    }
                    else
                    {
                        isAt = false;
                    }
                }
                else
                {
                    btn_submit.Enabled = false;
                }
            };

            _swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            _swipeRefreshLayout.SetOnRefreshListener(this);
            _swipeRefreshLayout.Post(() =>
            {
                _swipeRefreshLayout.Refreshing = true;
            });
            _recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(this));
            _recyclerView.AddItemDecoration(new RecyclerViewDecoration(this, (int)Orientation.Vertical));
            initRecyclerView();
            userInfo = UserInfoShared.GetUserInfo(this);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 初始化页面控件
        /// </summary>
        protected override void InitViews()
        {
            tv_grade     = FindViewById <TextView>(Resource.Id.tv_grade);
            tv_course    = FindViewById <TextView>(Resource.Id.tv_course);
            tv_title     = FindViewById <TextView>(Resource.Id.tv_title);
            tv_itemTitle = FindViewById <TextView>(Resource.Id.tv_item_title);

            tv_title.Text = areaName;
            if (dataType == 1)
            {
                tv_itemTitle.Text = "总人次";
            }
            else
            {
                tv_itemTitle.Text = "总收入";
            }

            mRecyclerView = (RecyclerView)FindViewById(Resource.Id.recycler_view);
            //adapter展示列表数据
            linearLayoutManager = new LinearLayoutManager(CurrActivity);
            mAdapter            = new SumByTeacherAdapter(CurrContext, sumTeacherList);
            mRecyclerView.SetLayoutManager(linearLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            mAdapter.NotifyDataSetChanged();

            RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this);

            mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener));

            //下拉刷新
            mSwipeRefreshLayout = (SwipeRefreshLayout)FindViewById(Resource.Id.refresher);
            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));
            mSwipeRefreshLayout.SetOnRefreshListener(this);
        }
Ejemplo n.º 14
0
        /// <summary>
        /// 初始化页面控件
        /// </summary>
        protected void InitViews(View view)
        {
            tv_totalcount = view.FindViewById <TextView>(Resource.Id.tv_totalcount);

            tv_year     = view.FindViewById <TextView>(Resource.Id.tv_year);
            tv_district = view.FindViewById <TextView>(Resource.Id.tv_district);
            tv_cagetory = view.FindViewById <TextView>(Resource.Id.tv_category);

            //添加按钮的事件监控
            tv_year.SetOnClickListener(this);
            tv_district.SetOnClickListener(this);
            tv_cagetory.SetOnClickListener(this);

            mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher);
            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));
            mSwipeRefreshLayout.SetOnRefreshListener(this);

            //adapter展示列表数据
            linearLayoutManager = new LinearLayoutManager(CurrActivity);
            mRecyclerView       = (RecyclerView)view.FindViewById(Resource.Id.recycler_view);
            mAdapter            = new NewStudentAdapter(CurrActivity, sumList, this.avgGrowthRate, mRecyclerView);
            mRecyclerView.SetLayoutManager(linearLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            mAdapter.NotifyDataSetChanged();

            //搜索条件弹框
            popYear     = null;
            popCategory = null;
            popDistrict = null;

            //初始化查询类型
            dataType = 1;
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 页面控件
        /// </summary>
        protected void InitViews(View view)
        {
            tv_btn1 = view.FindViewById <TextView>(Resource.Id.tv_btn1);
            tv_btn2 = view.FindViewById <TextView>(Resource.Id.tv_btn2);
            tv_btn3 = view.FindViewById <TextView>(Resource.Id.tv_btn3);
            tv_btn1.SetOnClickListener(this);
            tv_btn2.SetOnClickListener(this);
            tv_btn3.SetOnClickListener(this);


            mSwipeRefreshLayout = (SwipeRefreshLayout)view.FindViewById(Resource.Id.refresher);
            mRecyclerView       = (RecyclerView)view.FindViewById(Resource.Id.recycler_view);

            mSwipeRefreshLayout.SetColorSchemeColors(Color.ParseColor("#db0000"));
            //mSwipeRefreshLayout.SetColorScheme(Resource.Color.xam_dark_blue,
            //Resource.Color.xam_purple,
            //Resource.Color.xam_gray,
            //Resource.Color.xam_green);


            linearLayoutManager = new LinearLayoutManager(CurrActivity);
            mAdapter            = new RenewReportAdapter(CurrActivity, teachReportList);
            mRecyclerView.SetLayoutManager(linearLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            mAdapter.NotifyDataSetChanged();

            mSwipeRefreshLayout.SetOnRefreshListener(this);
            RecyclerViewItemOnGestureListener viewOnGestureListener = new RecyclerViewItemOnGestureListener(mRecyclerView, this);

            mRecyclerView.AddOnItemTouchListener(new RecyclerViewItemOnItemTouchListener(mRecyclerView, viewOnGestureListener));
        }
Ejemplo n.º 16
0
        protected override void OnElementChanged(ElementChangedEventArgs <ListView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                ((IListViewController)e.OldElement).ScrollToRequested -= OnScrollToRequested;

                if (_adapter != null)
                {
                    // Unhook the adapter from the ListView before disposing of it
                    if (Control != null)
                    {
                        Control.Adapter = null;
                    }

                    _adapter.Dispose();
                    _adapter = null;
                }
            }

            if (e.NewElement != null)
            {
                AListView nativeListView = Control;
                if (nativeListView == null)
                {
                    var ctx = Context;
                    nativeListView = CreateNativeControl();
                    _refresh       = CreateNativePullToRefresh(ctx);
                    _refresh.SetOnRefreshListener(this);
                    _refresh.AddView(nativeListView, new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent));
                    SetNativeControl(nativeListView, _refresh);

                    _headerView = new Container(ctx);
                    nativeListView.AddHeaderView(_headerView, null, false);
                    _footerView = new Container(ctx);
                    nativeListView.AddFooterView(_footerView, null, false);
                }

                ((IListViewController)e.NewElement).ScrollToRequested += OnScrollToRequested;

                nativeListView.DividerHeight          = 0;
                nativeListView.Focusable              = false;
                nativeListView.DescendantFocusability = DescendantFocusability.AfterDescendants;
                nativeListView.OnFocusChangeListener  = this;
                nativeListView.Adapter      = _adapter = e.NewElement.IsGroupingEnabled && e.NewElement.OnThisPlatform().IsFastScrollEnabled() ? new GroupedListViewAdapter(Context, nativeListView, e.NewElement) : new ListViewAdapter(Context, nativeListView, e.NewElement);
                _adapter.HeaderView         = _headerView;
                _adapter.FooterView         = _footerView;
                _adapter.IsAttachedToWindow = _isAttached;

                UpdateHeader();
                UpdateFooter();
                UpdateIsSwipeToRefreshEnabled();
                UpdateFastScrollEnabled();
                UpdateSelectionMode();
                UpdateSpinnerColor();
                UpdateHorizontalScrollBarVisibility();
                UpdateVerticalScrollBarVisibility();
            }
        }
Ejemplo n.º 17
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            id               = Intent.GetStringExtra("id");
            handler          = new Handler();
            commentPresenter = new DailyCommentPresenter(this);

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetNavigationIcon(Resource.Drawable.back_24dp);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            toolbar.SetNavigationOnClickListener(this);

            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);

            recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            adapter = new DailyCommentsAdapter();
            adapter.OnLoadMoreListener = this;

            recyclerView.SetAdapter(adapter);
            recyclerView.Post(() =>
            {
                swipeRefreshLayout.Refreshing = true;
                OnRefresh();
            });
        }
        protected override void OnCreate(Bundle state)
        {
            base.OnCreate(state);
            SetContentView(Resource.Layout.activity_device_grid);

            ActionBar.SetIcon(Resource.Drawable.ic_nav_devmanager.AsResourceDrawable(this, Resource.Color.gray));
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            _swiper             = FindViewById <SwipeRefreshLayout>(Resource.Id.swiper);
            _availableHeader    = FindViewById(Resource.Id.content);
            _disconnectedHeader = FindViewById(Resource.Id.content2);
            _availableList      = FindViewById <RecyclerView>(Resource.Id.connected);
            _disconnectedList   = FindViewById <RecyclerView>(Resource.Id.disconnected);

            _handler = new Handler();

            _swiper.SetOnRefreshListener(this);
            _availableList.SetLayoutManager(new GridLayoutManager(this, COL_SIZE));
            _availableAdapter = new DeviceGridAdapter(ion, COL_SIZE, (gd) => {
                return(gd.isConnected || gd.isNearby);
            });
            _availableList.SetAdapter(_availableAdapter);
            _availableAdapter.onSensorClicked = OnSensorClicked;

            _disconnectedList.SetLayoutManager(new GridLayoutManager(this, COL_SIZE));
            _disconnectedAdapter = new DeviceGridAdapter(ion, COL_SIZE, (gd) => {
                return(gd.connection.connectionState == EConnectionState.Disconnected && !gd.isNearby);
            });
            _disconnectedList.SetAdapter(_disconnectedAdapter);
            _disconnectedAdapter.onSensorClicked = OnSensorClicked;

            _receiver = new CombinedScanReceiver(this, ion.deviceManager);
        }
Ejemplo n.º 19
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            swipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);

            recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            var manager = new LinearLayoutManager(this.Activity);

            recyclerView.SetLayoutManager(manager);

            adapter = new NewsAdapter();
            adapter.SetOnLoadMoreListener(this);
            recyclerView.SetAdapter(adapter);
            notDataView        = this.Activity.LayoutInflater.Inflate(Resource.Layout.empty_view, (ViewGroup)recyclerView.Parent, false);
            notDataView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            errorView        = this.Activity.LayoutInflater.Inflate(Resource.Layout.error_view, (ViewGroup)recyclerView.Parent, false);
            errorView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            recyclerView.Post(async() =>
            {
                await newsPresenter.GetClientNews(position);
            });
        }
		protected override void OnElementChanged (ElementChangedEventArgs<PullToRefreshContentView> e)
		{
			base.OnElementChanged (e);

			if (refresher != null)
				return;

			refresher = new SwipeRefreshLayout (Xamarin.Forms.Forms.Context);
			refresher.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
			refresher.SetColorSchemeResources (Resource.Color.xam_purple);

			refresher.SetOnRefreshListener (this);
			//This gets called when we pull down to refresh to trigger command
			refresher.Refresh += (object sender2, EventArgs e2) => {
				var command = this.Element.RefreshCommand;
				if (command == null)
					return;

				command.Execute (null);
			};

			//HACK as I need to add the sub group to the content group...
			//var text = new Android.Widget.ListView (Xamarin.Forms.Forms.Context);
			//text.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
			//text.Text = "Hello world";

			//refresher.AddView (text);

			refresher.SetBackgroundColor (Android.Graphics.Color.Red);
			SetNativeControl (refresher);
		}
Ejemplo n.º 21
0
        public override async void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            ly_expire           = view.FindViewById <LinearLayout>(Resource.Id.ly_expire);
            tv_startLogin       = view.FindViewById <TextView>(Resource.Id.tv_startLogin);
            _swipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            _swipeRefreshLayout.SetOnRefreshListener(this);
            userToken   = UserTokenUtil.GetToken(Activity);
            accessToken = AccessTokenUtil.GetToken(Activity);

            _recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(this.Activity));
            //_recyclerView.AddItemDecoration(new RecyclerViewDecoration(this.Activity, (int)Orientation.Vertical));
            try
            {
                if (position != 0 || isMy) //³ýÁË×îÐÂÉÁ´æ£¬ÆäËûµÄ¶¼Òªusertoken
                {
                    if (UserUtil.Instance(Activity).LoginExpire())
                    {
                        ly_expire.Visibility           = ViewStates.Visible;
                        _swipeRefreshLayout.Visibility = ViewStates.Gone;
                        tv_startLogin.Click           += (s, e) =>
                        {
                            Activity.StartActivity(new Intent(Activity, typeof(loginactivity)));
                        };
                    }
                    else
                    {
                        ly_expire.Visibility           = ViewStates.Gone;
                        _swipeRefreshLayout.Visibility = ViewStates.Visible;
                        statusList = await SQLiteUtil.SelectStatusList(Constact.PageSize, isMy);

                        if (statusList != null && statusList.Count != 0)
                        {
                            initRecycler();
                        }
                        OnRefresh();
                    }
                }
                else
                {
                    ly_expire.Visibility           = ViewStates.Gone;
                    _swipeRefreshLayout.Visibility = ViewStates.Visible;
                    statusList = await SQLiteUtil.SelectStatusList(Constact.PageSize);

                    if (statusList != null && statusList.Count != 0)
                    {
                        initRecycler();
                    }
                    OnRefresh();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.Write("statusTabFragment", ex.ToString());
            }
        }
Ejemplo n.º 22
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Create your application here
            StatusBarUtil.SetColorStatusBars(this);
            SetToolBarNavBack();
            shareWidget        = new UMengShareWidget(this);
            wb_content         = FindViewById <WebView>(Resource.Id.wb_content);
            tv_ding            = FindViewById <TextView>(Resource.Id.tv_ding);
            btn_mark           = FindViewById <Button>(Resource.Id.btn_mark);
            btn_comment        = FindViewById <Button>(Resource.Id.btn_comment);
            tv_view            = FindViewById <TextView>(Resource.Id.tv_view);
            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeColors(Resources.GetColor(Resource.Color.primary));
            swipeRefreshLayout.SetOnRefreshListener(this);

            btn_mark.Click += (s, e) =>
            {
                AddBookmarkActivity.Enter(this, string.Format(Constact.KbPage, ID), news.Title, "add");
            };
            btn_comment.Click += (s, e) =>
            {
                NewsCommentActivity.Enter(this, ID);
            };

            wb_content.Settings.DomStorageEnabled       = true;
            wb_content.Settings.JavaScriptEnabled       = true;    //支持js
            wb_content.Settings.DefaultTextEncodingName = "utf-8"; //设置编码方式utf-8
            wb_content.Settings.SetSupportZoom(false);             //不可缩放
            wb_content.Settings.DisplayZoomControls = false;       //隐藏原生的缩放控件
            wb_content.Settings.BuiltInZoomControls = false;       //设置内置的缩放控件
            wb_content.Settings.CacheMode           = CacheModes.CacheElseNetwork;
            wb_content.ScrollBarStyle = ScrollbarStyles.InsideOverlay;
            wb_content.Settings.LoadsImagesAutomatically = true; //支持自动加载图片
            wb_content.Settings.UseWideViewPort          = true; //将图片调整到合适webview的大小
            wb_content.Settings.SetLayoutAlgorithm(WebSettings.LayoutAlgorithm.SingleColumn);
            var jsInterface = new  WebViewJSInterface(this);

            wb_content.SetWebViewClient(ContentWebViewClient.Instance(this));
            wb_content.AddJavascriptInterface(jsInterface, "openlistner");
            jsInterface.CallFromPageReceived += delegate(object sender, WebViewJSInterface.CallFromPageReceivedEventArgs e)
            {
                PhotoActivity.Enter(this, e.Result.Split(','), e.Index);
            };
            ID = Intent.GetIntExtra("id", 0);
            if (ID == 0)
            {
                Android.OS.Handler handle = new Android.OS.Handler();
                handle.PostDelayed(() =>
                {
                    Finish();
                }, 2000);
                AlertUtil.ToastShort(this, "获取id错误立即返回");
            }
            InitNews();

            //shareWidget = new UMengShareWidget(this);
        }
Ejemplo n.º 23
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            _swipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout1);
            _recyclerView       = view.FindViewById <RecyclerView>(Resource.Id.recyclerView1);

            _swipeRefreshLayout.SetOnRefreshListener(this);
            _recyclerView.SetAdapter(GetInitializedDataSource());
        }
Ejemplo n.º 24
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Id = Intent.GetIntExtra("id", 0);
            statusPresenter  = new StatusPresenter(this);
            commentPresenter = new StatusCommentsPresenter(this);
            handler          = new Handler();

            StatusBarCompat.SetOrdinaryToolBar(this);
            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetNavigationIcon(Resource.Drawable.back_24dp);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            toolbar.SetNavigationOnClickListener(this);

            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);

            userName     = FindViewById <TextView>(Resource.Id.txtUserName);
            imgUserUrl   = FindViewById <ImageView>(Resource.Id.imgUserUrl);
            imgPrivate   = FindViewById <ImageView>(Resource.Id.imgPrivate);
            imgDelete    = FindViewById <ImageButton>(Resource.Id.imgDelete);
            txtPostdate  = FindViewById <TextView>(Resource.Id.txtPostdate);
            txtBody      = FindViewById <TextView>(Resource.Id.txtBody);
            commentCount = FindViewById <TextView>(Resource.Id.txtCommentCount);

            txtContent = FindViewById <TextView>(Resource.Id.txtContent);
            proLoading = FindViewById <ProgressBar>(Resource.Id.proLoading);
            btnComment = FindViewById <TextView>(Resource.Id.btnComment);
            btnComment.SetOnClickListener(this);

            recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            recyclerView.SetLayoutManager(new LinearLayoutManager(this));
            recyclerView.NestedScrollingEnabled = false;
            adapter = new StatusCommentsAdapter();
            adapter.OnDeleteClickListener = this;
            adapter.User = await SQLiteUtils.Instance().QueryUser();

            recyclerView.SetAdapter(adapter);

            notDataView        = this.LayoutInflater.Inflate(Resource.Layout.empty_view, (ViewGroup)recyclerView.Parent, false);
            notDataView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            errorView        = this.LayoutInflater.Inflate(Resource.Layout.error_view, (ViewGroup)recyclerView.Parent, false);
            errorView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            recyclerView.Post(async() =>
            {
                await statusPresenter.GetClientStatus(Id);
                OnRefresh();
            });
        }
Ejemplo n.º 25
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            POSTID = Intent.GetIntExtra("postId", 0);
            SetToolBarNavBack();
            StatusBarUtil.SetColorStatusBars(this);
            SetToolBarTitle(Resources.GetString(Resource.String.comment));
            //显示图片配置
            options = new DisplayImageOptions.Builder()
                      .ShowImageForEmptyUri(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnFail(Resource.Drawable.icon_yuanyou)
                      .ShowImageOnLoading(Resource.Drawable.icon_user)
                      .CacheInMemory(true)
                      .BitmapConfig(Bitmap.Config.Rgb565)
                      .CacheOnDisk(true)
                      // .Displayer(new DisplayerImageCircle(20))
                      .Build();

            edit_content = FindViewById <EditText>(Resource.Id.edit_content);
            btn_submit   = FindViewById <Button>(Resource.Id.btn_submit);
            //btn_submit.enabvle
            btn_submit.Click += (s, e) =>
            {
                Add();
            };
            edit_content.TextChanged += (s, e) =>
            {
                string temp = edit_content.Text.TrimStart().TrimEnd();
                if (!string.IsNullOrEmpty(temp))
                {
                    btn_submit.Enabled = true;
                    if (atUserName != null && atUserName.Length > 0 && temp.Contains(atUserName))
                    {
                        isAt = true;
                    }
                    else
                    {
                        isAt = false;
                    }
                }
                else
                {
                    btn_submit.Enabled = false;
                }
            };

            _swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            _swipeRefreshLayout.SetOnRefreshListener(this);

            _recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            _recyclerView.SetLayoutManager(new Android.Support.V7.Widget.LinearLayoutManager(this));
            _recyclerView.AddItemDecoration(new RecyclerViewDecoration(this, (int)Orientation.Vertical));
            System.Diagnostics.Debug.Write("主线程ID" + Thread.CurrentThread.ManagedThreadId);
            accessToken = AccessTokenUtil.GetToken(this);
            OnRefresh();
        }
Ejemplo n.º 26
0
        public override async void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            try
            {
                this.HasOptionsMenu = true;
                swipeRefreshLayout  = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
                swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
                swipeRefreshLayout.SetOnRefreshListener(this);

                recyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);
                var manager = new LinearLayoutManager(this.Activity);
                recyclerView.SetLayoutManager(manager);

                adapter = new StatusAdapter();
                adapter.SetOnLoadMoreListener(this);
                adapter.OnDeleteClickListener = this;
                adapter.User = await SQLiteUtils.Instance().QueryUser();

                recyclerView.SetAdapter(adapter);

                nologinView        = this.Activity.LayoutInflater.Inflate(Resource.Layout.nologin_view, (ViewGroup)recyclerView.Parent, false);
                nologinView.Click += delegate(object sender, EventArgs e)
                {
                    StartActivityForResult(new Intent(this.Activity, typeof(AuthorizeActivity)), (int)RequestCode.LoginCode);
                };
                notDataView        = this.Activity.LayoutInflater.Inflate(Resource.Layout.empty_view, (ViewGroup)recyclerView.Parent, false);
                notDataView.Click += delegate(object sender, EventArgs e)
                {
                    OnRefresh();
                };
                errorView        = this.Activity.LayoutInflater.Inflate(Resource.Layout.error_view, (ViewGroup)recyclerView.Parent, false);
                errorView.Click += delegate(object sender, EventArgs e)
                {
                    OnRefresh();
                };
                recyclerView.Post(async() =>
                {
                    if (position == 0)
                    {
                        await statusesPresenter.GetClientStatus();
                    }
                    else if (!LoginUtils.Instance(this.Activity).GetLoginStatus())
                    {
                        recyclerView.Post(() =>
                        {
                            adapter.SetEmptyView(nologinView);
                        });
                    }
                });
            }
            catch (Exception ex)
            {
                MobclickAgent.ReportError(Context, ex.Message + ex.StackTrace);
            }
        }
Ejemplo n.º 27
0
        protected async override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            blogApp       = Intent.GetStringExtra("blogApp");
            blogPresenter = new BlogPresenter(this);
            handler       = new Handler();

            coordinatorLayout = FindViewById <CoordinatorLayout>(Resource.Id.coordinatorLayout);
            appBarLayout      = FindViewById <AppBarLayout>(Resource.Id.appbar);
            linearLayout      = FindViewById <LinearLayout>(Resource.Id.linearLayout);

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetNavigationIcon(Resource.Drawable.back_24dp);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            toolbar.SetNavigationOnClickListener(this);

            StatusBarCompat.SetCollapsingToolbar(this, coordinatorLayout, appBarLayout, linearLayout, toolbar);

            imgAvatar   = FindViewById <ImageView>(Resource.Id.avatar);
            txtTitle    = FindViewById <TextView>(Resource.Id.txtTitle);
            txtSubTitle = FindViewById <TextView>(Resource.Id.txtSubTitle);

            user = await SQLiteUtils.Instance().QueryUser();

            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);

            recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView);
            var manager = new LinearLayoutManager(this);

            recyclerView.SetLayoutManager(manager);

            adapter = new ArticlesAdapter();
            adapter.SetOnLoadMoreListener(this);

            recyclerView.SetAdapter(adapter);
            notDataView        = this.LayoutInflater.Inflate(Resource.Layout.empty_view, (ViewGroup)recyclerView.Parent, false);
            notDataView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            errorView        = this.LayoutInflater.Inflate(Resource.Layout.error_view, (ViewGroup)recyclerView.Parent, false);
            errorView.Click += delegate(object sender, EventArgs e)
            {
                OnRefresh();
            };
            recyclerView.Post(async() =>
            {
                await blogPresenter.GetClientBlog(blogApp);
                OnRefresh();
            });
        }
Ejemplo n.º 28
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Id = Intent.GetIntExtra("id", 0);
            articlePresenter = new ArticlePresenter(this);
            handler          = new Handler();

            StatusBarCompat.SetOrdinaryToolBar(this);
            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            toolbar.SetNavigationIcon(Resource.Drawable.back_24dp);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            toolbar.SetNavigationOnClickListener(this);
            toolbar.SetOnMenuItemClickListener(this);
            swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetColorSchemeResources(Resource.Color.primary);
            swipeRefreshLayout.SetOnRefreshListener(this);
            scrollView = FindViewById <NestedScrollView>(Resource.Id.scrollView);

            txtTitle    = FindViewById <TextView>(Resource.Id.txtTitle);
            imgAvatar   = FindViewById <ImageView>(Resource.Id.llAvatar);
            txtAuthor   = FindViewById <TextView>(Resource.Id.txtAuthor);
            txtPostdate = FindViewById <TextView>(Resource.Id.txtPostdate);
            txtBody     = FindViewById <WebView>(Resource.Id.txtBody);
            txtBody.Settings.JavaScriptEnabled        = true;
            txtBody.Settings.DomStorageEnabled        = true;
            txtBody.Settings.LoadsImagesAutomatically = true;
            txtBody.Settings.DefaultTextEncodingName  = "utf-8";
            txtBody.SetWebViewClient(BodyWebViewClient.With(this));
            txtBody.ScrollBarStyle = ScrollbarStyles.InsideOverlay;
            txtBody.Settings.SetSupportZoom(false);
            txtBody.Settings.BuiltInZoomControls = false;
            txtBody.Settings.CacheMode           = CacheModes.CacheElseNetwork;
            txtBody.Settings.SetLayoutAlgorithm(WebSettings.LayoutAlgorithm.SingleColumn);
            var jsInterface = new WebViewJSInterface(this);

            txtBody.AddJavascriptInterface(jsInterface, "openlistner");
            jsInterface.CallFromPageReceived += delegate(object sender, WebViewJSInterface.CallFromPageReceivedEventArgs e)
            {
                PhotoActivity.Start(this, e.Result.Split(','), e.Index);
            };

            txtDigg     = FindViewById <TextView>(Resource.Id.txtDigg);
            txtRead     = FindViewById <TextView>(Resource.Id.txtRead);
            txtComments = FindViewById <TextView>(Resource.Id.txtComments);
            txtBookmark = FindViewById <TextView>(Resource.Id.txtBookmark);

            swipeRefreshLayout.Post(async() =>
            {
                await articlePresenter.GetClientArticle(Id);
            });

            shareAction = new ShareAction(this).SetDisplayList(SHARE_MEDIA.Weixin, SHARE_MEDIA.WeixinCircle, SHARE_MEDIA.WeixinFavorite, SHARE_MEDIA.Sina).SetShareboardclickCallback(this);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ActionBar.SetDisplayHomeAsUpEnabled(true);

            try {
                if (Build.VERSION.SdkInt > BuildVersionCodes.Lollipop)
                {
                    SetContentView(Resource.Layout.activity_portal_access_code_manager);
                }
                else
                {
                    SetContentView(Resource.Layout.activity_portal_access_code_manager_4_4);
                }
            } catch (Exception e) {
                Log.E(this, "Failed to set layout. Defaulting to old version", e);
                SetContentView(Resource.Layout.activity_portal_access_code_manager_4_4);
            }

            entry  = FindViewById <EditText>(Resource.Id.entry);
            swiper = FindViewById <SwipeRefreshLayout>(Resource.Id.swiper);
            list   = FindViewById <RecyclerView>(Resource.Id.list);

            FindViewById(Resource.Id.submit).Click += async(sender, e) => {
                await SubmitAccessCodeAsync(entry.Text);
            };

            FindViewById(Resource.Id.button).Click += async(sender, e) => {
                // TODO dialog
                var response = await ion.portal.RequestAccessCodeAsync();

                if (response.success)
                {
                    await QueryPendingAccessCodesAsync();
                }
                else
                {
                    Toast.MakeText(this, Resource.String.portal_error_access_code_too_many, ToastLength.Long).Show();
                }
            };

            list.SetAdapter(adapter = new Adapter());
            adapter.emptyView       = FindViewById(Resource.Id.empty);
            adapter.deleteAction    = OnDelete;
            adapter.onItemClicked  += (position) => {
                var record = adapter[position] as AccessCodeRecord;
                if (record.data.acceptId != 0)
                {
                    RequestConfirmAccess(position, record.data);
                }
            };
            swiper.SetOnRefreshListener(this);
        }
Ejemplo n.º 30
0
        protected override void OnElementChanged(ElementChangedEventArgs <ListView> e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null)
            {
                ((IListViewController)e.OldElement).ScrollToRequested -= OnScrollToRequested;

                if (_adapter != null)
                {
                    _adapter.Dispose();
                    _adapter = null;
                }
            }

            if (e.NewElement != null)
            {
                AListView nativeListView = Control;
                if (nativeListView == null)
                {
                    var ctx = Context;
                    nativeListView = new AListView(ctx);
                    _refresh       = new SwipeRefreshLayout(ctx);
                    _refresh.SetOnRefreshListener(this);
                    _refresh.AddView(nativeListView, LayoutParams.MatchParent);
                    SetNativeControl(nativeListView, _refresh);

                    _headerView = new Container(ctx);
                    nativeListView.AddHeaderView(_headerView, null, false);
                    _footerView = new Container(ctx);
                    nativeListView.AddFooterView(_footerView, null, false);
                }

                ((IListViewController)e.NewElement).ScrollToRequested += OnScrollToRequested;

                nativeListView.DividerHeight          = 0;
                nativeListView.Focusable              = false;
                nativeListView.DescendantFocusability = DescendantFocusability.AfterDescendants;
                nativeListView.OnFocusChangeListener  = this;
                nativeListView.Adapter      = _adapter = new ListViewAdapter(Context, nativeListView, e.NewElement);
                _adapter.HeaderView         = _headerView;
                _adapter.FooterView         = _footerView;
                _adapter.IsAttachedToWindow = _isAttached;

                UpdateHeader();
                UpdateFooter();
                UpdateIsSwipeToRefreshEnabled();
                UpdateIsRefreshing();
            }
        }
Ejemplo n.º 31
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view = inflater.Inflate(Resource.Layout.fragment_week_schedule, container, false);
            DrawContent(Resource.Id.relativelayout_week_schedule, Resource.Layout.layout_week_schedule);

            mSwipeRefreshLayout = view.FindViewById <SwipeRefreshLayout>(Resource.Id.swipetorefresh_week_schedule);
            mSwipeRefreshLayout.SetOnRefreshListener(this);

            recyclerViewSchedule = view.FindViewById <RecyclerView>(Resource.Id.recyclerview_week_schedule);

            LoadSheduleAndUpdateUIWithPorgressBar(weekDate, false);

            return(view);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_list);
            mContext = this;
            users = GetUsers();
            swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetOnRefreshListener(this);

            mRecyclerView = FindViewById<SwipeMenuRecyclerViews>(Resource.Id.listView);
            mRecyclerView.SetLayoutManager(new LinearLayoutManager(this));
            mRecyclerView.SetOpenInterpolator(new BounceInterpolator());
            mRecyclerView.SetCloseInterpolator(new BounceInterpolator());
            mAdapter = new AppAdapter(this, users);
            mRecyclerView.SetAdapter(mAdapter);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_list);
            mContext = this;
            users = GetUsers();
            swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout);
            swipeRefreshLayout.SetOnRefreshListener(this);

            mRecyclerView = FindViewById<SwipeMenuRecyclerViews>(Resource.Id.listView);
            mRecyclerView.SetLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.Vertical));
            mRecyclerView.AddItemDecoration(new StaggeredSpaceItemDecoration(15, 0, 15, 45));
            mRecyclerView.SetOpenInterpolator(new BounceInterpolator());
            mRecyclerView.SetCloseInterpolator(new BounceInterpolator());
            mAdapter = new AppAdapter(this, users);
            mRecyclerView.SetAdapter(mAdapter);
        }
Ejemplo n.º 34
0
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.LogTimeEntriesListFragment, container, false);
            view.FindViewById<TextView> (Resource.Id.EmptyTextTextView).SetFont (Font.RobotoLight);

            emptyMessageView = view.FindViewById<View> (Resource.Id.EmptyMessageView);
            emptyMessageView.Visibility = ViewStates.Gone;
            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.LogRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            swipeLayout = view.FindViewById<SwipeRefreshLayout> (Resource.Id.LogSwipeContainer);
            swipeLayout.SetOnRefreshListener (this);
            coordinatorLayout = view.FindViewById<CoordinatorLayout> (Resource.Id.logCoordinatorLayout);
            StartStopBtn = view.FindViewById<StartStopFab> (Resource.Id.StartStopBtn);
            timerComponent = ((MainDrawerActivity)Activity).Timer; // TODO: a better way to do this?
            HasOptionsMenu = true;

            return view;
        }
Ejemplo n.º 35
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Groepscherm);

            _persoon = Gegevens.GetPerson();
            _groep = Gegevens.CurrentGroup();

            _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar);

            TextView title = _toolbar.FindViewById<TextView>(Resource.Id.Title);
            title.Text = _groep.groepsnaam;

            SetSupportActionBar(_toolbar);
            SupportActionBar.Title = "";
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);

            _participantsRecyclerView = FindViewById<RecyclerView>(Resource.Id.participantsrecyclerview);
            _participantsRecyclerView.SetLayoutManager(new LinearLayoutManager(this));
            _participantsRecyclerView.SetScrollContainer(false);
            _participantsRecyclerView.NestedScrollingEnabled = false;

            _swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe_refresh);
            _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.mainColor);
            _swipeRefreshLayout.SetOnRefreshListener(this);

            CardView historyCardView = FindViewById<CardView>(Resource.Id.history_card_view);
            Button cameraButton = FindViewById<Button>(Resource.Id.buttonCamera);
            Button textButton = FindViewById<Button>(Resource.Id.buttonText);
            Button leaveButton = FindViewById<Button>(Resource.Id.buttonLeave);

            leaveButton.Click += (sender, e) =>
            {
                DatabaseInterface.RemoveFromGroup(_persoon.Id, _groep.groepsnaam, _persoon.Id, _persoon.Password);
                Finish();
            };
            historyCardView.Click += (sender, e) =>
            {
                var activity = new Intent(this, typeof(Historyscherm));
                StartActivity(activity);
            };
            cameraButton.Click += (sender, e) =>
            {
                var activity = new Intent(this, typeof(CameraActivity));
                StartActivityForResult(activity, 1);
            };
            textButton.Click += (sender, e) =>
            {
                var activity = new Intent(this, typeof(Nieuwschuld));
                StartActivity(activity);
            };

            CreateParticipantsEnvironment();
        }
        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.LogTimeEntriesListFragment, container, false);
            view.FindViewById<TextView> (Resource.Id.EmptyTextTextView).SetFont (Font.RobotoLight);

            experimentEmptyView = view.FindViewById<View> (Resource.Id.ExperimentEmptyMessageView);
            emptyMessageView = view.FindViewById<View> (Resource.Id.EmptyMessageView);
            welcomeMessage = view.FindViewById<TextView> (Resource.Id.WelcomeTextView);
            noItemsMessage = view.FindViewById<TextView> (Resource.Id.EmptyTitleTextView);
            layoverView = view.FindViewById<View> (Resource.Id.LayoverView);
            layoverView.Click += (sender, e) => { };
            layoverDismissButton = view.FindViewById<Button> (Resource.Id.LayoverButton);
            layoverDismissButton.Click += OnAllrightButtonClicked;
            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.LogRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            swipeLayout = view.FindViewById<SwipeRefreshLayout> (Resource.Id.LogSwipeContainer);
            swipeLayout.SetOnRefreshListener (this);
            coordinatorLayout = view.FindViewById<CoordinatorLayout> (Resource.Id.logCoordinatorLayout);
            StartStopBtn = view.FindViewById<StartStopFab> (Resource.Id.StartStopBtn);
            timerComponent = ((MainDrawerActivity)Activity).Timer; // TODO: a better way to do this?
            HasOptionsMenu = true;
            Activity.InvalidateOptionsMenu ();

            var settingsStore = ServiceContainer.Resolve<SettingsStore> ();
            var authManager = ServiceContainer.Resolve<AuthManager> ();
            if (settingsStore.ShowOverlay || !authManager.OfflineMode) {
                layoverView.Visibility = ViewStates.Gone;
            }
            return view;
        }
 private void SetUpSwipeView(View root)
 {
     _gridViewSwipeRefresh = root.FindViewById<SwipeRefreshLayout>(Resource.Id.swipeRefreshLayout_gridView);
     //OnCreateSwipeToRefresh(_gridViewSwipeRefresh);
     _gridViewSwipeRefresh.SetOnRefreshListener(this);
 }