Search in sources :

Example 1 with DeliveryReportItem

use of com.moez.QKSMS.ui.delivery.DeliveryReportItem in project qksms by moezbhatti.

the class MessageListFragment method showDeliveryReport.

private void showDeliveryReport(long messageId, String type) {
    DeliveryReportHelper deliveryReportHelper = new DeliveryReportHelper(mContext, messageId, type);
    List<DeliveryReportItem> deliveryReportItems = deliveryReportHelper.getListItems();
    String[] items = new String[deliveryReportItems.size() * 3];
    for (int i = 0; i < deliveryReportItems.size() * 3; i++) {
        switch(i % 3) {
            case 0:
                items[i] = deliveryReportItems.get(i - (i / 3)).recipient;
                break;
            case 1:
                items[i] = deliveryReportItems.get(i - 1 - ((i - 1) / 3)).status;
                break;
            case 2:
                items[i] = deliveryReportItems.get(i - 2 - ((i - 2) / 3)).deliveryDate;
                break;
        }
    }
    new QKDialog().setContext(mContext).setTitle(R.string.delivery_header_title).setItems(items, null).setPositiveButton(R.string.okay, null).show();
}
Also used : DeliveryReportItem(com.moez.QKSMS.ui.delivery.DeliveryReportItem) QKDialog(com.moez.QKSMS.ui.dialog.QKDialog) DeliveryReportHelper(com.moez.QKSMS.ui.delivery.DeliveryReportHelper) SpannableString(android.text.SpannableString)

Aggregations

SpannableString (android.text.SpannableString)1 DeliveryReportHelper (com.moez.QKSMS.ui.delivery.DeliveryReportHelper)1 DeliveryReportItem (com.moez.QKSMS.ui.delivery.DeliveryReportItem)1 QKDialog (com.moez.QKSMS.ui.dialog.QKDialog)1