Remove unnecessary casts on calls to findViewById
Just frameworks/ this time. More paths to come.
Bug: 24137209
Test: make -j32
Change-Id: Iff27abd26fa43296ac2fff8f534fc6742d2ae80c
diff --git a/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java b/packages/SystemUI/src/com/android/systemui/assist/AssistOrbView.java
index abcf27d..1d032e8 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 @@
@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 cdda45f..f06ea45 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 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 c06e56a..9c4f16b 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 @@
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 @@
}
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 59cb086..40a63d7 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 @@
.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 a2aff2d..4c81907 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 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 @@
}
});
- 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 @@
}
});
- 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 01d86b6..9945079 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 @@
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 57952f4..423530a 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 @@
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 d2a2919..f124e86 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 @@
@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 efc0668..f91aa9a 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 @@
@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 596d3bc..30053e3 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 @@
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 @@
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 9cd79f8..7224ae6 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 @@
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 c485a9e..1e9a618 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 @@
@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 f0a9bc3..143d934 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 @@
// 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 b8be580..e34987b 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 @@
@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 311f8ff..ae922fc 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 @@
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 7d847a3..6918a63 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 @@
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 afe89ec..5b234e9 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 @@
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 c48ecdb..da56e62 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 @@
@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 d4997ea..469f3ad 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 @@
@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 507b665..5377dee 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 @@
@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 fab4e59..7928575 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 @@
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 51345c2..b134fc5 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 @@
@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 0de3e02..4a3f112 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 @@
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 @@
}
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 c5e1438..d5f0e7c 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 @@
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 d530759..6cbbd6c 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 @@
@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 f46fc67..2de358f 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 @@
@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 9a49d67..41a60e2 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 @@
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 307a8c7..f1b4498 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 @@
@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 @@
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 4dc593b..916b603 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 @@
@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 784f25e..37b0de4 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 @@
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 faa1a28..9f61574 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 @@
@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 4e4832c..10b6ff5 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 @@
@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);