JoanZapata/base-adapter-helper

Add a callback on view inflating

DayS opened this issue · 8 comments

DayS commented

I have to apply custom font on my items.
Currently we have no easy way to do this only once after inflating the view. It would be great to have a view inflated callback on the BaseAdapterHelper.
I'll provide a PR soon for this

In your usecase, I don't think using the existing BaseAdapterHelper.setTypeface() would be a problem, since the TextView just ignore the call if the typeface hasn't changed:

public void setTypeface(Typeface tf) {
    if (mTextPaint.getTypeface() != tf) {
        ...
    }
}
DayS commented

Setting typeface was just for the example. I have a highly brandable application and some logic in order to apply color, text size, custom drawables, etc... So, I would like to handle all this only once via a callback :)
I already have a work-around but I had to fork a sub-part of BaseQuickAdapter. I'll be much nicer if a proper solution was integrated

Oh I see. Waiting for your pull request then. :)

DayS commented

Any chance to move on Gradle before that ? =)

Does it make any difference concerning this issue?

DayS commented

Nah, it's just a pain in the ass to import the project on AS

Ah? Never had any trouble using IntelliJ.
I'll try to get it done tonight then.

Sorry for the delay, I tried to migrate to gradle but it's too much complication sorry:

  • It's a java module depending on Android, and gradle still doesn't have a provided configuration for this. Adding one is easy with gradle but then intellij starts complaining.
  • The sample app is still using ActionBarSherlock which was deprecated before gradle was announced and therefore has no .aar version, which means I'd have to spend some time removing it from the project.
  • I think Maven is still the cleanest way to upload to maven central, with proper javadoc etc..

I'm really curious about what's wrong with the maven build when you import the project. Could you elaborate please?