<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<title>Lint Report</title>
|
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.blue-indigo.min.css" />
|
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,400,500,700" type="text/css">
|
<script defer src="https://code.getmdl.io/1.2.0/material.min.js"></script>
|
<style>
|
section.section--center {
|
max-width: 860px;
|
}
|
.mdl-card__supporting-text + .mdl-card__actions {
|
border-top: 1px solid rgba(0, 0, 0, 0.12);
|
}
|
main > .mdl-layout__tab-panel {
|
padding: 8px;
|
padding-top: 48px;
|
}
|
|
.mdl-card__actions {
|
margin: 0;
|
padding: 4px 40px;
|
color: inherit;
|
}
|
.mdl-card > * {
|
height: auto;
|
}
|
.mdl-card__actions a {
|
color: #00BCD4;
|
margin: 0;
|
}
|
.error-icon {
|
color: #bb7777;
|
vertical-align: bottom;
|
}
|
.warning-icon {
|
vertical-align: bottom;
|
}
|
.mdl-layout__content section:not(:last-of-type) {
|
position: relative;
|
margin-bottom: 48px;
|
}
|
|
.mdl-card .mdl-card__supporting-text {
|
margin: 40px;
|
-webkit-flex-grow: 1;
|
-ms-flex-positive: 1;
|
flex-grow: 1;
|
padding: 0;
|
color: inherit;
|
width: calc(100% - 80px);
|
}
|
div.mdl-layout__drawer-button .material-icons {
|
line-height: 48px;
|
}
|
.mdl-card .mdl-card__supporting-text {
|
margin-top: 0px;
|
}
|
.chips {
|
float: right;
|
vertical-align: middle;
|
}
|
pre.errorlines {
|
background-color: white;
|
font-family: monospace;
|
border: 1px solid #e0e0e0;
|
line-height: 0.9rem;
|
font-size: 0.9rem; padding: 1px 0px 1px; 1px;
|
overflow: scroll;
|
}
|
.prefix {
|
color: #660e7a;
|
font-weight: bold;
|
}
|
.attribute {
|
color: #0000ff;
|
font-weight: bold;
|
}
|
.value {
|
color: #008000;
|
font-weight: bold;
|
}
|
.tag {
|
color: #000080;
|
font-weight: bold;
|
}
|
.comment {
|
color: #808080;
|
font-style: italic;
|
}
|
.javadoc {
|
color: #808080;
|
font-style: italic;
|
}
|
.annotation {
|
color: #808000;
|
}
|
.string {
|
color: #008000;
|
font-weight: bold;
|
}
|
.number {
|
color: #0000ff;
|
}
|
.keyword {
|
color: #000080;
|
font-weight: bold;
|
}
|
.caretline {
|
background-color: #fffae3;
|
}
|
.lineno {
|
color: #999999;
|
background-color: #f0f0f0;
|
}
|
.error {
|
display: inline-block;
|
position:relative;
|
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AwCFR4T/3uLMgAAADxJREFUCNdNyLERQEAABMCjL4lQwIzcjErpguAL+C9AvgKJDbeD/PRpLdm35Hm+MU+cB+tCKaJW4L4YBy+CAiLJrFs9mgAAAABJRU5ErkJggg==) bottom repeat-x;
|
}
|
.warning {
|
text-decoration: none;
|
background-color: #f6ebbc;
|
}
|
.overview {
|
padding: 10pt;
|
width: 100%;
|
overflow: auto;
|
border-collapse:collapse;
|
}
|
.overview tr {
|
border-bottom: solid 1px #eeeeee;
|
}
|
.categoryColumn a {
|
text-decoration: none;
|
color: inherit;
|
}
|
.countColumn {
|
text-align: right;
|
padding-right: 20px;
|
width: 50px;
|
}
|
.issueColumn {
|
padding-left: 16px;
|
}
|
.categoryColumn {
|
position: relative;
|
left: -50px;
|
padding-top: 20px;
|
padding-bottom: 5px;
|
}
|
</style>
|
<script language="javascript" type="text/javascript">
|
<!--
|
function reveal(id) {
|
if (document.getElementById) {
|
document.getElementById(id).style.display = 'block';
|
document.getElementById(id+'Link').style.display = 'none';
|
}
|
}
|
function hideid(id) {
|
if (document.getElementById) {
|
document.getElementById(id).style.display = 'none';
|
}
|
}
|
//-->
|
</script>
|
</head>
|
<body class="mdl-color--grey-100 mdl-color-text--grey-700 mdl-base">
|
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
<header class="mdl-layout__header">
|
<div class="mdl-layout__header-row">
|
<span class="mdl-layout-title">Lint Report: 3 errors and 51 warnings</span>
|
<div class="mdl-layout-spacer"></div>
|
<nav class="mdl-navigation mdl-layout--large-screen-only">
|
Check performed at Wed Jul 29 17:06:21 CST 2020 </nav>
|
</div>
|
</header>
|
<div class="mdl-layout__drawer">
|
<span class="mdl-layout-title">Issue Types</span>
|
<nav class="mdl-navigation">
|
<a class="mdl-navigation__link" href="#overview"><i class="material-icons">dashboard</i>Overview</a>
|
<a class="mdl-navigation__link" href="#GradleCompatible"><i class="material-icons error-icon">error</i>Incompatible Gradle Versions (1)</a>
|
<a class="mdl-navigation__link" href="#ApplySharedPref"><i class="material-icons warning-icon">warning</i>Use <code>apply()</code> on <code>SharedPreferences</code> (3)</a>
|
<a class="mdl-navigation__link" href="#DefaultLocale"><i class="material-icons warning-icon">warning</i>Implied default locale in case conversion (2)</a>
|
<a class="mdl-navigation__link" href="#GradleDeprecated"><i class="material-icons warning-icon">warning</i>Deprecated Gradle Construct (1)</a>
|
<a class="mdl-navigation__link" href="#InvalidPackage"><i class="material-icons error-icon">error</i>Package not included in Android (2)</a>
|
<a class="mdl-navigation__link" href="#OldTargetApi"><i class="material-icons warning-icon">warning</i>Target SDK attribute is not targeting latest version (1)</a>
|
<a class="mdl-navigation__link" href="#GradleDependency"><i class="material-icons warning-icon">warning</i>Obsolete Gradle Dependency (1)</a>
|
<a class="mdl-navigation__link" href="#HardwareIds"><i class="material-icons warning-icon">warning</i>Hardware Id Usage (2)</a>
|
<a class="mdl-navigation__link" href="#TrustAllX509TrustManager"><i class="material-icons warning-icon">warning</i>Insecure TLS/SSL trust manager (2)</a>
|
<a class="mdl-navigation__link" href="#ObsoleteLayoutParam"><i class="material-icons warning-icon">warning</i>Obsolete layout params (2)</a>
|
<a class="mdl-navigation__link" href="#ObsoleteSdkInt"><i class="material-icons warning-icon">warning</i>Obsolete SDK_INT Version Check (3)</a>
|
<a class="mdl-navigation__link" href="#StaticFieldLeak"><i class="material-icons warning-icon">warning</i>Static Field Leaks (3)</a>
|
<a class="mdl-navigation__link" href="#HandlerLeak"><i class="material-icons warning-icon">warning</i>Handler reference leaks (1)</a>
|
<a class="mdl-navigation__link" href="#DisableBaselineAlignment"><i class="material-icons warning-icon">warning</i>Missing <code>baselineAligned</code> attribute (1)</a>
|
<a class="mdl-navigation__link" href="#IconDensities"><i class="material-icons warning-icon">warning</i>Icon densities validation (3)</a>
|
<a class="mdl-navigation__link" href="#ContentDescription"><i class="material-icons warning-icon">warning</i>Image without <code>contentDescription</code> (1)</a>
|
<a class="mdl-navigation__link" href="#SetTextI18n"><i class="material-icons warning-icon">warning</i>TextView Internationalization (2)</a>
|
<a class="mdl-navigation__link" href="#HardcodedText"><i class="material-icons warning-icon">warning</i>Hardcoded text (7)</a>
|
<a class="mdl-navigation__link" href="#RtlSymmetry"><i class="material-icons warning-icon">warning</i>Padding and margin symmetry (2)</a>
|
<a class="mdl-navigation__link" href="#RtlHardcoded"><i class="material-icons warning-icon">warning</i>Using left/right instead of start/end attributes (14)</a>
|
</nav>
|
</div>
|
<main class="mdl-layout__content">
|
<div class="mdl-layout__tab-panel is-active">
|
<a name="overview"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="OverviewCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Overview</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<table class="overview">
|
<tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Correctness">Correctness</a>
|
</td></tr>
|
<tr>
|
<td class="countColumn">1</td><td class="issueColumn"><i class="material-icons error-icon">error</i>
|
<a href="#GradleCompatible">GradleCompatible</a>: Incompatible Gradle Versions</td></tr>
|
<tr>
|
<td class="countColumn">3</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#ApplySharedPref">ApplySharedPref</a>: Use <code>apply()</code> on <code>SharedPreferences</code></td></tr>
|
<tr>
|
<td class="countColumn">2</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#DefaultLocale">DefaultLocale</a>: Implied default locale in case conversion</td></tr>
|
<tr>
|
<td class="countColumn">1</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#GradleDeprecated">GradleDeprecated</a>: Deprecated Gradle Construct</td></tr>
|
<tr>
|
<td class="countColumn">2</td><td class="issueColumn"><i class="material-icons error-icon">error</i>
|
<a href="#InvalidPackage">InvalidPackage</a>: Package not included in Android</td></tr>
|
<tr>
|
<td class="countColumn">1</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#OldTargetApi">OldTargetApi</a>: Target SDK attribute is not targeting latest version</td></tr>
|
<tr>
|
<td class="countColumn">1</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#GradleDependency">GradleDependency</a>: Obsolete Gradle Dependency</td></tr>
|
<tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Security">Security</a>
|
</td></tr>
|
<tr>
|
<td class="countColumn">2</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#HardwareIds">HardwareIds</a>: Hardware Id Usage</td></tr>
|
<tr>
|
<td class="countColumn">2</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#TrustAllX509TrustManager">TrustAllX509TrustManager</a>: Insecure TLS/SSL trust manager</td></tr>
|
<tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Performance">Performance</a>
|
</td></tr>
|
<tr>
|
<td class="countColumn">2</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#ObsoleteLayoutParam">ObsoleteLayoutParam</a>: Obsolete layout params</td></tr>
|
<tr>
|
<td class="countColumn">3</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#ObsoleteSdkInt">ObsoleteSdkInt</a>: Obsolete SDK_INT Version Check</td></tr>
|
<tr>
|
<td class="countColumn">3</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#StaticFieldLeak">StaticFieldLeak</a>: Static Field Leaks</td></tr>
|
<tr>
|
<td class="countColumn">1</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#HandlerLeak">HandlerLeak</a>: Handler reference leaks</td></tr>
|
<tr>
|
<td class="countColumn">1</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#DisableBaselineAlignment">DisableBaselineAlignment</a>: Missing <code>baselineAligned</code> attribute</td></tr>
|
<tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Usability:Icons">Usability:Icons</a>
|
</td></tr>
|
<tr>
|
<td class="countColumn">3</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#IconDensities">IconDensities</a>: Icon densities validation</td></tr>
|
<tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Accessibility">Accessibility</a>
|
</td></tr>
|
<tr>
|
<td class="countColumn">1</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#ContentDescription">ContentDescription</a>: Image without <code>contentDescription</code></td></tr>
|
<tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Internationalization">Internationalization</a>
|
</td></tr>
|
<tr>
|
<td class="countColumn">2</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#SetTextI18n">SetTextI18n</a>: TextView Internationalization</td></tr>
|
<tr>
|
<td class="countColumn">7</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#HardcodedText">HardcodedText</a>: Hardcoded text</td></tr>
|
<tr><td class="countColumn"></td><td class="categoryColumn"><a href="#Internationalization:Bidirectional Text">Internationalization:Bidirectional Text</a>
|
</td></tr>
|
<tr>
|
<td class="countColumn">2</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#RtlSymmetry">RtlSymmetry</a>: Padding and margin symmetry</td></tr>
|
<tr>
|
<td class="countColumn">14</td><td class="issueColumn"><i class="material-icons warning-icon">warning</i>
|
<a href="#RtlHardcoded">RtlHardcoded</a>: Using left/right instead of start/end attributes</td></tr>
|
<tr><td></td><td class="categoryColumn"><a href="#MissingIssues">Disabled Checks (31)</a>
|
</td></tr></table>
|
<br/> </div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="OverviewCardLink" onclick="hideid('OverviewCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="Correctness"></a>
|
<a name="GradleCompatible"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="GradleCompatibleCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Incompatible Gradle Versions</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../build.gradle">../../build.gradle</a>:6</span>: <span class="message">This support library should not use a different version (24) than the <code>compileSdkVersion</code> (26)</span><br /><pre class="errorlines">
|
<span class="lineno"> 3 </span>dependencies {
|
<span class="lineno"> 4 </span> api fileTree(include: <span class="string">'*.jar'</span>, dir: <span class="string">'libs'</span>)
|
<span class="lineno"> 5 </span> api files(<span class="string">'libs/android-async-http-1.4.8.jar'</span>)
|
<span class="caretline"><span class="lineno"> 6 </span> <span class="error">api <span class="string">'com.android.support:support-v4:24.2.1'</span></span> </span>
|
<span class="lineno"> 7 </span> api project(<span class="string">':EventBus'</span>)
|
<span class="lineno"> 8 </span>}
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationGradleCompatible" style="display: none;">
|
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your <code>targetSdkVersion</code>).<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "GradleCompatible" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">GradleCompatible</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Correctness</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Fatal</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 8/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationGradleCompatibleLink" onclick="reveal('explanationGradleCompatible');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="GradleCompatibleCardLink" onclick="hideid('GradleCompatibleCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="ApplySharedPref"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="ApplySharedPrefCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Use apply() on SharedPreferences</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/util/PackageUtils2.java">../../src/com/ysh/wpc/appupdate/util/PackageUtils2.java</a>:19</span>: <span class="message">Consider using <code>apply()</code> instead; <code>commit</code> writes its data to persistent storage immediately, whereas <code>apply</code> will handle it in the background</span><br /><pre class="errorlines">
|
<span class="lineno"> 16 </span> <span class="keyword">int</span> lastVersion = prefs.getInt(<span class="string">"version_code"</span>, <span class="number">0</span>);
|
<span class="lineno"> 17 </span> <span class="keyword">if</span> (currentVersion > lastVersion) { <span class="comment">// 濡傛灉褰撳墠鐗堟湰澶т簬涓婃鐗堟湰锛岃鐗堟湰灞炰簬绗竴娆″惎鍔?</span>
|
<span class="lineno"> 18 </span> <span class="comment">// 灏嗗綋鍓嶇増鏈啓鍏reference涓紝鍒欎笅娆″惎鍔ㄧ殑鏃跺?锛屾嵁姝ゅ垽鏂紝涓嶅啀涓洪娆″惎鍔?</span>
|
<span class="caretline"><span class="lineno"> 19 </span> <span class="warning">prefs.edit().putInt(<span class="string">"version_code"</span>, currentVersion).commit()</span>; </span>
|
<span class="lineno"> 20 </span> <span class="keyword">return</span> <span class="keyword">true</span>;
|
<span class="lineno"> 21 </span> } <span class="keyword">else</span> {
|
<span class="lineno"> 22 </span> <span class="keyword">return</span> <span class="keyword">false</span>;
|
</pre>
|
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/util/SDCardUtil.java">../../src/com/ysh/wpc/appupdate/util/SDCardUtil.java</a>:163</span>: <span class="message">Consider using <code>apply()</code> instead; <code>commit</code> writes its data to persistent storage immediately, whereas <code>apply</code> will handle it in the background</span><br /><pre class="errorlines">
|
<span class="lineno"> 160 </span> Context.MODE_PRIVATE);
|
<span class="lineno"> 161 </span> SharedPreferences.Editor editor = share.edit();
|
<span class="lineno"> 162 </span> editor.putInt(<span class="string">"stro"</span>, type);
|
<span class="caretline"><span class="lineno"> 163 </span> <span class="warning">editor.commit()</span>; </span>
|
<span class="lineno"> 164 </span> }
|
<span class="lineno"> 165 </span>
|
<span class="lineno"> 166 </span> <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> initStorage(Context context) {
|
</pre>
|
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/util/SDCardUtil.java">../../src/com/ysh/wpc/appupdate/util/SDCardUtil.java</a>:179</span>: <span class="message">Consider using <code>apply()</code> instead; <code>commit</code> writes its data to persistent storage immediately, whereas <code>apply</code> will handle it in the background</span><br /><pre class="errorlines">
|
<span class="lineno"> 176 </span> }
|
<span class="lineno"> 177 </span> SharedPreferences.Editor editor = share.edit();
|
<span class="lineno"> 178 </span> editor.putBoolean(<span class="string">"StorageSetting"</span>, <span class="keyword">true</span>);
|
<span class="caretline"><span class="lineno"> 179 </span> <span class="warning">editor.commit()</span>; </span>
|
<span class="lineno"> 180 </span>
|
<span class="lineno"> 181 </span> }
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationApplySharedPref" style="display: none;">
|
Consider using <code>apply()</code> instead of <code>commit</code> on shared preferences. Whereas <code>commit</code> blocks and writes its data to persistent storage immediately, <code>apply</code> will handle it in the background.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "ApplySharedPref" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">ApplySharedPref</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Correctness</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationApplySharedPrefLink" onclick="reveal('explanationApplySharedPref');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="ApplySharedPrefCardLink" onclick="hideid('ApplySharedPrefCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="DefaultLocale"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="DefaultLocaleCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Implied default locale in case conversion</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/util/StringUtils.java">../../src/com/ysh/wpc/appupdate/util/StringUtils.java</a>:277</span>: <span class="message">Implicitly using the default locale is a common source of bugs: Use <code>toLowerCase(Locale)</code> instead. For strings meant to be internal use <code>Locale.ROOT</code>, otherwise <code>Locale.getDefault()</code>.</span><br /><pre class="errorlines">
|
<span class="lineno"> 274 </span>
|
<span class="lineno"> 275 </span> <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">boolean</span> isVoice(String text) {
|
<span class="lineno"> 276 </span>
|
<span class="caretline"><span class="lineno"> 277 </span> <span class="keyword">return</span> text.<span class="warning">toLowerCase</span>().endsWith(<span class="string">".amr"</span>); </span>
|
<span class="lineno"> 278 </span>
|
<span class="lineno"> 279 </span> }
|
</pre>
|
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/util/StringUtils.java">../../src/com/ysh/wpc/appupdate/util/StringUtils.java</a>:282</span>: <span class="message">Implicitly using the default locale is a common source of bugs: Use <code>toLowerCase(Locale)</code> instead. For strings meant to be internal use <code>Locale.ROOT</code>, otherwise <code>Locale.getDefault()</code>.</span><br /><pre class="errorlines">
|
<span class="lineno"> 279 </span> }
|
<span class="lineno"> 280 </span>
|
<span class="lineno"> 281 </span> <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">boolean</span> isImage(String text) {
|
<span class="caretline"><span class="lineno"> 282 </span> text = text.<span class="warning">toLowerCase</span>(); </span>
|
<span class="lineno"> 283 </span> <span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i < imageEndWiths.length; i++) {
|
<span class="lineno"> 284 </span> String endWidth = imageEndWiths[i];
|
<span class="lineno"> 285 </span> <span class="keyword">if</span> (text.endsWith(endWidth)) {
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationDefaultLocale" style="display: none;">
|
Calling <code>String#toLowerCase()</code> or <code>#toUpperCase()</code> <b>without specifying an explicit locale</b> is a common source of bugs. The reason for that is that those methods will use the current locale on the user's device, and even though the code appears to work correctly when you are developing the app, it will fail in some locales. For example, in the Turkish locale, the uppercase replacement for <code>i</code> is <b>not</b> <code>I</code>.<br/>
|
<br/>
|
If you want the methods to just perform ASCII replacement, for example to convert an enum name, call <code>String#toUpperCase(Locale.US)</code> instead. If you really want to use the current locale, call <code>String#toUpperCase(Locale.getDefault())</code> instead.<br/><div class="moreinfo">More info: <a href="http://developer.android.com/reference/java/util/Locale.html#default_locale">http://developer.android.com/reference/java/util/Locale.html#default_locale</a>
|
</div>To suppress this error, use the issue id "DefaultLocale" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">DefaultLocale</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Correctness</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationDefaultLocaleLink" onclick="reveal('explanationDefaultLocale');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="DefaultLocaleCardLink" onclick="hideid('DefaultLocaleCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="GradleDeprecated"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="GradleDeprecatedCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Deprecated Gradle Construct</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../build.gradle">../../build.gradle</a>:1</span>: <span class="message">'android-library' is deprecated; use 'com.android.library' instead</span><br /><pre class="errorlines">
|
<span class="caretline"><span class="lineno"> 1 </span><span class="warning">apply plugin: <span class="string">'android-library'</span></span> </span>
|
<span class="lineno"> 2 </span>
|
<span class="lineno"> 3 </span>dependencies {
|
<span class="lineno"> 4 </span> api fileTree(include: <span class="string">'*.jar'</span>, dir: <span class="string">'libs'</span>)
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationGradleDeprecated" style="display: none;">
|
This detector looks for deprecated Gradle constructs which currently work but will likely stop working in a future update.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "GradleDeprecated" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">GradleDeprecated</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Correctness</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationGradleDeprecatedLink" onclick="reveal('explanationGradleDeprecated');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="GradleDeprecatedCardLink" onclick="hideid('GradleDeprecatedCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="InvalidPackage"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="InvalidPackageCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Package not included in Android</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../../EventBus/libs/fastjson-1.2.7.jar">../../../EventBus/libs/fastjson-1.2.7.jar</a></span>: <span class="message">Invalid package reference in library; not included in Android: <code>java.awt</code>. Referenced from <code>com.alibaba.fastjson.serializer.ColorCodec</code>.</span><br />
|
<span class="location"><a href="../../../EventBus/libs/fastjson-1.2.7.jar">../../../EventBus/libs/fastjson-1.2.7.jar</a></span>: <span class="message">Invalid package reference in library; not included in Android: <code>javax.servlet.http</code>. Referenced from <code>com.alibaba.fastjson.support.spring.FastJsonJsonView</code>.</span><br />
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationInvalidPackage" style="display: none;">
|
This check scans through libraries looking for calls to APIs that are not included in Android.<br/>
|
<br/>
|
When you create Android projects, the classpath is set up such that you can only access classes in the API packages that are included in Android. However, if you add other projects to your libs/ folder, there is no guarantee that those .jar files were built with an Android specific classpath, and in particular, they could be accessing unsupported APIs such as java.applet.<br/>
|
<br/>
|
This check scans through library jars and looks for references to API packages that are not included in Android and flags these. This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.<br/>To suppress this error, use the issue id "InvalidPackage" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">InvalidPackage</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Correctness</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Error</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationInvalidPackageLink" onclick="reveal('explanationInvalidPackage');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="InvalidPackageCardLink" onclick="hideid('InvalidPackageCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="OldTargetApi"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="OldTargetApiCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Target SDK attribute is not targeting latest version</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../build.gradle">../../build.gradle</a>:25</span>: <span class="message">Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.</span><br /><pre class="errorlines">
|
<span class="lineno"> 22 </span> }
|
<span class="lineno"> 23 </span> defaultConfig {
|
<span class="lineno"> 24 </span> minSdkVersion <span class="number">16</span>
|
<span class="caretline"><span class="lineno"> 25 </span> <span class="warning">targetSdkVersion <span class="number">26</span></span> </span>
|
<span class="lineno"> 26 </span> }
|
<span class="lineno"> 27 </span> sourceSets {
|
<span class="lineno"> 28 </span> main {
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationOldTargetApi" style="display: none;">
|
When your application runs on a version of Android that is more recent than your <code>targetSdkVersion</code> specifies that it has been tested with, various compatibility modes kick in. This ensures that your application continues to work, but it may look out of place. For example, if the <code>targetSdkVersion</code> is less than 14, your app may get an option button in the UI.<br/>
|
<br/>
|
To fix this issue, set the <code>targetSdkVersion</code> to the highest available value. Then test your app to make sure everything works correctly. You may want to consult the compatibility notes to see what changes apply to each version you are adding support for: <a href="http://developer.android.com/reference/android/os/Build.VERSION_CODES.html">http://developer.android.com/reference/android/os/Build.VERSION_CODES.html</a> as well as follow this guide:<br/>
|
<a href="https://developer.android.com/distribute/best-practices/develop/target-sdk.html">https://developer.android.com/distribute/best-practices/develop/target-sdk.html</a><br/><div class="moreinfo">More info: <ul><li><a href="https://developer.android.com/distribute/best-practices/develop/target-sdk.html">https://developer.android.com/distribute/best-practices/develop/target-sdk.html</a>
|
<li><a href="http://developer.android.com/reference/android/os/Build.VERSION_CODES.html">http://developer.android.com/reference/android/os/Build.VERSION_CODES.html</a>
|
</ul></div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "OldTargetApi" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">OldTargetApi</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Correctness</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationOldTargetApiLink" onclick="reveal('explanationOldTargetApi');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="OldTargetApiCardLink" onclick="hideid('OldTargetApiCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="GradleDependency"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="GradleDependencyCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Obsolete Gradle Dependency</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../build.gradle">../../build.gradle</a>:6</span>: <span class="message">A newer version of com.android.support:support-v4 than 24.2.1 is available: 26.1.0</span><br /><pre class="errorlines">
|
<span class="lineno"> 3 </span>dependencies {
|
<span class="lineno"> 4 </span> api fileTree(include: <span class="string">'*.jar'</span>, dir: <span class="string">'libs'</span>)
|
<span class="lineno"> 5 </span> api files(<span class="string">'libs/android-async-http-1.4.8.jar'</span>)
|
<span class="caretline"><span class="lineno"> 6 </span> <span class="warning">api <span class="string">'com.android.support:support-v4:24.2.1'</span></span> </span>
|
<span class="lineno"> 7 </span> api project(<span class="string">':EventBus'</span>)
|
<span class="lineno"> 8 </span>}
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationGradleDependency" style="display: none;">
|
This detector looks for usages of libraries where the version you are using is not the current stable release. Using older versions is fine, and there are cases where you deliberately want to stick with an older version. However, you may simply not be aware that a more recent version is available, and that is what this lint check helps find.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "GradleDependency" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">GradleDependency</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Correctness</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 4/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationGradleDependencyLink" onclick="reveal('explanationGradleDependency');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="GradleDependencyCardLink" onclick="hideid('GradleDependencyCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="Security"></a>
|
<a name="HardwareIds"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="HardwareIdsCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Hardware Id Usage</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/AppUpdate.java">../../src/com/ysh/wpc/appupdate/AppUpdate.java</a>:66</span>: <span class="message">Using <code>getDeviceId</code> to get device identifiers is not recommended.</span><br /><pre class="errorlines">
|
<span class="lineno"> 63 </span> String deviceId=<span class="string">""</span>;
|
<span class="lineno"> 64 </span> <span class="keyword">if</span> (ContextCompat.checkSelfPermission(mActivity, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED
|
<span class="lineno"> 65 </span> || ContextCompat.checkSelfPermission(mActivity, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
|
<span class="caretline"><span class="lineno"> 66 </span> deviceId = <span class="warning">manager.getDeviceId()</span>;<span class="comment">// 获取deviceId</span> </span>
|
<span class="lineno"> 67 </span> }
|
<span class="lineno"> 68 </span> <span class="keyword">int</span> versionCode = <span class="number">1</span>;<span class="comment">// 版本号</span>
|
<span class="lineno"> 69 </span> <span class="keyword">try</span> {
|
</pre>
|
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/util/StringUtils.java">../../src/com/ysh/wpc/appupdate/util/StringUtils.java</a>:445</span>: <span class="message">Using <code>getDeviceId</code> to get device identifiers is not recommended.</span><br /><pre class="errorlines">
|
<span class="lineno"> 442 </span> String deviceid =<span class="string">""</span>;
|
<span class="lineno"> 443 </span> <span class="keyword">if</span> (ContextCompat.checkSelfPermission(context, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED
|
<span class="lineno"> 444 </span> || ContextCompat.checkSelfPermission(context, android.Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) {
|
<span class="caretline"><span class="lineno"> 445 </span> deviceid = <span class="warning">tm.getDeviceId()</span>;<span class="comment">// 获取deviceId</span> </span>
|
<span class="lineno"> 446 </span> }
|
<span class="lineno"> 447 </span>
|
<span class="lineno"> 448 </span> <span class="keyword">return</span> deviceid;
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationHardwareIds" style="display: none;">
|
Using these device identifiers is not recommended other than for high value fraud prevention and advanced telephony use-cases. For advertising use-cases, use <code>AdvertisingIdClient$Info#getId</code> and for analytics, use <code>InstanceId#getId</code>.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/training/articles/user-data-ids.html">https://developer.android.com/training/articles/user-data-ids.html</a>
|
</div>To suppress this error, use the issue id "HardwareIds" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">HardwareIds</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Security</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationHardwareIdsLink" onclick="reveal('explanationHardwareIds');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="HardwareIdsCardLink" onclick="hideid('HardwareIdsCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="TrustAllX509TrustManager"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="TrustAllX509TrustManagerCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Insecure TLS/SSL trust manager</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="file:///D:/workspace/Android/buwan/AndroidBuWanVideoProject/com/loopj/android/http/MySSLSocketFactory$1.class">D:\workspace\Android\buwan\AndroidBuWanVideoProject\com\loopj\android\http\MySSLSocketFactory$1.class</a></span>: <span class="message"><code>checkClientTrusted</code> is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers</span><br />
|
<span class="location"><a href="file:///D:/workspace/Android/buwan/AndroidBuWanVideoProject/com/loopj/android/http/MySSLSocketFactory$1.class">D:\workspace\Android\buwan\AndroidBuWanVideoProject\com\loopj\android\http\MySSLSocketFactory$1.class</a></span>: <span class="message"><code>checkServerTrusted</code> is empty, which could cause insecure network traffic due to trusting arbitrary TLS/SSL certificates presented by peers</span><br />
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationTrustAllX509TrustManager" style="display: none;">
|
This check looks for X509TrustManager implementations whose <code>checkServerTrusted</code> or <code>checkClientTrusted</code> methods do nothing (thus trusting any certificate chain) which could result in insecure network traffic caused by trusting arbitrary TLS/SSL certificates presented by peers.<br/>To suppress this error, use the issue id "TrustAllX509TrustManager" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">TrustAllX509TrustManager</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Security</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationTrustAllX509TrustManagerLink" onclick="reveal('explanationTrustAllX509TrustManager');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="TrustAllX509TrustManagerCardLink" onclick="hideid('TrustAllX509TrustManagerCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="Performance"></a>
|
<a name="ObsoleteLayoutParam"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="ObsoleteLayoutParamCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Obsolete layout params</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../res/layout/notify_item.xml">../../res/layout/notify_item.xml</a>:12</span>: <span class="message">Invalid layout param in a <code>LinearLayout</code>: <code>layout_centerHorizontal</code></span><br /><pre class="errorlines">
|
<span class="lineno"> 9 </span> <span class="tag"><ImageView</span><span class="attribute">
|
</span><span class="lineno"> 10 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 11 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="caretline"><span class="lineno"> 12 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_centerHorizontal</span>=<span class="value">"true"</span></span> </span>
|
<span class="lineno"> 13 </span> <span class="prefix">android:</span><span class="attribute">layout_marginLeft</span>=<span class="value">"15dp"</span>
|
<span class="lineno"> 14 </span> <span class="prefix">android:</span><span class="attribute">src</span>=<span class="value">"@drawable/ic_launcher"</span> />
|
<span class="lineno"> 15 </span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/notify_item.xml">../../res/layout/notify_item.xml</a>:25</span>: <span class="message">Invalid layout param in a <code>LinearLayout</code>: <code>layout_centerHorizontal</code></span><br /><pre class="errorlines">
|
<span class="lineno"> 22 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">id</span>=<span class="value">"@+id/content_view_text1"</span>
|
<span class="lineno"> 23 </span> <span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 24 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"0dp"</span>
|
<span class="caretline"><span class="lineno"> 25 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_centerHorizontal</span>=<span class="value">"true"</span></span> </span>
|
<span class="lineno"> 26 </span> <span class="prefix">android:</span><span class="attribute">layout_marginLeft</span>=<span class="value">"15dp"</span>
|
<span class="lineno"> 27 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 28 </span> <span class="prefix">android:</span><span class="attribute">textSize</span>=<span class="value">"18sp"</span>
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationObsoleteLayoutParam" style="display: none;">
|
The given layout_param is not defined for the given layout, meaning it has no effect. This usually happens when you change the parent layout or move view code around without updating the layout params. This will cause useless attribute processing at runtime, and is misleading for others reading the layout so the parameter should be removed.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "ObsoleteLayoutParam" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">ObsoleteLayoutParam</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Performance</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationObsoleteLayoutParamLink" onclick="reveal('explanationObsoleteLayoutParam');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="ObsoleteLayoutParamCardLink" onclick="hideid('ObsoleteLayoutParamCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="ObsoleteSdkInt"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="ObsoleteSdkIntCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Obsolete SDK_INT Version Check</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/util/Environment.java">../../src/com/ysh/wpc/appupdate/util/Environment.java</a>:49</span>: <span class="message">Unnecessary; SDK_INT is always >= 16</span><br /><pre class="errorlines">
|
<span class="lineno"> 46 </span> mStorageList = <span class="keyword">null</span>;
|
<span class="lineno"> 47 </span> <span class="keyword">if</span> (mStorageList == <span class="keyword">null</span>) {
|
<span class="lineno"> 48 </span> <span class="keyword">try</span> {
|
<span class="caretline"><span class="lineno"> 49 </span> mStorageList = (<span class="warning">Build.VERSION.SDK_INT >= <span class="number">14</span></span>) </span>
|
<span class="lineno"> 50 </span> ? getExternalStorageList((StorageManager) context.getSystemService(Context.STORAGE_SERVICE))
|
<span class="lineno"> 51 </span> : getVolumeDaemonExternalStorageList();
|
<span class="lineno"> 52 </span> } <span class="keyword">catch</span> (Exception e) {
|
</pre>
|
|
<span class="location"><a href="../../res/values-v11">../../res/values-v11</a></span>: <span class="message">This folder configuration (<code>v11</code>) is unnecessary; <code>minSdkVersion</code> is 16. Merge all the resources in this folder into <code>values</code>.</span><br />
|
<span class="location"><a href="../../res/values-v14">../../res/values-v14</a></span>: <span class="message">This folder configuration (<code>v14</code>) is unnecessary; <code>minSdkVersion</code> is 16. Merge all the resources in this folder into <code>values</code>.</span><br />
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationObsoleteSdkInt" style="display: none;">
|
This check flags version checks that are not necessary, because the <code>minSdkVersion</code> (or surrounding known API level) is already at least as high as the version checked for.<br/>
|
<br/>
|
Similarly, it also looks for resources in <code>-vNN</code> folders, such as <code>values-v14</code> where the version qualifier is less than or equal to the <code>minSdkVersion</code>, where the contents should be merged into the best folder.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "ObsoleteSdkInt" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">ObsoleteSdkInt</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Performance</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationObsoleteSdkIntLink" onclick="reveal('explanationObsoleteSdkInt');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="ObsoleteSdkIntCardLink" onclick="hideid('ObsoleteSdkIntCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="StaticFieldLeak"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="StaticFieldLeakCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Static Field Leaks</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/AppUpdate.java">../../src/com/ysh/wpc/appupdate/AppUpdate.java</a>:38</span>: <span class="message">Do not place Android context classes in static fields; this is a memory leak (and also breaks Instant Run)</span><br /><pre class="errorlines">
|
<span class="lineno"> 35 </span>
|
<span class="lineno"> 36 </span> <span class="keyword">private</span> <span class="keyword">static</span> String mKey;
|
<span class="lineno"> 37 </span>
|
<span class="caretline"><span class="lineno"> 38 </span> <span class="keyword">private</span> <span class="warning"><span class="keyword">static</span></span> Activity mActivity; </span>
|
<span class="lineno"> 39 </span>
|
<span class="lineno"> 40 </span> <span class="keyword">private</span> <span class="keyword">static</span> AppUpdate appUpdate;
|
</pre>
|
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/AppUpdate.java">../../src/com/ysh/wpc/appupdate/AppUpdate.java</a>:40</span>: <span class="message">Do not place Android context classes in static fields (static reference to <code>AppUpdate</code> which has field <code>mActivity</code> pointing to <code>Activity</code>); this is a memory leak (and also breaks Instant Run)</span><br /><pre class="errorlines">
|
<span class="lineno"> 37 </span>
|
<span class="lineno"> 38 </span> <span class="keyword">private</span> <span class="keyword">static</span> Activity mActivity;
|
<span class="lineno"> 39 </span>
|
<span class="caretline"><span class="lineno"> 40 </span> <span class="keyword">private</span> <span class="warning"><span class="keyword">static</span></span> AppUpdate appUpdate; </span>
|
<span class="lineno"> 41 </span>
|
<span class="lineno"> 42 </span> <span class="keyword">private</span> <span class="keyword">boolean</span> isWifi = <span class="keyword">false</span>;
|
</pre>
|
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/download/DownLoadApks.java">../../src/com/ysh/wpc/appupdate/download/DownLoadApks.java</a>:21</span>: <span class="message">This field leaks a context object</span><br /><pre class="errorlines">
|
<span class="lineno"> 18 </span><span class="keyword">public</span> <span class="keyword">class</span> DownLoadApks <span class="keyword">extends</span> AsyncTask<String, Integer, String> <span class="keyword">implements</span>
|
<span class="lineno"> 19 </span> DownLoadFile.FileProgressListener {
|
<span class="lineno"> 20 </span> <span class="keyword">private</span> <span class="keyword">static</span> <span class="keyword">final</span> String TAG = <span class="string">"DownLoadApks"</span>;
|
<span class="caretline"><span class="lineno"> 21 </span> <span class="warning"><span class="comment">// TextView tv;</span></span> </span>
|
<span class="lineno"> 22 </span> Context context;
|
<span class="lineno"> 23 </span> IProgress progress;
|
<span class="lineno"> 24 </span> String apkType;
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationStaticFieldLeak" style="display: none;">
|
A static field will leak contexts.<br/>
|
<br/>
|
Non-static inner classes have an implicit reference to their outer class. If that outer class is for example a <code>Fragment</code> or <code>Activity</code>, then this reference means that the long-running handler/loader/task will hold a reference to the activity which prevents it from getting garbage collected.<br/>
|
<br/>
|
Similarly, direct field references to activities and fragments from these longer running instances can cause leaks.<br/>
|
<br/>
|
ViewModel classes should never point to Views or non-application Contexts.<br/>To suppress this error, use the issue id "StaticFieldLeak" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">StaticFieldLeak</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Performance</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationStaticFieldLeakLink" onclick="reveal('explanationStaticFieldLeak');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="StaticFieldLeakCardLink" onclick="hideid('StaticFieldLeakCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="HandlerLeak"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="HandlerLeakCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Handler reference leaks</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/service/DownLoadFileService.java">../../src/com/ysh/wpc/appupdate/service/DownLoadFileService.java</a>:82</span>: <span class="message">This Handler class should be static or leaks might occur (anonymous android.os.Handler)</span><br /><pre class="errorlines">
|
<span class="lineno"> 79 </span> <span class="javadoc">/**
|
</span><span class="lineno"> 80 </span><span class="javadoc"> * 下载进度推送
|
</span><span class="lineno"> 81 </span><span class="javadoc"> */</span>
|
<span class="caretline"><span class="lineno"> 82 </span> <span class="keyword">private</span> Handler handler = <span class="warning"><span class="keyword">new</span> Handler() {</span> </span>
|
<span class="lineno"> 83 </span> <span class="annotation">@Override</span>
|
<span class="lineno"> 84 </span> <span class="keyword">public</span> <span class="keyword">void</span> handleMessage(Message msg) {
|
<span class="lineno"> 85 </span> <span class="keyword">super</span>.handleMessage(msg);
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationHandlerLeak" style="display: none;">
|
Since this Handler is declared as an inner class, it may prevent the outer class from being garbage collected. If the Handler is using a Looper or MessageQueue for a thread other than the main thread, then there is no issue. If the Handler is using the Looper or MessageQueue of the main thread, you need to fix your Handler declaration, as follows: Declare the Handler as a static class; In the outer class, instantiate a WeakReference to the outer class and pass this object to your Handler when you instantiate the Handler; Make all references to members of the outer class using the WeakReference object.<br/>To suppress this error, use the issue id "HandlerLeak" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">HandlerLeak</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Performance</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 4/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationHandlerLeakLink" onclick="reveal('explanationHandlerLeak');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="HandlerLeakCardLink" onclick="hideid('HandlerLeakCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="DisableBaselineAlignment"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="DisableBaselineAlignmentCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Missing baselineAligned attribute</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:81</span>: <span class="message">Set <code>android:baselineAligned="false"</code> on this element for better performance</span><br /><pre class="errorlines">
|
<span class="lineno"> 78 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"@color/red"</span> />
|
<span class="lineno"> 79 </span> <span class="tag"></LinearLayout></span>
|
<span class="lineno"> 80 </span>
|
<span class="caretline"><span class="lineno"> 81 </span> <span class="tag"><</span><span class="warning"><span class="tag">LinearLayout</span></span><span class="attribute"> </span> </span><span class="attribute">
|
</span><span class="lineno"> 82 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 83 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 84 </span> <span class="prefix">android:</span><span class="attribute">background</span>=<span class="value">"#ffffffff"</span>
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationDisableBaselineAlignment" style="display: none;">
|
When a LinearLayout is used to distribute the space proportionally between nested layouts, the baseline alignment property should be turned off to make the layout computation faster.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "DisableBaselineAlignment" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">DisableBaselineAlignment</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Performance</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 3/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationDisableBaselineAlignmentLink" onclick="reveal('explanationDisableBaselineAlignment');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="DisableBaselineAlignmentCardLink" onclick="hideid('DisableBaselineAlignmentCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="Usability:Icons"></a>
|
<a name="IconDensities"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="IconDensitiesCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Icon densities validation</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../res/drawable-hdpi">../../res/drawable-hdpi</a></span>: <span class="message">Missing the following drawables in <code>drawable-hdpi</code>: update_bottom.9.png (found in drawable-xhdpi)</span><br />
|
<span class="location"><a href="../../res/drawable-mdpi">../../res/drawable-mdpi</a></span>: <span class="message">Missing the following drawables in <code>drawable-mdpi</code>: update_bottom.9.png (found in drawable-xhdpi)</span><br />
|
<span class="location"><a href="../../res/drawable-xxhdpi">../../res/drawable-xxhdpi</a></span>: <span class="message">Missing the following drawables in <code>drawable-xxhdpi</code>: update_bottom.9.png (found in drawable-xhdpi)</span><br />
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationIconDensities" style="display: none;">
|
Icons will look best if a custom version is provided for each of the major screen density classes (low, medium, high, extra high). This lint check identifies icons which do not have complete coverage across the densities.<br/>
|
<br/>
|
Low density is not really used much anymore, so this check ignores the ldpi density. To force lint to include it, set the environment variable <code>ANDROID_LINT_INCLUDE_LDPI=true</code>. For more information on current density usage, see <a href="http://developer.android.com/resources/dashboard/screens.html">http://developer.android.com/resources/dashboard/screens.html</a><br/><div class="moreinfo">More info: <a href="http://developer.android.com/guide/practices/screens_support.html">http://developer.android.com/guide/practices/screens_support.html</a>
|
</div>To suppress this error, use the issue id "IconDensities" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">IconDensities</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Icons</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Usability</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 4/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationIconDensitiesLink" onclick="reveal('explanationIconDensities');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="IconDensitiesCardLink" onclick="hideid('IconDensitiesCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="Accessibility"></a>
|
<a name="ContentDescription"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="ContentDescriptionCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Image without contentDescription</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../res/layout/notify_item.xml">../../res/layout/notify_item.xml</a>:9</span>: <span class="message">Missing <code>contentDescription</code> attribute on image</span><br /><pre class="errorlines">
|
<span class="lineno"> 6 </span> <span class="prefix">android:</span><span class="attribute">orientation</span>=<span class="value">"horizontal"</span>
|
<span class="lineno"> 7 </span> <span class="prefix">android:</span><span class="attribute">padding</span>=<span class="value">"5dp"</span> >
|
<span class="lineno"> 8 </span>
|
<span class="caretline"><span class="lineno"> 9 </span> <span class="tag"><</span><span class="warning"><span class="tag">ImageView</span></span><span class="attribute"> </span> </span><span class="attribute">
|
</span><span class="lineno"> 10 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 11 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 12 </span> <span class="prefix">android:</span><span class="attribute">layout_centerHorizontal</span>=<span class="value">"true"</span>
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationContentDescription" style="display: none;">
|
Non-textual widgets like ImageViews and ImageButtons should use the <code>contentDescription</code> attribute to specify a textual description of the widget such that screen readers and other accessibility tools can adequately describe the user interface.<br/>
|
<br/>
|
Note that elements in application screens that are purely decorative and do not provide any content or enable a user action should not have accessibility content descriptions. In this case, just suppress the lint warning with a tools:ignore="ContentDescription" attribute.<br/>
|
<br/>
|
Note that for text fields, you should not set both the <code>hint</code> and the <code>contentDescription</code> attributes since the hint will never be shown. Just set the <code>hint</code>. See <a href="http://developer.android.com/guide/topics/ui/accessibility/checklist.html#special-cases">http://developer.android.com/guide/topics/ui/accessibility/checklist.html#special-cases</a>.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "ContentDescription" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">ContentDescription</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Accessibility</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 3/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationContentDescriptionLink" onclick="reveal('explanationContentDescription');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="ContentDescriptionCardLink" onclick="hideid('ContentDescriptionCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="Internationalization"></a>
|
<a name="SetTextI18n"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="SetTextI18nCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">TextView Internationalization</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/view/CustomDialog.java">../../src/com/ysh/wpc/appupdate/view/CustomDialog.java</a>:197</span>: <span class="message">Do not concatenate text displayed with <code>setText</code>. Use resource string with placeholders.</span><br /><pre class="errorlines">
|
<span class="lineno"> 194 </span> }
|
<span class="lineno"> 195 </span> <span class="keyword">if</span> (version != <span class="keyword">null</span>) {
|
<span class="lineno"> 196 </span> ((TextView) layout.findViewById(R.id.tv_version))
|
<span class="caretline"><span class="lineno"> 197 </span> .setText(<span class="warning"><span class="string">"版本:"</span> + version</span>); </span>
|
<span class="lineno"> 198 </span> }
|
<span class="lineno"> 199 </span> <span class="keyword">if</span> (size != <span class="keyword">null</span>) {
|
<span class="lineno"> 200 </span> ((TextView) layout.findViewById(R.id.tv_size))
|
</pre>
|
|
<span class="location"><a href="../../src/com/ysh/wpc/appupdate/view/CustomDialog.java">../../src/com/ysh/wpc/appupdate/view/CustomDialog.java</a>:201</span>: <span class="message">Do not concatenate text displayed with <code>setText</code>. Use resource string with placeholders.</span><br /><pre class="errorlines">
|
<span class="lineno"> 198 </span> }
|
<span class="lineno"> 199 </span> <span class="keyword">if</span> (size != <span class="keyword">null</span>) {
|
<span class="lineno"> 200 </span> ((TextView) layout.findViewById(R.id.tv_size))
|
<span class="caretline"><span class="lineno"> 201 </span> .setText(<span class="warning"><span class="string">"大小:"</span> + size</span>); </span>
|
<span class="lineno"> 202 </span> }
|
<span class="lineno"> 203 </span> <span class="keyword">if</span> (!no_wifi) {
|
<span class="lineno"> 204 </span> ((TextView) layout.findViewById(R.id.tv_dialog_noti_wifi))
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationSetTextI18n" style="display: none;">
|
When calling <code>TextView#setText</code><br/>
|
* Never call <code>Number#toString()</code> to format numbers; it will not handle fraction separators and locale-specific digits properly. Consider using <code>String#format</code> with proper format specifications (<code>%d</code> or <code>%f</code>) instead.<br/>
|
* Do not pass a string literal (e.g. "Hello") to display text. Hardcoded text can not be properly translated to other languages. Consider using Android resource strings instead.<br/>
|
* Do not build messages by concatenating text chunks. Such messages can not be properly translated.<br/><div class="moreinfo">More info: <a href="http://developer.android.com/guide/topics/resources/localization.html">http://developer.android.com/guide/topics/resources/localization.html</a>
|
</div>To suppress this error, use the issue id "SetTextI18n" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">SetTextI18n</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Internationalization</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationSetTextI18nLink" onclick="reveal('explanationSetTextI18n');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="SetTextI18nCardLink" onclick="hideid('SetTextI18nCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="HardcodedText"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="HardcodedTextCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Hardcoded text</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:19</span>: <span class="message">Hardcoded string "更新提示", should use <code>@string</code> resource</span><br /><pre class="errorlines">
|
<span class="lineno"> 16 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 17 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"10dp"</span>
|
<span class="lineno"> 18 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"center"</span>
|
<span class="caretline"><span class="lineno"> 19 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"更新提示"</span></span> </span>
|
<span class="lineno"> 20 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span>
|
<span class="lineno"> 21 </span> <span class="prefix">android:</span><span class="attribute">textSize</span>=<span class="value">"20sp"</span> />
|
<span class="lineno"> 22 </span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:42</span>: <span class="message">Hardcoded string "版本:2.1", should use <code>@string</code> resource</span><br /><pre class="errorlines">
|
<span class="lineno"> 39 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"8dp"</span>
|
<span class="lineno"> 40 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 41 </span> <span class="prefix">android:</span><span class="attribute">paddingLeft</span>=<span class="value">"25dp"</span>
|
<span class="caretline"><span class="lineno"> 42 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"版本:2.1"</span></span> </span>
|
<span class="lineno"> 43 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span> />
|
<span class="lineno"> 44 </span>
|
<span class="lineno"> 45 </span> <span class="tag"><TextView</span><span class="attribute">
|
</span></pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:53</span>: <span class="message">Hardcoded string "大小:21M", should use <code>@string</code> resource</span><br /><pre class="errorlines">
|
<span class="lineno"> 50 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 51 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"right"</span>
|
<span class="lineno"> 52 </span> <span class="prefix">android:</span><span class="attribute">paddingRight</span>=<span class="value">"25dp"</span>
|
<span class="caretline"><span class="lineno"> 53 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"大小:21M"</span></span> </span>
|
<span class="lineno"> 54 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span> />
|
<span class="lineno"> 55 </span> <span class="tag"></LinearLayout></span>
|
<span class="lineno"> 56 </span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:65</span>: <span class="message">Hardcoded string "更新提示", should use <code>@string</code> resource</span><br /><pre class="errorlines">
|
<span class="lineno"> 62 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"left"</span>
|
<span class="lineno"> 63 </span> <span class="prefix">android:</span><span class="attribute">paddingLeft</span>=<span class="value">"25dp"</span>
|
<span class="lineno"> 64 </span> <span class="prefix">android:</span><span class="attribute">paddingRight</span>=<span class="value">"25dp"</span>
|
<span class="caretline"><span class="lineno"> 65 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"更新提示"</span></span> </span>
|
<span class="lineno"> 66 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span>
|
<span class="lineno"> 67 </span> <span class="prefix">android:</span><span class="attribute">textSize</span>=<span class="value">"16sp"</span> />
|
<span class="lineno"> 68 </span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:103</span>: <span class="message">Hardcoded string "取消", should use <code>@string</code> resource</span><br /><pre class="errorlines">
|
<span class="lineno"> 100 </span> <span class="prefix">android:</span><span class="attribute">background</span>=<span class="value">"@drawable/shape_update_left"</span>
|
<span class="lineno"> 101 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"center"</span>
|
<span class="lineno"> 102 </span> <span class="prefix">android:</span><span class="attribute">padding</span>=<span class="value">"5dp"</span>
|
<span class="caretline"><span class="lineno"> 103 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"取消"</span></span> </span>
|
<span class="lineno"> 104 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span>
|
<span class="lineno"> 105 </span> <span class="prefix">android:</span><span class="attribute">textSize</span>=<span class="value">"18sp"</span> />
|
<span class="lineno"> 106 </span> <span class="tag"></FrameLayout></span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:124</span>: <span class="message">Hardcoded string "立即更新", should use <code>@string</code> resource</span><br /><pre class="errorlines">
|
<span class="lineno"> 121 </span> <span class="prefix">android:</span><span class="attribute">background</span>=<span class="value">"@drawable/shape_update_right"</span>
|
<span class="lineno"> 122 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"center"</span>
|
<span class="lineno"> 123 </span> <span class="prefix">android:</span><span class="attribute">padding</span>=<span class="value">"5dp"</span>
|
<span class="caretline"><span class="lineno"> 124 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"立即更新"</span></span> </span>
|
<span class="lineno"> 125 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span>
|
<span class="lineno"> 126 </span> <span class="prefix">android:</span><span class="attribute">textSize</span>=<span class="value">"18sp"</span> />
|
<span class="lineno"> 127 </span> <span class="tag"></FrameLayout></span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/notify_item.xml">../../res/layout/notify_item.xml</a>:29</span>: <span class="message">Hardcoded string "插件下载", should use <code>@string</code> resource</span><br /><pre class="errorlines">
|
<span class="lineno"> 26 </span> <span class="prefix">android:</span><span class="attribute">layout_marginLeft</span>=<span class="value">"15dp"</span>
|
<span class="lineno"> 27 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 28 </span> <span class="prefix">android:</span><span class="attribute">textSize</span>=<span class="value">"18sp"</span>
|
<span class="caretline"><span class="lineno"> 29 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"插件下载"</span></span> </span>
|
<span class="lineno"> 30 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"@color/gray1"</span> />
|
<span class="lineno"> 31 </span>
|
<span class="lineno"> 32 </span> <span class="tag"><TextView</span><span class="attribute">
|
</span></pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationHardcodedText" style="display: none;">
|
Hardcoding text attributes directly in layout files is bad for several reasons:<br/>
|
<br/>
|
* When creating configuration variations (for example for landscape or portrait) you have to repeat the actual text (and keep it up to date when making changes)<br/>
|
<br/>
|
* The application cannot be translated to other languages by just adding new translations for existing string resources.<br/>
|
<br/>
|
There are quickfixes to automatically extract this hardcoded string into a resource lookup.<br/>To suppress this error, use the issue id "HardcodedText" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">HardcodedText</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Internationalization</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 5/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationHardcodedTextLink" onclick="reveal('explanationHardcodedText');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="HardcodedTextCardLink" onclick="hideid('HardcodedTextCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="Internationalization:Bidirectional Text"></a>
|
<a name="RtlSymmetry"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="RtlSymmetryCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Padding and margin symmetry</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:41</span>: <span class="message">When you define <code>paddingLeft</code> you should probably also define <code>paddingRight</code> for right-to-left symmetry</span><br /><pre class="errorlines">
|
<span class="lineno"> 38 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 39 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"8dp"</span>
|
<span class="lineno"> 40 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="caretline"><span class="lineno"> 41 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">paddingLeft</span></span>=<span class="value">"25dp"</span> </span>
|
<span class="lineno"> 42 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"版本:2.1"</span>
|
<span class="lineno"> 43 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span> />
|
<span class="lineno"> 44 </span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:52</span>: <span class="message">When you define <code>paddingRight</code> you should probably also define <code>paddingLeft</code> for right-to-left symmetry</span><br /><pre class="errorlines">
|
<span class="lineno"> 49 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"8dp"</span>
|
<span class="lineno"> 50 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 51 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"right"</span>
|
<span class="caretline"><span class="lineno"> 52 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">paddingRight</span></span>=<span class="value">"25dp"</span> </span>
|
<span class="lineno"> 53 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"大小:21M"</span>
|
<span class="lineno"> 54 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span> />
|
<span class="lineno"> 55 </span> <span class="tag"></LinearLayout></span>
|
</pre>
|
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationRtlSymmetry" style="display: none;">
|
If you specify padding or margin on the left side of a layout, you should probably also specify padding on the right side (and vice versa) for right-to-left layout symmetry.<br/>To suppress this error, use the issue id "RtlSymmetry" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">RtlSymmetry</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Bidirectional Text</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Internationalization</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 6/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationRtlSymmetryLink" onclick="reveal('explanationRtlSymmetry');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="RtlSymmetryCardLink" onclick="hideid('RtlSymmetryCard');">
|
Dismiss</button> </div>
|
</div>
|
</section><a name="RtlHardcoded"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="RtlHardcodedCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Using left/right instead of start/end attributes</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
<div class="issue">
|
<div class="warningslist">
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:41</span>: <span class="message">Consider adding <code>android:paddingStart="25dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 38 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 39 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"8dp"</span>
|
<span class="lineno"> 40 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="caretline"><span class="lineno"> 41 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">paddingLeft</span></span>=<span class="value">"25dp"</span> </span>
|
<span class="lineno"> 42 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"版本:2.1"</span>
|
<span class="lineno"> 43 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span> />
|
<span class="lineno"> 44 </span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:51</span>: <span class="message">Use "<code>end</code>" instead of "<code>right</code>" to ensure correct behavior in right-to-left locales</span><br /><pre class="errorlines">
|
<span class="lineno"> 48 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 49 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"8dp"</span>
|
<span class="lineno"> 50 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="caretline"><span class="lineno"> 51 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"</span><span class="warning"><span class="value">right</span></span><span class="value">"</span> </span>
|
<span class="lineno"> 52 </span> <span class="prefix">android:</span><span class="attribute">paddingRight</span>=<span class="value">"25dp"</span>
|
<span class="lineno"> 53 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"大小:21M"</span>
|
<span class="lineno"> 54 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span> />
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:52</span>: <span class="message">Consider adding <code>android:paddingEnd="25dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 49 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"8dp"</span>
|
<span class="lineno"> 50 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 51 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"right"</span>
|
<span class="caretline"><span class="lineno"> 52 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">paddingRight</span></span>=<span class="value">"25dp"</span> </span>
|
<span class="lineno"> 53 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"大小:21M"</span>
|
<span class="lineno"> 54 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"#FFc9b5ac"</span> />
|
<span class="lineno"> 55 </span> <span class="tag"></LinearLayout></span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:62</span>: <span class="message">Use "<code>start</code>" instead of "<code>left</code>" to ensure correct behavior in right-to-left locales</span><br /><pre class="errorlines">
|
<span class="lineno"> 59 </span> <span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 60 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 61 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"15dp"</span>
|
<span class="caretline"><span class="lineno"> 62 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"</span><span class="warning"><span class="value">left</span></span><span class="value">"</span> </span>
|
<span class="lineno"> 63 </span> <span class="prefix">android:</span><span class="attribute">paddingLeft</span>=<span class="value">"25dp"</span>
|
<span class="lineno"> 64 </span> <span class="prefix">android:</span><span class="attribute">paddingRight</span>=<span class="value">"25dp"</span>
|
<span class="lineno"> 65 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"更新提示"</span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:74</span>: <span class="message">Use "<code>start</code>" instead of "<code>left</code>" to ensure correct behavior in right-to-left locales</span><br /><pre class="errorlines">
|
<span class="lineno"> 71 </span> <span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 72 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 73 </span> <span class="prefix">android:</span><span class="attribute">layout_marginTop</span>=<span class="value">"20dp"</span>
|
<span class="caretline"><span class="lineno"> 74 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"</span><span class="warning"><span class="value">left</span></span><span class="value">"</span> </span>
|
<span class="lineno"> 75 </span> <span class="prefix">android:</span><span class="attribute">paddingLeft</span>=<span class="value">"25dp"</span>
|
<span class="lineno"> 76 </span> <span class="prefix">android:</span><span class="attribute">paddingRight</span>=<span class="value">"25dp"</span>
|
<span class="lineno"> 77 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"@string/WIFI_NOTI"</span>
|
</pre>
|
|
<button class="mdl-button mdl-js-button mdl-button--primary" id="RtlHardcodedDivLink" onclick="reveal('RtlHardcodedDiv');" />+ 9 More Occurrences...</button>
|
<div id="RtlHardcodedDiv" style="display: none">
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:90</span>: <span class="message">Consider adding <code>android:layout_marginEnd="6dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 87 </span> <span class="tag"><FrameLayout</span><span class="attribute">
|
</span><span class="lineno"> 88 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"0dp"</span>
|
<span class="lineno"> 89 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"match_parent"</span>
|
<span class="caretline"><span class="lineno"> 90 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_marginRight</span></span>=<span class="value">"6dp"</span> </span>
|
<span class="lineno"> 91 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>>
|
<span class="lineno"> 92 </span>
|
<span class="lineno"> 93 </span> <span class="tag"><TextView</span><span class="attribute">
|
</span></pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:97</span>: <span class="message">Use "<code>end</code>" instead of "<code>right</code>" to ensure correct behavior in right-to-left locales</span><br /><pre class="errorlines">
|
<span class="lineno"> 94 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">id</span>=<span class="value">"@+id/tv_no_update"</span>
|
<span class="lineno"> 95 </span> <span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 96 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="caretline"><span class="lineno"> 97 </span> <span class="prefix">android:</span><span class="attribute">layout_gravity</span>=<span class="value">"</span><span class="warning"><span class="value">bottom|right</span></span><span class="value">"</span> </span>
|
<span class="lineno"> 98 </span> <span class="prefix">android:</span><span class="attribute">layout_marginBottom</span>=<span class="value">"20dp"</span>
|
<span class="lineno"> 99 </span> <span class="prefix">android:</span><span class="attribute">layout_marginLeft</span>=<span class="value">"12dp"</span>
|
<span class="lineno"> 100 </span> <span class="prefix">android:</span><span class="attribute">background</span>=<span class="value">"@drawable/shape_update_left"</span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:99</span>: <span class="message">Consider adding <code>android:layout_marginStart="12dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 96 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 97 </span> <span class="prefix">android:</span><span class="attribute">layout_gravity</span>=<span class="value">"bottom|right"</span>
|
<span class="lineno"> 98 </span> <span class="prefix">android:</span><span class="attribute">layout_marginBottom</span>=<span class="value">"20dp"</span>
|
<span class="caretline"><span class="lineno"> 99 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_marginLeft</span></span>=<span class="value">"12dp"</span> </span>
|
<span class="lineno"> 100 </span> <span class="prefix">android:</span><span class="attribute">background</span>=<span class="value">"@drawable/shape_update_left"</span>
|
<span class="lineno"> 101 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"center"</span>
|
<span class="lineno"> 102 </span> <span class="prefix">android:</span><span class="attribute">padding</span>=<span class="value">"5dp"</span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:111</span>: <span class="message">Consider adding <code>android:layout_marginStart="6dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 108 </span> <span class="tag"><FrameLayout</span><span class="attribute">
|
</span><span class="lineno"> 109 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"0dp"</span>
|
<span class="lineno"> 110 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"match_parent"</span>
|
<span class="caretline"><span class="lineno"> 111 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_marginLeft</span></span>=<span class="value">"6dp"</span> </span>
|
<span class="lineno"> 112 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>>
|
<span class="lineno"> 113 </span>
|
<span class="lineno"> 114 </span> <span class="tag"><TextView</span><span class="attribute">
|
</span></pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:118</span>: <span class="message">Use "<code>start</code>" instead of "<code>left</code>" to ensure correct behavior in right-to-left locales</span><br /><pre class="errorlines">
|
<span class="lineno"> 115 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">id</span>=<span class="value">"@+id/tv_atonce_update"</span>
|
<span class="lineno"> 116 </span> <span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"match_parent"</span>
|
<span class="lineno"> 117 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="caretline"><span class="lineno"> 118 </span> <span class="prefix">android:</span><span class="attribute">layout_gravity</span>=<span class="value">"</span><span class="warning"><span class="value">bottom|left</span></span><span class="value">"</span> </span>
|
<span class="lineno"> 119 </span> <span class="prefix">android:</span><span class="attribute">layout_marginBottom</span>=<span class="value">"20dp"</span>
|
<span class="lineno"> 120 </span> <span class="prefix">android:</span><span class="attribute">layout_marginRight</span>=<span class="value">"12dp"</span>
|
<span class="lineno"> 121 </span> <span class="prefix">android:</span><span class="attribute">background</span>=<span class="value">"@drawable/shape_update_right"</span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/custom_dialog.xml">../../res/layout/custom_dialog.xml</a>:120</span>: <span class="message">Consider adding <code>android:layout_marginEnd="12dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 117 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 118 </span> <span class="prefix">android:</span><span class="attribute">layout_gravity</span>=<span class="value">"bottom|left"</span>
|
<span class="lineno"> 119 </span> <span class="prefix">android:</span><span class="attribute">layout_marginBottom</span>=<span class="value">"20dp"</span>
|
<span class="caretline"><span class="lineno"> 120 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_marginRight</span></span>=<span class="value">"12dp"</span> </span>
|
<span class="lineno"> 121 </span> <span class="prefix">android:</span><span class="attribute">background</span>=<span class="value">"@drawable/shape_update_right"</span>
|
<span class="lineno"> 122 </span> <span class="prefix">android:</span><span class="attribute">gravity</span>=<span class="value">"center"</span>
|
<span class="lineno"> 123 </span> <span class="prefix">android:</span><span class="attribute">padding</span>=<span class="value">"5dp"</span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/notify_item.xml">../../res/layout/notify_item.xml</a>:13</span>: <span class="message">Consider adding <code>android:layout_marginStart="15dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 10 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 11 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 12 </span> <span class="prefix">android:</span><span class="attribute">layout_centerHorizontal</span>=<span class="value">"true"</span>
|
<span class="caretline"><span class="lineno"> 13 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_marginLeft</span></span>=<span class="value">"15dp"</span> </span>
|
<span class="lineno"> 14 </span> <span class="prefix">android:</span><span class="attribute">src</span>=<span class="value">"@drawable/ic_launcher"</span> />
|
<span class="lineno"> 15 </span>
|
<span class="lineno"> 16 </span> <span class="tag"><LinearLayout</span><span class="attribute">
|
</span></pre>
|
|
<span class="location"><a href="../../res/layout/notify_item.xml">../../res/layout/notify_item.xml</a>:26</span>: <span class="message">Consider adding <code>android:layout_marginStart="15dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 23 </span> <span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 24 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"0dp"</span>
|
<span class="lineno"> 25 </span> <span class="prefix">android:</span><span class="attribute">layout_centerHorizontal</span>=<span class="value">"true"</span>
|
<span class="caretline"><span class="lineno"> 26 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_marginLeft</span></span>=<span class="value">"15dp"</span> </span>
|
<span class="lineno"> 27 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 28 </span> <span class="prefix">android:</span><span class="attribute">textSize</span>=<span class="value">"18sp"</span>
|
<span class="lineno"> 29 </span> <span class="prefix">android:</span><span class="attribute">text</span>=<span class="value">"插件下载"</span>
|
</pre>
|
|
<span class="location"><a href="../../res/layout/notify_item.xml">../../res/layout/notify_item.xml</a>:36</span>: <span class="message">Consider adding <code>android:layout_marginStart="15dp"</code> to better support right-to-left layouts</span><br /><pre class="errorlines">
|
<span class="lineno"> 33 </span><span class="attribute"> </span><span class="prefix">android:</span><span class="attribute">id</span>=<span class="value">"@+id/content_view_per"</span>
|
<span class="lineno"> 34 </span> <span class="prefix">android:</span><span class="attribute">layout_width</span>=<span class="value">"wrap_content"</span>
|
<span class="lineno"> 35 </span> <span class="prefix">android:</span><span class="attribute">layout_height</span>=<span class="value">"0dp"</span>
|
<span class="caretline"><span class="lineno"> 36 </span> <span class="warning"><span class="prefix">android:</span><span class="attribute">layout_marginLeft</span></span>=<span class="value">"15dp"</span> </span>
|
<span class="lineno"> 37 </span> <span class="prefix">android:</span><span class="attribute">layout_weight</span>=<span class="value">"1"</span>
|
<span class="lineno"> 38 </span> <span class="prefix">android:</span><span class="attribute">textColor</span>=<span class="value">"@color/gray1"</span> />
|
<span class="lineno"> 39 </span> <span class="tag"></LinearLayout></span>
|
</pre>
|
|
</div>
|
</div>
|
<div class="metadata"><div class="explanation" id="explanationRtlHardcoded" style="display: none;">
|
Using <code>Gravity#LEFT</code> and <code>Gravity#RIGHT</code> can lead to problems when a layout is rendered in locales where text flows from right to left. Use <code>Gravity#START</code> and <code>Gravity#END</code> instead. Similarly, in XML <code>gravity</code> and <code>layout_gravity</code> attributes, use <code>start</code> rather than <code>left</code>.<br/>
|
<br/>
|
For XML attributes such as paddingLeft and <code>layout_marginLeft</code>, use <code>paddingStart</code> and <code>layout_marginStart</code>. <b>NOTE</b>: If your <code>minSdkVersion</code> is less than 17, you should add <b>both</b> the older left/right attributes <b>as well as</b> the new start/right attributes. On older platforms, where RTL is not supported and the start/right attributes are unknown and therefore ignored, you need the older left/right attributes. There is a separate lint check which catches that type of error.<br/>
|
<br/>
|
(Note: For <code>Gravity#LEFT</code> and <code>Gravity#START</code>, you can use these constants even when targeting older platforms, because the <code>start</code> bitmask is a superset of the <code>left</code> bitmask. Therefore, you can use <code>gravity="start"</code> rather than <code>gravity="left|start"</code>.)<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "RtlHardcoded" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="chips">
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">RtlHardcoded</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Bidirectional Text</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Internationalization</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Warning</span>
|
</span>
|
<span class="mdl-chip">
|
<span class="mdl-chip__text">Priority 5/10</span>
|
</span>
|
</div>
|
</div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="explanationRtlHardcodedLink" onclick="reveal('explanationRtlHardcoded');">
|
Explain</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="RtlHardcodedCardLink" onclick="hideid('RtlHardcodedCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="MissingIssues"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="MissingIssuesCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Disabled Checks</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
One or more issues were not run by lint, either
|
because the check is not enabled by default, or because
|
it was disabled with a command line flag or via one or
|
more <code>lint.xml</code> configuration files in the project directories.
|
<div id="SuppressedIssues" style="display: none;"><br/><br/><div class="issue">
|
<div class="id">AppLinksAutoVerifyError<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Ensures that app links are correctly set and associated with website.<br/><div class="moreinfo">More info: <a href="https://g.co/appindexing/applinks">https://g.co/appindexing/applinks</a>
|
</div>To suppress this error, use the issue id "AppLinksAutoVerifyError" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">AppLinksAutoVerifyWarning<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Ensures that app links are correctly set and associated with website.<br/><div class="moreinfo">More info: <a href="https://g.co/appindexing/applinks">https://g.co/appindexing/applinks</a>
|
</div>To suppress this error, use the issue id "AppLinksAutoVerifyWarning" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">BackButton<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
According to the Android Design Guide,<br/>
|
<br/>
|
"Other platforms use an explicit back button with label to allow the user to navigate up the application's hierarchy. Instead, Android uses the main action bar's app icon for hierarchical navigation and the navigation bar's back button for temporal navigation."<br/>
|
This check is not very sophisticated (it just looks for buttons with the label "Back"), so it is disabled by default to not trigger on common scenarios like pairs of Back/Next buttons to paginate through screens.<br/><div class="moreinfo">More info: <a href="http://developer.android.com/design/patterns/pure-android.html">http://developer.android.com/design/patterns/pure-android.html</a>
|
</div>To suppress this error, use the issue id "BackButton" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">ConvertToWebp<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
The WebP format is typically more compact than PNG and JPEG. As of Android 4.2.1 it supports transparency and lossless conversion as well. Note that there is a quickfix in the IDE which lets you perform conversion.<br/>
|
<br/>
|
Launcher icons must be in the PNG format.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "ConvertToWebp" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">DalvikOverride<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
The Dalvik virtual machine will treat a package private method in one class as overriding a package private method in its super class, even if they are in separate packages.<br/>
|
<br/>
|
If you really did intend for this method to override the other, make the method <code>protected</code> instead.<br/>
|
<br/>
|
If you did <b>not</b> intend the override, consider making the method private, or changing its name or signature.<br/>
|
<br/>
|
Note that this check is disabled be default, because ART (the successor to Dalvik) no longer has this behavior.<br/>To suppress this error, use the issue id "DalvikOverride" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">DuplicateStrings<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Duplicate strings can make applications larger unnecessarily.<br/>
|
<br/>
|
This lint check looks for duplicate strings, including differences for strings where the only difference is in capitalization. Title casing and all uppercase can all be adjusted in the layout or in code.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType">https://developer.android.com/reference/android/widget/TextView.html#attr_android:inputType</a>
|
</div>To suppress this error, use the issue id "DuplicateStrings" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">EasterEgg<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
An "easter egg" is code deliberately hidden in the code, both from potential users and even from other developers. This lint check looks for code which looks like it may be hidden from sight.<br/>To suppress this error, use the issue id "EasterEgg" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">FieldGetter<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Accessing a field within the class that defines a getter for that field is at least 3 times faster than calling the getter. For simple getters that do nothing other than return the field, you might want to just reference the local field directly instead.<br/>
|
<br/>
|
<b>NOTE</b>: As of Android 2.3 (Gingerbread), this optimization is performed automatically by Dalvik, so there is no need to change your code; this is only relevant if you are targeting older versions of Android.<br/><div class="moreinfo">More info: <a href="http://developer.android.com/guide/practices/design/performance.html#internal_get_set">http://developer.android.com/guide/practices/design/performance.html#internal_get_set</a>
|
</div>To suppress this error, use the issue id "FieldGetter" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">GoogleAppIndexingApiWarning<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search.<br/><div class="moreinfo">More info: <a href="https://g.co/AppIndexing/AndroidStudio">https://g.co/AppIndexing/AndroidStudio</a>
|
</div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "GoogleAppIndexingApiWarning" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">IconExpectedSize<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
There are predefined sizes (for each density) for launcher icons. You should follow these conventions to make sure your icons fit in with the overall look of the platform.<br/><div class="moreinfo">More info: <a href="http://developer.android.com/design/style/iconography.html">http://developer.android.com/design/style/iconography.html</a>
|
</div>To suppress this error, use the issue id "IconExpectedSize" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">KotlinPropertyAccess<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
For a method to be represented as a property in Kotlin, strict “bean”-style prefixing must be used.<br/>
|
<br/>
|
Accessor methods require a ‘get’ prefix or for boolean-returning methods an ‘is’ prefix can be used.<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#property-prefixes">https://android.github.io/kotlin-guides/interop.html#property-prefixes</a>
|
</div>To suppress this error, use the issue id "KotlinPropertyAccess" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">LambdaLast<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
To improve calling this code from Kotlin,<br/>
|
parameter types eligible for SAM conversion should be last.<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#lambda-parameters-last">https://android.github.io/kotlin-guides/interop.html#lambda-parameters-last</a>
|
</div>To suppress this error, use the issue id "LambdaLast" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">LogConditional<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
The BuildConfig class (available in Tools 17) provides a constant, "DEBUG", which indicates whether the code is being built in release mode or in debug mode. In release mode, you typically want to strip out all the logging calls. Since the compiler will automatically remove all code which is inside a "if (false)" check, surrounding your logging calls with a check for BuildConfig.DEBUG is a good idea.<br/>
|
<br/>
|
If you <b>really</b> intend for the logging to be present in release mode, you can suppress this warning with a @SuppressLint annotation for the intentional logging calls.<br/>To suppress this error, use the issue id "LogConditional" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">MangledCRLF<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
On Windows, line endings are typically recorded as carriage return plus newline: \r\n.<br/>
|
<br/>
|
This detector looks for invalid line endings with repeated carriage return characters (without newlines). Previous versions of the ADT plugin could accidentally introduce these into the file, and when editing the file, the editor could produce confusing visual artifacts.<br/><div class="moreinfo">More info: <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421">https://bugs.eclipse.org/bugs/show_bug.cgi?id=375421</a>
|
</div>To suppress this error, use the issue id "MangledCRLF" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">MinSdkTooLow<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
The value of the <code>minSdkVersion</code> property is too low and can be incremented without noticeably reducing the number of supported devices.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "MinSdkTooLow" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">MissingRegistered<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
If a class is referenced in the manifest or in a layout file, it must also exist in the project (or in one of the libraries included by the project. This check helps uncover typos in registration names, or attempts to rename or move classes without updating the manifest file properly.<br/><div class="moreinfo">More info: <a href="http://developer.android.com/guide/topics/manifest/manifest-intro.html">http://developer.android.com/guide/topics/manifest/manifest-intro.html</a>
|
</div>To suppress this error, use the issue id "MissingRegistered" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">NegativeMargin<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Margin values should be positive. Negative values are generally a sign that you are making assumptions about views surrounding the current one, or may be tempted to turn off child clipping to allow a view to escape its parent. Turning off child clipping to do this not only leads to poor graphical performance, it also results in wrong touch event handling since touch events are based strictly on a chain of parent-rect hit tests. Finally, making assumptions about the size of strings can lead to localization problems.<br/>To suppress this error, use the issue id "NegativeMargin" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">NewerVersionAvailable<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
This detector checks with a central repository to see if there are newer versions available for the dependencies used by this project. This is similar to the <code>GradleDependency</code> check, which checks for newer versions available in the Android SDK tools and libraries, but this works with any MavenCentral dependency, and connects to the library every time, which makes it more flexible but also <b>much</b> slower.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "NewerVersionAvailable" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">NoHardKeywords<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Do not use Kotlin’s hard keywords as the name of methods or fields.<br/>
|
These require the use of backticks to escape when calling from Kotlin.<br/>
|
Soft keywords, modifier keywords, and special identifiers are allowed.<br/>
|
<br/>
|
For example, Mockito’s <code>when</code> function requires backticks when used from Kotlin:<br/>
|
<br/>
|
val callable = Mockito.mock(Callable::class.java)<br/>
|
Mockito.`when`(callable.call()).thenReturn(/* … */)<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#no-hard-keywords">https://android.github.io/kotlin-guides/interop.html#no-hard-keywords</a>
|
</div>To suppress this error, use the issue id "NoHardKeywords" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">PermissionImpliesUnsupportedChromeOsHardware<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
The <code><uses-permission></code> element should not require a permission that implies an unsupported Chrome OS hardware feature. Google Play assumes that certain hardware related permissions indicate that the underlying hardware features are required by default. To fix the issue, consider declaring the corresponding uses-feature element with <code>required="false"</code> attribute.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/topic/arc/manifest.html#implied-features">https://developer.android.com/topic/arc/manifest.html#implied-features</a>
|
</div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "PermissionImpliesUnsupportedChromeOsHardware" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">Registered<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Activities, services and content providers should be registered in the <code>AndroidManifest.xml</code> file using <code><activity></code>, <code><service></code> and <code><provider></code> tags.<br/>
|
<br/>
|
If your activity is simply a parent class intended to be subclassed by other "real" activities, make it an abstract class.<br/><div class="moreinfo">More info: <a href="http://developer.android.com/guide/topics/manifest/manifest-intro.html">http://developer.android.com/guide/topics/manifest/manifest-intro.html</a>
|
</div>To suppress this error, use the issue id "Registered" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">RequiredSize<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
All views must specify an explicit <code>layout_width</code> and <code>layout_height</code> attribute. There is a runtime check for this, so if you fail to specify a size, an exception is thrown at runtime.<br/>
|
<br/>
|
It's possible to specify these widths via styles as well. GridLayout, as a special case, does not require you to specify a size.<br/>To suppress this error, use the issue id "RequiredSize" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">SelectableText<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
If a <code><TextView></code> is used to display data, the user might want to copy that data and paste it elsewhere. To allow this, the <code><TextView></code> should specify <code>android:textIsSelectable="true"</code>.<br/>
|
<br/>
|
This lint check looks for TextViews which are likely to be displaying data: views whose text is set dynamically. This value will be ignored on platforms older than API 11, so it is okay to set it regardless of your <code>minSdkVersion</code>.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "SelectableText" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">StopShip<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Using the comment <code>// STOPSHIP</code> can be used to flag code that is incomplete but checked in. This comment marker can be used to indicate that the code should not be shipped until the issue is addressed, and lint will look for these. In Gradle projects, this is only checked for non-debug (release) builds.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "StopShip" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">SyntheticAccessor<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
A private inner class which is accessed from the outer class will force the compiler to insert a synthetic accessor; this means that you are causing extra overhead. This is not important in small projects, but is important for large apps running up against the 64K method handle limit, and especially for <b>libraries</b> where you want to make sure your library is as small as possible for the cases where your library is used in an app running up against the 64K limit.<br/>To suppress this error, use the issue id "SyntheticAccessor" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">TypographyQuotes<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Straight single quotes and double quotes, when used as a pair, can be replaced by "curvy quotes" (or directional quotes). This can make the text more readable.<br/>
|
<br/>
|
Note that you should never use grave accents and apostrophes to quote, `like this'.<br/>
|
<br/>
|
(Also note that you should not use curvy quotes for code fragments.)<br/><div class="moreinfo">More info: <a href="http://en.wikipedia.org/wiki/Quotation_mark">http://en.wikipedia.org/wiki/Quotation_mark</a>
|
</div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "TypographyQuotes" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">UnknownNullness<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
To improve referencing this code from Kotlin, consider adding<br/>
|
explicit nullness information here with either <code>@NonNull</code> or <code>@Nullable</code>.<br/>
|
<br/>
|
You can set the environment variable<br/>
|
<code>ANDROID_LINT_NULLNESS_IGNORE_DEPRECATED=true</code><br/>
|
if you want lint to ignore classes and members that have been annotated with<br/>
|
<code>@Deprecated</code>.<br/><div class="moreinfo">More info: <a href="https://android.github.io/kotlin-guides/interop.html#nullability-annotations">https://android.github.io/kotlin-guides/interop.html#nullability-annotations</a>
|
</div>To suppress this error, use the issue id "UnknownNullness" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">UnpackedNativeCode<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
This app loads native libraries using <code>System.loadLibrary()</code>.<br/>
|
<br/>
|
Consider adding <code>android:extractNativeLibs="false"</code> to the <code><application></code> tag in AndroidManifest.xml. Starting with Android 6.0, this will make installation faster, the app will take up less space on the device and updates will have smaller download sizes.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "UnpackedNativeCode" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">UnsupportedChromeOsHardware<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
The <code><uses-feature></code> element should not require this unsupported Chrome OS hardware feature. Any uses-feature not explicitly marked with <code>required="false"</code> is necessary on the device to be installed on. Ensure that any features that might prevent it from being installed on a Chrome OS device are reviewed and marked as not required in the manifest.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/topic/arc/manifest.html#incompat-entries">https://developer.android.com/topic/arc/manifest.html#incompat-entries</a>
|
</div>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "UnsupportedChromeOsHardware" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">UnusedIds<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
This resource id definition appears not to be needed since it is not referenced from anywhere. Having id definitions, even if unused, is not necessarily a bad idea since they make working on layouts and menus easier, so there is not a strong reason to delete these.<br/>
|
<br/>
|
The unused resource check can ignore tests. If you want to include resources that are only referenced from tests, consider packaging them in a test source set instead.<br/>
|
<br/>
|
You can include test sources in the unused resource check by setting the system property lint.unused-resources.include-tests=true, and to exclude them (usually for performance reasons), use lint.unused-resources.exclude-tests=true.<br/>Note: This issue has an associated quickfix operation in Android Studio and IntelliJ IDEA.<br>
|
To suppress this error, use the issue id "UnusedIds" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
<div class="issue">
|
<div class="id">WrongThreadInterprocedural<div class="issueSeparator"></div>
|
</div>
|
<div class="metadata">Disabled By: Default<br/>
|
<div class="explanation">
|
Searches for interprocedural call paths that violate thread annotations in the program. Tracks the flow of instantiated types and lambda expressions to increase accuracy across method boundaries.<br/><div class="moreinfo">More info: <a href="https://developer.android.com/guide/components/processes-and-threads.html#Threads">https://developer.android.com/guide/components/processes-and-threads.html#Threads</a>
|
</div>To suppress this error, use the issue id "WrongThreadInterprocedural" as explained in the <a href="#SuppressInfo">Suppressing Warnings and Errors</a> section.<br/>
|
<br/></div>
|
</div>
|
</div>
|
</div> </div>
|
<div class="mdl-card__actions mdl-card--border">
|
<button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="SuppressedIssuesLink" onclick="reveal('SuppressedIssues');">
|
List Missing Issues</button><button class="mdl-button mdl-js-button mdl-js-ripple-effect" id="MissingIssuesCardLink" onclick="hideid('MissingIssuesCard');">
|
Dismiss</button> </div>
|
</div>
|
</section>
|
<a name="SuppressInfo"></a>
|
<section class="section--center mdl-grid mdl-grid--no-spacing mdl-shadow--2dp" id="SuppressCard" style="display: block;">
|
<div class="mdl-card mdl-cell mdl-cell--12-col">
|
<div class="mdl-card__title">
|
<h2 class="mdl-card__title-text">Suppressing Warnings and Errors</h2>
|
</div>
|
<div class="mdl-card__supporting-text">
|
Lint errors can be suppressed in a variety of ways:<br/>
|
<br/>
|
1. With a <code>@SuppressLint</code> annotation in the Java code<br/>
|
2. With a <code>tools:ignore</code> attribute in the XML file<br/>
|
3. With a //noinspection comment in the source code<br/>
|
4. With ignore flags specified in the <code>build.gradle</code> file, as explained below<br/>
|
5. With a <code>lint.xml</code> configuration file in the project<br/>
|
6. With a <code>lint.xml</code> configuration file passed to lint via the --config flag<br/>
|
7. With the --ignore flag passed to lint.<br/>
|
<br/>
|
To suppress a lint warning with an annotation, add a <code>@SuppressLint("id")</code> annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as <code>"UnusedResources"</code> or <code>{"UnusedResources","UnusedIds"}</code>, or it can be <code>"all"</code> to suppress all lint warnings in the given scope.<br/>
|
<br/>
|
To suppress a lint warning with a comment, add a <code>//noinspection id</code> comment on the line before the statement with the error.<br/>
|
<br/>
|
To suppress a lint warning in an XML file, add a <code>tools:ignore="id"</code> attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the <code>xmlns:android</code> declaration:<br/>
|
<code>xmlns:tools="http://schemas.android.com/tools"</code><br/>
|
<br/>
|
To suppress a lint warning in a <code>build.gradle</code> file, add a section like this:<br/>
|
<br/>
|
android {<br/>
|
lintOptions {<br/>
|
disable 'TypographyFractions','TypographyQuotes'<br/>
|
}<br/>
|
}<br/>
|
<br/>
|
Here we specify a comma separated list of issue id's after the disable command. You can also use <code>warning</code> or <code>error</code> instead of <code>disable</code> to change the severity of issues.<br/>
|
<br/>
|
To suppress lint warnings with a configuration XML file, create a file named <code>lint.xml</code> and place it at the root directory of the module in which it applies.<br/>
|
<br/>
|
The format of the <code>lint.xml</code> file is something like the following:<br/>
|
<br/>
|
<?xml version="1.0" encoding="UTF-8"?><br/>
|
<lint><br/>
|
<!-- Ignore everything in the test source set --><br/>
|
<issue id="all"><br/>
|
<ignore path="*/test/*" /><br/>
|
</issue><br/>
|
<br/>
|
<!-- Disable this given check in this project --><br/>
|
<issue id="IconMissingDensityFolder" severity="ignore" /><br/>
|
<br/>
|
<!-- Ignore the ObsoleteLayoutParam issue in the given files --><br/>
|
<issue id="ObsoleteLayoutParam"><br/>
|
<ignore path="res/layout/activation.xml" /><br/>
|
<ignore path="res/layout-xlarge/activation.xml" /><br/>
|
<ignore regexp="(foo|bar).java" /><br/>
|
</issue><br/>
|
<br/>
|
<!-- Ignore the UselessLeaf issue in the given file --><br/>
|
<issue id="UselessLeaf"><br/>
|
<ignore path="res/layout/main.xml" /><br/>
|
</issue><br/>
|
<br/>
|
<!-- Change the severity of hardcoded strings to "error" --><br/>
|
<issue id="HardcodedText" severity="error" /><br/>
|
</lint><br/>
|
<br/>
|
To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:<br/>
|
<code>$ lint --ignore UnusedResources,UselessLeaf /my/project/path</code><br/>
|
<br/>
|
For more information, see <a href="http://g.co/androidstudio/suppressing-lint-warnings">http://g.co/androidstudio/suppressing-lint-warnings</a><br/>
|
|
</div>
|
</div>
|
</section> </div>
|
</main>
|
</div>
|
</body>
|
</html>
|