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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations