コード例 #1
0
 /// <summary>
 /// This allows you to add extra LoadingLayout instances to this proxy. This
 /// is only necessary if you keep your own instances, and want to have them
 /// included in any
 /// {@link PullToRefreshBase#createLoadingLayoutProxy(boolean, boolean)
 /// createLoadingLayoutProxy(...)} calls.
 /// </summary>
 /// <param name="layout"> - LoadingLayout to have included. </param>
 public virtual void addLayout(LoadingLayoutBase layout)
 {
     if (null != layout)
     {
         mLoadingLayouts.Add(layout);
     }
 }
コード例 #2
0
        protected override void HandleStyledAttributes(TypedArray a)
        {
            base.HandleStyledAttributes(a);

            mListViewExtrasEnabled = a.GetBoolean(Resource.Styleable.PullToRefresh_ptrListViewExtrasEnabled, true);

            if (mListViewExtrasEnabled)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final android.widget.FrameLayout.LayoutParams lp = new android.widget.FrameLayout.LayoutParams(android.widget.FrameLayout.LayoutParams.MATCH_PARENT, android.widget.FrameLayout.LayoutParams.WRAP_CONTENT, android.view.Gravity.CENTER_HORIZONTAL);
                FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.WrapContent, GravityFlags.CenterHorizontal);

                // Create Loading Views ready for use later
                mLvHeaderLoadingFrame         = new FrameLayout(Context);
                mHeaderLoadingView            = CreateLoadingLayout(Context, PullMode.PULL_FROM_START, a);
                mHeaderLoadingView.Visibility = ViewStates.Gone;
                mLvHeaderLoadingFrame.AddView(mHeaderLoadingView, lp);
                mRefreshableView.AddHeaderView(mLvHeaderLoadingFrame, null, false);

                mLvFooterLoadingFrame         = new FrameLayout(Context);
                mFooterLoadingView            = CreateLoadingLayout(Context, PullMode.PULL_FROM_END, a);
                mFooterLoadingView.Visibility = ViewStates.Gone;
                mLvFooterLoadingFrame.AddView(mFooterLoadingView, lp);

                mLvSecondFooterLoadingFrame = new FrameLayout(Context);

                /// <summary>
                /// If the value for Scrolling While Refreshing hasn't been
                /// explicitly set via XML, enable Scrolling While Refreshing.
                /// </summary>
                if (!a.HasValue(Resource.Styleable.PullToRefresh_ptrScrollingWhileRefreshingEnabled))
                {
                    ScrollingWhileRefreshingEnabled = true;
                }
            }
        }