diff options
191 files changed, 523 insertions, 523 deletions
diff --git a/core/java/android/accounts/ChooseAccountActivity.java b/core/java/android/accounts/ChooseAccountActivity.java index 16a45ba6d5fe..9f2c39bbc4ce 100644 --- a/core/java/android/accounts/ChooseAccountActivity.java +++ b/core/java/android/accounts/ChooseAccountActivity.java @@ -77,7 +77,7 @@ public class ChooseAccountActivity extends Activity { setContentView(R.layout.choose_account); // Setup the list - ListView list = (ListView) findViewById(android.R.id.list); + ListView list = findViewById(android.R.id.list); // Use an existing ListAdapter that will map an array of strings to TextViews list.setAdapter(new AccountArrayAdapter(this, android.R.layout.simple_list_item_1, mAccountInfos)); diff --git a/core/java/android/accounts/ChooseAccountTypeActivity.java b/core/java/android/accounts/ChooseAccountTypeActivity.java index a3222d849367..e3352bc85668 100644 --- a/core/java/android/accounts/ChooseAccountTypeActivity.java +++ b/core/java/android/accounts/ChooseAccountTypeActivity.java @@ -99,7 +99,7 @@ public class ChooseAccountTypeActivity extends Activity { setContentView(R.layout.choose_account_type); // Setup the list - ListView list = (ListView) findViewById(android.R.id.list); + ListView list = findViewById(android.R.id.list); // Use an existing ListAdapter that will map an array of strings to TextViews list.setAdapter(new AccountArrayAdapter(this, android.R.layout.simple_list_item_1, mAuthenticatorInfosToDisplay)); diff --git a/core/java/android/accounts/ChooseTypeAndAccountActivity.java b/core/java/android/accounts/ChooseTypeAndAccountActivity.java index 844258515561..6680ce6acb04 100644 --- a/core/java/android/accounts/ChooseTypeAndAccountActivity.java +++ b/core/java/android/accounts/ChooseTypeAndAccountActivity.java @@ -248,7 +248,7 @@ public class ChooseTypeAndAccountActivity extends Activity populateUIAccountList(listItems); // Only enable "OK" button if something has been selected. - mOkButton = (Button) findViewById(android.R.id.button2); + mOkButton = findViewById(android.R.id.button2); mOkButton.setEnabled(mSelectedItemIndex != SELECTED_ITEM_NONE); } @@ -592,7 +592,7 @@ public class ChooseTypeAndAccountActivity extends Activity * If not specified then makes the description invisible. */ private void overrideDescriptionIfSupplied(String descriptionOverride) { - TextView descriptionView = (TextView) findViewById(R.id.description); + TextView descriptionView = findViewById(R.id.description); if (!TextUtils.isEmpty(descriptionOverride)) { descriptionView.setText(descriptionOverride); } else { @@ -605,7 +605,7 @@ public class ChooseTypeAndAccountActivity extends Activity * based on {@code mSelectedItemIndex} member variable. */ private final void populateUIAccountList(String[] listItems) { - ListView list = (ListView) findViewById(android.R.id.list); + ListView list = findViewById(android.R.id.list); list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_single_choice, listItems)); list.setChoiceMode(ListView.CHOICE_MODE_SINGLE); diff --git a/core/java/android/accounts/GrantCredentialsPermissionActivity.java b/core/java/android/accounts/GrantCredentialsPermissionActivity.java index 38eab2905022..af74b036a796 100644 --- a/core/java/android/accounts/GrantCredentialsPermissionActivity.java +++ b/core/java/android/accounts/GrantCredentialsPermissionActivity.java @@ -84,7 +84,7 @@ public class GrantCredentialsPermissionActivity extends Activity implements View return; } - final TextView authTokenTypeView = (TextView) findViewById(R.id.authtoken_type); + final TextView authTokenTypeView = findViewById(R.id.authtoken_type); authTokenTypeView.setVisibility(View.GONE); final AccountManagerCallback<String> callback = new AccountManagerCallback<String>() { @@ -116,7 +116,7 @@ public class GrantCredentialsPermissionActivity extends Activity implements View findViewById(R.id.allow_button).setOnClickListener(this); findViewById(R.id.deny_button).setOnClickListener(this); - LinearLayout packagesListView = (LinearLayout) findViewById(R.id.packages_list); + LinearLayout packagesListView = findViewById(R.id.packages_list); for (String pkg : packages) { String packageLabel; diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java index 9928512de09f..7d81c4c029de 100644 --- a/core/java/android/app/AlertDialog.java +++ b/core/java/android/app/AlertDialog.java @@ -48,7 +48,7 @@ import com.android.internal.R; * and add your view to it: * * <pre> - * FrameLayout fl = (FrameLayout) findViewById(android.R.id.custom); + * FrameLayout fl = findViewById(android.R.id.custom); * fl.addView(myView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT)); * </pre> * diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 9c18df8c6c2a..4abca9a13c4b 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -165,7 +165,7 @@ public class SearchDialog extends Dialog { setContentView(com.android.internal.R.layout.search_bar); // get the view elements for local access - mSearchView = (SearchView) findViewById(com.android.internal.R.id.search_view); + mSearchView = findViewById(com.android.internal.R.id.search_view); mSearchView.setIconified(false); mSearchView.setOnCloseListener(mOnCloseListener); mSearchView.setOnQueryTextListener(mOnQueryChangeListener); @@ -184,7 +184,7 @@ public class SearchDialog extends Dialog { mBadgeLabel = (TextView) mSearchView.findViewById(com.android.internal.R.id.search_badge); mSearchAutoComplete = (AutoCompleteTextView) mSearchView.findViewById(com.android.internal.R.id.search_src_text); - mAppIcon = (ImageView) findViewById(com.android.internal.R.id.search_app_icon); + mAppIcon = findViewById(com.android.internal.R.id.search_app_icon); mSearchPlate = mSearchView.findViewById(com.android.internal.R.id.search_plate); mWorkingSpinner = getContext().getDrawable(com.android.internal.R.drawable.search_spinner); // TODO: Restore the spinner for slow suggestion lookups diff --git a/core/java/android/app/TabActivity.java b/core/java/android/app/TabActivity.java index 637c8c19aef5..ad8b0dbe23f7 100644 --- a/core/java/android/app/TabActivity.java +++ b/core/java/android/app/TabActivity.java @@ -108,7 +108,7 @@ public class TabActivity extends ActivityGroup { @Override public void onContentChanged() { super.onContentChanged(); - mTabHost = (TabHost) findViewById(com.android.internal.R.id.tabhost); + mTabHost = findViewById(com.android.internal.R.id.tabhost); if (mTabHost == null) { throw new RuntimeException( diff --git a/core/java/android/inputmethodservice/ExtractEditLayout.java b/core/java/android/inputmethodservice/ExtractEditLayout.java index 37ca4b44a1a1..af69f0f8fa74 100644 --- a/core/java/android/inputmethodservice/ExtractEditLayout.java +++ b/core/java/android/inputmethodservice/ExtractEditLayout.java @@ -41,6 +41,6 @@ public class ExtractEditLayout extends LinearLayout { @Override public void onFinishInflate() { super.onFinishInflate(); - mExtractActionButton = (Button) findViewById(com.android.internal.R.id.inputExtractAction); + mExtractActionButton = findViewById(com.android.internal.R.id.inputExtractAction); } } diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java index fe9197867484..20f7acebf6e5 100644 --- a/core/java/android/view/NotificationHeaderView.java +++ b/core/java/android/view/NotificationHeaderView.java @@ -94,8 +94,8 @@ public class NotificationHeaderView extends ViewGroup { super.onFinishInflate(); mAppName = findViewById(com.android.internal.R.id.app_name_text); mHeaderText = findViewById(com.android.internal.R.id.header_text); - mExpandButton = (ImageView) findViewById(com.android.internal.R.id.expand_button); - mIcon = (CachingIconView) findViewById(com.android.internal.R.id.icon); + mExpandButton = findViewById(com.android.internal.R.id.expand_button); + mIcon = findViewById(com.android.internal.R.id.icon); mProfileBadge = findViewById(com.android.internal.R.id.profile_badge); } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 9072bf93d9d8..30922659d09d 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -321,7 +321,7 @@ import java.util.function.Predicate; * </pre></li> * <li>From the onCreate method of an Activity, find the Button * <pre class="prettyprint"> - * Button myButton = (Button) findViewById(R.id.my_button); + * Button myButton = findViewById(R.id.my_button); * </pre></li> * </ul> * <p> diff --git a/core/java/android/view/ViewStub.java b/core/java/android/view/ViewStub.java index 85d10f199218..e9d1b8784914 100644 --- a/core/java/android/view/ViewStub.java +++ b/core/java/android/view/ViewStub.java @@ -58,7 +58,7 @@ import java.lang.ref.WeakReference; * The preferred way to perform the inflation of the layout resource is the following: * * <pre> - * ViewStub stub = (ViewStub) findViewById(R.id.stub); + * ViewStub stub = findViewById(R.id.stub); * View inflated = stub.inflate(); * </pre> * diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java index 06d486813b1b..6df76fa2e09a 100644 --- a/core/java/android/widget/AppSecurityPermissions.java +++ b/core/java/android/widget/AppSecurityPermissions.java @@ -151,8 +151,8 @@ public class AppSecurityPermissions { mShowRevokeUI = showRevokeUI; mPackageName = packageName; - ImageView permGrpIcon = (ImageView) findViewById(R.id.perm_icon); - TextView permNameView = (TextView) findViewById(R.id.perm_name); + ImageView permGrpIcon = findViewById(R.id.perm_icon); + TextView permNameView = findViewById(R.id.perm_name); PackageManager pm = getContext().getPackageManager(); Drawable icon = null; diff --git a/core/java/android/widget/Button.java b/core/java/android/widget/Button.java index 09e09b7c2c9c..09ba553cbf3e 100644 --- a/core/java/android/widget/Button.java +++ b/core/java/android/widget/Button.java @@ -37,7 +37,7 @@ import android.widget.RemoteViews.RemoteView; * * setContentView(R.layout.content_layout_id); * - * final Button button = (Button) findViewById(R.id.button_id); + * final Button button = findViewById(R.id.button_id); * button.setOnClickListener(new View.OnClickListener() { * public void onClick(View v) { * // Perform action on click diff --git a/core/java/android/widget/DayPickerView.java b/core/java/android/widget/DayPickerView.java index 0f0e6c30979d..be0967f162c4 100644 --- a/core/java/android/widget/DayPickerView.java +++ b/core/java/android/widget/DayPickerView.java @@ -124,13 +124,13 @@ class DayPickerView extends ViewGroup { addView(child); } - mPrevButton = (ImageButton) findViewById(R.id.prev); + mPrevButton = findViewById(R.id.prev); mPrevButton.setOnClickListener(mOnClickListener); - mNextButton = (ImageButton) findViewById(R.id.next); + mNextButton = findViewById(R.id.next); mNextButton.setOnClickListener(mOnClickListener); - mViewPager = (ViewPager) findViewById(R.id.day_picker_view_pager); + mViewPager = findViewById(R.id.day_picker_view_pager); mViewPager.setAdapter(mAdapter); mViewPager.setOnPageChangeListener(mOnPageChangedListener); diff --git a/core/java/android/widget/MultiAutoCompleteTextView.java b/core/java/android/widget/MultiAutoCompleteTextView.java index 2152e4338362..f348d73c1b42 100644 --- a/core/java/android/widget/MultiAutoCompleteTextView.java +++ b/core/java/android/widget/MultiAutoCompleteTextView.java @@ -43,7 +43,7 @@ import android.util.AttributeSet; * * ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, * android.R.layout.simple_dropdown_item_1line, COUNTRIES); - * MultiAutoCompleteTextView textView = (MultiAutoCompleteTextView) findViewById(R.id.edit); + * MultiAutoCompleteTextView textView = findViewById(R.id.edit); * textView.setAdapter(adapter); * textView.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer()); * } diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java index 662e64099fc8..7bdd6dadf415 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -706,7 +706,7 @@ public class NumberPicker extends LinearLayout { // increment button if (!mHasSelectorWheel) { - mIncrementButton = (ImageButton) findViewById(R.id.increment); + mIncrementButton = findViewById(R.id.increment); mIncrementButton.setOnClickListener(onClickListener); mIncrementButton.setOnLongClickListener(onLongClickListener); } else { @@ -715,7 +715,7 @@ public class NumberPicker extends LinearLayout { // decrement button if (!mHasSelectorWheel) { - mDecrementButton = (ImageButton) findViewById(R.id.decrement); + mDecrementButton = findViewById(R.id.decrement); mDecrementButton.setOnClickListener(onClickListener); mDecrementButton.setOnLongClickListener(onLongClickListener); } else { @@ -723,7 +723,7 @@ public class NumberPicker extends LinearLayout { } // input text - mInputText = (EditText) findViewById(R.id.numberpicker_input); + mInputText = findViewById(R.id.numberpicker_input); mInputText.setOnFocusChangeListener(new OnFocusChangeListener() { public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java index 7e2cadfc8c45..8de17c072b59 100644 --- a/core/java/android/widget/TabHost.java +++ b/core/java/android/widget/TabHost.java @@ -136,7 +136,7 @@ mTabHost.setup(); mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); */ public void setup() { - mTabWidget = (TabWidget) findViewById(com.android.internal.R.id.tabs); + mTabWidget = findViewById(com.android.internal.R.id.tabs); if (mTabWidget == null) { throw new RuntimeException( "Your TabHost must have a TabWidget whose id attribute is 'android.R.id.tabs'"); @@ -171,7 +171,7 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); } }); - mTabContent = (FrameLayout) findViewById(com.android.internal.R.id.tabcontent); + mTabContent = findViewById(com.android.internal.R.id.tabcontent); if (mTabContent == null) { throw new RuntimeException( "Your TabHost must have a FrameLayout whose id attribute is " diff --git a/core/java/android/widget/TextInputTimePickerView.java b/core/java/android/widget/TextInputTimePickerView.java index 0183343e96e1..11b7514d6ac8 100644 --- a/core/java/android/widget/TextInputTimePickerView.java +++ b/core/java/android/widget/TextInputTimePickerView.java @@ -76,12 +76,12 @@ public class TextInputTimePickerView extends RelativeLayout { inflate(context, R.layout.time_picker_text_input_material, this); - mHourEditText = (EditText) findViewById(R.id.input_hour); - mMinuteEditText = (EditText) findViewById(R.id.input_minute); - mInputSeparatorView = (TextView) findViewById(R.id.input_separator); - mErrorLabel = (TextView) findViewById(R.id.label_error); - mHourLabel = (TextView) findViewById(R.id.label_hour); - mMinuteLabel = (TextView) findViewById(R.id.label_minute); + mHourEditText = findViewById(R.id.input_hour); + mMinuteEditText = findViewById(R.id.input_minute); + mInputSeparatorView = findViewById(R.id.input_separator); + mErrorLabel = findViewById(R.id.label_error); + mHourLabel = findViewById(R.id.label_hour); + mMinuteLabel = findViewById(R.id.label_minute); mHourEditText.addTextChangedListener(new TextWatcher() { @Override @@ -109,7 +109,7 @@ public class TextInputTimePickerView extends RelativeLayout { } }); - mAmPmSpinner = (Spinner) findViewById(R.id.am_pm_spinner); + mAmPmSpinner = findViewById(R.id.am_pm_spinner); final String[] amPmStrings = TimePicker.getAmPmStrings(context); ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(context, R.layout.simple_spinner_dropdown_item); diff --git a/core/java/android/widget/TwoLineListItem.java b/core/java/android/widget/TwoLineListItem.java index 0445ebd50926..553b86e1f0c2 100644 --- a/core/java/android/widget/TwoLineListItem.java +++ b/core/java/android/widget/TwoLineListItem.java @@ -70,8 +70,8 @@ public class TwoLineListItem extends RelativeLayout { protected void onFinishInflate() { super.onFinishInflate(); - mText1 = (TextView) findViewById(com.android.internal.R.id.text1); - mText2 = (TextView) findViewById(com.android.internal.R.id.text2); + mText1 = findViewById(com.android.internal.R.id.text1); + mText2 = findViewById(com.android.internal.R.id.text2); } /** diff --git a/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java b/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java index ee5d339a19d3..9d9042946084 100644 --- a/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java +++ b/core/java/com/android/internal/app/AccessibilityButtonChooserActivity.java @@ -59,7 +59,7 @@ public class AccessibilityButtonChooserActivity extends Activity { String component = Settings.Secure.getString(getContentResolver(), Settings.Secure.ACCESSIBILITY_BUTTON_TARGET_COMPONENT); if (TextUtils.isEmpty(component)) { - TextView prompt = (TextView) findViewById(R.id.accessibility_button_prompt); + TextView prompt = findViewById(R.id.accessibility_button_prompt); prompt.setVisibility(View.VISIBLE); } @@ -78,7 +78,7 @@ public class AccessibilityButtonChooserActivity extends Activity { finish(); } - GridView gridview = (GridView) findViewById(R.id.accessibility_button_chooser_grid); + GridView gridview = findViewById(R.id.accessibility_button_chooser_grid); gridview.setAdapter(new TargetAdapter()); gridview.setOnItemClickListener((parent, view, position, id) -> { onTargetSelected(mTargets.get(position)); diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java index 622b70843cc2..b59667815922 100644 --- a/core/java/com/android/internal/app/ResolverActivity.java +++ b/core/java/com/android/internal/app/ResolverActivity.java @@ -287,7 +287,7 @@ public class ResolverActivity extends Activity { return; } - final ResolverDrawerLayout rdl = (ResolverDrawerLayout) findViewById(R.id.contentPanel); + final ResolverDrawerLayout rdl = findViewById(R.id.contentPanel); if (rdl != null) { rdl.setOnDismissedListener(new ResolverDrawerLayout.OnDismissedListener() { @Override @@ -922,10 +922,10 @@ public class ResolverActivity extends Activity { } - mAdapterView = (AbsListView) findViewById(R.id.resolver_list); + mAdapterView = findViewById(R.id.resolver_list); if (count == 0 && mAdapter.mPlaceholderCount == 0) { - final TextView emptyView = (TextView) findViewById(R.id.empty); + final TextView emptyView = findViewById(R.id.empty); emptyView.setVisibility(View.VISIBLE); mAdapterView.setVisibility(View.GONE); } else { @@ -959,7 +959,7 @@ public class ResolverActivity extends Activity { public void setTitleAndIcon() { if (mAdapter.getCount() == 0 && mAdapter.mPlaceholderCount == 0) { - final TextView titleView = (TextView) findViewById(R.id.title); + final TextView titleView = findViewById(R.id.title); if (titleView != null) { titleView.setVisibility(View.GONE); } @@ -970,14 +970,14 @@ public class ResolverActivity extends Activity { : getTitleForAction(getTargetIntent().getAction(), mDefaultTitleResId); if (!TextUtils.isEmpty(title)) { - final TextView titleView = (TextView) findViewById(R.id.title); + final TextView titleView = findViewById(R.id.title); if (titleView != null) { titleView.setText(title); } setTitle(title); // Try to initialize the title icon if we have a view for it and a title to match - final ImageView titleIcon = (ImageView) findViewById(R.id.title_icon); + final ImageView titleIcon = findViewById(R.id.title_icon); if (titleIcon != null) { ApplicationInfo ai = null; try { @@ -994,7 +994,7 @@ public class ResolverActivity extends Activity { } } - final ImageView iconView = (ImageView) findViewById(R.id.icon); + final ImageView iconView = findViewById(R.id.icon); final DisplayResolveInfo iconInfo = mAdapter.getFilteredItem(); if (iconView != null && iconInfo != null) { new LoadIconIntoViewTask(iconInfo, iconView).execute(); @@ -1003,7 +1003,7 @@ public class ResolverActivity extends Activity { public void resetAlwaysOrOnceButtonBar() { if (mSupportsAlwaysUseOption) { - final ViewGroup buttonLayout = (ViewGroup) findViewById(R.id.button_bar); + final ViewGroup buttonLayout = findViewById(R.id.button_bar); if (buttonLayout != null) { buttonLayout.setVisibility(View.VISIBLE); mAlwaysButton = (Button) buttonLayout.findViewById(R.id.button_always); diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java index c4540f59ebb1..baf6db93daaf 100644 --- a/core/java/com/android/internal/policy/DecorView.java +++ b/core/java/com/android/internal/policy/DecorView.java @@ -1688,7 +1688,7 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind } }; } else { - ViewStub stub = (ViewStub) findViewById(R.id.action_mode_bar_stub); + ViewStub stub = findViewById(R.id.action_mode_bar_stub); if (stub != null) { mPrimaryActionModeView = (ActionBarContextView) stub.inflate(); mPrimaryActionModePopup = null; diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java index 7b966de86756..243916b4ade2 100644 --- a/core/java/com/android/internal/policy/PhoneWindow.java +++ b/core/java/com/android/internal/policy/PhoneWindow.java @@ -1593,7 +1593,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (featureId == FEATURE_PROGRESS || featureId == FEATURE_INDETERMINATE_PROGRESS) { updateProgressBars(value); } else if (featureId == FEATURE_CUSTOM_TITLE) { - FrameLayout titleContainer = (FrameLayout) findViewById(R.id.title_container); + FrameLayout titleContainer = findViewById(R.id.title_container); if (titleContainer != null) { mLayoutInflater.inflate(value, titleContainer); } @@ -2690,7 +2690,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { invalidatePanelMenu(FEATURE_ACTION_BAR); } } else { - mTitleView = (TextView) findViewById(R.id.title); + mTitleView = findViewById(R.id.title); if (mTitleView != null) { if ((getLocalFeatures() & (1 << FEATURE_NO_TITLE)) != 0) { final View titleContainer = findViewById(R.id.title_container); @@ -2967,7 +2967,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mContentParent == null && shouldInstallDecor) { installDecor(); } - mCircularProgressBar = (ProgressBar) findViewById(R.id.progress_circular); + mCircularProgressBar = findViewById(R.id.progress_circular); if (mCircularProgressBar != null) { mCircularProgressBar.setVisibility(View.INVISIBLE); } @@ -2981,7 +2981,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { if (mContentParent == null && shouldInstallDecor) { installDecor(); } - mHorizontalProgressBar = (ProgressBar) findViewById(R.id.progress_horizontal); + mHorizontalProgressBar = findViewById(R.id.progress_horizontal); if (mHorizontalProgressBar != null) { mHorizontalProgressBar.setVisibility(View.INVISIBLE); } diff --git a/core/java/com/android/internal/view/menu/ListMenuItemView.java b/core/java/com/android/internal/view/menu/ListMenuItemView.java index 919cf991d433..83a2838be07e 100644 --- a/core/java/com/android/internal/view/menu/ListMenuItemView.java +++ b/core/java/com/android/internal/view/menu/ListMenuItemView.java @@ -89,14 +89,14 @@ public class ListMenuItemView extends LinearLayout implements MenuView.ItemView setBackgroundDrawable(mBackground); - mTitleView = (TextView) findViewById(com.android.internal.R.id.title); + mTitleView = findViewById(com.android.internal.R.id.title); if (mTextAppearance != -1) { mTitleView.setTextAppearance(mTextAppearanceContext, mTextAppearance); } - mShortcutView = (TextView) findViewById(com.android.internal.R.id.shortcut); - mSubMenuArrowView = (ImageView) findViewById(com.android.internal.R.id.submenuarrow); + mShortcutView = findViewById(com.android.internal.R.id.shortcut); + mSubMenuArrowView = findViewById(com.android.internal.R.id.submenuarrow); if (mSubMenuArrowView != null) { mSubMenuArrowView.setImageDrawable(mSubMenuArrow); } diff --git a/core/java/com/android/internal/widget/ActionBarOverlayLayout.java b/core/java/com/android/internal/widget/ActionBarOverlayLayout.java index c3a7460e5752..65cd4fa20341 100644 --- a/core/java/com/android/internal/widget/ActionBarOverlayLayout.java +++ b/core/java/com/android/internal/widget/ActionBarOverlayLayout.java @@ -569,10 +569,10 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar void pullChildren() { if (mContent == null) { mContent = findViewById(com.android.internal.R.id.content); - mActionBarTop = (ActionBarContainer) findViewById( + mActionBarTop = findViewById( com.android.internal.R.id.action_bar_container); mDecorToolbar = getDecorToolbar(findViewById(com.android.internal.R.id.action_bar)); - mActionBarBottom = (ActionBarContainer) findViewById( + mActionBarBottom = findViewById( com.android.internal.R.id.split_action_bar); } } @@ -707,7 +707,7 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar mDecorToolbar.setSplitToolbar(splitActionBar); mDecorToolbar.setSplitWhenNarrow(splitWhenNarrow); - final ActionBarContextView cab = (ActionBarContextView) findViewById( + final ActionBarContextView cab = findViewById( com.android.internal.R.id.action_context_bar); cab.setSplitView(mActionBarBottom); cab.setSplitToolbar(splitActionBar); diff --git a/core/java/com/android/internal/widget/MediaNotificationView.java b/core/java/com/android/internal/widget/MediaNotificationView.java index f63afada7e38..afb2a5efcf95 100644 --- a/core/java/com/android/internal/widget/MediaNotificationView.java +++ b/core/java/com/android/internal/widget/MediaNotificationView.java @@ -152,7 +152,7 @@ public class MediaNotificationView extends FrameLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mRightIcon = (ImageView) findViewById(com.android.internal.R.id.right_icon); + mRightIcon = findViewById(com.android.internal.R.id.right_icon); mActions = findViewById(com.android.internal.R.id.media_actions); mHeader = findViewById(com.android.internal.R.id.notification_header); mMainColumn = findViewById(com.android.internal.R.id.notification_main_column); diff --git a/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java b/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java index 6bcf8fc43d10..0e1e6ac98672 100644 --- a/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java +++ b/core/tests/coretests/src/android/animation/BasicAnimatorActivity.java @@ -27,6 +27,6 @@ public class BasicAnimatorActivity extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.animator_basic); - mAnimatingButton = (Button) findViewById(R.id.animatingButton); + mAnimatingButton = findViewById(R.id.animatingButton); } } diff --git a/core/tests/coretests/src/android/os/BrightnessLimit.java b/core/tests/coretests/src/android/os/BrightnessLimit.java index f4a5e09033ed..43cd373ef850 100644 --- a/core/tests/coretests/src/android/os/BrightnessLimit.java +++ b/core/tests/coretests/src/android/os/BrightnessLimit.java @@ -40,7 +40,7 @@ public class BrightnessLimit extends Activity implements OnClickListener { setContentView(R.layout.brightness_limit); - Button b = (Button) findViewById(R.id.go); + Button b = findViewById(R.id.go); b.setOnClickListener(this); } diff --git a/core/tests/coretests/src/android/view/Disabled.java b/core/tests/coretests/src/android/view/Disabled.java index fa921071874d..d3c7470bd0f9 100644 --- a/core/tests/coretests/src/android/view/Disabled.java +++ b/core/tests/coretests/src/android/view/Disabled.java @@ -34,16 +34,16 @@ public class Disabled extends Activity implements OnClickListener { setContentView(R.layout.disabled); // Find our buttons - Button disabledButton = (Button) findViewById(R.id.disabledButton); + Button disabledButton = findViewById(R.id.disabledButton); disabledButton.setEnabled(false); // Find our buttons - Button disabledButtonA = (Button) findViewById(R.id.disabledButtonA); + Button disabledButtonA = findViewById(R.id.disabledButtonA); disabledButtonA.setOnClickListener(this); } public void onClick(View v) { - Button disabledButtonB = (Button) findViewById(R.id.disabledButtonB); + Button disabledButtonB = findViewById(R.id.disabledButtonB); disabledButtonB.setEnabled(!disabledButtonB.isEnabled()); } } diff --git a/core/tests/coretests/src/android/view/DrawableBgMinSize.java b/core/tests/coretests/src/android/view/DrawableBgMinSize.java index a75b23aaee04..58bfb8a77064 100644 --- a/core/tests/coretests/src/android/view/DrawableBgMinSize.java +++ b/core/tests/coretests/src/android/view/DrawableBgMinSize.java @@ -58,14 +58,14 @@ public class DrawableBgMinSize extends Activity implements OnClickListener { mBackgroundDrawable = getResources().getDrawable(R.drawable.drawable_background); mBigBackgroundDrawable = getResources().getDrawable(R.drawable.big_drawable_background); - mChangeBackgroundsButton = (Button) findViewById(R.id.change_backgrounds); + mChangeBackgroundsButton = findViewById(R.id.change_backgrounds); mChangeBackgroundsButton.setOnClickListener(this); - mTextView = (TextView) findViewById(R.id.text_view); - mLinearLayout = (LinearLayout) findViewById(R.id.linear_layout); - mRelativeLayout = (RelativeLayout) findViewById(R.id.relative_layout); - mFrameLayout = (FrameLayout) findViewById(R.id.frame_layout); - mAbsoluteLayout = (AbsoluteLayout) findViewById(R.id.absolute_layout); + mTextView = findViewById(R.id.text_view); + mLinearLayout = findViewById(R.id.linear_layout); + mRelativeLayout = findViewById(R.id.relative_layout); + mFrameLayout = findViewById(R.id.frame_layout); + mAbsoluteLayout = findViewById(R.id.absolute_layout); changeBackgrounds(mBackgroundDrawable); } diff --git a/core/tests/coretests/src/android/view/PopupWindowVisibility.java b/core/tests/coretests/src/android/view/PopupWindowVisibility.java index 6e11ede201db..85ce04fae71b 100644 --- a/core/tests/coretests/src/android/view/PopupWindowVisibility.java +++ b/core/tests/coretests/src/android/view/PopupWindowVisibility.java @@ -45,13 +45,13 @@ public class PopupWindowVisibility extends Activity implements OnClickListener { mFrame = findViewById(R.id.frame); - mHide = (Button) findViewById(R.id.hide); + mHide = findViewById(R.id.hide); mHide.setOnClickListener(this); - mShow = (Button) findViewById(R.id.show); + mShow = findViewById(R.id.show); mShow.setOnClickListener(this); - Spinner spinner = (Spinner) findViewById(R.id.spinner); + Spinner spinner = findViewById(R.id.spinner); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mStrings); spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); @@ -59,7 +59,7 @@ public class PopupWindowVisibility extends Activity implements OnClickListener { ArrayAdapter<String> autoAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES); - AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.auto); + AutoCompleteTextView textView = findViewById(R.id.auto); textView.setAdapter(autoAdapter); } diff --git a/core/tests/coretests/src/android/view/PreDrawListener.java b/core/tests/coretests/src/android/view/PreDrawListener.java index 981c6c06ce7f..60bbee483173 100644 --- a/core/tests/coretests/src/android/view/PreDrawListener.java +++ b/core/tests/coretests/src/android/view/PreDrawListener.java @@ -75,9 +75,9 @@ public class PreDrawListener extends Activity implements OnClickListener { super.onCreate(icicle); setContentView(R.layout.pre_draw_listener); - mFrame = (MyLinearLayout) findViewById(R.id.frame); + mFrame = findViewById(R.id.frame); - Button mGoButton = (Button) findViewById(R.id.go); + Button mGoButton = findViewById(R.id.go); mGoButton.setOnClickListener(this); } diff --git a/core/tests/coretests/src/android/view/Visibility.java b/core/tests/coretests/src/android/view/Visibility.java index 97ff252eb034..031568c5a446 100644 --- a/core/tests/coretests/src/android/view/Visibility.java +++ b/core/tests/coretests/src/android/view/Visibility.java @@ -37,9 +37,9 @@ public class Visibility extends Activity { mVictim = findViewById(R.id.victim); // Find our buttons - Button visibleButton = (Button) findViewById(R.id.vis); - Button invisibleButton = (Button) findViewById(R.id.invis); - Button goneButton = (Button) findViewById(R.id.gone); + Button visibleButton = findViewById(R.id.vis); + Button invisibleButton = findViewById(R.id.invis); + Button goneButton = findViewById(R.id.gone); // Wire each button to a click listener visibleButton.setOnClickListener(mVisibleListener); diff --git a/core/tests/coretests/src/android/view/VisibilityCallback.java b/core/tests/coretests/src/android/view/VisibilityCallback.java index 7290a62f3133..f98a0a882764 100644 --- a/core/tests/coretests/src/android/view/VisibilityCallback.java +++ b/core/tests/coretests/src/android/view/VisibilityCallback.java @@ -45,9 +45,9 @@ public class VisibilityCallback extends Activity { mVictim = (MonitoredTextView)findViewById(R.id.victim); // Find our buttons - Button visibleButton = (Button) findViewById(R.id.vis); - Button invisibleButton = (Button) findViewById(R.id.invis); - Button goneButton = (Button) findViewById(R.id.gone); + Button visibleButton = findViewById(R.id.vis); + Button invisibleButton = findViewById(R.id.invis); + Button goneButton = findViewById(R.id.gone); // Wire each button to a click listener visibleButton.setOnClickListener(mVisibleListener); diff --git a/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java b/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java index f6cec26f3e08..b4e05aa26de7 100644 --- a/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java +++ b/core/tests/coretests/src/android/widget/AutoCompleteTextViewSimple.java @@ -47,7 +47,7 @@ public class AutoCompleteTextViewSimple extends Activity // setup layout & views setContentView(R.layout.autocompletetextview_simple); - mTextView = (AutoCompleteTextView) findViewById(R.id.autocompletetextview1); + mTextView = findViewById(R.id.autocompletetextview1); // configure callbacks used for monitoring mTextView.setOnItemClickListener(this); diff --git a/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java b/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java index f7d91aa31357..f6b0520fbadb 100644 --- a/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java +++ b/core/tests/coretests/src/android/widget/focus/DescendantFocusability.java @@ -40,13 +40,13 @@ public class DescendantFocusability extends Activity { setContentView(R.layout.descendant_focusability); - beforeDescendants = (ViewGroup) findViewById(R.id.beforeDescendants); + beforeDescendants = findViewById(R.id.beforeDescendants); beforeDescendantsChild = (Button) beforeDescendants.getChildAt(0); - afterDescendants = (ViewGroup) findViewById(R.id.afterDescendants); + afterDescendants = findViewById(R.id.afterDescendants); afterDescendantsChild = (Button) afterDescendants.getChildAt(0); - blocksDescendants = (ViewGroup) findViewById(R.id.blocksDescendants); + blocksDescendants = findViewById(R.id.blocksDescendants); blocksDescendantsChild = (Button) blocksDescendants.getChildAt(0); } diff --git a/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java b/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java index 93245e7b8116..b3d5ec5e5099 100644 --- a/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java +++ b/core/tests/coretests/src/android/widget/focus/FocusAfterRemoval.java @@ -35,10 +35,10 @@ public class FocusAfterRemoval extends Activity { super.onCreate(icicle); setContentView(R.layout.focus_after_removal); - final LinearLayout left = (LinearLayout) findViewById(R.id.leftLayout); + final LinearLayout left = findViewById(R.id.leftLayout); // top left makes parent layout GONE - Button topLeftButton = (Button) findViewById(R.id.topLeftButton); + Button topLeftButton = findViewById(R.id.topLeftButton); topLeftButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { @@ -48,7 +48,7 @@ public class FocusAfterRemoval extends Activity { // bottom left makes parent layout INVISIBLE // top left makes parent layout GONE - Button bottomLeftButton = (Button) findViewById(R.id.bottomLeftButton); + Button bottomLeftButton = findViewById(R.id.bottomLeftButton); bottomLeftButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { @@ -57,7 +57,7 @@ public class FocusAfterRemoval extends Activity { }); // top right button makes top right button GONE - final Button topRightButton = (Button) findViewById(R.id.topRightButton); + final Button topRightButton = findViewById(R.id.topRightButton); topRightButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { @@ -66,7 +66,7 @@ public class FocusAfterRemoval extends Activity { }); // bottom right button makes bottom right button INVISIBLE - final Button bottomRightButton = (Button) findViewById(R.id.bottomRightButton); + final Button bottomRightButton = findViewById(R.id.bottomRightButton); bottomRightButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { diff --git a/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java b/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java index db082ec6a5b7..acd632f3402b 100644 --- a/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java +++ b/core/tests/coretests/src/android/widget/focus/LinearLayoutGrid.java @@ -33,7 +33,7 @@ public class LinearLayoutGrid extends Activity { } public ViewGroup getRootView() { - return (ViewGroup) findViewById(R.id.layout); + return findViewById(R.id.layout); } public Button getButtonAt(int column, int row) { @@ -51,11 +51,11 @@ public class LinearLayoutGrid extends Activity { private LinearLayout getColumn(int column) { switch (column) { case 0: - return (LinearLayout) findViewById(R.id.column1); + return findViewById(R.id.column1); case 1: - return (LinearLayout) findViewById(R.id.column2); + return findViewById(R.id.column2); case 2: - return (LinearLayout) findViewById(R.id.column3); + return findViewById(R.id.column3); default: throw new IllegalArgumentException("column out of range"); } diff --git a/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java b/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java index ceb0e953cf5c..b9082011f8b4 100644 --- a/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java +++ b/core/tests/coretests/src/android/widget/focus/ListWithFooterViewAndNewLabels.java @@ -54,7 +54,7 @@ public class ListWithFooterViewAndNewLabels extends ListActivity { setListAdapter(mMyAdapter); // not in list - Button topButton = (Button) findViewById(R.id.button); + Button topButton = findViewById(R.id.button); topButton.setText("click to add new item"); topButton.setOnClickListener(new View.OnClickListener() { diff --git a/core/tests/coretests/src/android/widget/focus/RequestFocus.java b/core/tests/coretests/src/android/widget/focus/RequestFocus.java index 21d762a55061..4daf0b4206b0 100644 --- a/core/tests/coretests/src/android/widget/focus/RequestFocus.java +++ b/core/tests/coretests/src/android/widget/focus/RequestFocus.java @@ -34,7 +34,7 @@ public class RequestFocus extends Activity { setContentView(R.layout.focus_after_removal); // bottom right button starts with the focus. - final Button bottomRightButton = (Button) findViewById(R.id.bottomRightButton); + final Button bottomRightButton = findViewById(R.id.bottomRightButton); bottomRightButton.requestFocus(); bottomRightButton.setText("I should have focus"); } diff --git a/core/tests/coretests/src/android/widget/gridview/GridPadding.java b/core/tests/coretests/src/android/widget/gridview/GridPadding.java index 0b9e4c5c146b..c3156dcbb819 100644 --- a/core/tests/coretests/src/android/widget/gridview/GridPadding.java +++ b/core/tests/coretests/src/android/widget/gridview/GridPadding.java @@ -40,7 +40,7 @@ public class GridPadding extends Activity { values[i] = String.valueOf(i); } - mGridView = (GridView) findViewById(R.id.grid); + mGridView = findViewById(R.id.grid); mGridView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values)); } diff --git a/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java b/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java index 4290941426de..0ce5a31c8539 100644 --- a/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java +++ b/core/tests/coretests/src/android/widget/gridview/GridScrollListener.java @@ -46,8 +46,8 @@ public class GridScrollListener extends Activity implements AbsListView.OnScroll values[i] = ((Integer)i).toString(); } - mText = (TextView) findViewById(R.id.text); - mGridView = (GridView) findViewById(R.id.grid); + mText = findViewById(R.id.text); + mGridView = findViewById(R.id.grid); mGridView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values)); diff --git a/core/tests/coretests/src/android/widget/gridview/GridThrasher.java b/core/tests/coretests/src/android/widget/gridview/GridThrasher.java index 0ef5db951a29..ad89bb6ab90c 100644 --- a/core/tests/coretests/src/android/widget/gridview/GridThrasher.java +++ b/core/tests/coretests/src/android/widget/gridview/GridThrasher.java @@ -115,9 +115,9 @@ public class GridThrasher extends Activity implements AdapterView.OnItemSelected setContentView(R.layout.grid_thrasher); - mText = (TextView) findViewById(R.id.text); + mText = findViewById(R.id.text); mAdapter = new ThrashListAdapter(this); - GridView g = (GridView) findViewById(R.id.grid); + GridView g = findViewById(R.id.grid); g.setAdapter(mAdapter); mHandler.postDelayed(mThrash, 5000); diff --git a/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java b/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java index fe2525f5f3ba..83331caa6069 100644 --- a/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java +++ b/core/tests/coretests/src/android/widget/layout/linear/LLEditTextThenButton.java @@ -36,9 +36,9 @@ public class LLEditTextThenButton extends Activity { setContentView(R.layout.linear_layout_edittext_then_button); - mLayout = (LinearLayout) findViewById(R.id.layout); - mEditText = (EditText) findViewById(R.id.editText); - mButton = (Button) findViewById(R.id.button); + mLayout = findViewById(R.id.layout); + mEditText = findViewById(R.id.editText); + mButton = findViewById(R.id.button); } public LinearLayout getLayout() { diff --git a/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java b/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java index 3d0144f9f8cc..ab2f060eafc2 100644 --- a/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java +++ b/core/tests/coretests/src/android/widget/layout/linear/LLOfButtons1.java @@ -37,7 +37,7 @@ public class LLOfButtons1 extends Activity { protected void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.linear_layout_buttons); - mFirstButton = (Button) findViewById(R.id.button1); + mFirstButton = findViewById(R.id.button1); mFirstButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { @@ -48,7 +48,7 @@ public class LLOfButtons1 extends Activity { } public LinearLayout getLayout() { - return (LinearLayout) findViewById(R.id.layout); + return findViewById(R.id.layout); } public Button getFirstButton() { diff --git a/core/tests/coretests/src/android/widget/listview/ListDividers.java b/core/tests/coretests/src/android/widget/listview/ListDividers.java index 3928c03e01a5..9b5a0879d6ba 100644 --- a/core/tests/coretests/src/android/widget/listview/ListDividers.java +++ b/core/tests/coretests/src/android/widget/listview/ListDividers.java @@ -40,7 +40,7 @@ public class ListDividers extends Activity { values[i] = ((Integer) i).toString(); } - mListView = (ListView) findViewById(android.R.id.list); + mListView = findViewById(android.R.id.list); mListView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values)); diff --git a/core/tests/coretests/src/android/widget/listview/ListFilter.java b/core/tests/coretests/src/android/widget/listview/ListFilter.java index 9e9d1b05cabe..c2ac90e7c47c 100644 --- a/core/tests/coretests/src/android/widget/listview/ListFilter.java +++ b/core/tests/coretests/src/android/widget/listview/ListFilter.java @@ -46,10 +46,10 @@ public class ListFilter extends ListActivity implements OnClickListener { getListView().setTextFilterEnabled(true); mFrame = findViewById(R.id.frame); - mHide = (Button) findViewById(R.id.hide); + mHide = findViewById(R.id.hide); mHide.setOnClickListener(this); - mShow = (Button) findViewById(R.id.show); + mShow = findViewById(R.id.show); mShow.setOnClickListener(this); } diff --git a/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java b/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java index 5f09ff6209c6..a373a5b19be3 100644 --- a/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java +++ b/core/tests/coretests/src/android/widget/listview/ListInHorizontal.java @@ -43,7 +43,7 @@ public class ListInHorizontal extends Activity { values[i] = ((Integer) i).toString(); } - mListView = (ListView) findViewById(R.id.list); + mListView = findViewById(R.id.list); mListView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values)); diff --git a/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java b/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java index d5d726191ae3..76814fb480cd 100644 --- a/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java +++ b/core/tests/coretests/src/android/widget/listview/ListRecyclerProfiling.java @@ -38,14 +38,14 @@ public class ListRecyclerProfiling extends Activity { values[i] = ((Integer) i).toString(); } - ListView listView = (ListView) findViewById(R.id.list); + ListView listView = findViewById(R.id.list); ViewDebug.startRecyclerTracing("SimpleList", listView); listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values)); - ImageButton stopProfiling = (ImageButton) findViewById(R.id.pause); + ImageButton stopProfiling = findViewById(R.id.pause); stopProfiling.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { ViewDebug.stopRecyclerTracing(); diff --git a/core/tests/coretests/src/android/widget/listview/ListScrollListener.java b/core/tests/coretests/src/android/widget/listview/ListScrollListener.java index 58a31dc4f2cb..f349dc6ac13a 100644 --- a/core/tests/coretests/src/android/widget/listview/ListScrollListener.java +++ b/core/tests/coretests/src/android/widget/listview/ListScrollListener.java @@ -46,7 +46,7 @@ public class ListScrollListener extends ListActivity implements AbsListView.OnSc values[i] = ((Integer)i).toString(); } - mText = (TextView) findViewById(R.id.text); + mText = findViewById(R.id.text); setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, values)); diff --git a/core/tests/coretests/src/android/widget/listview/ListThrasher.java b/core/tests/coretests/src/android/widget/listview/ListThrasher.java index ba3d5901fab5..0237a9551ce5 100644 --- a/core/tests/coretests/src/android/widget/listview/ListThrasher.java +++ b/core/tests/coretests/src/android/widget/listview/ListThrasher.java @@ -112,7 +112,7 @@ public class ListThrasher extends ListActivity implements AdapterView.OnItemSele setContentView(R.layout.list_thrasher); - mText = (TextView) findViewById(R.id.text); + mText = findViewById(R.id.text); mAdapter = new ThrashListAdapter(this); setListAdapter(mAdapter); diff --git a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java index 9cc85441e631..afc275f25181 100644 --- a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java +++ b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisible.java @@ -43,8 +43,8 @@ public class RequestRectangleVisible extends Activity { final Rect rect = new Rect(); final View childToMakeVisible = findViewById(R.id.childToMakeVisible); - final TextView topBlob = (TextView) findViewById(R.id.topBlob); - final TextView bottomBlob = (TextView) findViewById(R.id.bottomBlob); + final TextView topBlob = findViewById(R.id.topBlob); + final TextView bottomBlob = findViewById(R.id.bottomBlob); // estimate to get blobs larger than screen int screenHeight = getWindowManager().getDefaultDisplay().getHeight(); diff --git a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java index 0e2586d2d856..731b25a08926 100644 --- a/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java +++ b/core/tests/coretests/src/android/widget/scroll/RequestRectangleVisibleWithInternalScroll.java @@ -53,11 +53,11 @@ public class RequestRectangleVisibleWithInternalScroll extends Activity { setContentView(R.layout.scroll_to_rect_with_internal_scroll); - mTextBlob = (TextView) findViewById(R.id.blob); + mTextBlob = findViewById(R.id.blob); mTextBlob.scrollBy(0, scrollYofBlob); - mScrollToBlob = (Button) findViewById(R.id.scrollToBlob); + mScrollToBlob = findViewById(R.id.scrollToBlob); mScrollToBlob.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { diff --git a/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java b/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java index 4d0892c35aaf..027ea0f83350 100644 --- a/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java +++ b/core/tests/coretests/src/android/widget/scroll/ScrollViewButtonsAndLabels.java @@ -66,8 +66,8 @@ public class ScrollViewButtonsAndLabels extends Activity { int screenHeight = getWindowManager().getDefaultDisplay().getHeight(); mNumGroups = screenHeight / 30; - mScrollView = (ScrollView) findViewById(R.id.scrollView); - mLinearLayout = (LinearLayout) findViewById(R.id.layout); + mScrollView = findViewById(R.id.scrollView); + mLinearLayout = findViewById(R.id.layout); LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, diff --git a/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java b/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java index c0c303426573..0b62bca9a7ec 100644 --- a/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java +++ b/media/mca/samples/CameraEffectsRecordingSample/java/android/media/filterfw/samples/CameraEffectsRecordingSample.java @@ -45,8 +45,8 @@ public class CameraEffectsRecordingSample extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); - mRunButton = (Button) findViewById(R.id.runbutton); - mCameraView = (SurfaceView) findViewById(R.id.cameraview); + mRunButton = findViewById(R.id.runbutton); + mCameraView = findViewById(R.id.cameraview); mRunButton.setOnClickListener(mRunButtonClick); Intent intent = getIntent(); diff --git a/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java b/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java index 1a10d6422184..cce2acc5869a 100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/BassBoostTest.java @@ -70,7 +70,7 @@ public class BassBoostTest extends Activity implements OnCheckedChangeListener { setContentView(R.layout.bassboosttest); - mSessionText = (EditText) findViewById(R.id.sessionEdit); + mSessionText = findViewById(R.id.sessionEdit); mSessionText.setOnKeyListener(mSessionKeyListener); mSessionText.setText(Integer.toString(sSession)); diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java index 594e8446faa7..1731dba88757 100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/EnvReverbTest.java @@ -73,9 +73,9 @@ public class EnvReverbTest extends Activity implements OnCheckedChangeListener, ToggleButton button; setContentView(R.layout.envreverbtest); - ImageView playPause = (ImageView) findViewById(R.id.playPause1); - ImageView stop = (ImageView) findViewById(R.id.stop1); - textView = (TextView) findViewById(R.id.sessionText); + ImageView playPause = findViewById(R.id.playPause1); + ImageView stop = findViewById(R.id.stop1); + textView = findViewById(R.id.sessionText); if (sPlayerController == null) { sPlayerController = new SimplePlayer(this, R.id.playPause1, playPause, R.id.stop1, stop, textView, diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java index f30a26f39c64..fd5695603ee2 100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/EqualizerTest.java @@ -72,7 +72,7 @@ public class EqualizerTest extends Activity implements OnCheckedChangeListener { setContentView(R.layout.equalizertest); - mSessionText = (EditText) findViewById(R.id.sessionEdit); + mSessionText = findViewById(R.id.sessionEdit); mSessionText.setOnKeyListener(mSessionKeyListener); mSessionText.setText(Integer.toString(sSession)); diff --git a/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java index bb32e6fa7603..4f2180fac5e5 100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/VirtualizerTest.java @@ -70,7 +70,7 @@ public class VirtualizerTest extends Activity implements OnCheckedChangeListener setContentView(R.layout.virtualizertest); - mSessionText = (EditText) findViewById(R.id.sessionEdit); + mSessionText = findViewById(R.id.sessionEdit); mSessionText.setOnKeyListener(mSessionKeyListener); mSessionText.setText(Integer.toString(sSession)); diff --git a/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java b/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java index 60583e0adf72..7db1d8d8625e 100644 --- a/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java +++ b/media/tests/EffectsTest/src/com/android/effectstest/VisualizerTest.java @@ -72,7 +72,7 @@ public class VisualizerTest extends Activity implements OnCheckedChangeListener setContentView(R.layout.visualizertest); - mSessionText = (EditText) findViewById(R.id.sessionEdit); + mSessionText = findViewById(R.id.sessionEdit); mSessionText.setOnKeyListener(mSessionKeyListener); mSessionText.setText(Integer.toString(sSession)); diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java index c3dd842903ec..963b20d11243 100644 --- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java +++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/Camera2SurfaceViewActivity.java @@ -43,7 +43,7 @@ public class Camera2SurfaceViewActivity extends Activity implements SurfaceHolde super.onCreate(savedInstanceState); setContentView(R.layout.surface_view_2); - mSurfaceView = (SurfaceView) findViewById(R.id.surface_view); + mSurfaceView = findViewById(R.id.surface_view); mSurfaceView.getHolder().addCallback(this); //Acquire the full wake lock to keep the device up diff --git a/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java b/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java index 0969b10b1f90..b0ca0bb74548 100644 --- a/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java +++ b/media/tests/NativeMidiDemo/java/com/example/android/nativemididemo/NativeMidi.java @@ -269,12 +269,12 @@ public class NativeMidi extends Activity super.onCreate(savedInstanceState); setContentView(R.layout.main); - mCallbackStatusTextView = (TextView) findViewById(R.id.callback_status); - mJavaMidiStatusTextView = (TextView) findViewById(R.id.java_midi_status); - mMessagesTextView = (TextView) findViewById(R.id.messages); - mMessagesContainer = (TouchableScrollView) findViewById(R.id.messages_scroll); - mMidiDevicesRadioGroup = (RadioGroup) findViewById(R.id.devices); - RadioButton deviceNone = (RadioButton) findViewById(R.id.device_none); + mCallbackStatusTextView = findViewById(R.id.callback_status); + mJavaMidiStatusTextView = findViewById(R.id.java_midi_status); + mMessagesTextView = findViewById(R.id.messages); + mMessagesContainer = findViewById(R.id.messages_scroll); + mMidiDevicesRadioGroup = findViewById(R.id.devices); + RadioButton deviceNone = findViewById(R.id.device_none); deviceNone.setOnClickListener(new MidiOutputPortSelector()); AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE); diff --git a/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java b/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java index 7e21876accb2..8427d16d9760 100644 --- a/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java +++ b/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java @@ -97,8 +97,8 @@ public class ScoAudioTest extends Activity { setContentView(R.layout.scoaudiotest); - mScoStateTxt = (TextView) findViewById(R.id.scoStateTxt); - mVdStateTxt = (TextView) findViewById(R.id.vdStateTxt); + mScoStateTxt = findViewById(R.id.scoStateTxt); + mVdStateTxt = findViewById(R.id.vdStateTxt); IntentFilter intentFilter = new IntentFilter(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED); @@ -112,7 +112,7 @@ public class ScoAudioTest extends Activity { mMediaControllers[0] = new SimplePlayerController(this, R.id.playPause1, R.id.stop1, R.raw.sine440_mo_16b_16k, AudioManager.STREAM_BLUETOOTH_SCO); - TextView name = (TextView) findViewById(R.id.playPause1Text); + TextView name = findViewById(R.id.playPause1Text); name.setText("VOICE_CALL stream"); mScoButton = (ToggleButton)findViewById(R.id.ForceScoButton); @@ -135,7 +135,7 @@ public class ScoAudioTest extends Activity { mTtsParams.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, UTTERANCE); - mSpeakText = (EditText) findViewById(R.id.speakTextEdit); + mSpeakText = findViewById(R.id.speakTextEdit); mSpeakText.setOnKeyListener(mSpeakKeyListener); mSpeakText.setText("sco audio test sentence"); mTtsToFileButton = (ToggleButton)findViewById(R.id.TtsToFileButton); @@ -143,7 +143,7 @@ public class ScoAudioTest extends Activity { mTtsToFile = true; mTtsToFileButton.setChecked(mTtsToFile); - mModeSpinner = (Spinner) findViewById(R.id.modeSpinner); + mModeSpinner = findViewById(R.id.modeSpinner); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mModeStrings); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); @@ -208,12 +208,12 @@ public class ScoAudioTest extends Activity { mForceScoOn = isChecked; AudioManager mngr = mAudioManager; boolean useVirtualCall = false; - CheckBox box = (CheckBox) findViewById(R.id.useSecondAudioManager); + CheckBox box = findViewById(R.id.useSecondAudioManager); if (box.isChecked()) { Log.i(TAG, "Using 2nd audio manager"); mngr = mAudioManager2; } - box = (CheckBox) findViewById(R.id.useVirtualCallCheckBox); + box = findViewById(R.id.useVirtualCallCheckBox); useVirtualCall = box.isChecked(); if (mForceScoOn) { @@ -278,8 +278,8 @@ public class ScoAudioTest extends Activity { mPlayPauseButtonId = playPausebuttonId; mStopButtonId = stopButtonId; mFileNameBase = fileName; - mPlayPauseButton = (ImageButton) findViewById(playPausebuttonId); - ImageButton stop = (ImageButton) findViewById(stopButtonId); + mPlayPauseButton = findViewById(playPausebuttonId); + ImageButton stop = findViewById(stopButtonId); mPlayPauseButton.setOnClickListener(this); mPlayPauseButton.requestFocus(); @@ -294,8 +294,8 @@ public class ScoAudioTest extends Activity { mStopButtonId = stopButtonId; mFileNameBase = ""; mFileResId = fileResId; - mPlayPauseButton = (ImageButton) findViewById(playPausebuttonId); - ImageButton stop = (ImageButton) findViewById(stopButtonId); + mPlayPauseButton = findViewById(playPausebuttonId); + ImageButton stop = findViewById(stopButtonId); mPlayPauseButton.setOnClickListener(this); mPlayPauseButton.requestFocus(); diff --git a/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java index 7fa57367301e..9fa7a6646c9c 100644 --- a/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java +++ b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java @@ -173,13 +173,13 @@ public class BackupRestoreConfirmation extends Activity { setContentView(layoutId); // Same resource IDs for each layout variant (backup / restore) - mStatusView = (TextView) findViewById(R.id.package_name); - mAllowButton = (Button) findViewById(R.id.button_allow); - mDenyButton = (Button) findViewById(R.id.button_deny); + mStatusView = findViewById(R.id.package_name); + mAllowButton = findViewById(R.id.button_allow); + mDenyButton = findViewById(R.id.button_deny); - mCurPassword = (TextView) findViewById(R.id.password); - mEncPassword = (TextView) findViewById(R.id.enc_password); - TextView curPwDesc = (TextView) findViewById(R.id.password_desc); + mCurPassword = findViewById(R.id.password); + mEncPassword = findViewById(R.id.enc_password); + TextView curPwDesc = findViewById(R.id.password_desc); mAllowButton.setOnClickListener(new View.OnClickListener() { @Override @@ -214,7 +214,7 @@ public class BackupRestoreConfirmation extends Activity { curPwDesc.setVisibility(View.GONE); mCurPassword.setVisibility(View.GONE); if (layoutId == R.layout.confirm_backup) { - TextView encPwDesc = (TextView) findViewById(R.id.enc_password_desc); + TextView encPwDesc = findViewById(R.id.enc_password_desc); if (mIsEncrypted) { encPwDesc.setText(R.string.backup_enc_password_required); monitorEncryptionPassword(); diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java index 6394c64b74cc..5d20cf38e21b 100644 --- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java +++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java @@ -117,7 +117,7 @@ public class CaptivePortalLoginActivity extends Activity { } mCm.registerNetworkCallback(builder.build(), mNetworkCallback); - final WebView myWebView = (WebView) findViewById(R.id.webview); + final WebView myWebView = findViewById(R.id.webview); myWebView.clearCache(true); WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); @@ -184,7 +184,7 @@ public class CaptivePortalLoginActivity extends Activity { @Override public void onBackPressed() { - WebView myWebView = (WebView) findViewById(R.id.webview); + WebView myWebView = findViewById(R.id.webview); if (myWebView.canGoBack() && mWebViewClient.allowBack()) { myWebView.goBack(); } else { @@ -326,7 +326,7 @@ public class CaptivePortalLoginActivity extends Activity { // For internally generated pages, leave URL bar listing prior URL as this is the URL // the page refers to. if (!url.startsWith(INTERNAL_ASSETS)) { - final TextView myUrlBar = (TextView) findViewById(R.id.url_bar); + final TextView myUrlBar = findViewById(R.id.url_bar); myUrlBar.setText(url); } testForCaptivePortal(); @@ -407,7 +407,7 @@ public class CaptivePortalLoginActivity extends Activity { private class MyWebChromeClient extends WebChromeClient { @Override public void onProgressChanged(WebView view, int newProgress) { - final ProgressBar myProgressBar = (ProgressBar) findViewById(R.id.progress_bar); + final ProgressBar myProgressBar = findViewById(R.id.progress_bar); myProgressBar.setProgress(newProgress); } } diff --git a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java index a5820f2da56c..6276ce3f0b98 100644 --- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java +++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java @@ -91,7 +91,7 @@ public class CaptivePortalLoginActivity extends Activity { setContentView(R.layout.activity_captive_portal_login); getActionBar().setDisplayShowHomeEnabled(false); - mWebView = (WebView) findViewById(R.id.webview); + mWebView = findViewById(R.id.webview); mWebView.clearCache(true); WebSettings webSettings = mWebView.getSettings(); webSettings.setJavaScriptEnabled(true); @@ -113,7 +113,7 @@ public class CaptivePortalLoginActivity extends Activity { @Override public void onBackPressed() { - WebView myWebView = (WebView) findViewById(R.id.webview); + WebView myWebView = findViewById(R.id.webview); if (myWebView.canGoBack() && mWebViewClient.allowBack()) { myWebView.goBack(); } else { @@ -328,7 +328,7 @@ public class CaptivePortalLoginActivity extends Activity { // For internally generated pages, leave URL bar listing prior URL as this is the URL // the page refers to. if (!url.startsWith(INTERNAL_ASSETS)) { - final TextView myUrlBar = (TextView) findViewById(R.id.url_bar); + final TextView myUrlBar = findViewById(R.id.url_bar); myUrlBar.setText(url); } if (mNetwork != null) { @@ -412,7 +412,7 @@ public class CaptivePortalLoginActivity extends Activity { private class MyWebChromeClient extends WebChromeClient { @Override public void onProgressChanged(WebView view, int newProgress) { - final ProgressBar myProgressBar = (ProgressBar) findViewById(R.id.progress_bar); + final ProgressBar myProgressBar = findViewById(R.id.progress_bar); myProgressBar.setProgress(newProgress); } } diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java index 14b9de59bf5a..76a64e51b9e1 100644 --- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java +++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java @@ -65,7 +65,7 @@ public class DeviceChooserActivity extends Activity { } else { setContentView(R.layout.device_chooser); setTitle(Html.fromHtml(getString(R.string.chooser_title, getCallingAppName()), 0)); - mDeviceListView = (ListView) findViewById(R.id.device_list); + mDeviceListView = findViewById(R.id.device_list); final DeviceDiscoveryService.DevicesAdapter adapter = getService().mDevicesAdapter; mDeviceListView.setAdapter(adapter); adapter.registerDataSetObserver(new DataSetObserver() { @@ -101,7 +101,7 @@ public class DeviceChooserActivity extends Activity { @Override public void setTitle(CharSequence title) { - final TextView titleView = (TextView) findViewById(R.id.title); + final TextView titleView = findViewById(R.id.title); final int padding = getPadding(getResources()); titleView.setPadding(padding, padding, padding, padding); titleView.setText(title); diff --git a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java index f59f0d97d24b..689e38142988 100644 --- a/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java +++ b/packages/EasterEgg/src/com/android/egg/neko/NekoLand.java @@ -82,7 +82,7 @@ public class NekoLand extends Activity implements PrefsListener { mPrefs = new PrefState(this); mPrefs.setListener(this); - final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.holder); + final RecyclerView recyclerView = findViewById(R.id.holder); mAdapter = new CatAdapter(); recyclerView.setAdapter(mAdapter); recyclerView.setLayoutManager(new GridLayoutManager(this, 3)); diff --git a/packages/Osu/src/com/android/hotspot2/app/MainActivity.java b/packages/Osu/src/com/android/hotspot2/app/MainActivity.java index ae0a45c78ff9..7fd2238703f1 100644 --- a/packages/Osu/src/com/android/hotspot2/app/MainActivity.java +++ b/packages/Osu/src/com/android/hotspot2/app/MainActivity.java @@ -123,7 +123,7 @@ public class MainActivity extends Activity { if (osuData.size() > 0) { noOsuView.setVisibility(View.GONE); osuListAdapter = new OsuListAdapter(this, osuData); - osuListView = (ListView) findViewById(R.id.profile_list); + osuListView = findViewById(R.id.profile_list); osuListView.setAdapter(osuListAdapter); osuListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override diff --git a/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java b/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java index afbd0d151b3d..a6778c82021a 100644 --- a/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java +++ b/packages/Osu/src/com/android/hotspot2/osu/OSUWebView.java @@ -37,7 +37,7 @@ public class OSUWebView extends Activity { setContentView(R.layout.osu_web_view); getActionBar().setDisplayShowHomeEnabled(false); - final WebView myWebView = (WebView) findViewById(R.id.webview); + final WebView myWebView = findViewById(R.id.webview); myWebView.clearCache(true); WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java index 4cce166db645..ccdec6216679 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/ui/PrintActivity.java @@ -1290,11 +1290,11 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat private void bindUi() { // Summary mSummaryContainer = findViewById(R.id.summary_content); - mSummaryCopies = (TextView) findViewById(R.id.copies_count_summary); - mSummaryPaperSize = (TextView) findViewById(R.id.paper_size_summary); + mSummaryCopies = findViewById(R.id.copies_count_summary); + mSummaryPaperSize = findViewById(R.id.paper_size_summary); // Options container - mOptionsContent = (PrintContentView) findViewById(R.id.options_content); + mOptionsContent = findViewById(R.id.options_content); mOptionsContent.setOptionsStateChangeListener(this); mOptionsContent.setOpenOptionsController(this); @@ -1302,7 +1302,7 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat OnClickListener clickListener = new MyClickListener(); // Copies - mCopiesEditText = (EditText) findViewById(R.id.copies_edittext); + mCopiesEditText = findViewById(R.id.copies_edittext); mCopiesEditText.setOnFocusChangeListener(mSelectAllOnFocusListener); mCopiesEditText.setText(MIN_COPIES_STRING); mCopiesEditText.setSelection(mCopiesEditText.getText().length()); @@ -1311,28 +1311,28 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat // Destination. mPrintersObserver = new PrintersObserver(); mDestinationSpinnerAdapter.registerDataSetObserver(mPrintersObserver); - mDestinationSpinner = (Spinner) findViewById(R.id.destination_spinner); + mDestinationSpinner = findViewById(R.id.destination_spinner); mDestinationSpinner.setAdapter(mDestinationSpinnerAdapter); mDestinationSpinner.setOnItemSelectedListener(itemSelectedListener); // Media size. mMediaSizeSpinnerAdapter = new ArrayAdapter<>( this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1); - mMediaSizeSpinner = (Spinner) findViewById(R.id.paper_size_spinner); + mMediaSizeSpinner = findViewById(R.id.paper_size_spinner); mMediaSizeSpinner.setAdapter(mMediaSizeSpinnerAdapter); mMediaSizeSpinner.setOnItemSelectedListener(itemSelectedListener); // Color mode. mColorModeSpinnerAdapter = new ArrayAdapter<>( this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1); - mColorModeSpinner = (Spinner) findViewById(R.id.color_spinner); + mColorModeSpinner = findViewById(R.id.color_spinner); mColorModeSpinner.setAdapter(mColorModeSpinnerAdapter); mColorModeSpinner.setOnItemSelectedListener(itemSelectedListener); // Duplex mode. mDuplexModeSpinnerAdapter = new ArrayAdapter<>( this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1); - mDuplexModeSpinner = (Spinner) findViewById(R.id.duplex_spinner); + mDuplexModeSpinner = findViewById(R.id.duplex_spinner); mDuplexModeSpinner.setAdapter(mDuplexModeSpinnerAdapter); mDuplexModeSpinner.setOnItemSelectedListener(itemSelectedListener); @@ -1345,32 +1345,32 @@ public class PrintActivity extends Activity implements RemotePrintDocument.Updat ORIENTATION_PORTRAIT, orientationLabels[0])); mOrientationSpinnerAdapter.add(new SpinnerItem<>( ORIENTATION_LANDSCAPE, orientationLabels[1])); - mOrientationSpinner = (Spinner) findViewById(R.id.orientation_spinner); + mOrientationSpinner = findViewById(R.id.orientation_spinner); mOrientationSpinner.setAdapter(mOrientationSpinnerAdapter); mOrientationSpinner.setOnItemSelectedListener(itemSelectedListener); // Range options ArrayAdapter<SpinnerItem<Integer>> rangeOptionsSpinnerAdapter = new ArrayAdapter<>( this, android.R.layout.simple_spinner_dropdown_item, android.R.id.text1); - mRangeOptionsSpinner = (Spinner) findViewById(R.id.range_options_spinner); + mRangeOptionsSpinner = findViewById(R.id.range_options_spinner); mRangeOptionsSpinner.setAdapter(rangeOptionsSpinnerAdapter); mRangeOptionsSpinner.setOnItemSelectedListener(itemSelectedListener); updatePageRangeOptions(PrintDocumentInfo.PAGE_COUNT_UNKNOWN); // Page range - mPageRangeTitle = (TextView) findViewById(R.id.page_range_title); - mPageRangeEditText = (EditText) findViewById(R.id.page_range_edittext); + mPageRangeTitle = findViewById(R.id.page_range_title); + mPageRangeEditText = findViewById(R.id.page_range_edittext); mPageRangeEditText.setVisibility(View.GONE); mPageRangeTitle.setVisibility(View.GONE); mPageRangeEditText.setOnFocusChangeListener(mSelectAllOnFocusListener); mPageRangeEditText.addTextChangedListener(new RangeTextWatcher()); // Advanced options button. - mMoreOptionsButton = (Button) findViewById(R.id.more_options_button); + mMoreOptionsButton = findViewById(R.id.more_options_button); mMoreOptionsButton.setOnClickListener(clickListener); // Print button - mPrintButton = (ImageView) findViewById(R.id.print_button); + mPrintButton = findViewById(R.id.print_button); mPrintButton.setOnClickListener(clickListener); // The UI is now initialized diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java b/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java index 6f0caa244281..a9a6cbd47699 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java +++ b/packages/PrintSpooler/src/com/android/printspooler/ui/SelectPrinterActivity.java @@ -134,7 +134,7 @@ public final class SelectPrinterActivity extends Activity implements LOADER_ID_PRINT_REGISTRY_INT); // Hook up the list view. - mListView = (ListView) findViewById(android.R.id.list); + mListView = findViewById(android.R.id.list); final DestinationAdapter adapter = new DestinationAdapter(); adapter.registerDataSetObserver(new DataSetObserver() { @Override @@ -411,7 +411,7 @@ public final class SelectPrinterActivity extends Activity implements View emptyView = findViewById(R.id.empty_print_state); mListView.setEmptyView(emptyView); } - TextView titleView = (TextView) findViewById(R.id.title); + TextView titleView = findViewById(R.id.title); View progressBar = findViewById(R.id.progress_bar); if (mEnabledPrintServices.size() == 0) { titleView.setText(R.string.print_no_print_services); diff --git a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java index 0bb4bfa18513..8b00ed053b26 100644 --- a/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java +++ b/packages/PrintSpooler/src/com/android/printspooler/widget/PrintContentView.java @@ -136,12 +136,12 @@ public final class PrintContentView extends ViewGroup implements View.OnClickLis @Override protected void onFinishInflate() { mStaticContent = findViewById(R.id.static_content); - mSummaryContent = (ViewGroup) findViewById(R.id.summary_content); + mSummaryContent = findViewById(R.id.summary_content); mDynamicContent = findViewById(R.id.dynamic_content); mDraggableContent = findViewById(R.id.draggable_content); mPrintButton = findViewById(R.id.print_button); mMoreOptionsButton = findViewById(R.id.more_options_button); - mOptionsContainer = (ViewGroup) findViewById(R.id.options_container); + mOptionsContainer = findViewById(R.id.options_container); mEmbeddedContentContainer = findViewById(R.id.embedded_content_container); mEmbeddedContentScrim = findViewById(R.id.embedded_content_scrim); mExpandCollapseHandle = findViewById(R.id.expand_collapse_handle); diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java b/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java index c6a45bcf1e9f..e2c05a193882 100644 --- a/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java +++ b/packages/SettingsLib/src/com/android/settingslib/graph/UsageView.java @@ -35,15 +35,15 @@ public class UsageView extends FrameLayout { public UsageView(Context context, AttributeSet attrs) { super(context, attrs); LayoutInflater.from(context).inflate(R.layout.usage_view, this); - mUsageGraph = (UsageGraph) findViewById(R.id.usage_graph); + mUsageGraph = findViewById(R.id.usage_graph); mLabels = new TextView[] { - (TextView) findViewById(R.id.label_bottom), - (TextView) findViewById(R.id.label_middle), - (TextView) findViewById(R.id.label_top), + findViewById(R.id.label_bottom), + findViewById(R.id.label_middle), + findViewById(R.id.label_top), }; mBottomLabels = new TextView[] { - (TextView) findViewById(R.id.label_start), - (TextView) findViewById(R.id.label_end), + findViewById(R.id.label_start), + findViewById(R.id.label_end), }; TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.UsageView, 0, 0); if (a.hasValue(R.styleable.UsageView_sideLabels)) { @@ -64,15 +64,15 @@ public class UsageView extends FrameLayout { if (a.hasValue(R.styleable.UsageView_android_gravity)) { int gravity = a.getInt(R.styleable.UsageView_android_gravity, 0); if (gravity == Gravity.END) { - LinearLayout layout = (LinearLayout) findViewById(R.id.graph_label_group); - LinearLayout labels = (LinearLayout) findViewById(R.id.label_group); + LinearLayout layout = findViewById(R.id.graph_label_group); + LinearLayout labels = findViewById(R.id.label_group); // Swap the children order. layout.removeView(labels); layout.addView(labels); // Set gravity. labels.setGravity(Gravity.END); // Swap the bottom space order. - LinearLayout bottomLabels = (LinearLayout) findViewById(R.id.bottom_label_group); + LinearLayout bottomLabels = findViewById(R.id.bottom_label_group); View bottomSpace = bottomLabels.findViewById(R.id.bottom_label_space); bottomLabels.removeView(bottomSpace); bottomLabels.addView(bottomSpace); diff --git a/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java b/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java index 0a89d9b15e26..e98ef0607951 100644 --- a/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java +++ b/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java @@ -37,8 +37,8 @@ public class EmergencyCarrierArea extends AlphaOptimizedLinearLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mCarrierText = (CarrierText) findViewById(R.id.carrier_text); - mEmergencyButton = (EmergencyButton) findViewById(R.id.emergency_call_button); + mCarrierText = findViewById(R.id.carrier_text); + mEmergencyButton = findViewById(R.id.emergency_call_button); // The emergency button overlaps the carrier text, only noticeable when highlighted. // So temporarily hide the carrier text while the emergency button is pressed. diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java index 5aa673b40124..abc3b94777b0 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java @@ -98,7 +98,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout mSecurityMessageDisplay = KeyguardMessageArea.findSecurityMessageDisplay(this); mEcaView = findViewById(R.id.keyguard_selector_fade_container); - EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button); + EmergencyButton button = findViewById(R.id.emergency_call_button); if (button != null) { button.setCallback(this); } diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java index dd5544d2cdad..27a3f7d44890 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java @@ -143,7 +143,7 @@ public class KeyguardHostView extends FrameLayout implements SecurityCallback { @Override protected void onFinishInflate() { mSecurityContainer = - (KeyguardSecurityContainer) findViewById(R.id.keyguard_security_container); + findViewById(R.id.keyguard_security_container); mLockPatternUtils = new LockPatternUtils(mContext); mSecurityContainer.setLockPatternUtils(mLockPatternUtils); mSecurityContainer.setSecurityCallback(this); diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java index 590d8d5de672..c1cff9e8f735 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java @@ -79,11 +79,11 @@ public class KeyguardPINView extends KeyguardPinBasedInputView { protected void onFinishInflate() { super.onFinishInflate(); - mContainer = (ViewGroup) findViewById(R.id.container); - mRow0 = (ViewGroup) findViewById(R.id.row0); - mRow1 = (ViewGroup) findViewById(R.id.row1); - mRow2 = (ViewGroup) findViewById(R.id.row2); - mRow3 = (ViewGroup) findViewById(R.id.row3); + mContainer = findViewById(R.id.container); + mRow0 = findViewById(R.id.row0); + mRow1 = findViewById(R.id.row1); + mRow2 = findViewById(R.id.row2); + mRow3 = findViewById(R.id.row3); mDivider = findViewById(R.id.divider); mViews = new View[][]{ new View[]{ diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java index d49ff975473d..b6184a883210 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java @@ -174,7 +174,7 @@ public class KeyguardPasswordView extends KeyguardAbsKeyInputView mImm = (InputMethodManager) getContext().getSystemService( Context.INPUT_METHOD_SERVICE); - mPasswordEntry = (TextView) findViewById(getPasswordTextViewId()); + mPasswordEntry = findViewById(getPasswordTextViewId()); mPasswordEntryDisabler = new TextViewInputDisabler(mPasswordEntry); mPasswordEntry.setKeyListener(TextKeyListener.getInstance()); mPasswordEntry.setInputType(InputType.TYPE_CLASS_TEXT diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java index c2b57ffa6113..3c9a6b9dcdec 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java @@ -140,7 +140,7 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit mLockPatternUtils = mLockPatternUtils == null ? new LockPatternUtils(mContext) : mLockPatternUtils; - mLockPatternView = (LockPatternView) findViewById(R.id.lockPatternView); + mLockPatternView = findViewById(R.id.lockPatternView); mLockPatternView.setSaveEnabled(false); mLockPatternView.setOnPatternListener(new UnlockPatternListener()); @@ -150,9 +150,9 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit mSecurityMessageDisplay = (KeyguardMessageArea) KeyguardMessageArea.findSecurityMessageDisplay(this); mEcaView = findViewById(R.id.keyguard_selector_fade_container); - mContainer = (ViewGroup) findViewById(R.id.container); + mContainer = findViewById(R.id.container); - EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button); + EmergencyButton button = findViewById(R.id.emergency_call_button); if (button != null) { button.setCallback(this); } diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java index 108b466e44af..c04ae68dab36 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java @@ -171,7 +171,7 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView @Override protected void onFinishInflate() { - mPasswordEntry = (PasswordTextView) findViewById(getPasswordTextViewId()); + mPasswordEntry = findViewById(getPasswordTextViewId()); mPasswordEntry.setOnKeyListener(this); // Set selected property on so the view can send accessibility events. diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java index 8cdb906a0e56..b447979be45d 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java @@ -160,7 +160,7 @@ public class KeyguardSecurityContainer extends FrameLayout implements KeyguardSe } protected void onFinishInflate() { - mSecurityViewFlipper = (KeyguardSecurityViewFlipper) findViewById(R.id.view_flipper); + mSecurityViewFlipper = findViewById(R.id.view_flipper); mSecurityViewFlipper.setLockPatternUtils(mLockPatternUtils); } diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java index 839d3cec5e96..0cf890037f55 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java @@ -144,7 +144,7 @@ public class KeyguardSimPinView extends KeyguardPinBasedInputView { if (mEcaView instanceof EmergencyCarrierArea) { ((EmergencyCarrierArea) mEcaView).setCarrierTextVisible(true); } - mSimImageView = (ImageView) findViewById(R.id.keyguard_sim); + mSimImageView = findViewById(R.id.keyguard_sim); } @Override diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java index 3871448cb617..fb3cee74ab68 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java @@ -187,7 +187,7 @@ public class KeyguardSimPukView extends KeyguardPinBasedInputView { if (mEcaView instanceof EmergencyCarrierArea) { ((EmergencyCarrierArea) mEcaView).setCarrierTextVisible(true); } - mSimImageView = (ImageView) findViewById(R.id.keyguard_sim); + mSimImageView = findViewById(R.id.keyguard_sim); } @Override diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java index b2b0ee463a97..162faa595ed3 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java @@ -115,14 +115,14 @@ public class KeyguardStatusView extends GridLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mClockContainer = (ViewGroup) findViewById(R.id.keyguard_clock_container); - mAlarmStatusView = (TextView) findViewById(R.id.alarm_status); - mDateView = (TextClock) findViewById(R.id.date_view); - mClockView = (TextClock) findViewById(R.id.clock_view); + mClockContainer = findViewById(R.id.keyguard_clock_container); + mAlarmStatusView = findViewById(R.id.alarm_status); + mDateView = findViewById(R.id.date_view); + mClockView = findViewById(R.id.clock_view); mDateView.setShowCurrentUserTime(true); mClockView.setShowCurrentUserTime(true); - mOwnerInfo = (TextView) findViewById(R.id.owner_info); - mBatteryDoze = (ChargingView) findViewById(R.id.battery_doze); + mOwnerInfo = findViewById(R.id.owner_info); + mBatteryDoze = findViewById(R.id.battery_doze); mVisibleInDoze = new View[]{mBatteryDoze, mClockView}; boolean shouldMarquee = KeyguardUpdateMonitor.getInstance(mContext).isDeviceInteractive(); diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java b/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java index abcf27d28976..1d032e8aba48 100644 --- a/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java +++ b/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java @@ -137,7 +137,7 @@ public class AssistOrbView extends FrameLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mLogo = (ImageView) findViewById(R.id.search_logo); + mLogo = findViewById(R.id.search_logo); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java b/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java index cdda45f6b02c..f06ea451d4d0 100644 --- a/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java +++ b/packages/SystemUI/src/com/android/systemui/egg/MLandActivity.java @@ -30,8 +30,8 @@ public class MLandActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mland); - mLand = (MLand) findViewById(R.id.world); - mLand.setScoreFieldHolder((ViewGroup) findViewById(R.id.scores)); + mLand = findViewById(R.id.world); + mLand.setScoreFieldHolder(findViewById(R.id.scores)); final View welcome = findViewById(R.id.welcome); mLand.setSplash(welcome); final int numControllers = mLand.getGameControllers().size(); diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index c06e56a06a67..9c4f16b808ab 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -188,10 +188,10 @@ public class PipMenuActivity extends Activity { mDismissButton.setOnClickListener((v) -> { dismissPip(); }); - mActionsGroup = (LinearLayout) findViewById(R.id.actions_group); + mActionsGroup = findViewById(R.id.actions_group); mBetweenActionPaddingLand = getResources().getDimensionPixelSize( R.dimen.pip_between_action_padding_land); - mExpandButton = (ImageView) findViewById(R.id.expand_button); + mExpandButton = findViewById(R.id.expand_button); updateFromIntent(getIntent()); setTitle(R.string.pip_menu_title); @@ -392,8 +392,8 @@ public class PipMenuActivity extends Activity { } private void updateActionViews(Rect stackBounds) { - ViewGroup expandContainer = (ViewGroup) findViewById(R.id.expand_container); - ViewGroup actionsContainer = (ViewGroup) findViewById(R.id.actions_container); + ViewGroup expandContainer = findViewById(R.id.expand_container); + ViewGroup actionsContainer = findViewById(R.id.actions_container); actionsContainer.setOnTouchListener((v, ev) -> { // Do nothing, prevent click through to parent return true; diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java index 59cb0860fdfd..40a63d7d92c0 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlButtonView.java @@ -77,9 +77,9 @@ public class PipControlButtonView extends RelativeLayout { .getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.tv_pip_control_button, this); - mIconImageView = (ImageView) findViewById(R.id.icon); - mButtonImageView = (ImageView) findViewById(R.id.button); - mDescriptionTextView = (TextView) findViewById(R.id.desc); + mIconImageView = findViewById(R.id.icon); + mButtonImageView = findViewById(R.id.button); + mDescriptionTextView = findViewById(R.id.desc); int[] values = new int[] {android.R.attr.src, android.R.attr.text}; TypedArray typedArray = diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java index a2aff2df52e9..4c81907c35f7 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipControlsView.java @@ -107,7 +107,7 @@ public class PipControlsView extends LinearLayout { public void onFinishInflate() { super.onFinishInflate(); - mFullButtonView = (PipControlButtonView) findViewById(R.id.full_button); + mFullButtonView = findViewById(R.id.full_button); mFullButtonView.setOnFocusChangeListener(mFocusChangeListener); mFullButtonView.setOnClickListener(new View.OnClickListener() { @Override @@ -116,7 +116,7 @@ public class PipControlsView extends LinearLayout { } }); - mCloseButtonView = (PipControlButtonView) findViewById(R.id.close_button); + mCloseButtonView = findViewById(R.id.close_button); mCloseButtonView.setOnFocusChangeListener(mFocusChangeListener); mCloseButtonView.setOnClickListener(new View.OnClickListener() { @Override @@ -128,7 +128,7 @@ public class PipControlsView extends LinearLayout { } }); - mPlayPauseButtonView = (PipControlButtonView) findViewById(R.id.play_pause_button); + mPlayPauseButtonView = findViewById(R.id.play_pause_button); mPlayPauseButtonView.setOnFocusChangeListener(mFocusChangeListener); mPlayPauseButtonView.setOnClickListener(new View.OnClickListener() { @Override diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java index 01d86b67eaf7..9945079445a8 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipMenuActivity.java @@ -44,7 +44,7 @@ public class PipMenuActivity extends Activity implements PipManager.Listener { mPipManager.addListener(this); mRestorePipSizeWhenClose = true; - mPipControlsView = (PipControlsView) findViewById(R.id.pip_controls); + mPipControlsView = findViewById(R.id.pip_controls); mFadeInAnimation = AnimatorInflater.loadAnimator( this, R.anim.tv_pip_menu_fade_in_animation); mFadeInAnimation.setTarget(mPipControlsView); diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java index 57952f43bc17..423530a70c04 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipOnboardingActivity.java @@ -65,7 +65,7 @@ public class PipOnboardingActivity extends Activity implements PipManager.Listen mEnterAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { - ImageView button = (ImageView) findViewById(R.id.remote_button); + ImageView button = findViewById(R.id.remote_button); ((AnimationDrawable) button.getDrawable()).start(); } }); diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java index d2a291944d8d..f124e8686749 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetail.java @@ -92,14 +92,14 @@ public class QSDetail extends LinearLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mDetailContent = (ViewGroup) findViewById(android.R.id.content); - mDetailSettingsButton = (TextView) findViewById(android.R.id.button2); - mDetailDoneButton = (TextView) findViewById(android.R.id.button1); + mDetailContent = findViewById(android.R.id.content); + mDetailSettingsButton = findViewById(android.R.id.button2); + mDetailDoneButton = findViewById(android.R.id.button1); mQsDetailHeader = findViewById(R.id.qs_detail_header); mQsDetailHeaderTitle = (TextView) mQsDetailHeader.findViewById(android.R.id.title); mQsDetailHeaderSwitch = (Switch) mQsDetailHeader.findViewById(android.R.id.toggle); - mQsDetailHeaderProgress = (ImageView) findViewById(R.id.qs_detail_header_progress); + mQsDetailHeaderProgress = findViewById(R.id.qs_detail_header_progress); updateDetailText(); diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java b/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java index efc066865d34..f91aa9a6d0b0 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSDetailItems.java @@ -76,7 +76,7 @@ public class QSDetailItems extends FrameLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mItemList = (AutoSizingList) findViewById(android.R.id.list); + mItemList = findViewById(android.R.id.list); mItemList.setVisibility(GONE); mItemList.setAdapter(mAdapter); mEmpty = findViewById(android.R.id.empty); diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java index 596d3bc6e8f6..30053e35ef05 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java @@ -82,7 +82,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene LayoutInflater.from(getContext()).inflate(R.layout.qs_customize_panel_content, this); - mToolbar = (Toolbar) findViewById(com.android.internal.R.id.action_bar); + mToolbar = findViewById(com.android.internal.R.id.action_bar); TypedValue value = new TypedValue(); mContext.getTheme().resolveAttribute(android.R.attr.homeAsUpIndicator, value, true); mToolbar.setNavigationIcon( @@ -98,7 +98,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene mContext.getString(com.android.internal.R.string.reset)); mToolbar.setTitle(R.string.qs_edit); - mRecyclerView = (RecyclerView) findViewById(android.R.id.list); + mRecyclerView = findViewById(android.R.id.list); mTileAdapter = new TileAdapter(getContext()); mRecyclerView.setAdapter(mTileAdapter); mTileAdapter.getItemTouchHelper().attachToRecyclerView(mRecyclerView); diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java index 9cd79f84cb89..7224ae6a1e15 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java @@ -98,21 +98,21 @@ public class DataUsageDetailView extends LinearLayout { usageColor = Utils.getColorAccent(mContext); } - final TextView title = (TextView) findViewById(android.R.id.title); + final TextView title = findViewById(android.R.id.title); title.setText(titleId); - final TextView usage = (TextView) findViewById(R.id.usage_text); + final TextView usage = findViewById(R.id.usage_text); usage.setText(formatBytes(bytes)); usage.setTextColor(usageColor); - final DataUsageGraph graph = (DataUsageGraph) findViewById(R.id.usage_graph); + final DataUsageGraph graph = findViewById(R.id.usage_graph); graph.setLevels(info.limitLevel, info.warningLevel, info.usageLevel); - final TextView carrier = (TextView) findViewById(R.id.usage_carrier_text); + final TextView carrier = findViewById(R.id.usage_carrier_text); carrier.setText(info.carrier); - final TextView period = (TextView) findViewById(R.id.usage_period_text); + final TextView period = findViewById(R.id.usage_period_text); period.setText(info.period); - final TextView infoTop = (TextView) findViewById(R.id.usage_info_top_text); + final TextView infoTop = findViewById(R.id.usage_info_top_text); infoTop.setVisibility(top != null ? View.VISIBLE : View.GONE); infoTop.setText(top); - final TextView infoBottom = (TextView) findViewById(R.id.usage_info_bottom_text); + final TextView infoBottom = findViewById(R.id.usage_info_bottom_text); infoBottom.setVisibility(bottom != null ? View.VISIBLE : View.GONE); infoBottom.setText(bottom); boolean showLevel = info.warningLevel > 0 || info.limitLevel > 0; diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java index c485a9ecbf6a..1e9a618c3324 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailItemView.java @@ -117,8 +117,8 @@ public class UserDetailItemView extends LinearLayout { @Override protected void onFinishInflate() { - mAvatar = (UserAvatarView) findViewById(R.id.user_picture); - mName = (TextView) findViewById(R.id.user_name); + mAvatar = findViewById(R.id.user_picture); + mName = findViewById(R.id.user_name); if (mRegularTypeface == null) { mRegularTypeface = mName.getTypeface(); } diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index f0a9bc3f80be..143d934dd002 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -325,7 +325,7 @@ public class RecentsActivity extends Activity implements ViewTreeObserver.OnPreD // Set the Recents layout setContentView(R.layout.recents); takeKeyEvents(true); - mRecentsView = (RecentsView) findViewById(R.id.recents_view); + mRecentsView = findViewById(R.id.recents_view); mRecentsView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java index b8be5800764a..e34987b1d47a 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskView.java @@ -222,8 +222,8 @@ public class TaskView extends FixedSizeFrameLayout implements Task.TaskCallbacks @Override protected void onFinishInflate() { // Bind the views - mHeaderView = (TaskViewHeader) findViewById(R.id.task_view_bar); - mThumbnailView = (TaskViewThumbnail) findViewById(R.id.task_view_thumbnail); + mHeaderView = findViewById(R.id.task_view_bar); + mThumbnailView = findViewById(R.id.task_view_thumbnail); mThumbnailView.updateClipToTaskBar(mHeaderView); mActionButtonView = findViewById(R.id.lock_to_app_fab); mActionButtonView.setOutlineProvider(new ViewOutlineProvider() { diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java index 311f8ffe258f..ae922fcc218e 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskViewHeader.java @@ -244,12 +244,12 @@ public class TaskViewHeader extends FrameLayout SystemServicesProxy ssp = Recents.getSystemServices(); // Initialize the icon and description views - mIconView = (ImageView) findViewById(R.id.icon); + mIconView = findViewById(R.id.icon); mIconView.setOnLongClickListener(this); - mTitleView = (TextView) findViewById(R.id.title); - mDismissButton = (ImageView) findViewById(R.id.dismiss_task); + mTitleView = findViewById(R.id.title); + mDismissButton = findViewById(R.id.dismiss_task); if (ssp.hasFreeformWorkspaceSupport()) { - mMoveTaskButton = (ImageView) findViewById(R.id.move_task); + mMoveTaskButton = findViewById(R.id.move_task); } onConfigurationChanged(); diff --git a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java index 7d847a3ea111..6918a6309ae1 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java +++ b/packages/SystemUI/src/com/android/systemui/settings/BrightnessDialog.java @@ -54,8 +54,8 @@ public class BrightnessDialog extends Activity { R.layout.quick_settings_brightness_dialog, null); setContentView(v); - final ImageView icon = (ImageView) findViewById(R.id.brightness_icon); - final ToggleSliderView slider = (ToggleSliderView) findViewById(R.id.brightness_slider); + final ImageView icon = findViewById(R.id.brightness_icon); + final ToggleSliderView slider = findViewById(R.id.brightness_slider); mBrightnessController = new BrightnessController(this, icon, slider); } diff --git a/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java b/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java index afe89ec2a9ac..5b234e9c5576 100644 --- a/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java +++ b/packages/SystemUI/src/com/android/systemui/settings/ToggleSliderView.java @@ -60,13 +60,13 @@ public class ToggleSliderView extends RelativeLayout implements ToggleSlider { final TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.ToggleSliderView, defStyle, 0); - mToggle = (CompoundButton) findViewById(R.id.toggle); + mToggle = findViewById(R.id.toggle); mToggle.setOnCheckedChangeListener(mCheckListener); - mSlider = (ToggleSeekBar) findViewById(R.id.slider); + mSlider = findViewById(R.id.slider); mSlider.setOnSeekBarChangeListener(mSeekListener); - mLabel = (TextView) findViewById(R.id.label); + mLabel = findViewById(R.id.label); mLabel.setText(a.getString(R.styleable.ToggleSliderView_text)); mSlider.setAccessibilityLabel(getContentDescription().toString()); diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java index c48ecdbe838a..da56e62f3c6e 100644 --- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java +++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java @@ -269,9 +269,9 @@ public class DividerView extends FrameLayout implements OnTouchListener, @Override protected void onFinishInflate() { super.onFinishInflate(); - mHandle = (DividerHandleView) findViewById(R.id.docked_divider_handle); + mHandle = findViewById(R.id.docked_divider_handle); mBackground = findViewById(R.id.docked_divider_background); - mMinimizedShadow = (MinimizedDockShadow) findViewById(R.id.minimized_dock_shadow); + mMinimizedShadow = findViewById(R.id.minimized_dock_shadow); mHandle.setOnTouchListener(this); mDividerWindowWidth = getResources().getDimensionPixelSize( com.android.internal.R.dimen.docked_stack_divider_thickness); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java index d4997ead8292..469f3ad45c56 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/ActivatableNotificationView.java @@ -203,10 +203,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView @Override protected void onFinishInflate() { super.onFinishInflate(); - mBackgroundNormal = (NotificationBackgroundView) findViewById(R.id.backgroundNormal); - mFakeShadow = (FakeShadowView) findViewById(R.id.fake_shadow); + mBackgroundNormal = findViewById(R.id.backgroundNormal); + mFakeShadow = findViewById(R.id.fake_shadow); mShadowHidden = mFakeShadow.getVisibility() != VISIBLE; - mBackgroundDimmed = (NotificationBackgroundView) findViewById(R.id.backgroundDimmed); + mBackgroundDimmed = findViewById(R.id.backgroundDimmed); mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg); mBackgroundDimmed.setCustomBackground(R.drawable.notification_material_bg_dim); updateBackground(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java index 507b66524c0b..5377deef337e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcutAppItemLayout.java @@ -44,8 +44,8 @@ public class KeyboardShortcutAppItemLayout extends RelativeLayout { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { if (MeasureSpec.getMode(widthMeasureSpec) == MeasureSpec.EXACTLY) { - ImageView shortcutIcon = (ImageView) findViewById(R.id.keyboard_shortcuts_icon); - TextView shortcutKeyword = (TextView) findViewById(R.id.keyboard_shortcuts_keyword); + ImageView shortcutIcon = findViewById(R.id.keyboard_shortcuts_icon); + TextView shortcutKeyword = findViewById(R.id.keyboard_shortcuts_keyword); int totalMeasuredWidth = MeasureSpec.getSize(widthMeasureSpec); int totalPadding = getPaddingLeft() + getPaddingRight(); int availableWidth = totalMeasuredWidth - totalPadding; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java index fab4e592a9aa..7928575df4d4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java @@ -151,7 +151,7 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G pkg, mAppUid, false /* includeDeleted */); String channelsDescText; - mNumChannelsView = (TextView) (findViewById(R.id.num_channels_desc)); + mNumChannelsView = findViewById(R.id.num_channels_desc); if (isSingleDefaultChannel) { channelsDescText = mContext.getString(R.string.notification_default_channel_desc); } else { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java index 51345c20abe1..b134fc542776 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java @@ -79,7 +79,7 @@ public class NotificationShelf extends ActivatableNotificationView implements @Override protected void onFinishInflate() { super.onFinishInflate(); - mShelfIcons = (NotificationIconContainer) findViewById(R.id.content); + mShelfIcons = findViewById(R.id.content); mShelfIcons.setClipChildren(false); mShelfIcons.setClipToPadding(false); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java index 0de3e0244fa4..4a3f112f0406 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java @@ -63,9 +63,9 @@ public class NotificationSnooze extends LinearLayout createOptionViews(); // Snackbar - mSelectedOptionText = (TextView) findViewById(R.id.snooze_option_default); + mSelectedOptionText = findViewById(R.id.snooze_option_default); mSelectedOptionText.setOnClickListener(this); - mUndoButton = (TextView) findViewById(R.id.undo); + mUndoButton = findViewById(R.id.undo); mUndoButton.setOnClickListener(this); // Default to first option in list @@ -102,7 +102,7 @@ public class NotificationSnooze extends LinearLayout } private void createOptionViews() { - mSnoozeOptionView = (ViewGroup) findViewById(R.id.snooze_options); + mSnoozeOptionView = findViewById(R.id.snooze_options); mSnoozeOptionView.removeAllViews(); mSnoozeOptionView.setVisibility(View.GONE); final Resources res = getResources(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java index c5e1438c272e..d5f0e7c2a60b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java @@ -177,22 +177,22 @@ public class SignalClusterView extends LinearLayout implements NetworkController protected void onFinishInflate() { super.onFinishInflate(); - mVpn = (ImageView) findViewById(R.id.vpn); - mEthernetGroup = (ViewGroup) findViewById(R.id.ethernet_combo); - mEthernet = (ImageView) findViewById(R.id.ethernet); - mEthernetDark = (ImageView) findViewById(R.id.ethernet_dark); - mWifiGroup = (ViewGroup) findViewById(R.id.wifi_combo); - mWifi = (ImageView) findViewById(R.id.wifi_signal); - mWifiDark = (ImageView) findViewById(R.id.wifi_signal_dark); - mWifiActivityIn = (ImageView) findViewById(R.id.wifi_in); - mWifiActivityOut= (ImageView) findViewById(R.id.wifi_out); - mAirplane = (ImageView) findViewById(R.id.airplane); - mNoSims = (ImageView) findViewById(R.id.no_sims); - mNoSimsDark = (ImageView) findViewById(R.id.no_sims_dark); + mVpn = findViewById(R.id.vpn); + mEthernetGroup = findViewById(R.id.ethernet_combo); + mEthernet = findViewById(R.id.ethernet); + mEthernetDark = findViewById(R.id.ethernet_dark); + mWifiGroup = findViewById(R.id.wifi_combo); + mWifi = findViewById(R.id.wifi_signal); + mWifiDark = findViewById(R.id.wifi_signal_dark); + mWifiActivityIn = findViewById(R.id.wifi_in); + mWifiActivityOut= findViewById(R.id.wifi_out); + mAirplane = findViewById(R.id.airplane); + mNoSims = findViewById(R.id.no_sims); + mNoSimsDark = findViewById(R.id.no_sims_dark); mNoSimsCombo = findViewById(R.id.no_sims_combo); mWifiAirplaneSpacer = findViewById(R.id.wifi_airplane_spacer); mWifiSignalSpacer = findViewById(R.id.wifi_signal_spacer); - mMobileSignalGroup = (LinearLayout) findViewById(R.id.mobile_signal_group); + mMobileSignalGroup = findViewById(R.id.mobile_signal_group); maybeScaleVpnAndNoSimsIcons(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java index d530759c7d3d..6cbbd6cd1f18 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java @@ -40,8 +40,8 @@ class CarNavigationBarView extends NavigationBarView { @Override public void onFinishInflate() { - mNavButtons = (LinearLayout) findViewById(R.id.nav_buttons); - mLightsOutButtons = (LinearLayout) findViewById(R.id.lights_out); + mNavButtons = findViewById(R.id.nav_buttons); + mLightsOutButtons = findViewById(R.id.lights_out); } public void addButton(CarNavigationButton button, CarNavigationButton lightsOutButton){ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java index f46fc6769b17..2de358f1c292 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationButton.java @@ -41,13 +41,13 @@ public class CarNavigationButton extends RelativeLayout { @Override public void onFinishInflate() { super.onFinishInflate(); - mIcon = (AlphaOptimizedImageButton) findViewById(R.id.car_nav_button_icon); + mIcon = findViewById(R.id.car_nav_button_icon); mIcon.setScaleType(ImageView.ScaleType.CENTER); mIcon.setClickable(false); mIcon.setBackgroundColor(android.R.color.transparent); mIcon.setAlpha(UNSELECTED_ALPHA); - mMoreIcon = (AlphaOptimizedImageButton) findViewById(R.id.car_nav_button_more_icon); + mMoreIcon = findViewById(R.id.car_nav_button_more_icon); mMoreIcon.setClickable(false); mMoreIcon.setBackgroundColor(android.R.color.transparent); mMoreIcon.setVisibility(INVISIBLE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 9a49d67d70d6..41a60e24e700 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -227,14 +227,14 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL protected void onFinishInflate() { super.onFinishInflate(); mLockPatternUtils = new LockPatternUtils(mContext); - mPreviewContainer = (ViewGroup) findViewById(R.id.preview_container); - mRightAffordanceView = (KeyguardAffordanceView) findViewById(R.id.camera_button); - mLeftAffordanceView = (KeyguardAffordanceView) findViewById(R.id.left_button); - mLockIcon = (LockIcon) findViewById(R.id.lock_icon); - mIndicationArea = (ViewGroup) findViewById(R.id.keyguard_indication_area); - mEnterpriseDisclosure = (TextView) findViewById( + mPreviewContainer = findViewById(R.id.preview_container); + mRightAffordanceView = findViewById(R.id.camera_button); + mLeftAffordanceView = findViewById(R.id.left_button); + mLockIcon = findViewById(R.id.lock_icon); + mIndicationArea = findViewById(R.id.keyguard_indication_area); + mEnterpriseDisclosure = findViewById( R.id.keyguard_indication_enterprise_disclosure); - mIndicationText = (TextView) findViewById(R.id.keyguard_indication_text); + mIndicationText = findViewById(R.id.keyguard_indication_text); watchForCameraPolicyChanges(); updateCameraVisibility(); mUnlockMethodCache = UnlockMethodCache.getInstance(getContext()); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 307a8c7b16dc..f1b449891529 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -231,9 +231,9 @@ public class NotificationPanelView extends PanelView implements @Override protected void onFinishInflate() { super.onFinishInflate(); - mKeyguardStatusBar = (KeyguardStatusBarView) findViewById(R.id.keyguard_header); - mKeyguardStatusView = (KeyguardStatusView) findViewById(R.id.keyguard_status_view); - mClockView = (TextView) findViewById(R.id.clock_view); + mKeyguardStatusBar = findViewById(R.id.keyguard_header); + mKeyguardStatusView = findViewById(R.id.keyguard_status_view); + mClockView = findViewById(R.id.clock_view); mNotificationContainerParent = (NotificationsQuickSettingsContainer) findViewById(R.id.notification_container_parent); @@ -242,13 +242,13 @@ public class NotificationPanelView extends PanelView implements mNotificationStackScroller.setOnHeightChangedListener(this); mNotificationStackScroller.setOverscrollTopChangedListener(this); mNotificationStackScroller.setOnEmptySpaceClickListener(this); - mKeyguardBottomArea = (KeyguardBottomAreaView) findViewById(R.id.keyguard_bottom_area); + mKeyguardBottomArea = findViewById(R.id.keyguard_bottom_area); mQsNavbarScrim = findViewById(R.id.qs_navbar_scrim); mAffordanceHelper = new KeyguardAffordanceHelper(this, getContext()); mKeyguardBottomArea.setAffordanceHelper(mAffordanceHelper); mLastOrientation = getResources().getConfiguration().orientation; - mQsFrame = (FrameLayout) findViewById(R.id.qs_frame); + mQsFrame = findViewById(R.id.qs_frame); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 4dc593b856e6..916b603f54fa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -75,7 +75,7 @@ public class PhoneStatusBarView extends PanelBar { @Override public void onFinishInflate() { mBarTransitions.init(); - mBattery = (DarkReceiver) findViewById(R.id.battery); + mBattery = findViewById(R.id.battery); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java index 784f25e25a56..37b0de400c9e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java @@ -101,9 +101,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene protected void onFinishInflate() { super.onFinishInflate(); - mProgressBar = (ProgressBar) findViewById(R.id.remote_input_progress); + mProgressBar = findViewById(R.id.remote_input_progress); - mSendButton = (ImageButton) findViewById(R.id.remote_input_send); + mSendButton = findViewById(R.id.remote_input_send); mSendButton.setOnClickListener(this); mEditText = (RemoteEditText) getChildAt(0); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java index faa1a28ace8b..9f6157492a38 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SplitClockView.java @@ -59,8 +59,8 @@ public class SplitClockView extends LinearLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mTimeView = (TextClock) findViewById(R.id.time_view); - mAmPmView = (TextClock) findViewById(R.id.am_pm_view); + mTimeView = findViewById(R.id.time_view); + mAmPmView = findViewById(R.id.am_pm_view); mTimeView.setShowCurrentUserTime(true); mAmPmView.setShowCurrentUserTime(true); } diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java index 4e4832c5f33a..10b6ff5cdfdc 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java +++ b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java @@ -60,10 +60,10 @@ public class ZenFooter extends LinearLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); - mIcon = (ImageView) findViewById(R.id.volume_zen_icon); - mSummaryLine1 = (TextView) findViewById(R.id.volume_zen_summary_line_1); - mSummaryLine2 = (TextView) findViewById(R.id.volume_zen_summary_line_2); - mEndNowButton = (TextView) findViewById(R.id.volume_zen_end_now); + mIcon = findViewById(R.id.volume_zen_icon); + mSummaryLine1 = findViewById(R.id.volume_zen_summary_line_1); + mSummaryLine2 = findViewById(R.id.volume_zen_summary_line_2); + mEndNowButton = findViewById(R.id.volume_zen_end_now); mConfigurableTexts.add(mSummaryLine1); mConfigurableTexts.add(mSummaryLine2); mConfigurableTexts.add(mEndNowButton, R.string.volume_zen_end_now); diff --git a/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java b/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java index 78fd174313b7..63b6a11c71ef 100644 --- a/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java +++ b/packages/WAPPushManager/tests/src/com/android/smspush/unitTests/ClientTest.java @@ -49,21 +49,21 @@ public class ClientTest extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.main); - Button addpbtn = (Button) findViewById(R.id.addpkg); - Button procbtn = (Button) findViewById(R.id.procmsg); - Button delbtn = (Button) findViewById(R.id.delpkg); + Button addpbtn = findViewById(R.id.addpkg); + Button procbtn = findViewById(R.id.procmsg); + Button delbtn = findViewById(R.id.delpkg); Log.v(LOG_TAG, "activity created!!"); addpbtn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - EditText app_id = (EditText) findViewById(R.id.app_id); - EditText cont = (EditText) findViewById(R.id.cont); - EditText pkg = (EditText) findViewById(R.id.pkg); - EditText cls = (EditText) findViewById(R.id.cls); - RadioButton act = (RadioButton) findViewById(R.id.act); - CheckBox sig = (CheckBox) findViewById(R.id.sig); - CheckBox ftr = (CheckBox) findViewById(R.id.ftr); + EditText app_id = findViewById(R.id.app_id); + EditText cont = findViewById(R.id.cont); + EditText pkg = findViewById(R.id.pkg); + EditText cls = findViewById(R.id.cls); + RadioButton act = findViewById(R.id.act); + CheckBox sig = findViewById(R.id.sig); + CheckBox ftr = findViewById(R.id.ftr); try { if (!mWapPushMan.addPackage( @@ -93,11 +93,11 @@ public class ClientTest extends Activity { delbtn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - EditText app_id = (EditText) findViewById(R.id.app_id); - EditText cont = (EditText) findViewById(R.id.cont); - EditText pkg = (EditText) findViewById(R.id.pkg); - EditText cls = (EditText) findViewById(R.id.cls); - // CheckBox delall = (CheckBox) findViewById(R.id.delall); + EditText app_id = findViewById(R.id.app_id); + EditText cont = findViewById(R.id.cont); + EditText pkg = findViewById(R.id.pkg); + EditText cls = findViewById(R.id.cls); + // CheckBox delall = findViewById(R.id.delall); // Log.d(LOG_TAG, "button clicked"); try { @@ -115,9 +115,9 @@ public class ClientTest extends Activity { procbtn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { - EditText pdu = (EditText) findViewById(R.id.pdu); - EditText app_id = (EditText) findViewById(R.id.app_id); - EditText cont = (EditText) findViewById(R.id.cont); + EditText pdu = findViewById(R.id.pdu); + EditText app_id = findViewById(R.id.app_id); + EditText cont = findViewById(R.id.cont); // WapPushOverSms wap = new WapPushOverSms(); // wap.dispatchWapPdu(strToHex(pdu.getText().toString())); diff --git a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java index a319beb6bbe9..f878b4d11f72 100644 --- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java +++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java @@ -88,7 +88,7 @@ public class WallpaperCropActivity extends Activity { protected void init() { setContentView(R.layout.wallpaper_cropper); - mCropView = (CropView) findViewById(R.id.cropView); + mCropView = findViewById(R.id.cropView); Intent cropIntent = getIntent(); final Uri imageUri = cropIntent.getData(); diff --git a/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java b/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java index b7ed3314ef1c..27d230b5737b 100644 --- a/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java +++ b/samples/training/network-usage/src/com/example/android/networkusage/NetworkActivity.java @@ -158,7 +158,7 @@ public class NetworkActivity extends Activity { setContentView(R.layout.main); // The specified network connection is not available. Displays error message. - WebView myWebView = (WebView) findViewById(R.id.webview); + WebView myWebView = findViewById(R.id.webview); myWebView.loadData(getResources().getString(R.string.connection_error), "text/html", null); } @@ -205,7 +205,7 @@ public class NetworkActivity extends Activity { protected void onPostExecute(String result) { setContentView(R.layout.main); // Displays the HTML string in the UI via a WebView - WebView myWebView = (WebView) findViewById(R.id.webview); + WebView myWebView = findViewById(R.id.webview); myWebView.loadData(result, "text/html", null); } } diff --git a/services/core/java/com/android/server/am/AppErrorDialog.java b/services/core/java/com/android/server/am/AppErrorDialog.java index 646f6ce0653a..02ec07561f4f 100644 --- a/services/core/java/com/android/server/am/AppErrorDialog.java +++ b/services/core/java/com/android/server/am/AppErrorDialog.java @@ -106,7 +106,7 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - final FrameLayout frame = (FrameLayout) findViewById(android.R.id.custom); + final FrameLayout frame = findViewById(android.R.id.custom); final Context context = getContext(); LayoutInflater.from(context).inflate( com.android.internal.R.layout.app_error_dialog, frame, true); @@ -114,19 +114,19 @@ final class AppErrorDialog extends BaseErrorDialog implements View.OnClickListen boolean hasRestart = !mRepeating && mIsRestartable; final boolean hasReceiver = mProc.errorReportReceiver != null; - final TextView restart = (TextView) findViewById(com.android.internal.R.id.aerr_restart); + final TextView restart = findViewById(com.android.internal.R.id.aerr_restart); restart.setOnClickListener(this); restart.setVisibility(hasRestart ? View.VISIBLE : View.GONE); - final TextView report = (TextView) findViewById(com.android.internal.R.id.aerr_report); + final TextView report = findViewById(com.android.internal.R.id.aerr_report); report.setOnClickListener(this); report.setVisibility(hasReceiver ? View.VISIBLE : View.GONE); - final TextView close = (TextView) findViewById(com.android.internal.R.id.aerr_close); + final TextView close = findViewById(com.android.internal.R.id.aerr_close); close.setVisibility(!hasRestart ? View.VISIBLE : View.GONE); close.setOnClickListener(this); boolean showMute = !IS_USER_BUILD && Settings.Global.getInt(context.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) != 0; - final TextView mute = (TextView) findViewById(com.android.internal.R.id.aerr_mute); + final TextView mute = findViewById(com.android.internal.R.id.aerr_mute); mute.setOnClickListener(this); mute.setVisibility(showMute ? View.VISIBLE : View.GONE); diff --git a/services/core/java/com/android/server/am/AppNotRespondingDialog.java b/services/core/java/com/android/server/am/AppNotRespondingDialog.java index 9e297255c2f9..a3a67784fadc 100644 --- a/services/core/java/com/android/server/am/AppNotRespondingDialog.java +++ b/services/core/java/com/android/server/am/AppNotRespondingDialog.java @@ -104,18 +104,18 @@ final class AppNotRespondingDialog extends BaseErrorDialog implements View.OnCli @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - final FrameLayout frame = (FrameLayout) findViewById(android.R.id.custom); + final FrameLayout frame = findViewById(android.R.id.custom); final Context context = getContext(); LayoutInflater.from(context).inflate( com.android.internal.R.layout.app_anr_dialog, frame, true); - final TextView report = (TextView) findViewById(com.android.internal.R.id.aerr_report); + final TextView report = findViewById(com.android.internal.R.id.aerr_report); report.setOnClickListener(this); final boolean hasReceiver = mProc.errorReportReceiver != null; report.setVisibility(hasReceiver ? View.VISIBLE : View.GONE); - final TextView close = (TextView) findViewById(com.android.internal.R.id.aerr_close); + final TextView close = findViewById(com.android.internal.R.id.aerr_close); close.setOnClickListener(this); - final TextView wait = (TextView) findViewById(com.android.internal.R.id.aerr_wait); + final TextView wait = findViewById(com.android.internal.R.id.aerr_wait); wait.setOnClickListener(this); findViewById(com.android.internal.R.id.customPanel).setVisibility(View.VISIBLE); diff --git a/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java b/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java index d14f4eb33dc5..013eab8679a8 100644 --- a/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java +++ b/services/retaildemo/java/com/android/server/retaildemo/UserInactivityCountdownDialog.java @@ -67,7 +67,7 @@ public class UserInactivityCountdownDialog extends AlertDialog { @Override public void show() { super.show(); - final TextView messageView = (TextView) findViewById(R.id.message); + final TextView messageView = findViewById(R.id.message); messageView.post(new Runnable() { @Override public void run() { diff --git a/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java b/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java index 6fe2cfbcd8f4..fc1d47bcd20f 100644 --- a/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java +++ b/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/SinkActivity.java @@ -95,13 +95,13 @@ public class SinkActivity extends Activity { setContentView(R.layout.sink_activity); - mLogTextView = (TextView) findViewById(R.id.logTextView); + mLogTextView = findViewById(R.id.logTextView); mLogTextView.setMovementMethod(ScrollingMovementMethod.getInstance()); mLogger = new TextLogger(); - mFpsTextView = (TextView) findViewById(R.id.fpsTextView); + mFpsTextView = findViewById(R.id.fpsTextView); - mSurfaceView = (SurfaceView) findViewById(R.id.surfaceView); + mSurfaceView = findViewById(R.id.surfaceView); mSurfaceView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { diff --git a/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java b/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java index c59c95856efa..a2161028f9a6 100644 --- a/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java +++ b/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/SourceActivity.java @@ -63,7 +63,7 @@ public class SourceActivity extends Activity { setContentView(R.layout.source_activity); - mLogTextView = (TextView) findViewById(R.id.logTextView); + mLogTextView = findViewById(R.id.logTextView); mLogTextView.setMovementMethod(ScrollingMovementMethod.getInstance()); mLogger = new TextLogger(); mPresenter = new Presenter(); diff --git a/tests/AmSlam/Android.mk b/tests/AmSlam/Android.mk index 8dafac73403d..934bae03a560 100644 --- a/tests/AmSlam/Android.mk +++ b/tests/AmSlam/Android.mk @@ -21,7 +21,7 @@ LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_PACKAGE_NAME := AmSlam -LOCAL_SDK_VERSION := 21 +LOCAL_SDK_VERSION := current LOCAL_MIN_SDK_VERSION := 21 LOCAL_JAVA_LANGUAGE_VERSION := 1.8 diff --git a/tests/AmSlam/src/test/amslam/MainActivity.java b/tests/AmSlam/src/test/amslam/MainActivity.java index cce955e999f8..17fca091ac09 100644 --- a/tests/AmSlam/src/test/amslam/MainActivity.java +++ b/tests/AmSlam/src/test/amslam/MainActivity.java @@ -60,7 +60,7 @@ public class MainActivity extends Activity implements PongReceiver.PingPongRespo super.onCreate(savedInstanceState); sAppContext = getApplicationContext(); setContentView(R.layout.activity_main); - mOutput = (TextView) findViewById(R.id.output); + mOutput = findViewById(R.id.output); PongReceiver.addListener(this); findViewById(R.id.run).setOnClickListener(view -> { diff --git a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java index b88a885efa43..f85e82deb0d6 100644 --- a/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java +++ b/tests/BiDiTests/src/com/android/bidi/BiDiTestActivity.java @@ -75,7 +75,7 @@ public class BiDiTestActivity extends Activity { setContentView(R.layout.main); - mList = (ListView) findViewById(R.id.testlist); + mList = findViewById(R.id.testlist); mList.setChoiceMode(ListView.CHOICE_MODE_SINGLE); mList.setFocusableInTouchMode(true); diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java index 1ed47230c6fc..8ccd4e2181ed 100644 --- a/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java +++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/AutomaticActivity.java @@ -111,8 +111,8 @@ public class AutomaticActivity extends CompareActivity { super.onCreate(savedInstanceState); setContentView(R.layout.automatic_layout); - mSoftwareImageView = (ImageView) findViewById(R.id.software_image_view); - mHardwareImageView = (ImageView) findViewById(R.id.hardware_image_view); + mSoftwareImageView = findViewById(R.id.software_image_view); + mHardwareImageView = findViewById(R.id.hardware_image_view); onCreateCommon(mRunnable); beginTest(); diff --git a/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java b/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java index 8d8d9de1a249..0dec1de79a46 100644 --- a/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java +++ b/tests/CanvasCompare/src/com/android/test/hwuicompare/CompareActivity.java @@ -57,7 +57,7 @@ abstract public class CompareActivity extends Activity { getWindow().setBackgroundDrawable(new ColorDrawable(0xffefefef)); ResourceModifiers.init(getResources()); - mHardwareView = (MainView) findViewById(R.id.hardware_view); + mHardwareView = findViewById(R.id.hardware_view); mHardwareView.setLayerType(View.LAYER_TYPE_HARDWARE, null); mHardwareView.setBackgroundColor(Color.WHITE); mHardwareView.addDrawCallback(mDrawCallback); diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java index 78e360bdb831..723c46089d51 100644 --- a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java +++ b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java @@ -162,19 +162,19 @@ public class FrameworkPerfActivity extends Activity // in res/layout/hello_activity.xml setContentView(R.layout.main); - mFgSpinner = (Spinner) findViewById(R.id.fgspinner); + mFgSpinner = findViewById(R.id.fgspinner); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mAvailOpLabels); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mFgSpinner.setAdapter(adapter); mFgSpinner.setOnItemSelectedListener(this); - mBgSpinner = (Spinner) findViewById(R.id.bgspinner); + mBgSpinner = findViewById(R.id.bgspinner); adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mAvailOpLabels); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); mBgSpinner.setAdapter(adapter); mBgSpinner.setOnItemSelectedListener(this); - mLimitSpinner = (Spinner) findViewById(R.id.limitspinner); + mLimitSpinner = findViewById(R.id.limitspinner); adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, mLimitLabels); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); diff --git a/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java b/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java index 84e31aa8417e..83c27fb750e5 100644 --- a/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java +++ b/tests/HugeBackup/src/com/android/hugebackup/HugeBackupActivity.java @@ -71,9 +71,9 @@ public class HugeBackupActivity extends Activity { setContentView(R.layout.backup_restore); /** Once the UI has been inflated, cache the controls for later */ - mFillingGroup = (RadioGroup) findViewById(R.id.filling_group); - mAddMayoCheckbox = (CheckBox) findViewById(R.id.mayo); - mAddTomatoCheckbox = (CheckBox) findViewById(R.id.tomato); + mFillingGroup = findViewById(R.id.filling_group); + mAddMayoCheckbox = findViewById(R.id.mayo); + mAddTomatoCheckbox = findViewById(R.id.tomato); /** Set up our file bookkeeping */ mDataFile = new File(getFilesDir(), HugeBackupActivity.DATA_FILE_NAME); diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java b/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java index eb4e3fd00eee..492d158ec5ef 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/DatePicker.java @@ -101,7 +101,7 @@ public class DatePicker extends FrameLayout { Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.date_picker, this, true); - mDayPicker = (NumberPicker) findViewById(R.id.day); + mDayPicker = findViewById(R.id.day); mDayPicker.setFormatter(NumberPicker.getTwoDigitFormatter()); mDayPicker.setOnLongPressUpdateInterval(100); mDayPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() { @@ -110,7 +110,7 @@ public class DatePicker extends FrameLayout { notifyDateChanged(); } }); - mMonthPicker = (NumberPicker) findViewById(R.id.month); + mMonthPicker = findViewById(R.id.month); mMonthPicker.setFormatter(NumberPicker.getTwoDigitFormatter()); DateFormatSymbols dfs = new DateFormatSymbols(); String[] months = dfs.getShortMonths(); @@ -146,7 +146,7 @@ public class DatePicker extends FrameLayout { updateDaySpinner(); } }); - mYearPicker = (NumberPicker) findViewById(R.id.year); + mYearPicker = findViewById(R.id.year); mYearPicker.setOnLongPressUpdateInterval(100); mYearPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() { public void onValueChange(NumberPicker picker, int oldVal, int newVal) { @@ -158,7 +158,7 @@ public class DatePicker extends FrameLayout { } }); - mYearToggle = (CheckBox) findViewById(R.id.yearToggle); + mYearToggle = findViewById(R.id.yearToggle); mYearToggle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { @@ -229,7 +229,7 @@ public class DatePicker extends FrameLayout { /* Remove the 3 pickers from their parent and then add them back in the * required order. */ - LinearLayout parent = (LinearLayout) findViewById(R.id.parent); + LinearLayout parent = findViewById(R.id.parent); parent.removeAllViews(); boolean quoted = false; diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java index 0defe924e6b3..134c2e045449 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ListActivity.java @@ -82,7 +82,7 @@ public class ListActivity extends Activity { ListAdapter adapter = new SimpleListAdapter(this); - final ListView list = (ListView) findViewById(R.id.list); + final ListView list = findViewById(R.id.list); list.setAdapter(adapter); registerForContextMenu(list); diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java index 5655adf878fe..262b0e93671b 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/StackActivity.java @@ -35,7 +35,7 @@ public class StackActivity extends Activity { setContentView(R.layout.stack); - StackView stack = (StackView) findViewById(R.id.stack_view); + StackView stack = findViewById(R.id.stack_view); stack.setAdapter(new ArrayAdapter<Drawable>(this, android.R.layout.simple_list_item_1, android.R.id.text1, new Drawable[] { getResources().getDrawable(R.drawable.sunset1), diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java index 684d17944549..b5a5e025e757 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TransformsAndAnimationsActivity.java @@ -55,23 +55,23 @@ public class TransformsAndAnimationsActivity extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.transforms_and_animations); - button1 = (Button) findViewById(R.id.button1); - button2 = (Button) findViewById(R.id.button2); - button3 = (Button) findViewById(R.id.button3); - button1a = (Button) findViewById(R.id.button1a); - button2a = (Button) findViewById(R.id.button2a); - button3a = (Button) findViewById(R.id.button3a); - button1b = (Button) findViewById(R.id.button1b); - button2b = (Button) findViewById(R.id.button2b); - button3b = (Button) findViewById(R.id.button3b); - button4 = (Button) findViewById(R.id.button4); - button5 = (Button) findViewById(R.id.button5); - button6 = (Button) findViewById(R.id.button6); - button7 = (Button) findViewById(R.id.button7); - button8 = (Button) findViewById(R.id.button8); - layersNoneCB = (CheckBox) findViewById(R.id.layersNoneCB); - layersHardwareCB = (CheckBox) findViewById(R.id.layersHwCB); - layersSoftwareCB = (CheckBox) findViewById(R.id.layersSwCB); + button1 = findViewById(R.id.button1); + button2 = findViewById(R.id.button2); + button3 = findViewById(R.id.button3); + button1a = findViewById(R.id.button1a); + button2a = findViewById(R.id.button2a); + button3a = findViewById(R.id.button3a); + button1b = findViewById(R.id.button1b); + button2b = findViewById(R.id.button2b); + button3b = findViewById(R.id.button3b); + button4 = findViewById(R.id.button4); + button5 = findViewById(R.id.button5); + button6 = findViewById(R.id.button6); + button7 = findViewById(R.id.button7); + button8 = findViewById(R.id.button8); + layersNoneCB = findViewById(R.id.layersNoneCB); + layersHardwareCB = findViewById(R.id.layersHwCB); + layersSoftwareCB = findViewById(R.id.layersSwCB); layersNoneCB.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener() { @Override diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java index ffb86893be73..deb8585a95f5 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/TransparentListActivity.java @@ -84,7 +84,7 @@ public class TransparentListActivity extends Activity { ListAdapter adapter = new SimpleListAdapter(this); - ListView list = (ListView) findViewById(R.id.list); + ListView list = findViewById(R.id.list); list.setAdapter(adapter); list.setCacheColorHint(0); list.setVerticalFadingEdgeEnabled(true); diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java index 6d47d6c467e7..a261fb729a65 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayerInvalidationActivity.java @@ -49,13 +49,13 @@ public class ViewLayerInvalidationActivity extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.view_layer_invalidation); - container = (LinearLayout) findViewById(R.id.container); - final LinearLayout container1 = (LinearLayout) findViewById(R.id.container1); - final LinearLayout container2 = (LinearLayout) findViewById(R.id.container2); - final LinearLayout container3 = (LinearLayout) findViewById(R.id.container3); - nestedStatusTV = (TextView) findViewById(R.id.nestedStatus); - invalidateStatusTV = (TextView) findViewById(R.id.invalidateStatus); - final TextView tva = (TextView) findViewById(R.id.textviewa); + container = findViewById(R.id.container); + final LinearLayout container1 = findViewById(R.id.container1); + final LinearLayout container2 = findViewById(R.id.container2); + final LinearLayout container3 = findViewById(R.id.container3); + nestedStatusTV = findViewById(R.id.nestedStatus); + invalidateStatusTV = findViewById(R.id.invalidateStatus); + final TextView tva = findViewById(R.id.textviewa); topLayouts.add(container1); topLayouts.add(container2); diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java index 7168478c083c..07dc0a1b5df0 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity.java @@ -94,7 +94,7 @@ public class ViewLayersActivity extends Activity { } private void setupList(int listId) { - final ListView list = (ListView) findViewById(listId); + final ListView list = findViewById(listId); list.setAdapter(new SimpleListAdapter(this)); } diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java index e65dd6331408..96cf43e48778 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity3.java @@ -39,7 +39,7 @@ public class ViewLayersActivity3 extends Activity { } private void setupList(int listId) { - final ListView list = (ListView) findViewById(listId); + final ListView list = findViewById(listId); list.setAdapter(new SimpleListAdapter(this)); list.setLayerType(View.LAYER_TYPE_HARDWARE, null); ((View) list.getParent()).setLayerType(View.LAYER_TYPE_HARDWARE, null); diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java index 17f78af50edb..1f3f874744db 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity4.java @@ -47,7 +47,7 @@ public class ViewLayersActivity4 extends Activity { } private void setupList(int listId) { - final ListView list = (ListView) findViewById(listId); + final ListView list = findViewById(listId); list.setAdapter(new SimpleListAdapter(this)); list.setLayerType(View.LAYER_TYPE_HARDWARE, null); } diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java index 2dd7b6a99ce1..715da201458b 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewLayersActivity5.java @@ -113,7 +113,7 @@ public class ViewLayersActivity5 extends Activity { } private void setupList(int listId) { - final ListView list = (ListView) findViewById(listId); + final ListView list = findViewById(listId); list.setAdapter(new SimpleListAdapter(this)); } diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java index 738801d8b285..9ae38119cac6 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ViewPropertyAlphaActivity.java @@ -60,12 +60,12 @@ public class ViewPropertyAlphaActivity extends Activity { startAnim(R.id.imageview); startAnim(myViewAlphaDefault); startAnim(myViewAlphaHandled); - EditText selectedText = (EditText) findViewById(R.id.selectedtext); + EditText selectedText = findViewById(R.id.selectedtext); selectedText.setSelection(3, 8); } }, 2000); - Button invalidator = (Button) findViewById(R.id.invalidateButton); + Button invalidator = findViewById(R.id.invalidateButton); invalidator.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -74,7 +74,7 @@ public class ViewPropertyAlphaActivity extends Activity { } }); - TextView textView = (TextView) findViewById(R.id.spantext); + TextView textView = findViewById(R.id.spantext); if (textView != null) { SpannableStringBuilder text = new SpannableStringBuilder("Now this is a short text message with spans"); @@ -93,7 +93,7 @@ public class ViewPropertyAlphaActivity extends Activity { textView.setText(text); } - LinearLayout container = (LinearLayout) findViewById(R.id.container); + LinearLayout container = findViewById(R.id.container); myViewAlphaDefault = new MyView(this, false); myViewAlphaDefault.setLayoutParams(new LinearLayout.LayoutParams(75, 75)); container.addView(myViewAlphaDefault); diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java index 45e77edb03da..08979bce8f73 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/ZOrderingActivity.java @@ -12,7 +12,7 @@ public class ZOrderingActivity extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.z_ordering); - ViewGroup grandParent = (ViewGroup) findViewById(R.id.parent); + ViewGroup grandParent = findViewById(R.id.parent); if (grandParent == null) throw new IllegalStateException(); View.OnClickListener l = new View.OnClickListener() { @Override diff --git a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java index 292bbd22d0fc..6115fd5a0fd0 100644 --- a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java +++ b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java @@ -50,7 +50,7 @@ public class AutoCompleteTextViewActivityLandscape extends Activity ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES); - AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit); + AutoCompleteTextView textView = findViewById(R.id.edit); textView.setAdapter(adapter); } diff --git a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java index 570cb6bf8a06..253c50fe5810 100644 --- a/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java +++ b/tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java @@ -45,7 +45,7 @@ public class AutoCompleteTextViewActivityPortrait extends Activity ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line, COUNTRIES); - AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.edit); + AutoCompleteTextView textView = findViewById(R.id.edit); textView.setAdapter(adapter); } diff --git a/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java b/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java index 5aa0d4f35a21..51cdbb585659 100644 --- a/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java +++ b/tests/JobSchedulerTestApp/src/com/android/demo/jobSchedulerApp/MainActivity.java @@ -56,16 +56,16 @@ public class MainActivity extends Activity { stopJobColor = getColor(R.color.stop_received); // Set up UI. - mShowStartView = (TextView) findViewById(R.id.onstart_textview); - mShowStopView = (TextView) findViewById(R.id.onstop_textview); - mParamsTextView = (TextView) findViewById(R.id.task_params); - mDelayEditText = (EditText) findViewById(R.id.delay_time); - mDeadlineEditText = (EditText) findViewById(R.id.deadline_time); - mWiFiConnectivityRadioButton = (RadioButton) findViewById(R.id.checkbox_unmetered); - mAnyConnectivityRadioButton = (RadioButton) findViewById(R.id.checkbox_any); - mRequiresChargingCheckBox = (CheckBox) findViewById(R.id.checkbox_charging); - mRequiresIdleCheckbox = (CheckBox) findViewById(R.id.checkbox_idle); - mIsPersistedCheckbox = (CheckBox) findViewById(R.id.checkbox_persisted); + mShowStartView = findViewById(R.id.onstart_textview); + mShowStopView = findViewById(R.id.onstop_textview); + mParamsTextView = findViewById(R.id.task_params); + mDelayEditText = findViewById(R.id.delay_time); + mDeadlineEditText = findViewById(R.id.deadline_time); + mWiFiConnectivityRadioButton = findViewById(R.id.checkbox_unmetered); + mAnyConnectivityRadioButton = findViewById(R.id.checkbox_any); + mRequiresChargingCheckBox = findViewById(R.id.checkbox_charging); + mRequiresIdleCheckbox = findViewById(R.id.checkbox_idle); + mIsPersistedCheckbox = findViewById(R.id.checkbox_persisted); mServiceComponent = new ComponentName(this, TestJobService.class); // Start service and provide it a way to communicate with us. diff --git a/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java b/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java index e3a9cf40b066..612c53e3e93c 100644 --- a/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java +++ b/tests/LargeAssetTest/src/com/android/largeassettest/LargeAssetTest.java @@ -43,8 +43,8 @@ public class LargeAssetTest extends Activity { super.onCreate(icicle); setContentView(R.layout.lat); - mResultText = (TextView) findViewById(R.id.result); - mValidateButton = (Button) findViewById(R.id.validate); + mResultText = findViewById(R.id.result); + mValidateButton = findViewById(R.id.validate); mValidateButton.setOnClickListener(mClickListener); } diff --git a/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java b/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java index 9f297aa13e90..c0091ad7b03f 100644 --- a/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java +++ b/tests/LowStorageTest/src/com/android/lowstoragetest/LowStorageTest.java @@ -52,9 +52,9 @@ public class LowStorageTest extends Activity { StatFs stat = new StatFs(path.getPath()); int totalBlocks = stat.getBlockCount(); mBlockSize = (int) (stat.getBlockSize()); - TextView startSizeTextView = (TextView) findViewById(R.id.totalsize); + TextView startSizeTextView = findViewById(R.id.totalsize); startSizeTextView.setText(Long.toString((totalBlocks * mBlockSize) / BYTE_SIZE)); - Button button = (Button) findViewById(R.id.button_run); + Button button = findViewById(R.id.button_run); button.setOnClickListener(mStartListener); } @@ -121,9 +121,9 @@ public class LowStorageTest extends Activity { File path = Environment.getDataDirectory(); StatFs stat = new StatFs(path.getPath()); long availableBlocks = stat.getAvailableBlocks(); - TextView freeSizeTextView = (TextView) findViewById(R.id.freesize); + TextView freeSizeTextView = findViewById(R.id.freesize); freeSizeTextView.setText(Long.toString((availableBlocks * mBlockSize) / BYTE_SIZE)); - TextView statusTextView = (TextView) findViewById(R.id.status); + TextView statusTextView = findViewById(R.id.status); statusTextView.setText("Finished. You can start the test now."); } catch (Exception e) { Log.v(TAG, e.toString()); diff --git a/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java b/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java index 2ff3e2026cc0..85cc8fb046f2 100644 --- a/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java +++ b/tests/OneMedia/src/com/android/onemedia/OnePlayerActivity.java @@ -68,16 +68,16 @@ public class OnePlayerActivity extends Activity { mPlayer = new PlayerController(this, OnePlayerService.getServiceIntent(this)); - mStartButton = (Button) findViewById(R.id.start_button); - mPlayButton = (Button) findViewById(R.id.play_button); - mRouteButton = (Button) findViewById(R.id.route_button); - mStatusView = (TextView) findViewById(R.id.status); - mContentText = (EditText) findViewById(R.id.content); - mNextContentText = (EditText) findViewById(R.id.next_content); - mHasVideo = (CheckBox) findViewById(R.id.has_video); - mArtView = (ImageView) findViewById(R.id.art); - - final Button artPicker = (Button) findViewById(R.id.art_picker); + mStartButton = findViewById(R.id.start_button); + mPlayButton = findViewById(R.id.play_button); + mRouteButton = findViewById(R.id.route_button); + mStatusView = findViewById(R.id.status); + mContentText = findViewById(R.id.content); + mNextContentText = findViewById(R.id.next_content); + mHasVideo = findViewById(R.id.has_video); + mArtView = findViewById(R.id.art); + + final Button artPicker = findViewById(R.id.art_picker); artPicker.setOnClickListener(mButtonListener); mStartButton.setOnClickListener(mButtonListener); diff --git a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java index ee4c8343d9e9..241206d8919b 100644 --- a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java +++ b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java @@ -43,7 +43,7 @@ public class MainActivity extends Activity implements OnItemClickListener { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); - ListView lv = (ListView) findViewById(android.R.id.list); + ListView lv = findViewById(android.R.id.list); lv.setDrawSelectorOnTop(true); lv.setAdapter(new SimpleAdapter(this, SAMPLES, R.layout.item_layout, new String[] { KEY_NAME }, @@ -55,7 +55,7 @@ public class MainActivity extends Activity implements OnItemClickListener { @Override protected void onResume() { super.onResume(); - ListView lv = (ListView) findViewById(android.R.id.list); + ListView lv = findViewById(android.R.id.list); for (int i = 0; i < lv.getChildCount(); i++) { lv.getChildAt(i).animate().translationY(0).setDuration(DURATION); } diff --git a/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java b/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java index 892cbae50560..22fc6911f7df 100644 --- a/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java +++ b/tests/RenderThreadTest/src/com/example/renderthread/SubActivity.java @@ -39,7 +39,7 @@ public class SubActivity extends Activity { @Override protected void onResume() { super.onResume(); - ViewGroup container = (ViewGroup) findViewById(R.id.my_container); + ViewGroup container = findViewById(R.id.my_container); int dx = getWindowManager().getDefaultDisplay().getWidth(); for (int i = 0; i < container.getChildCount(); i++) { View child = container.getChildAt(i); diff --git a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java index 4841bc59c794..c3c4cf556986 100644 --- a/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java +++ b/tests/SoundTriggerTestApp/src/com/android/test/soundtrigger/SoundTriggerTestActivity.java @@ -81,14 +81,14 @@ public class SoundTriggerTestActivity extends Activity implements SoundTriggerTe super.onCreate(savedInstanceState); setContentView(R.layout.main); - mDebugView = (TextView) findViewById(R.id.console); - mScrollView = (ScrollView) findViewById(R.id.scroller_id); - mRadioGroup = (RadioGroup) findViewById(R.id.model_group_id); - mPlayTriggerButton = (Button) findViewById(R.id.play_trigger_id); + mDebugView = findViewById(R.id.console); + mScrollView = findViewById(R.id.scroller_id); + mRadioGroup = findViewById(R.id.model_group_id); + mPlayTriggerButton = findViewById(R.id.play_trigger_id); mDebugView.setText(mDebugView.getText(), TextView.BufferType.EDITABLE); mDebugView.setMovementMethod(new ScrollingMovementMethod()); - mCaptureAudioCheckBox = (CheckBox) findViewById(R.id.caputre_check_box); - mPlayCapturedAudioButton = (Button) findViewById(R.id.play_captured_id); + mCaptureAudioCheckBox = findViewById(R.id.caputre_check_box); + mPlayCapturedAudioButton = findViewById(R.id.play_captured_id); mHandler = new Handler(); mButtonModelUuidMap = new HashMap(); mModelButtons = new HashMap(); diff --git a/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java b/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java index 7c139742f54d..7632a6e3dfd6 100644 --- a/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java +++ b/tests/TouchLatency/app/src/main/java/com/prefabulated/touchlatency/TouchLatencyActivity.java @@ -180,7 +180,7 @@ public class TouchLatencyActivity extends ActionBarActivity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_touch_latency); - mTouchView = (TouchLatencyView) findViewById(R.id.canvasView); + mTouchView = findViewById(R.id.canvasView); } diff --git a/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java b/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java index 54c44e22d1b6..9985357d4577 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java +++ b/tests/TransitionTests/src/com/android/transitiontests/ClippingText.java @@ -42,7 +42,7 @@ public class ClippingText extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.clipping_text_1); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.clipping_text_1, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java b/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java index f687da37eedf..86ecf8e5f9f2 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java +++ b/tests/TransitionTests/src/com/android/transitiontests/ContactsExpansion.java @@ -49,7 +49,7 @@ public class ContactsExpansion extends Activity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.contacts_list); - ViewGroup contactsContainer = (ViewGroup) findViewById(R.id.contactsContainer); + ViewGroup contactsContainer = findViewById(R.id.contactsContainer); int contactsIndex = 0; addContact(contactsContainer, contactsIndex, R.drawable.self_portrait_square_100); diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java b/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java index 5bb0e77c08c9..0d41d647fe22 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java +++ b/tests/TransitionTests/src/com/android/transitiontests/CrossFadeDemo.java @@ -38,7 +38,7 @@ public class CrossFadeDemo extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.crossfade); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.crossfade, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java index 1f278b9a6485..1fb732e19eb9 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java +++ b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeImage.java @@ -41,10 +41,10 @@ public class CrossfadeImage extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.crossfade_image); - ViewGroup container = (ViewGroup) findViewById(R.id.container); + ViewGroup container = findViewById(R.id.container); mSceneRoot = container; - mImageView = (ImageView) findViewById(R.id.contact_picture); + mImageView = findViewById(R.id.contact_picture); mImageView.setScaleType(ImageView.ScaleType.FIT_CENTER); Crossfade mCrossfade = new Crossfade(); diff --git a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java index 469ee8b28a9f..15d15351957e 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java +++ b/tests/TransitionTests/src/com/android/transitiontests/CrossfadeMultiple.java @@ -49,12 +49,12 @@ public class CrossfadeMultiple extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.crossfade_multiple); - ViewGroup container = (ViewGroup) findViewById(R.id.container); + ViewGroup container = findViewById(R.id.container); mSceneRoot = container; - mButton = (Button) findViewById(R.id.button); - mImageView = (ImageView) findViewById(R.id.imageview); - mTextView = (TextView) findViewById(R.id.textview); + mButton = findViewById(R.id.button); + mImageView = findViewById(R.id.imageview); + mTextView = findViewById(R.id.textview); mCrossfade = new Crossfade(); mCrossfade.addTarget(R.id.button).addTarget(R.id.textview).addTarget(R.id.imageview); diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo0.java b/tests/TransitionTests/src/com/android/transitiontests/Demo0.java index d52ab1dc55ba..e1729045a42e 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/Demo0.java +++ b/tests/TransitionTests/src/com/android/transitiontests/Demo0.java @@ -35,7 +35,7 @@ public class Demo0 extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mCurrentScene = SEARCH_SCREEN; diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo1.java b/tests/TransitionTests/src/com/android/transitiontests/Demo1.java index 5b5eb156bba0..e92dd039c428 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/Demo1.java +++ b/tests/TransitionTests/src/com/android/transitiontests/Demo1.java @@ -40,7 +40,7 @@ public class Demo1 extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); // mResultsScreen = new MyScene(mSceneRoot, R.layout.results_screen); diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo2.java b/tests/TransitionTests/src/com/android/transitiontests/Demo2.java index 0f3257bbadad..c26723bc89e2 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/Demo2.java +++ b/tests/TransitionTests/src/com/android/transitiontests/Demo2.java @@ -38,7 +38,7 @@ public class Demo2 extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); } diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo3.java b/tests/TransitionTests/src/com/android/transitiontests/Demo3.java index 0ffa1f534834..094ab97ddacb 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/Demo3.java +++ b/tests/TransitionTests/src/com/android/transitiontests/Demo3.java @@ -38,7 +38,7 @@ public class Demo3 extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo4.java b/tests/TransitionTests/src/com/android/transitiontests/Demo4.java index 3aadbb0ae670..af67f26b3707 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/Demo4.java +++ b/tests/TransitionTests/src/com/android/transitiontests/Demo4.java @@ -38,7 +38,7 @@ public class Demo4 extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/Demo5.java b/tests/TransitionTests/src/com/android/transitiontests/Demo5.java index c36abda081b3..f01a29d60293 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/Demo5.java +++ b/tests/TransitionTests/src/com/android/transitiontests/Demo5.java @@ -33,7 +33,7 @@ public class Demo5 extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java b/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java index d497abe8d3d9..40bf975eb5a8 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java +++ b/tests/TransitionTests/src/com/android/transitiontests/FadingHierarchy.java @@ -34,11 +34,11 @@ public class FadingHierarchy extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.fading_hierarchy); - mContainer = (ViewGroup) findViewById(R.id.container); - mRemovingContainer = (ViewGroup) findViewById(R.id.removingContainer); + mContainer = findViewById(R.id.container); + mRemovingContainer = findViewById(R.id.removingContainer); mInnerContainerParent = (ViewGroup) mRemovingContainer.getParent(); - mRemovingButton = (Button) findViewById(R.id.removingButton); + mRemovingButton = findViewById(R.id.removingButton); } public void sendMessage(View view) { diff --git a/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java b/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java index 29fb868794f4..83073666d6a0 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java +++ b/tests/TransitionTests/src/com/android/transitiontests/FadingTest.java @@ -43,13 +43,13 @@ public class FadingTest extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.fading_test); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); - mRemovingButton = (Button) findViewById(R.id.removingButton); - mInvisibleButton = (Button) findViewById(R.id.invisibleButton); - mGoneButton = (Button) findViewById(R.id.goneButton); + mRemovingButton = findViewById(R.id.removingButton); + mInvisibleButton = findViewById(R.id.invisibleButton); + mGoneButton = findViewById(R.id.goneButton); mGoneButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java b/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java index a06ba8fb61d1..025e4e313738 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java +++ b/tests/TransitionTests/src/com/android/transitiontests/InstanceTargets.java @@ -37,7 +37,7 @@ public class InstanceTargets extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.instance_targets); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container; } diff --git a/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java b/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java index c26e93f95ed3..6186150d772a 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java +++ b/tests/TransitionTests/src/com/android/transitiontests/InterruptionTest.java @@ -40,17 +40,17 @@ public class InterruptionTest extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.interruption); - ViewGroup sceneRoot = (ViewGroup) findViewById(R.id.sceneRoot); + ViewGroup sceneRoot = findViewById(R.id.sceneRoot); mScene1 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_1, this); mScene2 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_2, this); mScene3 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_3, this); mScene4 = Scene.getSceneForLayout(sceneRoot, R.layout.interruption_inner_4, this); - mScene1RB = (RadioButton) findViewById(R.id.scene1RB); - mScene2RB = (RadioButton) findViewById(R.id.scene2RB); - mScene3RB = (RadioButton) findViewById(R.id.scene3RB); - mScene4RB = (RadioButton) findViewById(R.id.scene4RB); + mScene1RB = findViewById(R.id.scene1RB); + mScene2RB = findViewById(R.id.scene2RB); + mScene3RB = findViewById(R.id.scene3RB); + mScene4RB = findViewById(R.id.scene4RB); ChangeBounds changeBounds1 = new ChangeBounds(); changeBounds1.addTarget(R.id.button); diff --git a/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java b/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java index 251bf24e8a39..45b8286f6d0b 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java +++ b/tests/TransitionTests/src/com/android/transitiontests/ListViewAddRemove.java @@ -47,9 +47,9 @@ public class ListViewAddRemove extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.list_view_add_remove); - final LinearLayout container = (LinearLayout) findViewById(R.id.container); + final LinearLayout container = findViewById(R.id.container); - final ListView listview = (ListView) findViewById(R.id.listview); + final ListView listview = findViewById(R.id.listview); for (int i = 0; i < 200; ++i) { numList.add(Integer.toString(i)); } diff --git a/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java b/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java index 92bbb85edb52..96b018b9f8e0 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java +++ b/tests/TransitionTests/src/com/android/transitiontests/LoginActivity.java @@ -40,7 +40,7 @@ public class LoginActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mLoginScene = Scene.getSceneForLayout(mSceneRoot, R.layout.activity_login, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java b/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java index ef8cd3709413..384762b206be 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java +++ b/tests/TransitionTests/src/com/android/transitiontests/OverlayTest.java @@ -32,12 +32,12 @@ public class OverlayTest extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.overlay_test); - mContainer = (ViewGroup) findViewById(R.id.container); + mContainer = findViewById(R.id.container); mRoot = (ViewGroup) mContainer.getParent(); } public void onClick(View view) { - final Button fadingButton = (Button) findViewById(R.id.fadingButton); + final Button fadingButton = findViewById(R.id.fadingButton); if (fadingButton != null) { mContainer.removeView(fadingButton); mRoot.getOverlay().add(fadingButton); diff --git a/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java b/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java index 1ee862177e23..772ddc793334 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java +++ b/tests/TransitionTests/src/com/android/transitiontests/Reparenting.java @@ -34,9 +34,9 @@ public class Reparenting extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.reparenting); - ViewGroup container = (ViewGroup) findViewById(R.id.container); - mContainer1 = (ViewGroup) findViewById(R.id.container1); - mContainer2 = (ViewGroup) findViewById(R.id.container2); + ViewGroup container = findViewById(R.id.container); + mContainer1 = findViewById(R.id.container1); + mContainer2 = findViewById(R.id.container2); System.out.println("container 1 and 2 " + mContainer1 + ", " + mContainer2); setupButtons(0, mContainer1); diff --git a/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java b/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java index 1aee258343c4..96d3ae1fb354 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java +++ b/tests/TransitionTests/src/com/android/transitiontests/ResourceLoadingTest.java @@ -39,7 +39,7 @@ public class ResourceLoadingTest extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mCurrentScene = SEARCH_SCREEN; diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java index 7504058d315b..7ee4b3e7aa25 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java +++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTargets.java @@ -39,7 +39,7 @@ public class ScenesTestAutoTargets extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java index 23b28ec0fb2b..9333ea1c093b 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java +++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestAutoTransition.java @@ -37,7 +37,7 @@ public class ScenesTestAutoTransition extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java index ecf5ef349c25..a01f6382b154 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java +++ b/tests/TransitionTests/src/com/android/transitiontests/ScenesTestv21.java @@ -39,7 +39,7 @@ public class ScenesTestv21 extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.search_screen); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); mSearchScreen = Scene.getSceneForLayout(mSceneRoot, R.layout.search_screen, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java b/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java index c550e92f62d6..5f4560cceb06 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java +++ b/tests/TransitionTests/src/com/android/transitiontests/SequenceTest.java @@ -41,12 +41,12 @@ public class SequenceTest extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.fading_test); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); - mRemovingButton = (Button) findViewById(R.id.removingButton); - mInvisibleButton = (Button) findViewById(R.id.invisibleButton); - mGoneButton = (Button) findViewById(R.id.goneButton); + mRemovingButton = findViewById(R.id.removingButton); + mInvisibleButton = findViewById(R.id.invisibleButton); + mGoneButton = findViewById(R.id.goneButton); mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test, this); mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_scene_2, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java b/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java index 92b169ec9e1f..f478cb8630f5 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java +++ b/tests/TransitionTests/src/com/android/transitiontests/SequenceTestSimple.java @@ -42,10 +42,10 @@ public class SequenceTestSimple extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.fading_test_simple); - View container = (View) findViewById(R.id.container); + View container = findViewById(R.id.container); mSceneRoot = (ViewGroup) container.getParent(); - mRemovingButton = (Button) findViewById(R.id.removingButton); + mRemovingButton = findViewById(R.id.removingButton); mScene1 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple, this); mScene2 = Scene.getSceneForLayout(mSceneRoot, R.layout.fading_test_simple2, this); diff --git a/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java b/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java index 9b246adb08cb..8819c40bb27a 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java +++ b/tests/TransitionTests/src/com/android/transitiontests/SurfaceAndTextureViews.java @@ -48,8 +48,8 @@ public class SurfaceAndTextureViews extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.surface_texture_views); - final ViewGroup container = (ViewGroup) findViewById(R.id.container); - Button toggleButton = (Button) findViewById(R.id.toggleButton); + final ViewGroup container = findViewById(R.id.container); + Button toggleButton = findViewById(R.id.toggleButton); mView = new SimpleView(this); mView.setId(0); diff --git a/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java b/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java index c8249561ef2b..b2b24bc22600 100644 --- a/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java +++ b/tests/TransitionTests/src/com/android/transitiontests/UniqueIds.java @@ -40,7 +40,7 @@ public class UniqueIds extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.unique_id_test); - LinearLayout container = (LinearLayout) findViewById(R.id.container); + LinearLayout container = findViewById(R.id.container); LayoutInflater inflater = getLayoutInflater(); Button button = (Button) inflater.inflate(R.layout.button_template, null); container.addView(button); diff --git a/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java b/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java index 0a069c269697..c212c4cbf61a 100644 --- a/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java +++ b/tests/UiBench/src/com/android/test/uibench/ActivityTransition.java @@ -94,7 +94,7 @@ public class ActivityTransition extends AppCompatActivity { setupHero(); // Ensure that all images are visible regardless of orientation. - GridLayout gridLayout = (GridLayout) findViewById(R.id.transition_grid_layout); + GridLayout gridLayout = findViewById(R.id.transition_grid_layout); boolean isPortrait = getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT; gridLayout.setRowCount(isPortrait ? 4 : 2); @@ -105,7 +105,7 @@ public class ActivityTransition extends AppCompatActivity { String name = getIntent().getStringExtra(KEY_ID); mHero = null; if (name != null) { - mHero = (ImageView) findViewById(getIdForKey(name)); + mHero = findViewById(getIdForKey(name)); setEnterSharedElementCallback(new SharedElementCallback() { @Override public void onMapSharedElements(List<String> names, diff --git a/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java b/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java index a654c6107134..a4d57e173bfa 100644 --- a/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java +++ b/tests/UiBench/src/com/android/test/uibench/ActivityTransitionDetails.java @@ -39,7 +39,7 @@ public class ActivityTransitionDetails extends AppCompatActivity { super.onCreate(savedInstanceState); getWindow().setBackgroundDrawable(new ColorDrawable(Color.DKGRAY)); setContentView(R.layout.activity_transition_details); - ImageView titleImage = (ImageView) findViewById(R.id.titleImage); + ImageView titleImage = findViewById(R.id.titleImage); titleImage.setImageDrawable(getHeroDrawable()); } diff --git a/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java b/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java index e2bf8976a315..235e0e61b353 100644 --- a/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java +++ b/tests/UiBench/src/com/android/test/uibench/BitmapUploadActivity.java @@ -80,7 +80,7 @@ public class BitmapUploadActivity extends AppCompatActivity { setContentView(R.layout.activity_bitmap_upload); // animate color to force bitmap uploads - UploadView uploadView = (UploadView) findViewById(R.id.upload_view); + UploadView uploadView = findViewById(R.id.upload_view); ObjectAnimator colorValueAnimator = ObjectAnimator.ofInt(uploadView, "colorValue", 0, 255); colorValueAnimator.setRepeatMode(ValueAnimator.REVERSE); colorValueAnimator.setRepeatCount(ValueAnimator.INFINITE); diff --git a/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java b/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java index 7454124b5ed0..fee7480fa65e 100644 --- a/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java +++ b/tests/UiBench/src/com/android/test/uibench/ClippedListActivity.java @@ -35,16 +35,16 @@ public class ClippedListActivity extends AppCompatActivity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_navigation_drawer); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + DrawerLayout drawer = findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); - NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); + NavigationView navigationView = findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); FragmentManager fm = getSupportFragmentManager(); @@ -59,7 +59,7 @@ public class ClippedListActivity extends AppCompatActivity @Override public boolean onNavigationItemSelected(MenuItem item) { - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + DrawerLayout drawer = findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } diff --git a/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java b/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java index 1d68767b2db2..a54110454f7a 100644 --- a/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java +++ b/tests/UiBench/src/com/android/test/uibench/NavigationDrawerActivity.java @@ -31,22 +31,22 @@ public class NavigationDrawerActivity extends AppCompatActivity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_navigation_drawer); - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + DrawerLayout drawer = findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); - NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); + NavigationView navigationView = findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); } @Override public boolean onNavigationItemSelected(MenuItem item) { - DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); + DrawerLayout drawer = findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } diff --git a/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java b/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java index e2a9bcb0d2af..e1df7d3e28ac 100644 --- a/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java +++ b/tests/UiBench/src/com/android/test/uibench/RenderingJitter.java @@ -85,12 +85,12 @@ public class RenderingJitter extends Activity { View content = findViewById(android.R.id.content); content.setBackground(new AnimatedBackgroundDrawable()); content.setKeepScreenOn(true); - mJitterReport = (TextView) findViewById(R.id.jitter_mma); - mMostlyTotalFrameTimeReport = (TextView) findViewById(R.id.totalish_mma); - mUiFrameTimeReport = (TextView) findViewById(R.id.ui_frametime_mma); - mRenderThreadTimeReport = (TextView) findViewById(R.id.rt_frametime_mma); - mTotalFrameTimeReport = (TextView) findViewById(R.id.total_mma); - mGraph = (PointGraphView) findViewById(R.id.graph); + mJitterReport = findViewById(R.id.jitter_mma); + mMostlyTotalFrameTimeReport = findViewById(R.id.totalish_mma); + mUiFrameTimeReport = findViewById(R.id.ui_frametime_mma); + mRenderThreadTimeReport = findViewById(R.id.rt_frametime_mma); + mTotalFrameTimeReport = findViewById(R.id.total_mma); + mGraph = findViewById(R.id.graph); mJitterReport.setText("abcdefghijklmnopqrstuvwxyz"); mMostlyTotalFrameTimeReport.setText("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); mUiFrameTimeReport.setText("0123456789"); diff --git a/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java b/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java index 2d9226ff4246..af8b846385b0 100644 --- a/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java +++ b/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/UsbHostManagementActivity.java @@ -68,12 +68,12 @@ public class UsbHostManagementActivity extends Activity Log.i(TAG, "onCreate"); super.onCreate(savedInstanceState); setContentView(R.layout.host_management); - mDeviceInfoText = (TextView) findViewById(R.id.device_info_text); - mStartAoapButton = (Button) findViewById(R.id.start_aoap_button); - mStartAoapActivityButton = (Button) findViewById(R.id.start_aoap_activity_button); - mAoapAppLog = (TextView) findViewById(R.id.aoap_apps_text); - mResetUsbButton = (Button) findViewById(R.id.reset_button); - mFinishButton = (Button) findViewById(R.id.finish_button); + mDeviceInfoText = findViewById(R.id.device_info_text); + mStartAoapButton = findViewById(R.id.start_aoap_button); + mStartAoapActivityButton = findViewById(R.id.start_aoap_activity_button); + mAoapAppLog = findViewById(R.id.aoap_apps_text); + mResetUsbButton = findViewById(R.id.reset_button); + mFinishButton = findViewById(R.id.finish_button); Intent intent = getIntent(); if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(intent.getAction())) { diff --git a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java index 8de2f6b42840..47ca482b7771 100644 --- a/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java +++ b/tests/VectorDrawableTest/src/com/android/test/dynamic/AnimatedVectorDrawableAttr.java @@ -25,7 +25,7 @@ public class AnimatedVectorDrawableAttr extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.activity_animated_vector_drawable_attr); - ImageView avdIv = (ImageView) findViewById(R.id.avd); + ImageView avdIv = findViewById(R.id.avd); AnimatedVectorDrawable avd = (AnimatedVectorDrawable) avdIv.getDrawable(); avd.start(); } diff --git a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java index 41058c9ba8a4..733f602f6c14 100644 --- a/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java +++ b/tests/VoiceInteraction/src/com/android/test/voiceinteraction/StartVoiceInteractionActivity.java @@ -55,9 +55,9 @@ public class StartVoiceInteractionActivity extends Activity implements View.OnCl mPickButton.setOnClickListener(this); mCancelButton = (Button)findViewById(R.id.cancel); mCancelButton.setOnClickListener(this); - mStartButton = (Button) findViewById(R.id.start); + mStartButton = findViewById(R.id.start); mStartButton.setOnClickListener(this); - mStopButton = (Button) findViewById(R.id.stop); + mStopButton = findViewById(R.id.stop); mStopButton.setOnClickListener(this); mLog.append("Local Voice Interaction Supported = " + isLocalVoiceInteractionSupported()); diff --git a/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java b/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java index 7880f6721193..63e11a75f73a 100644 --- a/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java +++ b/tests/WallpaperTest/src/com/example/wallpapertest/MainActivity.java @@ -58,28 +58,28 @@ public class MainActivity extends Activity { mWallpaperManager = (WallpaperManager)getSystemService(Context.WALLPAPER_SERVICE); mWindowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE); - mDimenWidthView = (TextView) findViewById(R.id.dimen_width); + mDimenWidthView = findViewById(R.id.dimen_width); mDimenWidthView.addTextChangedListener(mTextWatcher); - mDimenHeightView = (TextView) findViewById(R.id.dimen_height); + mDimenHeightView = findViewById(R.id.dimen_height); mDimenHeightView.addTextChangedListener(mTextWatcher); - mWallOffXView = (TextView) findViewById(R.id.walloff_x); + mWallOffXView = findViewById(R.id.walloff_x); mWallOffXView.addTextChangedListener(mTextWatcher); - mWallOffYView = (TextView) findViewById(R.id.walloff_y); + mWallOffYView = findViewById(R.id.walloff_y); mWallOffYView.addTextChangedListener(mTextWatcher); - mPaddingLeftView = (TextView) findViewById(R.id.padding_left); + mPaddingLeftView = findViewById(R.id.padding_left); mPaddingLeftView.addTextChangedListener(mTextWatcher); - mPaddingRightView = (TextView) findViewById(R.id.padding_right); + mPaddingRightView = findViewById(R.id.padding_right); mPaddingRightView.addTextChangedListener(mTextWatcher); - mPaddingTopView = (TextView) findViewById(R.id.padding_top); + mPaddingTopView = findViewById(R.id.padding_top); mPaddingTopView.addTextChangedListener(mTextWatcher); - mPaddingBottomView = (TextView) findViewById(R.id.padding_bottom); + mPaddingBottomView = findViewById(R.id.padding_bottom); mPaddingBottomView.addTextChangedListener(mTextWatcher); - mDispOffXView = (TextView) findViewById(R.id.dispoff_x); + mDispOffXView = findViewById(R.id.dispoff_x); mDispOffXView.addTextChangedListener(mTextWatcher); - mDispOffYView = (TextView) findViewById(R.id.dispoff_y); + mDispOffYView = findViewById(R.id.dispoff_y); mDispOffYView.addTextChangedListener(mTextWatcher); updateDimens(); |