android - Where can I see exactly what Xml Attributes do codewise (TextView)? -


http://developer.android.com/reference/android/widget/textview.html#attr_android:password

i can't find in android code applied android:password xml attribute. basically, want set transformationmethod manually in code instead of using xml attribute. if call:

textview.settransformationmethod(new passwordtransformationmethod()) 

then happens textview correctly mask characters, until textview focused on in landscape orientation it's full screen keyboard text you're entering. in screen, text in plain text. obviously, xml attribute android:password doing more setting transformation method. can point me xml attributes interpreted in android code, or tell me else need mask characters correctly?

the reason can't use xml attribute because i'm doing specific character masking, want hyphens in plain text, while masking else (***-**). this, have extended passwordtransformationmethod ignore hyphens, have call transformationmethod setter manually in code.

update: think found problem. in textview.setinputtype(int type), sets transformationmethod passwordtransformationmethod depending on inputtypes passed in. textview exclusively allows inputtype combination of (inputtype.type_text_variation_password | inputtype.type_class_text) represent masked password. if have other inputtypes added, classify not password... frustrating.

anyway, problem @ end of textview.setinputtype(int type), calls

inputmethodmanager imm = inputmethodmanager.peekinstance(); if (imm != null) imm.restartinput(this); 

which believe setting full screen keyboard view's transformationmethod. fine, if didn't set transformationmethod passwordtransformationmethod earlier in same method, overwriting whatever had set previously.

to compound problems, reason can't seem access of inputmethodmanager's static functions peekinstance(). had tried extend editview, , override setinputtype(int type). but, odd reason, can't call same inputmethodmanager code noted above, , i'm guessing call full screen keyboard's view uses set it's transformationmethod...

i'm getting extremely frustrated android's class design. hard code stuff setting passwordtransformationmethod in several places strictly doing comparisons inputtypes, extremely confusing (bitwise comparisons, etc). , there's no way override private ispasswordinputtype checks change definition of "password" manually...

you have peek @ source code. inside frameworks/base.git @ android.git.kernel.org.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -