Browse Source

Fixes

main
M66B 6 years ago
parent
commit
82929b231e
8 changed files with 25 additions and 17 deletions
  1. +3
    -2
      app/src/main/java/eu/faircode/email/AdapterFolder.java
  2. +1
    -1
      app/src/main/java/eu/faircode/email/AdapterMessage.java
  3. +13
    -8
      app/src/main/java/eu/faircode/email/FragmentCompose.java
  4. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentFolder.java
  5. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentIdentity.java
  6. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentMessage.java
  7. +4
    -2
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  8. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentSetup.java

+ 3
- 2
app/src/main/java/eu/faircode/email/AdapterFolder.java View File

@ -145,8 +145,9 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
Collections.sort(folders, new Comparator<TupleFolderEx>() {
@Override
public int compare(TupleFolderEx f1, TupleFolderEx f2) {
int s = ((Integer) EntityFolder.FOLDER_SORT_ORDER.indexOf(f1.type))
.compareTo(EntityFolder.FOLDER_SORT_ORDER.indexOf(f2.type));
int s = Integer.compare(
EntityFolder.FOLDER_SORT_ORDER.indexOf(f1.type),
EntityFolder.FOLDER_SORT_ORDER.indexOf(f2.type));
if (s != 0)
return s;
int c = -f1.synchronize.compareTo(f2.synchronize);


+ 1
- 1
app/src/main/java/eu/faircode/email/AdapterMessage.java View File

@ -203,7 +203,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
this.debug = PreferenceManager.getDefaultSharedPreferences(context).getBoolean("debug", false);
}
public static final DiffUtil.ItemCallback<TupleMessageEx> DIFF_CALLBACK =
private static final DiffUtil.ItemCallback<TupleMessageEx> DIFF_CALLBACK =
new DiffUtil.ItemCallback<TupleMessageEx>() {
@Override
public boolean areItemsTheSame(


+ 13
- 8
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -317,12 +317,14 @@ public class FragmentCompose extends FragmentEx {
private void handlePickContact(int requestCode, Intent data) {
Cursor cursor = null;
try {
cursor = getContext().getContentResolver().query(data.getData(),
new String[]{
ContactsContract.CommonDataKinds.Email.ADDRESS,
ContactsContract.Contacts.DISPLAY_NAME
},
null, null, null);
Uri uri = data.getData();
if (uri != null)
cursor = getContext().getContentResolver().query(uri,
new String[]{
ContactsContract.CommonDataKinds.Email.ADDRESS,
ContactsContract.Contacts.DISPLAY_NAME
},
null, null, null);
if (cursor != null && cursor.moveToFirst()) {
int colEmail = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.ADDRESS);
int colName = cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
@ -370,7 +372,8 @@ public class FragmentCompose extends FragmentEx {
Cursor cursor = null;
try {
Uri uri = args.getParcelable("uri");
cursor = context.getContentResolver().query(uri, null, null, null, null, null);
if (uri != null)
cursor = context.getContentResolver().query(uri, null, null, null, null, null);
if (cursor == null || !cursor.moveToFirst())
return null;
@ -479,11 +482,13 @@ public class FragmentCompose extends FragmentEx {
Log.i(Helper.TAG, "Load draft action=" + action + " id=" + id + " account=" + account + " reference=" + reference);
EntityMessage draft;
DB db = DB.getInstance(context);
try {
db.beginTransaction();
EntityMessage draft = db.message().getMessage(id);
draft = db.message().getMessage(id);
if (draft == null) {
if ("edit".equals(action))
throw new IllegalStateException("Message to edit not found");


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentFolder.java View File

@ -75,7 +75,7 @@ public class FragmentFolder extends FragmentEx {
new SimpleTask<Void>() {
@Override
protected Void onLoad(Context context, Bundle args) throws Throwable {
protected Void onLoad(Context context, Bundle args) {
try {
ServiceSynchronize.stop(getContext(), "folder");


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentIdentity.java View File

@ -278,7 +278,7 @@ public class FragmentIdentity extends FragmentEx {
return null;
} finally {
ServiceSynchronize.restart(getContext(), "account");
ServiceSynchronize.restart(getContext(), "identity");
}
}


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -337,7 +337,7 @@ public class FragmentMessage extends FragmentEx {
top_navigation.setVisibility(View.VISIBLE);
bottom_navigation.getMenu().findItem(R.id.action_spam).setVisible(!inOutbox && !inArchive && !inJunk && hasJunk);
bottom_navigation.getMenu().findItem(R.id.action_trash).setVisible(!inOutbox && !inArchive && hasTrash);
bottom_navigation.getMenu().findItem(R.id.action_trash).setVisible(!inOutbox && hasTrash);
bottom_navigation.getMenu().findItem(R.id.action_move).setVisible(!inOutbox && (!inInbox || hasUser));
bottom_navigation.getMenu().findItem(R.id.action_archive).setVisible(!inOutbox && !inArchive && hasArchive);
bottom_navigation.getMenu().findItem(R.id.action_reply).setVisible(!inOutbox);


+ 4
- 2
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -185,8 +185,10 @@ public class FragmentMessages extends FragmentEx {
@Override
protected void onLoaded(Bundle args, Long account) {
fab.setTag(account);
fab.setVisibility(View.VISIBLE);
if (account != null) {
fab.setTag(account);
fab.setVisibility(View.VISIBLE);
}
}
@Override


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentSetup.java View File

@ -155,7 +155,7 @@ public class FragmentSetup extends FragmentEx {
// Create outbox
new SimpleTask<Void>() {
@Override
protected Void onLoad(Context context, Bundle args) throws Throwable {
protected Void onLoad(Context context, Bundle args) {
DB db = DB.getInstance(context);
try {
db.beginTransaction();


Loading…
Cancel
Save