android-autofittextview icon indicating copy to clipboard operation
android-autofittextview copied to clipboard

Added height fitting option (by KonradJanica)

Open Will5 opened this issue 7 years ago • 9 comments

Took KonradJanica's code (#43) and reformatted for easier review by grantland.

Will5 avatar Jul 14 '16 16:07 Will5

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).

grantland avatar Jul 20 '16 03:07 grantland

The proposed naming convention of #isAutofitHeightEnabled() and #setAutofitHeightEnabled(boolean), along with #isAutofitWidthEnabled() and #setAutofitWidthEnabled(boolean) sound much cleaner to me!

Will5 avatar Jul 21 '16 18:07 Will5

I pushed a commit with the API refactoring. Let me know if it sounds clearer.

Will5 avatar Jul 23 '16 22:07 Will5

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".

AllanHasegawa avatar Aug 09 '16 17:08 AllanHasegawa

Thank you @AranHase!

Will5 avatar Aug 09 '16 18:08 Will5

Any updates on this. Have been checking in on this pull request for a while now?

ejohansson avatar Nov 28 '16 21:11 ejohansson

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.

johnnylambada avatar Feb 04 '17 02:02 johnnylambada

why has this still not been merged?

slvrfn avatar Jun 16 '17 16:06 slvrfn

Please merge this PR, we do need this fix for our project as well. Thanks!

AndreasBoehm avatar Jul 14 '17 09:07 AndreasBoehm