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/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java
index 7fa5736..9fa7a664 100644
--- a/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java
+++ b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java
@@ -173,13 +173,13 @@
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 @@
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 6394c64..5d20cf3 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -117,7 +117,7 @@
}
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 @@
@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 @@
// 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 @@
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 a5820f2..6276ce3 100644
--- a/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
+++ b/packages/CarrierDefaultApp/src/com/android/carrierdefaultapp/CaptivePortalLoginActivity.java
@@ -91,7 +91,7 @@
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 @@
@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 @@
// 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 @@
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 14b9de5..76a64e5 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/DeviceChooserActivity.java
@@ -65,7 +65,7 @@
} 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 @@
@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 f59f0d9..689e381 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 @@
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 ae0a45c..7fd2238 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 @@
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 afbd0d1..a6778c8 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 @@
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 4cce166..ccdec62 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 @@
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 @@
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 @@
// 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 @@
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 6f0caa2..a9a6cbd 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 @@
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 @@
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 0bb4bfa..8b00ed0 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 @@
@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 c6a45bc..e2c05a1 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 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 @@
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 0a89d9b..e98ef06 100644
--- a/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java
+++ b/packages/SystemUI/src/com/android/keyguard/EmergencyCarrierArea.java
@@ -37,8 +37,8 @@
@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 5aa673b..abc3b94 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java
@@ -98,7 +98,7 @@
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 dd5544d..27a3f7d 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardHostView.java
@@ -143,7 +143,7 @@
@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 590d8d5..c1cff9e 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPINView.java
@@ -79,11 +79,11 @@
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 d49ff97..b6184a8 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPasswordView.java
@@ -174,7 +174,7 @@
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 c2b57ff..3c9a6b9 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPatternView.java
@@ -140,7 +140,7 @@
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 @@
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 108b466..c04ae68 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
@@ -171,7 +171,7 @@
@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 8cdb906..b447979 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
@@ -160,7 +160,7 @@
}
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 839d3ce..0cf8900 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPinView.java
@@ -144,7 +144,7 @@
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 3871448..fb3cee7 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSimPukView.java
@@ -187,7 +187,7 @@
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 b2b0ee4..162faa5 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
@@ -115,14 +115,14 @@
@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 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);
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 78fd174..63b6a11 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 @@
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 @@
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 @@
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 a319beb..f878b4d 100644
--- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
+++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java
@@ -88,7 +88,7 @@
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();