1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Merge branch 'fix_lint_warnings'

Fix some lint warnings
This commit is contained in:
cketti 2014-04-07 20:41:20 +02:00
commit 95cc319101
23 changed files with 56 additions and 99 deletions

4
lint.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="MissingTranslation" severity="ignore" />
</lint>

View File

@ -15,9 +15,9 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
 <item android:state_window_focused="false" android:state_enabled="true"
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/btn_dialog_normal" />
 <item android:state_window_focused="false" android:state_enabled="false"
<item android:state_window_focused="false" android:state_enabled="false"
android:drawable="@drawable/btn_dialog_disable" />
<item android:state_pressed="true"
android:drawable="@drawable/btn_dialog_pressed" />

View File

@ -15,9 +15,9 @@
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
 <item android:state_window_focused="false" android:state_enabled="true"
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/btn_edit_normal" />
 <item android:state_window_focused="false" android:state_enabled="false"
<item android:state_window_focused="false" android:state_enabled="false"
android:drawable="@drawable/btn_edit_disable" />
<item android:state_pressed="true"
android:drawable="@drawable/btn_edit_pressed" />

View File

@ -29,7 +29,6 @@
android:id="@+id/account_password"
android:inputType="textPassword"
android:hint="@string/account_setup_basics_password_hint"
android:password="true"
android:singleLine="true"
android:layout_height="wrap_content"
android:layout_width="fill_parent"

View File

@ -37,7 +37,6 @@
android:textColor="?android:attr/textColorPrimary" />
<EditText
android:id="@+id/account_password"
android:password="true"
android:inputType="textPassword"
android:singleLine="true"
android:layout_height="wrap_content"
@ -138,7 +137,7 @@
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"
android:textStyle="bold"
android:layout_marginTop="4px" />
android:layout_marginTop="4dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/webdav_mailbox_alias_section"

View File

@ -96,7 +96,6 @@
android:textColor="?android:attr/textColorPrimary" />
<EditText
android:id="@+id/account_password"
android:password="true"
android:singleLine="true"
android:inputType="textPassword"
android:layout_height="wrap_content"

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="12dp"
android:paddingLeft="12dp"
android:gravity="center_vertical">
<ProgressBar android:layout_width="32dp"
android:layout_height="32dp"
android:layout_alignParentRight="true"
style="?android:attr/indeterminateProgressStyle" />
</RelativeLayout>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.fsck.k9"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
@ -12,4 +12,4 @@
app:pointer_size="48"
app:wheel_size="16" />
</FrameLayout>
</FrameLayout>

View File

@ -48,13 +48,13 @@
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:hint="@string/edit_identity_email_hint"
/>
android:inputType="textEmailAddress"/>
<TextView
android:text="@string/edit_identity_reply_to_label"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorPrimary"
android:textColor="?android:attr/textColorPrimary"
/>
<EditText
android:id="@+id/reply_to"
@ -62,6 +62,7 @@
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:hint="@string/edit_identity_reply_to_hint"
android:inputType="textEmailAddress"
/>
<!--
<TextView
@ -98,6 +99,6 @@
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:hint="@string/edit_identity_signature_hint"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>

View File

@ -235,10 +235,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:editable="false"
android:minLines="0"
android:autoText="true"
android:capitalize="sentences"
android:hint="@string/message_compose_signature_hint"
android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
android:textAppearance="?android:attr/textAppearanceMedium" />
@ -246,7 +243,7 @@
<Button
android:id="@+id/quoted_text_show"
android:text="@string/message_compose_show_quoted_text_action"
android:textSize="16dip"
android:textSize="16sp"
android:padding="0dip"
android:layout_gravity="right"
android:layout_height="wrap_content"
@ -265,8 +262,6 @@
android:layout_height="wrap_content"
android:gravity="top"
android:minLines="3"
android:autoText="true"
android:capitalize="sentences"
android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
android:textAppearance="?android:attr/textAppearanceMedium" />
@ -307,10 +302,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:editable="false"
android:minLines="0"
android:autoText="true"
android:capitalize="sentences"
android:hint="@string/message_compose_signature_hint"
android:inputType="textMultiLine|textAutoCorrect|textCapSentences"
android:textAppearance="?android:attr/textAppearanceMedium" />

