-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handwritten setters that might be useful #27
Comments
I'd like to nominate I'm happy to put together a PR if that would be helpful. |
Sure, a PR for such a function is more than welcome! |
Hi, I just create PR #71 implementing setters for compound drawable for TextView (and so for many subclasses). But I have question: there are 3 more setters (setCompoundDrawablesRelative*) which was introduced in API 17. How to implement them if minimal API for BaseDSL is 15? |
@LukasVykuka if I understand it correctly, you can just wrap actual methods with |
Relative version place drawable dependently on direction of text of current Locale. Some languages are writen from right to left (https://en.wikipedia.org/wiki/Right-to-left) so if I set drawable to "start" position than it will be showed on left in normal language and on right in, e. g., in arabic language. I'm happy with this methods so far. |
@LukasVykuka Ah, I see. I'd either leave it as it is now, or implemented via SDK_INT check so that on pre-17 devices it was calling setCompoundDrawable, but on newer devices would call a better alternative to respect the RTL languages (I believe that's what android:drawableLeft etc do in XML) |
I think that there should be both versions (relative and non-relative) even for API >=17 because sometimes it will be appropriate to place drawable on some side independently on text direction. But I agree, leave it as it is now :) Oh btw is the best lib I have found in my 3 year Android developer life! Thank you 👍 |
I'm missing "TextInputLayout.setPasswordVisibilityToggleEnabled(boolean enabled)" in the Design library. But so far I'm loving everything about anvil! |
Currently Anvil contains lots of autogenerated bindings for all setters of all
views in Android SDK, starting with "set" and having exactly one parameter
(normally a value to set). Some setters are not covered - the ones that start
with "add" (like
addTextChangedListeer
and the ones having more than a singleparameter (like
setLineSpacing
).As it was discussed previously in issue #15 - missing setters will be added if
someone finds real need in them (most of them are really exotic), and makes a
pull-request. The list of setters has been taken from the recent android.jar of
API Level 23.
I suggest to split this in two phases:
I will move it to the "TODO" task list.
please make a pull request, and I will mark the task as done.
TODO
text
andonTextChanged
bindings)Missing setters starting with "add", not "set"
Missing setters with more than one parameter
The text was updated successfully, but these errors were encountered: