Ejemplo n.º 1
0
		public HeaderViewListAdapter(java.util.ArrayList<android.widget.ListView.FixedViewInfo
			> headerViewInfos, java.util.ArrayList<android.widget.ListView.FixedViewInfo> footerViewInfos
			, android.widget.ListAdapter adapter)
		{
			// These two ArrayList are assumed to NOT be null.
			// They are indeed created when declared in ListView and then shared.
			// Used as a placeholder in case the provided info views are indeed null.
			// Currently only used by some CTS tests, which may be removed.
			mAdapter = adapter;
			mIsFilterable = adapter is android.widget.Filterable;
			if (headerViewInfos == null)
			{
				mHeaderViewInfos = EMPTY_INFO_LIST;
			}
			else
			{
				mHeaderViewInfos = headerViewInfos;
			}
			if (footerViewInfos == null)
			{
				mFooterViewInfos = EMPTY_INFO_LIST;
			}
			else
			{
				mFooterViewInfos = footerViewInfos;
			}
			mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable
				(mFooterViewInfos);
		}
Ejemplo n.º 2
0
 public HeaderViewListAdapter(java.util.ArrayList <android.widget.ListView.FixedViewInfo
                                                   > headerViewInfos, java.util.ArrayList <android.widget.ListView.FixedViewInfo> footerViewInfos
                              , android.widget.ListAdapter adapter)
 {
     // These two ArrayList are assumed to NOT be null.
     // They are indeed created when declared in ListView and then shared.
     // Used as a placeholder in case the provided info views are indeed null.
     // Currently only used by some CTS tests, which may be removed.
     mAdapter      = adapter;
     mIsFilterable = adapter is android.widget.Filterable;
     if (headerViewInfos == null)
     {
         mHeaderViewInfos = EMPTY_INFO_LIST;
     }
     else
     {
         mHeaderViewInfos = headerViewInfos;
     }
     if (footerViewInfos == null)
     {
         mFooterViewInfos = EMPTY_INFO_LIST;
     }
     else
     {
         mFooterViewInfos = footerViewInfos;
     }
     mAreAllFixedViewsSelectable = areAllListInfosSelectable(mHeaderViewInfos) && areAllListInfosSelectable
                                       (mFooterViewInfos);
 }
Ejemplo n.º 3
0
        private int measureContentWidth(android.widget.ListAdapter adapter)
        {
            // Menus don't tend to be long, so this is more sane than it looks.
            int width = 0;

            android.view.View itemView = null;
            int itemType         = 0;
            int widthMeasureSpec = android.view.View.MeasureSpec.makeMeasureSpec(0, android.view.View
                                                                                 .MeasureSpec.UNSPECIFIED);
            int heightMeasureSpec = android.view.View.MeasureSpec.makeMeasureSpec(0, android.view.View
                                                                                  .MeasureSpec.UNSPECIFIED);
            int count = adapter.getCount();

            {
                for (int i = 0; i < count; i++)
                {
                    int positionType = adapter.getItemViewType(i);
                    if (positionType != itemType)
                    {
                        itemType = positionType;
                        itemView = null;
                    }
                    if (mMeasureParent == null)
                    {
                        mMeasureParent = new android.widget.FrameLayout(mContext);
                    }
                    itemView = adapter.getView(i, itemView, mMeasureParent);
                    itemView.measure(widthMeasureSpec, heightMeasureSpec);
                    width = System.Math.Max(width, itemView.getMeasuredWidth());
                }
            }
            return(width);
        }
Ejemplo n.º 4
0
 /// <summary><p>Creates a new ListAdapter wrapper for the specified adapter.</p></summary>
 /// <param name="adapter">the Adapter to transform into a ListAdapter</param>
 public DropDownAdapter(android.widget.SpinnerAdapter adapter)
 {
     this.mAdapter = adapter;
     if (adapter is android.widget.ListAdapter)
     {
         this.mListAdapter = (android.widget.ListAdapter)adapter;
     }
 }
Ejemplo n.º 5
0
 /// <summary>Provide the cursor for the list view.</summary>
 /// <remarks>Provide the cursor for the list view.</remarks>
 public virtual void setListAdapter(android.widget.ListAdapter adapter)
 {
     lock (this)
     {
         ensureList();
         mAdapter = adapter;
         mList.setAdapter(adapter);
     }
 }
