private void showMailboxPage() { boolean bHas = m_mailList.size() > 0; m_root.findViewById(R.id.mailbox_list_message).setVisibility(bHas ? View.GONE : View.VISIBLE); m_listView.setVisibility(bHas ? View.VISIBLE : View.GONE); if (bHas) m_adapter.notifyDataSetChanged(); if (m_bAppendMode) { ScrollView sv = (ScrollView) m_root.findViewById(R.id.MailboxScrollView); Util.delayedFlingOfScrollView(sv, 500, 500); } // Update message count? // Update unread count? }
public void markAsRead(int messageId) { Iterator<glitchMail> itr = m_mailList.iterator(); glitchMail mail; while (itr.hasNext()) { mail = itr.next(); if (mail.id == messageId) { if (!mail.is_read) { mail.is_read = true; m_application.decrMailUnreadCount(); m_mailboxUnread.setText(String.valueOf(m_application.getMailUnreadCount())); if (m_application.getMailUnreadCount() <= 0) m_mailboxUnread.setVisibility(View.GONE); m_adapter.notifyDataSetChanged(); } break; } } }
public void removeMessage(glitchMail message) { m_mailList.remove(message); m_adapter.notifyDataSetChanged(); }