View File

@ -62,7 +62,7 @@
android:layout_toRightOf="@+id/openpgp_signature_layout_image"
android:ellipsize="end"
android:paddingLeft="5dip"
android:text="User Id"
android:text="@string/openpgp_user_id"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:textColorPrimaryInverse" />
</RelativeLayout>
@ -88,4 +88,4 @@
android:padding="4dp"
android:visibility="gone" />
</com.fsck.k9.view.MessageOpenPgpView>
</com.fsck.k9.view.MessageOpenPgpView>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/UnreadWidgetContainer"
android:id="@+id/unread_widget_layout"
android:layout_width="match_parent"
@ -31,7 +32,8 @@
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:background="@drawable/unread_count_background"
android:textColor="#ffffff"/>
android:textColor="#ffffff"
tools:ignore="SpUsage"/>
</FrameLayout>

View File

@ -111,22 +111,22 @@
android:title="@string/refile_action">
<menu>
<item
android:id="@+id/archive"
android:id="@+id/refile_archive"
android:title="@string/archive_action"/>
<!-- MessageView -->
<item
android:id="@+id/spam"
android:id="@+id/refile_spam"
android:title="@string/spam_action"/>
<!-- MessageView -->
<item
android:id="@+id/move"
android:id="@+id/refile_move"
android:title="@string/move_action"/>
<!-- MessageView -->
<item
android:id="@+id/copy"
android:id="@+id/refile_copy"
android:title="@string/copy_action"/>
</menu>
</item>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="UnreadWidgetContainer">
<item name="android:paddingTop">2dp</item>
@ -11,7 +11,7 @@
</style>
<style name="UnreadWidgetTextView">
<item name="android:textSize">13dp</item>
<item name="android:textSize" tools:ignore="SpUsage">13dp</item>
<item name="android:background">@drawable/rounded_corners</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#000000</item>

View File

@ -559,26 +559,6 @@
<item>22</item>
</string-array>
<string-array name="font_entries_webview">
<item>@string/font_size_webview_smaller</item>
<item>@string/font_size_webview_small</item>
<item>@string/font_size_webview_normal</item>
<item>@string/font_size_webview_large</item>
<item>@string/font_size_webview_larger</item>
</string-array>
<!--
Be sure to also change FontSizes.getMessageViewContentAsInt() and
FontSizes.setMessageViewContent() if you change this.
-->
<string-array name="font_values_webview" translatable="false">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="idle_refresh_period_entries">
<item>@string/idle_refresh_period_1min</item>
<item>@string/idle_refresh_period_2min</item>

View File

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="button_minWidth">100sp</dimen>
<dimen name="colorpicker_onedp">1dp</dimen>
</resources>

View File