Ejemplo n.º 6
0
 public override void setAdapter(android.widget.ListAdapter arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.widget.ExpandableListView._setAdapter11240, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.widget.ExpandableListView.staticClass, global::android.widget.ExpandableListView._setAdapter11240, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Ejemplo n.º 7
0
 public virtual bool isEnabled(int position)
 {
     android.widget.ListAdapter adapter = mListAdapter;
     if (adapter != null)
     {
         return(adapter.isEnabled(position));
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 8
0
 public virtual bool areAllItemsEnabled()
 {
     android.widget.ListAdapter adapter = mListAdapter;
     if (adapter != null)
     {
         return(adapter.areAllItemsEnabled());
     }
     else
     {
         return(true);
     }
 }
Ejemplo n.º 9
0
 public virtual void setListAdapter(android.widget.ListAdapter arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.app.ListActivity._setListAdapter661, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.app.ListActivity.staticClass, global::android.app.ListActivity._setListAdapter661, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0));
     }
 }
Ejemplo n.º 10
0
        /// <summary>Provide the cursor for the list view.</summary>
        /// <remarks>Provide the cursor for the list view.</remarks>
        public virtual void setListAdapter(android.widget.ListAdapter adapter)
        {
            bool hadAdapter = mAdapter != null;

            mAdapter = adapter;
            if (mList != null)
            {
                mList.setAdapter(adapter);
                if (!mListShown && !hadAdapter)
                {
                    // The list was hidden, and previously didn't have an
                    // adapter.  It is now time to show it.
                    setListShown(true, getView().getWindowToken() != null);
                }
            }
        }
Ejemplo n.º 11
0
 public virtual android.app.AlertDialog.Builder setSingleChoiceItems(android.widget.ListAdapter
                                                                     adapter, int checkedItem, android.content.DialogInterfaceClass.OnClickListener
                                                                     listener)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 12
0
		private void ensureList()
		{
			if (mList != null)
			{
				return;
			}
			android.view.View root = getView();
			if (root == null)
			{
				throw new System.InvalidOperationException("Content view not yet created");
			}
			if (root is android.widget.ListView)
			{
				mList = (android.widget.ListView)root;
			}
			else
			{
				mStandardEmptyView = (android.widget.TextView)root.findViewById([email protected]
					.id.internalEmpty);
				if (mStandardEmptyView == null)
				{
					mEmptyView = root.findViewById(android.R.id.empty);
				}
				else
				{
					mStandardEmptyView.setVisibility(android.view.View.GONE);
				}
				mProgressContainer = root.findViewById([email protected]);
				mListContainer = root.findViewById([email protected]);
				android.view.View rawListView = root.findViewById(android.R.id.list);
				if (!(rawListView is android.widget.ListView))
				{
					throw new java.lang.RuntimeException("Content has view with id attribute 'android.R.id.list' "
						 + "that is not a ListView class");
				}
				mList = (android.widget.ListView)rawListView;
				if (mList == null)
				{
					throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is "
						 + "'android.R.id.list'");
				}
				if (mEmptyView != null)
				{
					mList.setEmptyView(mEmptyView);
				}
				else
				{
					if (mEmptyText != null)
					{
						mStandardEmptyView.setText(mEmptyText);
						mList.setEmptyView(mStandardEmptyView);
					}
				}
			}
			mListShown = true;
			mList.setOnItemClickListener(mOnClickListener);
			if (mAdapter != null)
			{
				android.widget.ListAdapter adapter = mAdapter;
				mAdapter = null;
				setListAdapter(adapter);
			}
			else
			{
				// We are starting without an adapter, so assume we won't
				// have our data right away and start with the progress indicator.
				if (mProgressContainer != null)
				{
					setListShown(false, false);
				}
			}
			mHandler.post(mRequestFocus);
		}
Ejemplo n.º 13
0
		/// <summary>
		/// Sets the adapter that provides the data and the views to represent the data
		/// in this popup window.
		/// </summary>
		/// <remarks>
		/// Sets the adapter that provides the data and the views to represent the data
		/// in this popup window.
		/// </remarks>
		/// <param name="adapter">The adapter to use to create this window's content.</param>
		public virtual void setAdapter(android.widget.ListAdapter adapter)
		{
			if (mObserver == null)
			{
				mObserver = new android.widget.ListPopupWindow.PopupDataSetObserver(this);
			}
			else
			{
				if (mAdapter != null)
				{
					mAdapter.unregisterDataSetObserver(mObserver);
				}
			}
			mAdapter = adapter;
			if (mAdapter != null)
			{
				adapter.registerDataSetObserver(mObserver);
			}
			if (mDropDownList != null)
			{
				mDropDownList.setAdapter(mAdapter);
			}
		}
Ejemplo n.º 14
0
			public override void setAdapter(android.widget.ListAdapter adapter)
			{
				base.setAdapter(adapter);
				this.mAdapter = adapter;
			}
