1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-11 12:05:06 -05:00

Merge branch 'master' of https://github.com/mnb20/k-9 into pull111

* 'master' of https://github.com/mnb20/k-9:
  High DPI version of archive button icon
  Fixed whitespace
  Remove TODO
  Replaced archive icon. Still a bit crap, but better than my previous attempt.
  Added batch buttons for Archive and Move. Made batch buttons configurable.
This commit is contained in:
Andrew Chen 2012-04-06 13:47:55 -07:00
commit 3e03120a73
9 changed files with 205 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -26,6 +26,20 @@
android:layout_weight="1" android:layout_weight="1"
android:src="@drawable/ic_button_delete" android:src="@drawable/ic_button_delete"
/> />
<ImageButton
android:id="@+id/batch_archive_button"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:src="@drawable/ic_button_archive"
/>
<ImageButton
android:id="@+id/batch_move_button"
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="1"
android:src="@drawable/ic_button_move"
/>
<ImageButton <ImageButton
android:id="@+id/batch_flag_button" android:id="@+id/batch_flag_button"
android:layout_width="0dip" android:layout_width="0dip"

View File

@ -361,6 +361,15 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
<string name="global_settings_privacy_mode_title">Lock-screen notifications</string> <string name="global_settings_privacy_mode_title">Lock-screen notifications</string>
<string name="global_settings_privacy_mode_summary">Don\'t display message subject in notification bar when system is locked</string> <string name="global_settings_privacy_mode_summary">Don\'t display message subject in notification bar when system is locked</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_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">Quiet Time</string>
<string name="quiet_time_description">Disable ringing, buzzing and flashing at night</string> <string name="quiet_time_description">Disable ringing, buzzing and flashing at night</string>
<string name="quiet_time_starts">Quiet Time starts</string> <string name="quiet_time_starts">Quiet Time starts</string>

View File

@ -157,6 +157,7 @@
android:dependency="messagelist_show_contact_name" android:dependency="messagelist_show_contact_name"
/> />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
@ -237,6 +238,50 @@
android:dialogTitle="@string/global_settings_confirm_actions_title" android:dialogTitle="@string/global_settings_confirm_actions_title"
android:positiveButtonText="@android:string/ok" android:positiveButtonText="@android:string/ok"
android:negativeButtonText="@android:string/cancel" /> android:negativeButtonText="@android:string/cancel" />
<PreferenceScreen
android:title="@string/global_settings_batch_buttons"
android:summary="@string/global_settings_batch_buttons_summary"
android:key="batch_buttons_settings">
<CheckBoxPreference
android:persistent="false"
android:key="batch_buttons_mark_read"
android:title="@string/global_settings_mark_read"
/>
<CheckBoxPreference
android:persistent="false"
android:key="batch_buttons_delete"
android:title="@string/global_settings_delete"
/>
<CheckBoxPreference
android:persistent="false"
android:key="batch_buttons_archive"
android:title="@string/global_settings_archive"
/>
<CheckBoxPreference
android:persistent="false"
android:key="batch_buttons_move"
android:title="@string/global_settings_move"
/>
<CheckBoxPreference
android:persistent="false"
android:key="batch_buttons_flag"
android:title="@string/global_settings_flag"
/>
<CheckBoxPreference
android:persistent="false"
android:key="batch_buttons_unselect"
android:title="@string/global_settings_unselect"
/>
</PreferenceScreen>
</PreferenceScreen> </PreferenceScreen>
<PreferenceScreen <PreferenceScreen

View File

