Ejemplo n.º 1
0
        /**
         * Create a new {@code StickyListHeadersAdapterDecorator}, decorating given {@link android.widget.BaseAdapter}.
         *
         * @param baseAdapter the {@code BaseAdapter} to decorate. If this is a {@code BaseAdapterDecorator}, it should wrap an instance of
         *                    {@link se.emilsjolander.stickylistheaders.StickyListHeadersAdapter}.
         */
        public StickyListHeadersAdapterDecorator(BaseAdapter baseAdapter)
            : base(baseAdapter)
        {
            //super(baseAdapter);

            BaseAdapter adapter = baseAdapter;

            while (adapter is BaseAdapterDecorator)
            {
                adapter = ((BaseAdapterDecorator)adapter).getDecoratedBaseAdapter();
            }

            if (!(adapter is IStickyListHeadersAdapter))
            {
                //.getCanonicalName()
                throw new Java.Lang.IllegalArgumentException(adapter.GetType().FullName + " does not implement StickyListHeadersAdapter");
            }

            mStickyListHeadersAdapter = (IStickyListHeadersAdapter)adapter;
        }