Search in sources :

Example 1 with Implementation

use of org.robolectric.annotation.Implementation in project materialistic by hidroh.

the class ShadowPreferenceFragmentCompat method onCreateView.

@Implementation
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    RecyclerView recyclerView = new RecyclerView(container.getContext());
    recyclerView.setId(R.id.list);
    ReflectionHelpers.setField(realObject, "mList", recyclerView);
    return recyclerView;
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) Implementation(org.robolectric.annotation.Implementation)

Example 2 with Implementation

use of org.robolectric.annotation.Implementation in project scdl by passy.

the class ShadowMessage method obtain.

@Implementation
public static Message obtain(Handler h) {
    Message m = new Message();
    m.setTarget(h);
    return m;
}
Also used : Message(android.os.Message) Implementation(org.robolectric.annotation.Implementation)

Example 3 with Implementation

use of org.robolectric.annotation.Implementation in project scdl by passy.

the class ShadowMessage method obtain.

@Implementation
public static Message obtain(Message msg) {
    Message m = new Message();
    m.copyFrom(msg);
    m.setTarget(msg.getTarget());
    return m;
}
Also used : Message(android.os.Message) Implementation(org.robolectric.annotation.Implementation)

Example 4 with Implementation

use of org.robolectric.annotation.Implementation in project robolectric by robolectric.

the class ShadowMatrix method mapRect.

@Implementation
public boolean mapRect(RectF destination, RectF source) {
    final PointF leftTop = mapPoint(source.left, source.top);
    final PointF rightBottom = mapPoint(source.right, source.bottom);
    destination.set(Math.min(leftTop.x, rightBottom.x), Math.min(leftTop.y, rightBottom.y), Math.max(leftTop.x, rightBottom.x), Math.max(leftTop.y, rightBottom.y));
    return true;
}
Also used : PointF(android.graphics.PointF) Implementation(org.robolectric.annotation.Implementation)

Example 5 with Implementation

use of org.robolectric.annotation.Implementation in project robolectric by robolectric.

the class ShadowCursorAdapter method swapCursor.

@Implementation
public Cursor swapCursor(Cursor cursor) {
    if (cursor == mCursor) {
        return null;
    }
    Cursor old = mCursor;
    if (mCursor != null) {
        if (mChangeObserver != null)
            mCursor.unregisterContentObserver(mChangeObserver);
        if (mDataSetObserver != null)
            mCursor.unregisterDataSetObserver(mDataSetObserver);
    }
    mCursor = cursor;
    if (cursor != null) {
        if (mChangeObserver != null)
            cursor.registerContentObserver(mChangeObserver);
        if (mDataSetObserver != null)
            cursor.registerDataSetObserver(mDataSetObserver);
        mRowIDColumn = cursor.getColumnIndexOrThrow("_id");
        mDataValid = true;
        // notify the observers about the new cursor
        realCursorAdapter.notifyDataSetChanged();
    } else {
        mRowIDColumn = -1;
        mDataValid = false;
        // notify the observers about the lack of a data set
        realCursorAdapter.notifyDataSetInvalidated();
    }
    return old;
}
Also used : Cursor(android.database.Cursor) Implementation(org.robolectric.annotation.Implementation)

Aggregations

Implementation (org.robolectric.annotation.Implementation)114 Bitmap (android.graphics.Bitmap)17 HiddenApi (org.robolectric.annotation.HiddenApi)10 BitmapDrawable (android.graphics.drawable.BitmapDrawable)6 View (android.view.View)6 IOException (java.io.IOException)6 ContentProvider (android.content.ContentProvider)5 IContentProvider (android.content.IContentProvider)5 AccessibilityNodeInfo (android.view.accessibility.AccessibilityNodeInfo)5 Rect (android.graphics.Rect)4 Message (android.os.Message)4 RealObject (org.robolectric.annotation.RealObject)4 FileTypedResource (org.robolectric.res.FileTypedResource)4 Point (android.graphics.Point)3 AccessibilityWindowInfo (android.view.accessibility.AccessibilityWindowInfo)3 ImageView (android.widget.ImageView)3 TextView (android.widget.TextView)3 LinkedList (java.util.LinkedList)3 Activity (android.app.Activity)2 Dialog (android.app.Dialog)2