mttkay / ignition

Kick-starts Android application development.
1.28k stars 290 forks source link

RemoteImageView should not apply attributes #14

Open rburgst opened 12 years ago

rburgst commented 12 years ago

In addImageView the given attributes are applied which causes any paddings, etc be applied to both the ViewSwitcher(from RemoteImageView) as well as to the ImageView itself. The same is true for background brushes, which looks particularly bad if you use a 9 patch brush.

    private void addImageView(Context context, AttributeSet attributes) {
        // when the view has paddings, then it will be displaced
//        if (attributes != null) {
//            // pass along any view attribtues inflated from XML to the image view
//            imageView = new ImageView(context, attributes);
//        } else {
            imageView =
mttkay commented 12 years ago

true, I must have missed that when writing that code. I suppose what we could do is merely delegate those view attributes that are defined by ImageView itself, such as android:src or android:scaleType, while applying the remaining once to the ViewSwitcher directly.

mttkay commented 12 years ago

I've been working on this but it turned out to be a major pain the back, and I wasn't able to resolve this so far. I hope to resolve it together with issue #19 for ignition-0.3.

mttkay commented 12 years ago

this should be fixed by 7a66e9a06b511bf4da1eb21141a17017dd3fd730

Can you please test this?