Methods Summary |
---|
private android.graphics.Bitmap | createCacheForView(android.view.View view)
final Bitmap[] cache = new Bitmap[1];
getActivity().runOnUiThread(new Runnable() {
public void run() {
view.setDrawingCacheEnabled(true);
view.invalidate();
view.buildDrawingCache();
cache[0] = view.getDrawingCache();
}
});
getInstrumentation().waitForIdleSync();
return cache[0];
|
public void | setUp()
super.setUp();
final BigCache activity = getActivity();
mTiny = activity.findViewById(R.id.a);
mLarge = activity.findViewById(R.id.b);
|
public void | testDrawingCacheAboveMaximumSize()
final int max = ViewConfiguration.get(getActivity()).getScaledMaximumDrawingCacheSize();
assertTrue(mLarge.getWidth() * mLarge.getHeight() * 2 > max);
assertNull(createCacheForView(mLarge));
|
public void | testDrawingCacheBelowMaximumSize()
final int max = ViewConfiguration.get(getActivity()).getScaledMaximumDrawingCacheSize();
assertTrue(mTiny.getWidth() * mTiny.getHeight() * 2 < max);
assertNotNull(createCacheForView(mTiny));
|
public void | testSetUpConditions()
assertNotNull(mTiny);
assertNotNull(mLarge);
|