History log of /packages/apps/Email/tests/src/com/android/email/activity/UiUtilitiesTests.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2fbb3db5d86210d03175ce77ff08c989a96c5864 28-Mar-2011 Makoto Onuki <omakoto@google.com> Don't use findViewById (part 1 -- account setup)

Added two new functions:
- UiUtilities.getView()
is a fail-fast version of findViewById(). Crashes when there's no view
- setVisibilitySafe()
same as View.setVisibility, but doesn't crash even if a view doesn't exist

Let's try to avoid the use of findViewById(), and instead use getView(), *right
after* the layout is inflated, so that we'll always fail-fast if a layout
doesn't have a required view. (Rather than getting a NPE only when the view
is really accessed, which can be in a code path which is rarely executed--e.g.
only when there's a protocol error.)

Let's only use findViewById() only when we're sure no all the variants of a
layout have the view in question and leave a comment to make it clear it's on
purpose.

(UiUtilities has been moved from com.android.email to
com.android.email.activity)

Change-Id: I36e0bab65a989f5d34cf636f13e1eaee084547af
/packages/apps/Email/tests/src/com/android/email/activity/UiUtilitiesTests.java