@Test public void testTintResourcesDelegateBackToOriginalResources() { final TestResources testResources = new TestResources(mActivityTestRule.getActivity().getResources()); assertFalse(testResources.wasGetDrawableCalled()); final Resources tintResources = new TintResources(mActivityTestRule.getActivity(), testResources); tintResources.getDrawable(android.R.drawable.ic_delete); assertTrue(testResources.wasGetDrawableCalled()); }
@Override public Drawable getDrawable(int id) throws NotFoundException { Drawable d = super.getDrawable(id); Context context = mContextRef.get(); if (d != null && context != null) { AppCompatDrawableManager.get().tintDrawableUsingColorFilter(context, id, d); } return d; }
TintResources extends ResourcesWrapper { @Override public Drawable getDrawable(int id) throws NotFoundException { Drawable d = super.getDrawable(id); Context context = mContextRef.get(); if (d != null && context != null) { AppCompatDrawableManager.get().tintDrawableUsingColorFilter(context, id, d); } return d; } }
TintResources extends ResourcesWrapper { @Override public Drawable getDrawable(int id) throws NotFoundException { Drawable d = super.getDrawable(id); Context context = mContextRef.get(); if (d != null && context != null) { AppCompatDrawableManager.get().tintDrawableUsingColorFilter(context, id, d); } return d; } TintResources(@NonNull Context context, @NonNull final Resources res); }
TintResources extends ResourcesWrapper { @Override public Drawable getDrawable(int id) throws NotFoundException { Drawable d = super.getDrawable(id); Context context = mContextRef.get(); if (d != null && context != null) { AppCompatDrawableManager.get().tintDrawableUsingColorFilter(context, id, d); } return d; } TintResources(@NonNull Context context, @NonNull final Resources res); @Override Drawable getDrawable(int id); }
TintResources extends ResourcesWrapper { @Override public Drawable getDrawable(int id) throws NotFoundException { Drawable d = super.getDrawable(id); Context context = mContextRef.get(); if (d != null && context != null) { AppCompatDrawableManager.get().tintDrawableUsingColorFilter(context, id, d); } return d; } TintResources(@NonNull Context context, @NonNull final Resources res); @Override Drawable getDrawable(int id);  }