use of com.hannesdorfmann.mosby3.sample.mail.model.mail.Label in project mosby by sockeqwe.
the class MainActivity method showMails.
private void showMails(Label label, boolean removeDetailsFragment) {
toolbarTitle = label.getName();
toolbar.setTitle(toolbarTitle);
if (drawerLayout.isDrawerOpen(GravityCompat.START)) {
drawerLayout.closeDrawer(GravityCompat.START);
}
getSupportFragmentManager().beginTransaction().replace(R.id.leftPane, new MailsFragmentBuilder(label).build(), FRAGMENT_TAG_LABEL).commit();
if (removeDetailsFragment) {
removeDetailsFragment();
}
}
use of com.hannesdorfmann.mosby3.sample.mail.model.mail.Label in project mosby by sockeqwe.
the class WriteActivity method onSendClicked.
@OnClick(R.id.send)
public void onSendClicked() {
String email = receiver.getText().toString();
if (TextUtils.isEmpty(email) || !emailPattern.matcher(email).matches()) {
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
receiver.startAnimation(shake);
return;
}
String sub = subject.getText().toString();
if (TextUtils.isEmpty(sub)) {
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
subject.startAnimation(shake);
return;
}
Person receiver = null;
if (email.equals(Person.BARNEY.getEmail())) {
receiver = Person.BARNEY;
} else if (email.equals(Person.LILY.getEmail())) {
receiver = Person.LILY;
} else if (email.equals(Person.MARSHALL.getEmail())) {
receiver = Person.MARSHALL;
} else if (email.equals(Person.ROBIN.getEmail())) {
receiver = Person.ROBIN;
} else {
String name = email.split("@")[0];
receiver = new Person(23, name, email, R.drawable.unknown, null, 0);
}
String text = message.getText().toString();
Mail mail = new Mail().date(new Date()).label(Label.SENT).sender(Person.TED).receiver(receiver).subject(sub).text(text);
presenter.writeMail(getApplicationContext(), mail);
}
use of com.hannesdorfmann.mosby3.sample.mail.model.mail.Label in project mosby by sockeqwe.
the class MenuFragment method decrementUnreadCount.
@Override
public void decrementUnreadCount(String label) {
for (Label l : adapter.getItems()) {
if (l.getName().equals(label)) {
l.decrementUnreadCount();
adapter.notifyDataSetChanged();
return;
}
}
}
Aggregations