|
|
|
@ -90,15 +90,27 @@ public class FragmentDialogSelectUnifiedFolder extends FragmentDialogBase {
|
|
|
|
|
else if (folders.size() > 0)
|
|
|
|
|
Collections.sort(folders, folders.get(0).getComparator(context));
|
|
|
|
|
|
|
|
|
|
TupleFolderEx unified = new TupleFolderEx();
|
|
|
|
|
unified.id = -1L;
|
|
|
|
|
unified.name = context.getString(R.string.title_folder_unified);
|
|
|
|
|
folders.add(0, unified);
|
|
|
|
|
|
|
|
|
|
AdapterFolder adapter = new AdapterFolder(context, folders, new AdapterFolder.IListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onSelected(TupleFolderEx folder) {
|
|
|
|
|
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
|
|
|
|
|
if (folder.id < 0)
|
|
|
|
|
lbm.sendBroadcast(
|
|
|
|
|
new Intent(ActivityView.ACTION_VIEW_MESSAGES)
|
|
|
|
|
.putExtra("type", (String) null)
|
|
|
|
|
.putExtra("unified", true));
|
|
|
|
|
else
|
|
|
|
|
lbm.sendBroadcast(
|
|
|
|
|
new Intent(ActivityView.ACTION_VIEW_MESSAGES)
|
|
|
|
|
.putExtra("account", folder.account)
|
|
|
|
|
.putExtra("folder", folder.id)
|
|
|
|
|
.putExtra("type", folder.type));
|
|
|
|
|
|
|
|
|
|
sendResult(RESULT_OK);
|
|
|
|
|
dialog.dismiss();
|
|
|
|
|
}
|
|
|
|
@ -148,6 +160,9 @@ public class FragmentDialogSelectUnifiedFolder extends FragmentDialogBase {
|
|
|
|
|
tv.setPadding(0, vpad, 0, vpad);
|
|
|
|
|
|
|
|
|
|
vwColor.setBackgroundColor(folder.color == null ? Color.TRANSPARENT : folder.color);
|
|
|
|
|
if (folder.accountName == null)
|
|
|
|
|
tv.setText(folder.getDisplayName(context));
|
|
|
|
|
else
|
|
|
|
|
tv.setText(folder.accountName + "/" + folder.getDisplayName(context));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|