android-autofittextview
android-autofittextview copied to clipboard
Added height fitting option (by KonradJanica)
Took KonradJanica's code (#43) and reformatted for easier review by grantland.
This is much cleaner!
The new API method names seem a bit odd to me. Instead of #isHeightFitting()
, #setHeightFitting(boolean)
, etc. do you think #isAutofitWidthEnabled()
, setAutofitHeightEnabled(boolean)
sounds more natural? Additionally, this would allow us to eventually deprecate #isEnabled()
, #getEnabled(boolean)
and add #isAutofitWidthEnabled()
and #setAutofitWidthEnabled(boolean)
.
The proposed naming convention of #isAutofitHeightEnabled()
and #setAutofitHeightEnabled(boolean)
, along with #isAutofitWidthEnabled()
and #setAutofitWidthEnabled(boolean)
sound much cleaner to me!
I pushed a commit with the API refactoring. Let me know if it sounds clearer.
Awesome, looks good ^^
Thank you for your commits.
Just a small nitpick. The variable named mIsAutofitHeightEnabled
is using "Hungarian Notation" to denote it is a "member variable". See Google's code style: link.
When you use it inside a static function (like the autofit(...)
), I think the proper naming convention would be to remove the "m" before the variable name, as it is no longer a "member variable".
Thank you @AranHase!
Any updates on this. Have been checking in on this pull request for a while now?
I made a quick fork of this with @Will5 's changes because I need to use it in my project. It's available from jitpack.io here: https://github.com/flipagram/android-autofittextview -- When this is all merged in I'll remove my fork.
why has this still not been merged?
Please merge this PR, we do need this fix for our project as well. Thanks!