@ -172,7 +172,7 @@ Please submit bug reports, contribute new features and ask questions at
<string name="add_cc_bcc_action">Add Cc/Bcc</string>
<string name="read_receipt">Read receipt</string>
<string name="read_receipt_enabled">Will request read receipt</string>
<string name="read_receipt_disabled">Will not not request read receipt</string>
<string name="read_receipt_disabled">Will not request read receipt</string>
<string name="add_attachment_action">Add attachment</string>
<string name="add_attachment_action_image">Add attachment (Image)</string>
<string name="add_attachment_action_video">Add attachment (Video)</string>
@ -347,16 +347,6 @@ Please submit bug reports, contribute new features and ask questions at
<string name="global_settings_notification_quick_delete_always">Always</string>
<string name="global_settings_notification_quick_delete_description">Show a button in the notification that allows quick message deletion</string>
<string name="global_settings_batch_buttons">Batch buttons</string>
<string name="global_settings_batch_buttons_summary">Configure message list batch buttons</string>
<string name="global_settings_mark_read">Mark read/unread</string>
<string name="global_settings_delete">Delete</string>
<string name="global_settings_archive">Move to archive</string>
<string name="global_settings_archive_disabled_reason">No archive folders.</string>
<string name="global_settings_move">Move</string>
<string name="global_settings_flag">Flag</string>
<string name="global_settings_unselect">Unselect</string>
<string name="quiet_time">Quiet Time</string>
<string name="quiet_time_description">Disable ringing, buzzing and flashing at night</string>
<string name="quiet_time_starts">Quiet Time starts</string>
@ -762,12 +752,9 @@ Please submit bug reports, contribute new features and ask questions at
<string name="account_clear_dlg_title">Clear Account</string>
<string name="provider_note_yahoojp">Be sure to enable POP3 on the Yahoo mail settings page.</string>
<string name="provider_note_auonejp">Be sure to enable IMAP or POP3 on the au one mail settings page.</string>
<string name="provider_note_naver">Be sure to enable IMAP or POP3 on the Naver mail settings page.</string>
<string name="provider_note_hanmail">Be sure to enable IMAP or POP3 on the Hanmail(Daum) mail settings page.</string>
<string name="provider_note_paran">Be sure to enable IMAP or POP3 on the Paran mail settings page.</string>
<string name="provider_note_nate">Be sure to enable IMAP or POP3 on the Nate mail settings page.</string>
<string name="account_setup_failed_dlg_invalid_certificate_title">Unrecognized Certificate</string>
<string name="account_setup_failed_dlg_invalid_certificate_accept">Accept Key</string>
@ -1168,5 +1155,6 @@ Please submit bug reports, contribute new features and ask questions at
<string name="openpgp_successful_decryption_unknown_signature">Successful decryption but missing public key</string>
<string name="openpgp_get_key">Lookup missing key</string>
<string name="openpgp_error">OpenPGP Error:</string>
<string name="openpgp_user_id">User Id</string>
</resources>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Theme.K9Dialog" parent="@android:Theme.Light">
<item name="android:windowFrame">@null</item>
@ -32,7 +32,7 @@
</style>
<style name="UnreadWidgetTextView">
<item name="android:textSize">13dp</item>
<item name="android:textSize" tools:ignore="SpUsage">13dp</item>
<item name="android:background">@drawable/rounded_corners</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#000000</item>

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import android.content.Context;
import android.content.Intent;
@ -1161,12 +1162,13 @@ public class FolderList extends K9ListActivity {
mSearchTerm = searchTerm;
FilterResults results = new FilterResults();
Locale locale = Locale.getDefault();
if ((searchTerm == null) || (searchTerm.length() == 0)) {
ArrayList<FolderInfoHolder> list = new ArrayList<FolderInfoHolder>(mFolders);
results.values = list;
results.count = list.size();
} else {
final String searchTermString = searchTerm.toString().toLowerCase();
final String searchTermString = searchTerm.toString().toLowerCase(locale);
final String[] words = searchTermString.split(" ");
final int wordCount = words.length;
@ -1176,7 +1178,7 @@ public class FolderList extends K9ListActivity {
if (value.displayName == null) {
continue;
}
final String valueText = value.displayName.toLowerCase();
final String valueText = value.displayName.toLowerCase(locale);
for (int k = 0; k < wordCount; k++) {
if (valueText.contains(words[k])) {

View File

@ -2,6 +2,7 @@ package com.fsck.k9.activity;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import android.util.Log;
import android.widget.ArrayAdapter;
@ -59,12 +60,13 @@ public class FolderListFilter<T> extends Filter {
}
}
Locale locale = Locale.getDefault();
if ((searchTerm == null) || (searchTerm.length() == 0)) {
ArrayList<T> list = new ArrayList<T>(mOriginalValues);
results.values = list;
results.count = list.size();
} else {
final String searchTermString = searchTerm.toString().toLowerCase();
final String searchTermString = searchTerm.toString().toLowerCase(locale);
final String[] words = searchTermString.split(" ");
final int wordCount = words.length;
@ -73,7 +75,7 @@ public class FolderListFilter<T> extends Filter {
final ArrayList<T> newValues = new ArrayList<T>();
for (final T value : values) {
final String valueText = value.toString().toLowerCase();
final String valueText = value.toString().toLowerCase(locale);
for (int k = 0; k < wordCount; k++) {
if (valueText.contains(words[k])) {

View File

@ -1,6 +1,7 @@
package com.fsck.k9.activity;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.PendingIntent;
@ -2167,6 +2168,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
* @param mime_type
* The MIME type we want our attachment to have.
*/
@SuppressLint("InlinedApi")
private void onAddAttachment2(final String mime_type) {
if (mAccount.getCryptoProvider().isAvailable(this) || mAccount.getOpenPgpProvider() != null) {
Toast.makeText(this, R.string.attachment_encryption_unsupported, Toast.LENGTH_LONG).show();
@ -4230,7 +4232,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
* {@code \r\n} to {@code \n} and back again when setting and getting text.
*
*/
private static class EolConvertingEditText extends EditText {
public static class EolConvertingEditText extends EditText {
public EolConvertingEditText(Context context, AttributeSet attrs) {
super(context, attrs);

View File

@ -867,19 +867,23 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
mMessageViewFragment.onToggleRead();
return true;
}
case R.id.archive: {
case R.id.archive:
case R.id.refile_archive: {
mMessageViewFragment.onArchive();
return true;
}
case R.id.spam: {
case R.id.spam:
case R.id.refile_spam: {
mMessageViewFragment.onSpam();
return true;
}
case R.id.move: {
case R.id.move:
case R.id.refile_move: {
mMessageViewFragment.onMove();
return true;
}
case R.id.copy: {
case R.id.copy:
case R.id.refile_copy: {
mMessageViewFragment.onCopy();
return true;
}
@ -1035,14 +1039,12 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
/*
* Set visibility of copy, move, archive, spam in action bar and refile submenu
*/
Menu refileSubmenu = menu.findItem(R.id.refile).getSubMenu();
if (mMessageViewFragment.isCopyCapable()) {
menu.findItem(R.id.copy).setVisible(K9.isMessageViewCopyActionVisible());
refileSubmenu.findItem(R.id.copy).setVisible(true);
menu.findItem(R.id.refile_copy).setVisible(true);
} else {
menu.findItem(R.id.copy).setVisible(false);
refileSubmenu.findItem(R.id.copy).setVisible(false);
menu.findItem(R.id.refile_copy).setVisible(false);
}
if (mMessageViewFragment.isMoveCapable()) {
@ -1055,9 +1057,9 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
menu.findItem(R.id.spam).setVisible(canMessageBeMovedToSpam &&
K9.isMessageViewSpamActionVisible());
refileSubmenu.findItem(R.id.move).setVisible(true);
refileSubmenu.findItem(R.id.archive).setVisible(canMessageBeArchived);
refileSubmenu.findItem(R.id.spam).setVisible(canMessageBeMovedToSpam);
menu.findItem(R.id.refile_move).setVisible(true);
menu.findItem(R.id.refile_archive).setVisible(canMessageBeArchived);
menu.findItem(R.id.refile_spam).setVisible(canMessageBeMovedToSpam);
} else {
menu.findItem(R.id.move).setVisible(false);
menu.findItem(R.id.archive).setVisible(false);

View File

@ -143,7 +143,7 @@ public class FontSizeSettings extends K9PreferenceActivity {
}
);
mMessageViewContentSlider.getOnPreferenceChangeListener().onPreferenceChange(
mMessageViewContentSlider, new Float(mMessageViewContentSlider.getValue()));
mMessageViewContentSlider, mMessageViewContentSlider.getValue());
mMessageComposeInput = setupListPreference(
PREFERENCE_MESSAGE_COMPOSE_INPUT_FONT,