More lint fixes

This commit is contained in:
Philip Whitehouse 2016-03-10 03:56:17 +00:00
parent 59cfc8c462
commit 0f929514ff
9 changed files with 19 additions and 15 deletions

View file

@ -154,7 +154,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
if (mUnreadMessageCount == 0) {
mActionBarUnread.setVisibility(View.GONE);
} else {
mActionBarUnread.setText(Integer.toString(mUnreadMessageCount));
mActionBarUnread.setText(String.format("%d", mUnreadMessageCount));
mActionBarUnread.setVisibility(View.VISIBLE);
}
@ -1786,10 +1786,10 @@ public class Accounts extends K9ListActivity implements OnItemClickListener {
Integer unreadMessageCount = null;
if (stats != null) {
unreadMessageCount = stats.unreadMessageCount;
holder.newMessageCount.setText(Integer.toString(unreadMessageCount));
holder.newMessageCount.setText(String.format("%d", unreadMessageCount));
holder.newMessageCountWrapper.setVisibility(unreadMessageCount > 0 ? View.VISIBLE : View.GONE);
holder.flaggedMessageCount.setText(Integer.toString(stats.flaggedMessageCount));
holder.flaggedMessageCount.setText(String.format("%d", stats.flaggedMessageCount));
holder.flaggedMessageCountWrapper.setVisibility(K9.messageListStars() && stats.flaggedMessageCount > 0 ? View.VISIBLE : View.GONE);
holder.flaggedMessageCountWrapper.setOnClickListener(createFlaggedSearchListener(account));

View file

@ -109,7 +109,7 @@ public class FolderList extends K9ListActivity {
if (mUnreadMessageCount == 0) {
mActionBarUnread.setVisibility(View.GONE);
} else {
mActionBarUnread.setText(Integer.toString(mUnreadMessageCount));
mActionBarUnread.setText(String.format("%d", mUnreadMessageCount));
mActionBarUnread.setVisibility(View.VISIBLE);
}
@ -1044,7 +1044,7 @@ public class FolderList extends K9ListActivity {
}
}
if (folder.unreadMessageCount > 0) {
holder.newMessageCount.setText(Integer.toString(folder.unreadMessageCount));
holder.newMessageCount.setText(String.format("%d", folder.unreadMessageCount));
holder.newMessageCountWrapper.setOnClickListener(
createUnreadSearch(mAccount, folder));
holder.newMessageCountWrapper.setVisibility(View.VISIBLE);
@ -1066,7 +1066,7 @@ public class FolderList extends K9ListActivity {
}
if (K9.messageListStars() && folder.flaggedMessageCount > 0) {
holder.flaggedMessageCount.setText(Integer.toString(folder.flaggedMessageCount));
holder.flaggedMessageCount.setText(String.format("%d", folder.flaggedMessageCount));
holder.flaggedMessageCountWrapper.setOnClickListener(
createFlaggedSearch(mAccount, folder));
holder.flaggedMessageCountWrapper.setVisibility(View.VISIBLE);

View file

@ -1150,7 +1150,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen
mActionBarUnread.setVisibility(View.GONE);
} else {
mActionBarUnread.setVisibility(View.VISIBLE);
mActionBarUnread.setText(Integer.toString(unread));
mActionBarUnread.setText(String.format("%d", unread));
}
}

View file

@ -276,7 +276,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener
}
if (settings.port != -1) {
mPortView.setText(Integer.toString(settings.port));
mPortView.setText(String.format("%d", settings.port));
} else {
updatePortFromSecurityType();
}

View file

@ -184,7 +184,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
}
if (settings.port != -1) {
mPortView.setText(Integer.toString(settings.port));
mPortView.setText(String.format("%d", settings.port));
} else {
updatePortFromSecurityType();
}

View file

@ -2018,7 +2018,7 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
// Thread count
if (threadCount > 1) {
holder.threadCount.setText(Integer.toString(threadCount));
holder.threadCount.setText(String.format("%d", threadCount));
holder.threadCount.setVisibility(View.VISIBLE);
} else {
holder.threadCount.setVisibility(View.GONE);

View file

@ -28,7 +28,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Not Encrypted"
android:text="@string/openpgp_result_not_encrypted"
android:layout_marginLeft="4dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" />
@ -51,7 +51,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Not signed"
android:text="@string/openpgp_result_no_signature"
android:layout_marginLeft="4dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp" />
@ -95,14 +95,14 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Alice" />
android:text="@string/example_signature_name" />
<TextView
android:id="@+id/result_signature_email"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="alice@example.com"
android:text="@string/example_signature_email"
android:gravity="center_vertical" />
</LinearLayout>
@ -113,7 +113,7 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show"
android:text="@string/openpgp_result_action_show"
android:drawablePadding="8dp"
android:gravity="center_vertical" />

View file

@ -1144,5 +1144,7 @@ Please submit bug reports, contribute new features and ask questions at
<string name="crypto_mode_private">Always Sign, Always Encrypt.</string>
<string name="error_crypto_provider_connect">Cannot connect to crypto provider, check your settings or click crypto icon to retry!</string>
<string name="error_crypto_provider_ui_required">Crypto provider access denied, click crypto icon to retry!</string>
<string name="example_signature_name">Alice</string>
<string name="example_signature_email">alice@example.com</string>
</resources>

View file

@ -86,6 +86,8 @@ public class PullToRefreshWebView2 extends PullToRefreshWebView {
WebView webView = super.createRefreshableView(context, attrs);
// Need to add JS Interface so we can get the response back
// TODO: Potiential security vulnerability in minSdkVersion < 17
// TODO: Missing annotation for API 17
mJsCallback = new JsValueCallback();
webView.addJavascriptInterface(mJsCallback, JS_INTERFACE_PKG);