use of org.robolectric.annotation.Implementation in project scdl by passy.
the class ShadowMessage method obtain.
@Implementation
public static Message obtain(Handler h, int what, int arg1, int arg2) {
Message m = obtain(h, what);
m.arg1 = arg1;
m.arg2 = arg2;
return m;
}
use of org.robolectric.annotation.Implementation in project scdl by passy.
the class ShadowMessage method obtain.
@Implementation
public static Message obtain(Handler h, int what, int arg1, int arg2, Object obj) {
Message m = obtain(h, what, arg1, arg2);
m.obj = obj;
return m;
}
use of org.robolectric.annotation.Implementation in project fresco by facebook.
the class MyShadowBitmap method createBitmap.
@Implementation
public static Bitmap createBitmap(int width, int height, Bitmap.Config config) {
Bitmap bitmap = Shadow.newInstanceOf(Bitmap.class);
MyShadowBitmap shadowBitmap = (MyShadowBitmap) ShadowExtractor.extract(bitmap);
shadowBitmap.width = width;
shadowBitmap.height = height;
shadowBitmap.mPixels = new int[width * height];
return bitmap;
}
use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowRemoteCallbackList method register.
@Implementation
public boolean register(E callback, Object cookie) {
synchronized (callbacks) {
if (killed) {
return false;
}
IBinder binder = callback.asBinder();
try {
Callback cb = new Callback(callback, cookie);
binder.linkToDeath(cb, 0);
callbacks.put(binder, cb);
return true;
} catch (RemoteException e) {
return false;
}
}
}
use of org.robolectric.annotation.Implementation in project robolectric by robolectric.
the class ShadowResources method getDisplayMetrics.
@Implementation
public DisplayMetrics getDisplayMetrics() {
if (displayMetrics == null) {
if (display == null) {
display = ReflectionHelpers.callConstructor(Display.class);
}
displayMetrics = new DisplayMetrics();
display.getMetrics(displayMetrics);
}
displayMetrics.density = this.density;
return displayMetrics;
}
Aggregations