use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowBitmapFactory method decodeByteArray.
@Implementation
public static Bitmap decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts) {
String desc = new String(data);
if (!Charset.forName("US-ASCII").newEncoder().canEncode(desc)) {
Checksum checksumEngine = new CRC32();
checksumEngine.update(data, 0, data.length);
desc = "byte array, checksum: " + checksumEngine.getValue();
}
if (offset != 0 || length != data.length) {
desc += " bytes " + offset + ".." + length;
}
return create(desc, opts);
}
use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowBitmapFactory method decodeByteArray.
@Implementation
public static Bitmap decodeByteArray(byte[] data, int offset, int length) {
Bitmap bitmap = decodeByteArray(data, offset, length, new BitmapFactory.Options());
ShadowBitmap shadowBitmap = Shadows.shadowOf(bitmap);
shadowBitmap.createdFromBytes = data;
return bitmap;
}
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;
}
Aggregations