Merge branch 'master' into issue-162
BIN
res/drawable-hdpi/divider_dark.9.png
Normal file
After Width: | Height: | Size: 78 B |
BIN
res/drawable-hdpi/divider_light.9.png
Normal file
After Width: | Height: | Size: 76 B |
BIN
res/drawable-hdpi/ic_menu_moreoverflow_holo_dark.png
Normal file
After Width: | Height: | Size: 144 B |
BIN
res/drawable-hdpi/ic_menu_moreoverflow_holo_light.png
Normal file
After Width: | Height: | Size: 148 B |
BIN
res/drawable-mdpi/divider_dark.9.png
Normal file
After Width: | Height: | Size: 78 B |
BIN
res/drawable-mdpi/divider_light.9.png
Normal file
After Width: | Height: | Size: 76 B |
BIN
res/drawable-mdpi/ic_menu_moreoverflow_holo_dark.png
Normal file
After Width: | Height: | Size: 122 B |
BIN
res/drawable-mdpi/ic_menu_moreoverflow_holo_light.png
Normal file
After Width: | Height: | Size: 131 B |
BIN
res/drawable-xhdpi/divider_dark.9.png
Normal file
After Width: | Height: | Size: 83 B |
BIN
res/drawable-xhdpi/divider_light.9.png
Normal file
After Width: | Height: | Size: 83 B |
BIN
res/drawable-xhdpi/ic_menu_moreoverflow_holo_dark.png
Normal file
After Width: | Height: | Size: 167 B |
BIN
res/drawable-xhdpi/ic_menu_moreoverflow_holo_light.png
Normal file
After Width: | Height: | Size: 184 B |
@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<declare-styleable name="K9Styles">
|
||||
<attr name="listDivider" format="reference" />
|
||||
<attr name="iconListItemMenu" format="reference" />
|
||||
<attr name="iconMenuInfoDetails" format="reference" />
|
||||
<attr name="iconActionAddAttachment" format="reference" />
|
||||
<attr name="iconActionAddCcBcc" format="reference" />
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
<style name="Theme.K9.Light" parent="Theme.Sherlock.Light">
|
||||
<item name="android:autoCompleteTextViewStyle">@style/Widget.K9.AutoCompleteTextView</item>
|
||||
<item name="listDivider">@drawable/divider_light</item>
|
||||
<item name="iconListItemMenu">@drawable/ic_menu_moreoverflow_holo_light</item>
|
||||
<item name="iconMenuInfoDetails">@android:drawable/ic_menu_info_details</item>
|
||||
<item name="iconActionAddAttachment">@drawable/ic_action_add_attachment_light</item>
|
||||
<item name="iconActionAddCcBcc">@drawable/ic_action_add_cc_bbc_light</item>
|
||||
@ -42,6 +44,8 @@
|
||||
|
||||
<style name="Theme.K9.Dark" parent="Theme.Sherlock">
|
||||
<item name="android:autoCompleteTextViewStyle">@style/Widget.K9.AutoCompleteTextView</item>
|
||||
<item name="listDivider">@drawable/divider_dark</item>
|
||||
<item name="iconListItemMenu">@drawable/ic_menu_moreoverflow_holo_dark</item>
|
||||
<item name="iconMenuInfoDetails">@android:drawable/ic_menu_info_details</item>
|
||||
<item name="iconActionAddAttachment">@drawable/ic_action_add_attachment_dark</item>
|
||||
<item name="iconActionAddCcBcc">@drawable/ic_action_add_cc_bcc_dark</item>
|
||||
|
@ -669,7 +669,7 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
|
||||
|
||||
MessageInfoHolder message = (MessageInfoHolder) mAdapter.getItem(position);
|
||||
if (mSelectedCount > 0) {
|
||||
handleContextRelatedClick(position);
|
||||
toggleMessageSelect(position);
|
||||
} else {
|
||||
onOpenMessage(message);
|
||||
}
|
||||
@ -700,7 +700,8 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
|
||||
@Override
|
||||
public boolean onItemLongClick(AdapterView<?> parent, View view,
|
||||
int position, long id) {
|
||||
return handleContextRelatedClick(position);
|
||||
toggleMessageSelect(position);
|
||||
return true;
|
||||
}});
|
||||
|
||||
// Correcting for screen rotation when in ActionMode
|
||||
@ -2320,24 +2321,12 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (position != -1) {
|
||||
MessageInfoHolder message = (MessageInfoHolder) mAdapter.getItem(position);
|
||||
if (message.selected != isChecked) {
|
||||
if (isChecked) {
|
||||
mSelectedCount++;
|
||||
} else if (mSelectedCount > 0) {
|
||||
mSelectedCount--;
|
||||
toggleMessageSelect(message);
|
||||
if (!mCheckboxes) {
|
||||
selected.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
// We must set the flag before showing the buttons as the
|
||||
// buttons text depends on what is selected.
|
||||
message.selected = isChecked;
|
||||
if (!mCheckboxes) {
|
||||
if (isChecked) {
|
||||
selected.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
selected.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2431,7 +2420,23 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
|
||||
mAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void toggleMessageSelect(int position){
|
||||
MessageInfoHolder holder = (MessageInfoHolder) mAdapter.getItem(position);
|
||||
toggleMessageSelect(holder);
|
||||
}
|
||||
|
||||
private void toggleMessageSelect(final MessageInfoHolder holder){
|
||||
if (mActionMode != null) {
|
||||
if (mSelectedCount == 1 && holder.selected) {
|
||||
mActionMode.finish();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
mActionMode = MessageList.this.startActionMode(mActionModeCallback);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (holder.selected) {
|
||||
holder.selected = false;
|
||||
mSelectedCount -= 1;
|
||||
@ -2715,25 +2720,6 @@ public class MessageList extends K9ListActivity implements OnItemClickListener {
|
||||
return account;
|
||||
}
|
||||
|
||||
private boolean handleContextRelatedClick(int position){
|
||||
MessageInfoHolder holder = (MessageInfoHolder) mAdapter.getItem(position);
|
||||
if (mActionMode != null) {
|
||||
if (mSelectedCount > 1) {
|
||||
toggleMessageSelect(holder);
|
||||
} else {
|
||||
if (holder.selected) {
|
||||
mActionMode.finish();
|
||||
} else {
|
||||
toggleMessageSelect(holder);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mActionMode = MessageList.this.startActionMode(mActionModeCallback);
|
||||
toggleMessageSelect(holder);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() {
|
||||
|
||||
|