Closed pawelantczak closed 9 years ago
@olivierg13 did that here: https://github.com/OrangeGangsters/android-autofittextview/commit/efa48edc6cb32acfc29221bb2eb8a3b09ec504b2
I'm not sure what the repercussions are of disabling OnLayoutChangeListener, but it seems like you'd lose the ability to refit the text on layout changes. You could possibly call autofit()
from your view's onLayout()
method manually in this situation.
Hello @pawelantczak, @grantland
Indeed, our app support SDK version 10 (beurghhhhh ^^), so I was forced to do it. The OnLayoutChangeListener is not anymore called, but we don't really care because we only "support" version 10, so even if the experience is a bit bad, we don't care as soon as it doesn't crash.
If you want to still use it, you can run something like:
if (getView() != null) {
getView().post(new Runnable() {
@Override
public void run() {
//TODO refresh autofittextview
}
}
);
}
Running a runnable on the view is a way to run a code as soon as the view is visible.
Cheers,
Olivier
Thanks! @grantland for lib @olivierg13 for backport
Hello. Is there a chance, that you will reduce
minSdkVersion
? To10
for example. Regards.