@ -184,6 +184,12 @@ public class K9 extends Application {
private static boolean compactLayouts = false; private static boolean compactLayouts = false;
private static String mAttachmentDefaultPath = ""; private static String mAttachmentDefaultPath = "";
private static boolean mBatchButtonsMarkRead = true;
private static boolean mBatchButtonsDelete = true;
private static boolean mBatchButtonsArchive = false;
private static boolean mBatchButtonsMove = false;
private static boolean mBatchButtonsFlag = true;
private static boolean mBatchButtonsUnselect = true;
private static boolean useGalleryBugWorkaround = false; private static boolean useGalleryBugWorkaround = false;
private static boolean galleryBuggy; private static boolean galleryBuggy;
@ -436,6 +442,13 @@ public class K9 extends Application {
editor.putBoolean("messageViewReturnToList", mMessageViewReturnToList); editor.putBoolean("messageViewReturnToList", mMessageViewReturnToList);
editor.putBoolean("messageViewShowNext", mMessageViewShowNext); editor.putBoolean("messageViewShowNext", mMessageViewShowNext);
editor.putBoolean("batchButtonsMarkRead", mBatchButtonsMarkRead);
editor.putBoolean("batchButtonsDelete", mBatchButtonsDelete);
editor.putBoolean("batchButtonsArchive", mBatchButtonsArchive);
editor.putBoolean("batchButtonsMove", mBatchButtonsMove);
editor.putBoolean("batchButtonsFlag", mBatchButtonsFlag);
editor.putBoolean("batchButtonsUnselect", mBatchButtonsUnselect);
editor.putString("language", language); editor.putString("language", language);
editor.putInt("theme", theme); editor.putInt("theme", theme);
editor.putBoolean("useGalleryBugWorkaround", useGalleryBugWorkaround); editor.putBoolean("useGalleryBugWorkaround", useGalleryBugWorkaround);
@ -586,6 +599,13 @@ public class K9 extends Application {
mMessageViewReturnToList = sprefs.getBoolean("messageViewReturnToList", false); mMessageViewReturnToList = sprefs.getBoolean("messageViewReturnToList", false);
mMessageViewShowNext = sprefs.getBoolean("messageViewShowNext", false); mMessageViewShowNext = sprefs.getBoolean("messageViewShowNext", false);
mBatchButtonsMarkRead = sprefs.getBoolean("batchButtonsMarkRead", true);
mBatchButtonsDelete = sprefs.getBoolean("batchButtonsDelete", true);
mBatchButtonsArchive = sprefs.getBoolean("batchButtonsArchive", true);
mBatchButtonsMove = sprefs.getBoolean("batchButtonsMove", true);
mBatchButtonsFlag = sprefs.getBoolean("batchButtonsFlag", true);
mBatchButtonsUnselect = sprefs.getBoolean("batchButtonsUnselect", true);
useGalleryBugWorkaround = sprefs.getBoolean("useGalleryBugWorkaround", K9.isGalleryBuggy()); useGalleryBugWorkaround = sprefs.getBoolean("useGalleryBugWorkaround", K9.isGalleryBuggy());
mConfirmDelete = sprefs.getBoolean("confirmDelete", false); mConfirmDelete = sprefs.getBoolean("confirmDelete", false);
@ -1031,6 +1051,48 @@ public class K9 extends Application {
K9.compactLayouts = compactLayouts; K9.compactLayouts = compactLayouts;
} }
public static boolean batchButtonsMarkRead() {
return mBatchButtonsMarkRead;
}
public static void setBatchButtonsMarkRead(final boolean state) {
mBatchButtonsMarkRead = state;
}
public static boolean batchButtonsDelete() {
return mBatchButtonsDelete;
}
public static void setBatchButtonsDelete(final boolean state) {
mBatchButtonsDelete = state;
}
public static boolean batchButtonsArchive() {
return mBatchButtonsArchive;
}
public static void setBatchButtonsArchive(final boolean state) {
mBatchButtonsArchive = state;
}
public static boolean batchButtonsMove() {
return mBatchButtonsMove;
}
public static void setBatchButtonsMove(final boolean state) {
mBatchButtonsMove = state;
}
public static boolean batchButtonsFlag() {
return mBatchButtonsFlag;
}
public static void setBatchButtonsFlag(final boolean state) {
mBatchButtonsFlag = state;
}
public static boolean batchButtonsUnselect() {
return mBatchButtonsUnselect;
}
public static void setBatchButtonsUnselect(final boolean state) {
mBatchButtonsUnselect = state;
}
/** /**
* Check if this system contains a buggy Gallery 3D package. * Check if this system contains a buggy Gallery 3D package.
* *

View File

@ -305,6 +305,8 @@ public class MessageList
private ImageButton mBatchReadButton; private ImageButton mBatchReadButton;
private ImageButton mBatchDeleteButton; private ImageButton mBatchDeleteButton;
private ImageButton mBatchFlagButton; private ImageButton mBatchFlagButton;
private ImageButton mBatchArchiveButton;
private ImageButton mBatchMoveButton;
private ImageButton mBatchDoneButton; private ImageButton mBatchDoneButton;
private FontSizes mFontSizes = K9.getFontSizes(); private FontSizes mFontSizes = K9.getFontSizes();
@ -902,10 +904,20 @@ public class MessageList
mBatchDeleteButton.setOnClickListener(this); mBatchDeleteButton.setOnClickListener(this);
mBatchFlagButton = (ImageButton) findViewById(R.id.batch_flag_button); mBatchFlagButton = (ImageButton) findViewById(R.id.batch_flag_button);
mBatchFlagButton.setOnClickListener(this); mBatchFlagButton.setOnClickListener(this);
mBatchArchiveButton = (ImageButton) findViewById(R.id.batch_archive_button);
mBatchArchiveButton.setOnClickListener(this);
mBatchMoveButton = (ImageButton) findViewById(R.id.batch_move_button);
mBatchMoveButton.setOnClickListener(this);
mBatchDoneButton = (ImageButton) findViewById(R.id.batch_done_button); mBatchDoneButton = (ImageButton) findViewById(R.id.batch_done_button);
mBatchDoneButton.setOnClickListener(this); mBatchDoneButton.setOnClickListener(this);
mBatchReadButton.setVisibility(K9.batchButtonsMarkRead() ? View.VISIBLE : View.GONE);
mBatchDeleteButton.setVisibility(K9.batchButtonsDelete() ? View.VISIBLE : View.GONE);
mBatchArchiveButton.setVisibility(K9.batchButtonsArchive() ? View.VISIBLE : View.GONE);
mBatchMoveButton.setVisibility(K9.batchButtonsMove() ? View.VISIBLE : View.GONE);
mBatchFlagButton.setVisibility(K9.batchButtonsFlag() ? View.VISIBLE : View.GONE);
mBatchDoneButton.setVisibility(K9.batchButtonsUnselect() ? View.VISIBLE : View.GONE);
// Gesture detection // Gesture detection
gestureDetector = new GestureDetector(new MyGestureDetector(true)); gestureDetector = new GestureDetector(new MyGestureDetector(true));
gestureListener = new View.OnTouchListener() { gestureListener = new View.OnTouchListener() {
@ -2533,8 +2545,6 @@ public class MessageList
} }
}); });
} }
static class FooterViewHolder { static class FooterViewHolder {
@ -2594,6 +2604,18 @@ public class MessageList
newState = computeBatchDirection(false); newState = computeBatchDirection(false);
} }
if (v == mBatchArchiveButton) {
final List<MessageInfoHolder> selection = getSelectionFromCheckboxes();
onArchive(selection);
return;
}
if (v == mBatchMoveButton) {
final List<MessageInfoHolder> selection = getSelectionFromCheckboxes();
onMove(selection);
return;
}
synchronized (mAdapter.messages) { synchronized (mAdapter.messages) {
for (MessageInfoHolder holder : mAdapter.messages) { for (MessageInfoHolder holder : mAdapter.messages) {
if (holder.selected) { if (holder.selected) {

View File

@ -74,7 +74,12 @@ public class Prefs extends K9PreferenceActivity {
private static final String PREFERENCE_QUIET_TIME_ENABLED = "quiet_time_enabled"; private static final String PREFERENCE_QUIET_TIME_ENABLED = "quiet_time_enabled";
private static final String PREFERENCE_QUIET_TIME_STARTS = "quiet_time_starts"; private static final String PREFERENCE_QUIET_TIME_STARTS = "quiet_time_starts";
private static final String PREFERENCE_QUIET_TIME_ENDS = "quiet_time_ends"; private static final String PREFERENCE_QUIET_TIME_ENDS = "quiet_time_ends";
private static final String PREFERENCE_BATCH_BUTTONS_MARK_READ = "batch_buttons_mark_read";
private static final String PREFERENCE_BATCH_BUTTONS_DELETE = "batch_buttons_delete";
private static final String PREFERENCE_BATCH_BUTTONS_ARCHIVE = "batch_buttons_archive";
private static final String PREFERENCE_BATCH_BUTTONS_MOVE = "batch_buttons_move";
private static final String PREFERENCE_BATCH_BUTTONS_FLAG = "batch_buttons_flag";
private static final String PREFERENCE_BATCH_BUTTONS_UNSELECT = "batch_buttons_unselect";
private static final String PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT = "messageview_mobile_layout"; private static final String PREFERENCE_MESSAGEVIEW_MOBILE_LAYOUT = "messageview_mobile_layout";
private static final String PREFERENCE_BACKGROUND_OPS = "background_ops"; private static final String PREFERENCE_BACKGROUND_OPS = "background_ops";
@ -121,6 +126,12 @@ public class Prefs extends K9PreferenceActivity {
private com.fsck.k9.preferences.TimePickerPreference mQuietTimeEnds; private com.fsck.k9.preferences.TimePickerPreference mQuietTimeEnds;
private Preference mAttachmentPathPreference; private Preference mAttachmentPathPreference;
private CheckBoxPreference mBatchButtonsMarkRead;
private CheckBoxPreference mBatchButtonsDelete;
private CheckBoxPreference mBatchButtonsArchive;
private CheckBoxPreference mBatchButtonsMove;
private CheckBoxPreference mBatchButtonsFlag;
private CheckBoxPreference mBatchButtonsUnselect;
public static void actionPrefs(Context context) { public static void actionPrefs(Context context) {
Intent i = new Intent(context, Prefs.class); Intent i = new Intent(context, Prefs.class);
@ -342,6 +353,19 @@ public class Prefs extends K9PreferenceActivity {
} }
}; };
}); });
mBatchButtonsMarkRead = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_MARK_READ);
mBatchButtonsDelete = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_DELETE);
mBatchButtonsArchive = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_ARCHIVE);
mBatchButtonsMove = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_MOVE);
mBatchButtonsFlag = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_FLAG);
mBatchButtonsUnselect = (CheckBoxPreference)findPreference(PREFERENCE_BATCH_BUTTONS_UNSELECT);
mBatchButtonsMarkRead.setChecked(K9.batchButtonsMarkRead());
mBatchButtonsDelete.setChecked(K9.batchButtonsDelete());
mBatchButtonsArchive.setChecked(K9.batchButtonsArchive());
mBatchButtonsMove.setChecked(K9.batchButtonsMove());
mBatchButtonsFlag.setChecked(K9.batchButtonsFlag());
mBatchButtonsUnselect.setChecked(K9.batchButtonsUnselect());
} }
private void saveSettings() { private void saveSettings() {
@ -380,6 +404,12 @@ public class Prefs extends K9PreferenceActivity {
K9.setQuietTimeStarts(mQuietTimeStarts.getTime()); K9.setQuietTimeStarts(mQuietTimeStarts.getTime());
K9.setQuietTimeEnds(mQuietTimeEnds.getTime()); K9.setQuietTimeEnds(mQuietTimeEnds.getTime());
K9.setBatchButtonsMarkRead(mBatchButtonsMarkRead.isChecked());
K9.setBatchButtonsDelete(mBatchButtonsDelete.isChecked());
K9.setBatchButtonsArchive(mBatchButtonsArchive.isChecked());
K9.setBatchButtonsMove(mBatchButtonsMove.isChecked());
K9.setBatchButtonsFlag(mBatchButtonsFlag.isChecked());
K9.setBatchButtonsUnselect(mBatchButtonsUnselect.isChecked());
K9.setZoomControlsEnabled(mZoomControlsEnabled.isChecked()); K9.setZoomControlsEnabled(mZoomControlsEnabled.isChecked());
K9.setAttachmentDefaultPath(mAttachmentPathPreference.getSummary().toString()); K9.setAttachmentDefaultPath(mAttachmentPathPreference.getSummary().toString());

View File

@ -196,6 +196,24 @@ public class GlobalSettings {
new V(1, new BooleanSetting(false)), new V(1, new BooleanSetting(false)),
new V(4, new BooleanSetting(true)) new V(4, new BooleanSetting(true))
)); ));
s.put("batchButtonsMarkRead", Settings.versions(
new V(1, new BooleanSetting(true))
));
s.put("batchButtonsDelete", Settings.versions(
new V(1, new BooleanSetting(true))
));
s.put("batchButtonsArchive", Settings.versions(
new V(1, new BooleanSetting(false))
));
s.put("batchButtonsMove", Settings.versions(
new V(1, new BooleanSetting(false))
));
s.put("batchButtonsFlag", Settings.versions(
new V(1, new BooleanSetting(true))
));
s.put("batchButtonsUnselect", Settings.versions(
new V(1, new BooleanSetting(true))
));
SETTINGS = Collections.unmodifiableMap(s); SETTINGS = Collections.unmodifiableMap(s);