/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.robolectric.shadows;

import android.content.Context;
import android.database.Cursor;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ResourceCursorAdapter;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

/**
 * An easy adapter that creates views defined in an XML file. You can specify
 * the XML file that defines the appearance of the views.
 */
@Implements(ResourceCursorAdapter.class)
public class ShadowResourceCursorAdapter extends ShadowCursorAdapter {
  private int mLayout;

  private int mDropDownLayout;

  private LayoutInflater mInflater;

  /**
   * Constructor.
   *
   * @param context The context where the ListView associated with this
   *            SimpleListItemFactory is running
   * @param layout resource identifier of a layout file that defines the views
   *            for this list item.  Unless you override them later, this will
   *            define both the item views and the drop down views.
   * @param c The cursor from which to get the data.
   */
  public void __constructor__(Context context, int layout, Cursor c) {
    super.__constructor__(context, c);
    mLayout = mDropDownLayout = layout;
    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  }

  /**
   * Constructor.
   *
   * @param context The context where the ListView associated with this
   *            SimpleListItemFactory is running
   * @param layout resource identifier of a layout file that defines the views
   *            for this list item.  Unless you override them later, this will
   *            define both the item views and the drop down views.
   * @param c The cursor from which to get the data.
   * @param autoRequery If true the adapter will call requery() on the
   *                    cursor whenever it changes so the most recent
   *                    data is always displayed.
   */
  public void __constructor__(Context context, int layout, Cursor c, boolean autoRequery) {
    super.__constructor__(context, c, autoRequery);
    mLayout = mDropDownLayout = layout;
    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  }

  @Implementation
  public View newView(Context context, Cursor cursor, ViewGroup parent) {
    return mInflater.inflate(mLayout, parent, false);
  }

  @Implementation
  public View newDropDownView(Context context, Cursor cursor, ViewGroup parent) {
    return mInflater.inflate(mDropDownLayout, parent, false);
  }

  @Implementation
  public void setViewResource(int layout) {
    mLayout = layout;
  }

  @Implementation
  public void setDropDownViewResource(int dropDownLayout) {
    mDropDownLayout = dropDownLayout;
  }
}
@@ -1,625 +1,4 @@
-/*%0A * Copyright (C) 2007 The Android Open Source Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A
 pack
@@ -597,33 +597,32 @@
 te int mLayout;%0A
-%0A
   private int mD
@@ -636,17 +636,16 @@
 Layout;%0A
-%0A
   privat
@@ -677,443 +677,8 @@
 r;%0A%0A
-  /**%0A   * Constructor.%0A   *%0A   * @param context The context where the ListView associated with this%0A   *            SimpleListItemFactory is running%0A   * @param layout resource identifier of a layout file that defines the views%0A   *            for this list item.  Unless you override them later, this will%0A   *            define both the item views and the drop down views.%0A   * @param c The cursor from which to get the data.%0A   */%0A
   pu
@@ -926,631 +926,286 @@
 %0A%0A  
-/**%0A   * Constructor.%0A   *%0A   * @param c
+public void __constructor__(C
 ontext 
-The 
 context
- where the ListView associated with this%0A   *            SimpleListItemFactory is running%0A   * @param layout resource identifier of a layout file that defines the views%0A   *            for this list item.  Unless you override them later, this will%0A   *            define both the item views and the drop down views.%0A   * @param c The cursor from which to get the data.%0A   * @param autoRequery If true the adapter will call requery() on the%0A   *                    cursor whenever it changes so the most recent%0A   *                    data is always displayed.%0A   */
+, int layout, Cursor c, boolean autoRequery) %7B%0A    super.__constructor__(context, c, autoRequery);%0A    mLayout = mDropDownLayout = layout;%0A    mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);%0A  %7D%0A
 %0A  p
@@ -1270,35 +1270,25 @@
 rsor c, 
-boolean autoRequery
+int flags
 ) %7B%0A    
@@ -1317,35 +1317,29 @@
 context, c, 
-autoRequery
+flags
 );%0A    mLayo

Add missing constructor for ShadowResourceCursorAdapter.