Compare commits

...

4 Commits
1.645 ... 1.646

Author SHA1 Message Date
M66B
5151fe8f54 1.646 release 2019-08-11 18:24:07 +02:00
M66B
a1ea433f10 Default compact view on small and normal screens 2019-08-11 18:23:32 +02:00
M66B
800f16682d Added compose breadcrumbs 2019-08-11 18:17:29 +02:00
M66B
07d05ef345 Small fix 2019-08-11 18:07:06 +02:00
3 changed files with 30 additions and 8 deletions

View File

@@ -13,8 +13,8 @@ android {
applicationId "eu.faircode.email"
minSdkVersion 21
targetSdkVersion 29
versionCode 645
versionName "1.645"
versionCode 646
versionName "1.646"
archivesBaseName = "FairEmail-v$versionName"
// https://en.wikipedia.org/wiki/List_of_dinosaur_genera

View File

@@ -142,7 +142,7 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
start.execute(this, new Bundle(), "main:accounts");
} else {
// Enable compact view on small screens
if (!getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_NORMAL))
if (!getResources().getConfiguration().isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE))
prefs.edit().putBoolean("compact", true).apply();
setTheme(R.style.AppThemeLight);

View File

@@ -104,6 +104,8 @@ import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bugsnag.android.BreadcrumbType;
import com.bugsnag.android.Bugsnag;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
import com.google.android.material.snackbar.Snackbar;
@@ -129,8 +131,10 @@ import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.regex.Pattern;
@@ -1948,6 +1952,12 @@ public class FragmentCompose extends FragmentBase {
Log.i("Load draft action=" + action + " id=" + id + " reference=" + reference);
Map<String, String> crumb = new HashMap<>();
crumb.put("draft", Long.toString(id));
crumb.put("reference", Long.toString(reference));
crumb.put("action", action);
Bugsnag.leaveBreadcrumb("compose", BreadcrumbType.LOG, crumb);
EntityMessage draft;
DB db = DB.getInstance(context);
@@ -2480,9 +2490,12 @@ public class FragmentCompose extends FragmentBase {
if (draft.account != aid && aid >= 0) {
Log.i("Account changed");
// To prevent violating constraints
Long uid = draft.uid;
String msgid = draft.msgid;
boolean content = draft.content;
long ui_hide = draft.ui_hide;
// To prevent violating constraints
draft.uid = null;
draft.msgid = null;
db.message().updateMessage(draft);
@@ -2494,7 +2507,7 @@ public class FragmentCompose extends FragmentBase {
draft.content = false;
draft.ui_hide = new Date().getTime();
draft.id = db.message().insertMessage(draft);
EntityOperation.queue(context, draft, EntityOperation.DELETE); // by msgid
EntityOperation.queue(context, draft, EntityOperation.DELETE);
// Restore original with new account, no uid and new msgid
draft.id = id;
@@ -2502,12 +2515,21 @@ public class FragmentCompose extends FragmentBase {
draft.folder = db.folder().getFolderByType(aid, EntityFolder.DRAFTS).id;
draft.uid = null;
draft.msgid = EntityMessage.generateMessageId();
draft.content = true;
draft.ui_hide = 0L;
draft.content = content;
draft.ui_hide = ui_hide;
db.message().updateMessage(draft);
EntityOperation.queue(context, draft, EntityOperation.ADD);
if (content)
EntityOperation.queue(context, draft, EntityOperation.ADD);
}
Map<String, String> crumb = new HashMap<>();
crumb.put("draft", draft.folder + ":" + draft.id);
crumb.put("content", Boolean.toString(draft.content));
crumb.put("file", Boolean.toString(draft.getFile(context).exists()));
crumb.put("action", getActionName(action));
Bugsnag.leaveBreadcrumb("compose", BreadcrumbType.LOG, crumb);
List<EntityAttachment> attachments = db.attachment().getAttachments(draft.id);
// Get data