mirror of https://github.com/M66B/FairEmail.git
Fixes
This commit is contained in:
parent
ccc42a77a8
commit
82929b231e
|
@ -145,8 +145,9 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
|
||||||
Collections.sort(folders, new Comparator<TupleFolderEx>() {
|
Collections.sort(folders, new Comparator<TupleFolderEx>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(TupleFolderEx f1, TupleFolderEx f2) {
|
public int compare(TupleFolderEx f1, TupleFolderEx f2) {
|
||||||
int s = ((Integer) EntityFolder.FOLDER_SORT_ORDER.indexOf(f1.type))
|
int s = Integer.compare(
|
||||||
.compareTo(EntityFolder.FOLDER_SORT_ORDER.indexOf(f2.type));
|
EntityFolder.FOLDER_SORT_ORDER.indexOf(f1.type),
|
||||||
|
EntityFolder.FOLDER_SORT_ORDER.indexOf(f2.type));
|
||||||
if (s != 0)
|
if (s != 0)
|
||||||
return s;
|
return s;
|
||||||
int c = -f1.synchronize.compareTo(f2.synchronize);
|
int c = -f1.synchronize.compareTo(f2.synchronize);
|
||||||
|
|
|
@ -203,7 +203,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
||||||
this.debug = PreferenceManager.getDefaultSharedPreferences(context).getBoolean("debug", false);
|
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>() {
|
new DiffUtil.ItemCallback<TupleMessageEx>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean areItemsTheSame(
|
public boolean areItemsTheSame(
|
||||||
|
|
|
@ -317,7 +317,9 @@ public class FragmentCompose extends FragmentEx {
|
||||||
private void handlePickContact(int requestCode, Intent data) {
|
private void handlePickContact(int requestCode, Intent data) {
|
||||||
Cursor cursor = null;
|
Cursor cursor = null;
|
||||||
try {
|
try {
|
||||||
cursor = getContext().getContentResolver().query(data.getData(),
|
Uri uri = data.getData();
|
||||||
|
if (uri != null)
|
||||||
|
cursor = getContext().getContentResolver().query(uri,
|
||||||
new String[]{
|
new String[]{
|
||||||
ContactsContract.CommonDataKinds.Email.ADDRESS,
|
ContactsContract.CommonDataKinds.Email.ADDRESS,
|
||||||
ContactsContract.Contacts.DISPLAY_NAME
|
ContactsContract.Contacts.DISPLAY_NAME
|
||||||
|
@ -370,6 +372,7 @@ public class FragmentCompose extends FragmentEx {
|
||||||
Cursor cursor = null;
|
Cursor cursor = null;
|
||||||
try {
|
try {
|
||||||
Uri uri = args.getParcelable("uri");
|
Uri uri = args.getParcelable("uri");
|
||||||
|
if (uri != null)
|
||||||
cursor = context.getContentResolver().query(uri, null, null, null, null, null);
|
cursor = context.getContentResolver().query(uri, null, null, null, null, null);
|
||||||
if (cursor == null || !cursor.moveToFirst())
|
if (cursor == null || !cursor.moveToFirst())
|
||||||
return null;
|
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);
|
Log.i(Helper.TAG, "Load draft action=" + action + " id=" + id + " account=" + account + " reference=" + reference);
|
||||||
|
|
||||||
|
EntityMessage draft;
|
||||||
|
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
try {
|
try {
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
|
|
||||||
EntityMessage draft = db.message().getMessage(id);
|
draft = db.message().getMessage(id);
|
||||||
if (draft == null) {
|
if (draft == null) {
|
||||||
if ("edit".equals(action))
|
if ("edit".equals(action))
|
||||||
throw new IllegalStateException("Message to edit not found");
|
throw new IllegalStateException("Message to edit not found");
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class FragmentFolder extends FragmentEx {
|
||||||
|
|
||||||
new SimpleTask<Void>() {
|
new SimpleTask<Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected Void onLoad(Context context, Bundle args) throws Throwable {
|
protected Void onLoad(Context context, Bundle args) {
|
||||||
try {
|
try {
|
||||||
ServiceSynchronize.stop(getContext(), "folder");
|
ServiceSynchronize.stop(getContext(), "folder");
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ public class FragmentIdentity extends FragmentEx {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
ServiceSynchronize.restart(getContext(), "account");
|
ServiceSynchronize.restart(getContext(), "identity");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,7 @@ public class FragmentMessage extends FragmentEx {
|
||||||
top_navigation.setVisibility(View.VISIBLE);
|
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_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_move).setVisible(!inOutbox && (!inInbox || hasUser));
|
||||||
bottom_navigation.getMenu().findItem(R.id.action_archive).setVisible(!inOutbox && !inArchive && hasArchive);
|
bottom_navigation.getMenu().findItem(R.id.action_archive).setVisible(!inOutbox && !inArchive && hasArchive);
|
||||||
bottom_navigation.getMenu().findItem(R.id.action_reply).setVisible(!inOutbox);
|
bottom_navigation.getMenu().findItem(R.id.action_reply).setVisible(!inOutbox);
|
||||||
|
|
|
@ -185,9 +185,11 @@ public class FragmentMessages extends FragmentEx {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLoaded(Bundle args, Long account) {
|
protected void onLoaded(Bundle args, Long account) {
|
||||||
|
if (account != null) {
|
||||||
fab.setTag(account);
|
fab.setTag(account);
|
||||||
fab.setVisibility(View.VISIBLE);
|
fab.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onException(Bundle args, Throwable ex) {
|
protected void onException(Bundle args, Throwable ex) {
|
||||||
|
|
|
@ -155,7 +155,7 @@ public class FragmentSetup extends FragmentEx {
|
||||||
// Create outbox
|
// Create outbox
|
||||||
new SimpleTask<Void>() {
|
new SimpleTask<Void>() {
|
||||||
@Override
|
@Override
|
||||||
protected Void onLoad(Context context, Bundle args) throws Throwable {
|
protected Void onLoad(Context context, Bundle args) {
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
try {
|
try {
|
||||||
db.beginTransaction();
|
db.beginTransaction();
|
||||||
|
|
Loading…
Reference in New Issue