Ejemplo n.º 15
0
		/// <summary>Provide the cursor for the list view.</summary>
		/// <remarks>Provide the cursor for the list view.</remarks>
		public virtual void setListAdapter(android.widget.ListAdapter adapter)
		{
			bool hadAdapter = mAdapter != null;
			mAdapter = adapter;
			if (mList != null)
			{
				mList.setAdapter(adapter);
				if (!mListShown && !hadAdapter)
				{
					// The list was hidden, and previously didn't have an
					// adapter.  It is now time to show it.
					setListShown(true, getView().getWindowToken() != null);
				}
			}
		}
Ejemplo n.º 16
0
			/// <summary><p>Creates a new ListAdapter wrapper for the specified adapter.</p></summary>
			/// <param name="adapter">the Adapter to transform into a ListAdapter</param>
			public DropDownAdapter(android.widget.SpinnerAdapter adapter)
			{
				this.mAdapter = adapter;
				if (adapter is android.widget.ListAdapter)
				{
					this.mListAdapter = (android.widget.ListAdapter)adapter;
				}
			}
Ejemplo n.º 17
0
			public virtual void setAdapter(android.widget.ListAdapter adapter)
			{
				this.mListAdapter = adapter;
			}
Ejemplo n.º 18
0
		/// <summary>Provide the cursor for the list view.</summary>
		/// <remarks>Provide the cursor for the list view.</remarks>
		public virtual void setListAdapter(android.widget.ListAdapter adapter)
		{
			lock (this)
			{
				ensureList();
				mAdapter = adapter;
				mList.setAdapter(adapter);
			}
		}
Ejemplo n.º 19
0
 public HeaderViewListAdapter(java.util.ArrayList arg0, java.util.ArrayList arg1, android.widget.ListAdapter arg2)  : base(global::MonoJavaBridge.JNIEnv.ThreadEnv)
 {
     global::MonoJavaBridge.JNIEnv         @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     global::MonoJavaBridge.JniLocalHandle handle = @__env.NewObject(android.widget.HeaderViewListAdapter.staticClass, global::android.widget.HeaderViewListAdapter._HeaderViewListAdapter11390, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2));
     Init(@__env, handle);
 }
Ejemplo n.º 20
0
 private void ensureList()
 {
     if (mList != null)
     {
         return;
     }
     android.view.View root = getView();
     if (root == null)
     {
         throw new System.InvalidOperationException("Content view not yet created");
     }
     if (root is android.widget.ListView)
     {
         mList = (android.widget.ListView)root;
     }
     else
     {
         mStandardEmptyView = (android.widget.TextView)root.findViewById([email protected]
                                                                         .id.internalEmpty);
         if (mStandardEmptyView == null)
         {
             mEmptyView = root.findViewById(android.R.id.empty);
         }
         else
         {
             mStandardEmptyView.setVisibility(android.view.View.GONE);
         }
         mProgressContainer = root.findViewById([email protected]);
         mListContainer     = root.findViewById([email protected]);
         android.view.View rawListView = root.findViewById(android.R.id.list);
         if (!(rawListView is android.widget.ListView))
         {
             throw new java.lang.RuntimeException("Content has view with id attribute 'android.R.id.list' "
                                                  + "that is not a ListView class");
         }
         mList = (android.widget.ListView)rawListView;
         if (mList == null)
         {
             throw new java.lang.RuntimeException("Your content must have a ListView whose id attribute is "
                                                  + "'android.R.id.list'");
         }
         if (mEmptyView != null)
         {
             mList.setEmptyView(mEmptyView);
         }
         else
         {
             if (mEmptyText != null)
             {
                 mStandardEmptyView.setText(mEmptyText);
                 mList.setEmptyView(mStandardEmptyView);
             }
         }
     }
     mListShown = true;
     mList.setOnItemClickListener(mOnClickListener);
     if (mAdapter != null)
     {
         android.widget.ListAdapter adapter = mAdapter;
         mAdapter = null;
         setListAdapter(adapter);
     }
     else
     {
         // We are starting without an adapter, so assume we won't
         // have our data right away and start with the progress indicator.
         if (mProgressContainer != null)
         {
             setListShown(false, false);
         }
     }
     mHandler.post(mRequestFocus);
 }
Ejemplo n.º 21
0
 public virtual void setAdapter(android.widget.ListAdapter adapter)
 {
     this.mListAdapter = adapter;
 }
Ejemplo n.º 22
0
 public override void setAdapter(android.widget.ListAdapter adapter)
 {
     base.setAdapter(adapter);
     this.mAdapter = adapter;
 }