You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have someone experience in replacing Resources in whole application, i need to intercept getDrawable method everywhere
Testing on Genymotion, Android 4.1.1
i need some ideas how to work around
Approach to wrap context when attachBaseContext method called, failed. When inflating views it doesn't works :(
I found really strange behavior that the original(android) views and custom views are getting different types of Context. Cause i made efforts to set background via XML on ImageButton and get Exception, but when i create custom view extended from ImageButton it worked update on approach 2
hmm, looks like if i define background as an attribute it falls, if do it by code it works
i found what is going on after all, the views calls TypedArray#getDrawable method
publicDrawablegetDrawable(intindex) {
if (mRecycled) {
thrownewRuntimeException("Cannot make calls to a recycled instance!");
}
finalTypedValuevalue = mValue;
if (getValueAt(index*AssetManager.STYLE_NUM_ENTRIES, value)) {
if (value.type == TypedValue.TYPE_ATTRIBUTE) {
thrownewRuntimeException("Failed to resolve attribute at index " + index);
}
returnmResources.loadDrawable(value, value.resourceId, mTheme);
}
returnnull;
}
Now i need to think how to replace loadDrawable method 😞
New plan, going to replace LayoutInflater with custom one and create custom attributes like Calligraphy did
The text was updated successfully, but these errors were encountered:
Have someone experience in replacing
Resources
in whole application, i need to intercept getDrawable method everywhereTesting on Genymotion, Android 4.1.1
i need some ideas how to work around
attachBaseContext
method called, failed. When inflating views it doesn't works :(update on approach 2
hmm, looks like if i define background as an attribute it falls, if do it by code it works
i found what is going on after all, the views calls TypedArray#getDrawable method
Now i need to think how to replace loadDrawable method 😞
New plan, going to replace LayoutInflater with custom one and create custom attributes like Calligraphy did
The text was updated successfully, but these errors were encountered: