diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 682a3be7..01ac7b24 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/build.gradle b/app/build.gradle index d1fec225..ddb2dd79 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,31 +45,25 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - // TODO: AndroidX - - def support_version = "28.0.0-alpha1" - def constraintlayout_version = "1.1.2" // 2.0.0-alpha1 - def lifecycle_version = "1.1.1" - def room_version = "1.1.1" - def paging_version = "1.0.0" + def androidx_version = "2.0.0-alpha1" def javamail_version = "1.6.0" def jsoup_version = "1.11.3" // https://developer.android.com/topic/libraries/support-library/revisions.html - implementation "com.android.support:appcompat-v7:$support_version" - implementation "com.android.support.constraint:constraint-layout:$constraintlayout_version" - implementation "com.android.support:recyclerview-v7:$support_version" - implementation "com.android.support:design:$support_version" + // https://developer.android.com/topic/libraries/support-library/packages + // https://developer.android.com/topic/libraries/support-library/refactor + implementation "androidx.appcompat:appcompat:1.0.0-alpha1" + implementation "androidx.constraintlayout:constraintlayout:1.1.0" + implementation "androidx.recyclerview:recyclerview:1.0.0-alpha1" + implementation "com.google.android.material:material:1.0.0-alpha1" + implementation "androidx.browser:browser:1.0.0-alpha1" // https://developer.android.com/topic/libraries/architecture/adding-components.html - implementation "android.arch.lifecycle:extensions:$lifecycle_version" - implementation "android.arch.persistence.room:runtime:$room_version" - implementation "android.arch.paging:runtime:$paging_version" - annotationProcessor "android.arch.lifecycle:compiler:$lifecycle_version" - annotationProcessor "android.arch.persistence.room:compiler:$room_version" - - // https://developer.android.com/topic/libraries/support-library/packages#custom-tabs - implementation "com.android.support:customtabs:$support_version" + implementation "androidx.lifecycle:lifecycle-extensions:$androidx_version" + implementation "androidx.room:room-runtime:$androidx_version" + implementation "androidx.paging:paging-runtime:$androidx_version" + annotationProcessor "androidx.lifecycle:lifecycle-compiler:$androidx_version" + annotationProcessor "androidx.room:room-compiler:$androidx_version" // https://javaee.github.io/javamail/ implementation "com.sun.mail:android-mail:$javamail_version" diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f1bc272f..fd78ad84 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -47,7 +47,7 @@ diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index 060a8705..27f1b840 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -22,15 +22,16 @@ package eu.faircode.email; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.v7.app.AppCompatActivity; import android.util.Log; +import androidx.appcompat.app.AppCompatActivity; + abstract class ActivityBase extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener { @Override protected void onCreate(Bundle savedInstanceState) { Log.i(Helper.TAG, "Create " + this.getClass().getName()); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); - String theme = prefs.getString("theme" , "light"); + String theme = prefs.getString("theme", "light"); setTheme("light".equals(theme) ? R.style.AppThemeLight : R.style.AppThemeDark); PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this); super.onCreate(savedInstanceState); diff --git a/app/src/main/java/eu/faircode/email/ActivityCompose.java b/app/src/main/java/eu/faircode/email/ActivityCompose.java index d4f575e4..3cbe33e3 100644 --- a/app/src/main/java/eu/faircode/email/ActivityCompose.java +++ b/app/src/main/java/eu/faircode/email/ActivityCompose.java @@ -20,10 +20,11 @@ package eu.faircode.email; */ import android.os.Bundle; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; import android.view.MenuItem; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; + public class ActivityCompose extends ActivityBase implements FragmentManager.OnBackStackChangedListener { static final int LOADER_COMPOSE_GET = 1; static final int LOADER_COMPOSE_PUT = 2; diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index fd135bfc..5024c4a3 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -24,11 +24,12 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.content.LocalBroadcastManager; import android.view.MenuItem; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + public class ActivitySetup extends ActivityBase implements FragmentManager.OnBackStackChangedListener { static final String ACTION_EDIT_ACCOUNT = BuildConfig.APPLICATION_ID + ".EDIT_ACCOUNT"; static final String ACTION_EDIT_IDENTITY = BuildConfig.APPLICATION_ID + ".EDIT_IDENTITY"; diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index fd2558b6..9e12204c 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -19,7 +19,6 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -29,13 +28,6 @@ import android.content.res.Configuration; import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.content.LocalBroadcastManager; -import android.support.v4.widget.DrawerLayout; -import android.support.v7.app.ActionBarDrawerToggle; import android.util.Log; import android.view.LayoutInflater; import android.view.MenuItem; @@ -56,6 +48,15 @@ import java.util.Locale; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; +import androidx.lifecycle.Observer; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + public class ActivityView extends ActivityBase implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener { private boolean newIntent = false; private DrawerLayout drawerLayout; diff --git a/app/src/main/java/eu/faircode/email/AdapterAccount.java b/app/src/main/java/eu/faircode/email/AdapterAccount.java index 5714822b..5e5eda3d 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAccount.java +++ b/app/src/main/java/eu/faircode/email/AdapterAccount.java @@ -21,11 +21,6 @@ package eu.faircode.email; import android.content.Context; import android.content.Intent; -import android.support.annotation.NonNull; -import android.support.v4.content.LocalBroadcastManager; -import android.support.v7.util.DiffUtil; -import android.support.v7.util.ListUpdateCallback; -import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -40,6 +35,12 @@ import java.util.Comparator; import java.util.List; import java.util.Locale; +import androidx.annotation.NonNull; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.recyclerview.widget.DiffUtil; +import androidx.recyclerview.widget.ListUpdateCallback; +import androidx.recyclerview.widget.RecyclerView; + public class AdapterAccount extends RecyclerView.Adapter { private Context context; @@ -77,7 +78,7 @@ public class AdapterAccount extends RecyclerView.Adapter { private Context context; private ExecutorService executor = Executors.newCachedThreadPool(); @@ -116,10 +117,10 @@ public class AdapterAttachment extends RecyclerView.Adapter { private Context context; diff --git a/app/src/main/java/eu/faircode/email/AdapterIdentity.java b/app/src/main/java/eu/faircode/email/AdapterIdentity.java index 6602c397..83cc55ab 100644 --- a/app/src/main/java/eu/faircode/email/AdapterIdentity.java +++ b/app/src/main/java/eu/faircode/email/AdapterIdentity.java @@ -21,11 +21,6 @@ package eu.faircode.email; import android.content.Context; import android.content.Intent; -import android.support.annotation.NonNull; -import android.support.v4.content.LocalBroadcastManager; -import android.support.v7.util.DiffUtil; -import android.support.v7.util.ListUpdateCallback; -import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -40,6 +35,12 @@ import java.util.Comparator; import java.util.List; import java.util.Locale; +import androidx.annotation.NonNull; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.recyclerview.widget.DiffUtil; +import androidx.recyclerview.widget.ListUpdateCallback; +import androidx.recyclerview.widget.RecyclerView; + public class AdapterIdentity extends RecyclerView.Adapter { private Context context; @@ -77,7 +78,7 @@ public class AdapterIdentity extends RecyclerView.Adapter { private Context context; private ViewType viewType; diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index 8690c473..539c90f4 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -45,7 +45,7 @@ public class ApplicationEx extends Application { db = DB.getBlockingInstance(ApplicationEx.this); EntityFolder drafts = db.folder().getPrimaryFolder(EntityFolder.TYPE_DRAFTS); if (drafts != null) { - Address to = new InternetAddress("marcel+email@faircode.eu" , "FairCode"); + Address to = new InternetAddress("marcel+email@faircode.eu", "FairCode"); String body = ex + "\n" + Log.getStackTraceString(ex); EntityMessage draft = new EntityMessage(); @@ -53,7 +53,7 @@ public class ApplicationEx extends Application { draft.folder = drafts.id; draft.to = new Address[]{to}; draft.subject = BuildConfig.APPLICATION_ID + " crash info"; - draft.body = "
" + body.replaceAll("\\r?\\n" , "
") + "
"; + draft.body = "
" + body.replaceAll("\\r?\\n", "
") + "
"; draft.received = new Date().getTime(); draft.seen = false; draft.ui_seen = false; diff --git a/app/src/main/java/eu/faircode/email/DB.java b/app/src/main/java/eu/faircode/email/DB.java index 2d2f9187..79a7c5b4 100644 --- a/app/src/main/java/eu/faircode/email/DB.java +++ b/app/src/main/java/eu/faircode/email/DB.java @@ -1,12 +1,5 @@ package eu.faircode.email; -import android.arch.persistence.db.SupportSQLiteDatabase; -import android.arch.persistence.room.Database; -import android.arch.persistence.room.Room; -import android.arch.persistence.room.RoomDatabase; -import android.arch.persistence.room.TypeConverter; -import android.arch.persistence.room.TypeConverters; -import android.arch.persistence.room.migration.Migration; import android.content.Context; import android.text.TextUtils; import android.util.Log; @@ -21,6 +14,14 @@ import java.util.List; import javax.mail.Address; import javax.mail.internet.InternetAddress; +import androidx.room.Database; +import androidx.room.Room; +import androidx.room.RoomDatabase; +import androidx.room.TypeConverter; +import androidx.room.TypeConverters; +import androidx.room.migration.Migration; +import androidx.sqlite.db.SupportSQLiteDatabase; + /* This file is part of Safe email. @@ -149,7 +150,7 @@ public abstract class DB extends RoomDatabase { @TypeConverter public static String toStringArray(String[] value) { - return TextUtils.join("," , value); + return TextUtils.join(",", value); } @TypeConverter @@ -165,13 +166,13 @@ public abstract class DB extends RoomDatabase { String p = ((InternetAddress) address).getPersonal(); JSONObject jaddress = new JSONObject(); if (a != null) - jaddress.put("address" , a); + jaddress.put("address", a); if (p != null) - jaddress.put("personal" , p); + jaddress.put("personal", p); jaddresses.put(jaddress); } else { JSONObject jaddress = new JSONObject(); - jaddress.put("address" , address.toString()); + jaddress.put("address", address.toString()); jaddresses.put(jaddress); } } catch (JSONException ex) { diff --git a/app/src/main/java/eu/faircode/email/DaoAccount.java b/app/src/main/java/eu/faircode/email/DaoAccount.java index 52189918..b5e568f0 100644 --- a/app/src/main/java/eu/faircode/email/DaoAccount.java +++ b/app/src/main/java/eu/faircode/email/DaoAccount.java @@ -19,15 +19,15 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Insert; -import android.arch.persistence.room.OnConflictStrategy; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Update; - import java.util.List; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.OnConflictStrategy; +import androidx.room.Query; +import androidx.room.Update; + @Dao public interface DaoAccount { @Query("SELECT * FROM account WHERE synchronize = :synchronize") diff --git a/app/src/main/java/eu/faircode/email/DaoAttachment.java b/app/src/main/java/eu/faircode/email/DaoAttachment.java index 3fffd8bb..01a41503 100644 --- a/app/src/main/java/eu/faircode/email/DaoAttachment.java +++ b/app/src/main/java/eu/faircode/email/DaoAttachment.java @@ -19,15 +19,15 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Insert; -import android.arch.persistence.room.OnConflictStrategy; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Update; - import java.util.List; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.OnConflictStrategy; +import androidx.room.Query; +import androidx.room.Update; + @Dao public interface DaoAttachment { @Query("SELECT id,message,sequence,name,type,size,progress" + diff --git a/app/src/main/java/eu/faircode/email/DaoFolder.java b/app/src/main/java/eu/faircode/email/DaoFolder.java index 67f68bc8..385e1e92 100644 --- a/app/src/main/java/eu/faircode/email/DaoFolder.java +++ b/app/src/main/java/eu/faircode/email/DaoFolder.java @@ -19,15 +19,15 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Insert; -import android.arch.persistence.room.OnConflictStrategy; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Update; - import java.util.List; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.OnConflictStrategy; +import androidx.room.Query; +import androidx.room.Update; + @Dao public interface DaoFolder { @Query("SELECT * FROM folder WHERE account = :account") diff --git a/app/src/main/java/eu/faircode/email/DaoIdentity.java b/app/src/main/java/eu/faircode/email/DaoIdentity.java index f59bbd58..d6a79818 100644 --- a/app/src/main/java/eu/faircode/email/DaoIdentity.java +++ b/app/src/main/java/eu/faircode/email/DaoIdentity.java @@ -19,15 +19,15 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.LiveData; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Insert; -import android.arch.persistence.room.OnConflictStrategy; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Update; - import java.util.List; +import androidx.lifecycle.LiveData; +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.OnConflictStrategy; +import androidx.room.Query; +import androidx.room.Update; + @Dao public interface DaoIdentity { @Query("SELECT * FROM identity") diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 804f2bd7..16b74aeb 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -19,16 +19,16 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.LiveData; -import android.arch.paging.DataSource; -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Insert; -import android.arch.persistence.room.OnConflictStrategy; -import android.arch.persistence.room.Query; -import android.arch.persistence.room.Update; - import java.util.List; +import androidx.lifecycle.LiveData; +import androidx.paging.DataSource; +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.OnConflictStrategy; +import androidx.room.Query; +import androidx.room.Update; + @Dao public interface DaoMessage { diff --git a/app/src/main/java/eu/faircode/email/DaoOperation.java b/app/src/main/java/eu/faircode/email/DaoOperation.java index 57b90325..f37a51d8 100644 --- a/app/src/main/java/eu/faircode/email/DaoOperation.java +++ b/app/src/main/java/eu/faircode/email/DaoOperation.java @@ -19,13 +19,13 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.persistence.room.Dao; -import android.arch.persistence.room.Insert; -import android.arch.persistence.room.OnConflictStrategy; -import android.arch.persistence.room.Query; - import java.util.List; +import androidx.room.Dao; +import androidx.room.Insert; +import androidx.room.OnConflictStrategy; +import androidx.room.Query; + @Dao public interface DaoOperation { @Insert(onConflict = OnConflictStrategy.REPLACE) diff --git a/app/src/main/java/eu/faircode/email/EntityAccount.java b/app/src/main/java/eu/faircode/email/EntityAccount.java index 06dfc75b..91d8d7ef 100644 --- a/app/src/main/java/eu/faircode/email/EntityAccount.java +++ b/app/src/main/java/eu/faircode/email/EntityAccount.java @@ -19,9 +19,9 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.PrimaryKey; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.PrimaryKey; @Entity( tableName = EntityAccount.TABLE_NAME, diff --git a/app/src/main/java/eu/faircode/email/EntityAttachment.java b/app/src/main/java/eu/faircode/email/EntityAttachment.java index f4db2d28..4c003e71 100644 --- a/app/src/main/java/eu/faircode/email/EntityAttachment.java +++ b/app/src/main/java/eu/faircode/email/EntityAttachment.java @@ -19,25 +19,25 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Ignore; -import android.arch.persistence.room.Index; -import android.arch.persistence.room.PrimaryKey; -import android.support.annotation.NonNull; - import javax.mail.BodyPart; -import static android.arch.persistence.room.ForeignKey.CASCADE; +import androidx.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Ignore; +import androidx.room.Index; +import androidx.room.PrimaryKey; + +import static androidx.room.ForeignKey.CASCADE; @Entity( tableName = EntityAttachment.TABLE_NAME, foreignKeys = { - @ForeignKey(childColumns = "message" , entity = EntityMessage.class, parentColumns = "id" , onDelete = CASCADE) + @ForeignKey(childColumns = "message", entity = EntityMessage.class, parentColumns = "id", onDelete = CASCADE) }, indices = { @Index(value = {"message"}), - @Index(value = {"message" , "sequence"}, unique = true) + @Index(value = {"message", "sequence"}, unique = true) } ) public class EntityAttachment { diff --git a/app/src/main/java/eu/faircode/email/EntityFolder.java b/app/src/main/java/eu/faircode/email/EntityFolder.java index e2e14aae..b35bbcef 100644 --- a/app/src/main/java/eu/faircode/email/EntityFolder.java +++ b/app/src/main/java/eu/faircode/email/EntityFolder.java @@ -19,16 +19,16 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.arch.persistence.room.PrimaryKey; -import android.support.annotation.NonNull; - import java.util.Arrays; import java.util.List; -import static android.arch.persistence.room.ForeignKey.CASCADE; +import androidx.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.room.PrimaryKey; + +import static androidx.room.ForeignKey.CASCADE; @Entity( tableName = EntityFolder.TABLE_NAME, diff --git a/app/src/main/java/eu/faircode/email/EntityIdentity.java b/app/src/main/java/eu/faircode/email/EntityIdentity.java index a3d9cc84..b5cd64cd 100644 --- a/app/src/main/java/eu/faircode/email/EntityIdentity.java +++ b/app/src/main/java/eu/faircode/email/EntityIdentity.java @@ -19,9 +19,9 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.PrimaryKey; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.PrimaryKey; @Entity( tableName = EntityIdentity.TABLE_NAME, diff --git a/app/src/main/java/eu/faircode/email/EntityMessage.java b/app/src/main/java/eu/faircode/email/EntityMessage.java index 0c628aeb..052b3881 100644 --- a/app/src/main/java/eu/faircode/email/EntityMessage.java +++ b/app/src/main/java/eu/faircode/email/EntityMessage.java @@ -19,32 +19,32 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.arch.persistence.room.PrimaryKey; -import android.support.annotation.NonNull; - import javax.mail.Address; -import static android.arch.persistence.room.ForeignKey.CASCADE; +import androidx.annotation.NonNull; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.room.PrimaryKey; + +import static androidx.room.ForeignKey.CASCADE; // https://developer.android.com/training/data-storage/room/defining-data @Entity( tableName = EntityMessage.TABLE_NAME, foreignKeys = { - @ForeignKey(childColumns = "account" , entity = EntityAccount.class, parentColumns = "id" , onDelete = CASCADE), - @ForeignKey(childColumns = "folder" , entity = EntityFolder.class, parentColumns = "id" , onDelete = CASCADE), - @ForeignKey(childColumns = "identity" , entity = EntityIdentity.class, parentColumns = "id" , onDelete = CASCADE), - @ForeignKey(childColumns = "replying" , entity = EntityMessage.class, parentColumns = "id" , onDelete = CASCADE) + @ForeignKey(childColumns = "account", entity = EntityAccount.class, parentColumns = "id", onDelete = CASCADE), + @ForeignKey(childColumns = "folder", entity = EntityFolder.class, parentColumns = "id", onDelete = CASCADE), + @ForeignKey(childColumns = "identity", entity = EntityIdentity.class, parentColumns = "id", onDelete = CASCADE), + @ForeignKey(childColumns = "replying", entity = EntityMessage.class, parentColumns = "id", onDelete = CASCADE) }, indices = { @Index(value = {"account"}), @Index(value = {"folder"}), @Index(value = {"identity"}), @Index(value = {"replying"}), - @Index(value = {"folder" , "uid"}, unique = true), + @Index(value = {"folder", "uid"}, unique = true), @Index(value = {"thread"}), @Index(value = {"received"}), @Index(value = {"ui_seen"}), diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index f4ef8e68..70b63887 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -19,14 +19,8 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.persistence.room.Entity; -import android.arch.persistence.room.ForeignKey; -import android.arch.persistence.room.Index; -import android.arch.persistence.room.PrimaryKey; import android.content.Context; import android.content.Intent; -import android.support.annotation.NonNull; -import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import org.json.JSONArray; @@ -34,12 +28,19 @@ import org.json.JSONArray; import java.util.ArrayList; import java.util.List; -import static android.arch.persistence.room.ForeignKey.CASCADE; +import androidx.annotation.NonNull; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.room.Entity; +import androidx.room.ForeignKey; +import androidx.room.Index; +import androidx.room.PrimaryKey; + +import static androidx.room.ForeignKey.CASCADE; @Entity( tableName = EntityOperation.TABLE_NAME, foreignKeys = { - @ForeignKey(childColumns = "message" , entity = EntityMessage.class, parentColumns = "id" , onDelete = CASCADE) + @ForeignKey(childColumns = "message", entity = EntityMessage.class, parentColumns = "id", onDelete = CASCADE) }, indices = { @Index(value = {"message"}) @@ -101,7 +102,7 @@ public class EntityOperation { intent.setType("account/" + message.account); intent.setAction(ServiceSynchronize.ACTION_PROCESS_FOLDER); } - intent.putExtra("folder" , message.folder); + intent.putExtra("folder", message.folder); synchronized (queue) { queue.add(intent); diff --git a/app/src/main/java/eu/faircode/email/FragmentAbout.java b/app/src/main/java/eu/faircode/email/FragmentAbout.java index 5d29936c..9639c78f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAbout.java +++ b/app/src/main/java/eu/faircode/email/FragmentAbout.java @@ -21,8 +21,6 @@ package eu.faircode.email; import android.content.Intent; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -37,6 +35,9 @@ import java.util.concurrent.Executors; import javax.mail.Address; import javax.mail.internet.InternetAddress; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + public class FragmentAbout extends FragmentEx { private ExecutorService executor = Executors.newCachedThreadPool(); @@ -65,14 +66,14 @@ public class FragmentAbout extends FragmentEx { StringBuilder info = Helper.getDebugInfo(); info.insert(0, getString(R.string.title_debug_info_remark) + "\n\n\n\n"); - Address to = new InternetAddress("marcel+email@faircode.eu" , "FairCode"); + Address to = new InternetAddress("marcel+email@faircode.eu", "FairCode"); EntityMessage draft = new EntityMessage(); draft.account = drafts.account; draft.folder = drafts.id; draft.to = new Address[]{to}; draft.subject = BuildConfig.APPLICATION_ID + " debug info"; - draft.body = "
" + info.toString().replaceAll("\\r?\\n" , "
") + "
"; + draft.body = "
" + info.toString().replaceAll("\\r?\\n", "
") + "
"; draft.received = new Date().getTime(); draft.seen = false; draft.ui_seen = false; @@ -83,7 +84,7 @@ public class FragmentAbout extends FragmentEx { EntityOperation.process(getContext()); startActivity(new Intent(getContext(), ActivityCompose.class) - .putExtra("id" , draft.id)); + .putExtra("id", draft.id)); } } catch (Throwable ex) { Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex)); diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 6c927029..30d13a89 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -19,17 +19,9 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.TextInputLayout; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.AsyncTaskLoader; -import android.support.v4.content.Loader; -import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; @@ -46,6 +38,7 @@ import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.Toast; +import com.google.android.material.textfield.TextInputLayout; import com.sun.mail.imap.IMAPFolder; import com.sun.mail.imap.IMAPStore; @@ -58,6 +51,14 @@ import javax.mail.Folder; import javax.mail.MessagingException; import javax.mail.Session; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.lifecycle.Observer; +import androidx.loader.app.LoaderManager; +import androidx.loader.content.AsyncTaskLoader; +import androidx.loader.content.Loader; + public class FragmentAccount extends FragmentEx { private List providers; @@ -149,7 +150,8 @@ public class FragmentAccount extends FragmentEx { args.putBoolean("synchronize", cbSynchronize.isChecked()); args.putBoolean("primary", cbPrimary.isChecked()); - getLoaderManager().restartLoader(ActivityView.LOADER_ACCOUNT_PUT, args, putLoaderCallbacks).forceLoad(); + LoaderManager.getInstance(FragmentAccount.this) + .restartLoader(ActivityView.LOADER_ACCOUNT_PUT, args, putLoaderCallbacks).forceLoad(); } }); @@ -382,7 +384,7 @@ public class FragmentAccount extends FragmentEx { @Override public void onLoadFinished(@NonNull Loader loader, Throwable ex) { - getLoaderManager().destroyLoader(loader.getId()); + LoaderManager.getInstance(FragmentAccount.this).destroyLoader(loader.getId()); btnSave.setEnabled(true); pbCheck.setVisibility(View.GONE); diff --git a/app/src/main/java/eu/faircode/email/FragmentAccounts.java b/app/src/main/java/eu/faircode/email/FragmentAccounts.java index db8bd411..aa7a202c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccounts.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccounts.java @@ -19,22 +19,24 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.constraint.Group; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.Group; +import androidx.fragment.app.FragmentTransaction; +import androidx.lifecycle.Observer; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + public class FragmentAccounts extends FragmentEx { private RecyclerView rvAccount; private ProgressBar pbWait; diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index a6d9e7f6..9084e0f0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -19,21 +19,12 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.os.Bundle; import android.os.Handler; import android.provider.ContactsContract; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.constraint.Group; -import android.support.design.widget.BottomNavigationView; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.AsyncTaskLoader; -import android.support.v4.content.Loader; import android.text.Html; import android.text.TextUtils; import android.util.Log; @@ -50,6 +41,8 @@ import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.Toast; +import com.google.android.material.bottomnavigation.BottomNavigationView; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -61,6 +54,15 @@ import javax.mail.Address; import javax.mail.MessagingException; import javax.mail.internet.InternetAddress; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.Group; +import androidx.fragment.app.FragmentTransaction; +import androidx.lifecycle.Observer; +import androidx.loader.app.LoaderManager; +import androidx.loader.content.AsyncTaskLoader; +import androidx.loader.content.Loader; + import static android.app.Activity.RESULT_OK; public class FragmentCompose extends FragmentEx { @@ -213,7 +215,8 @@ public class FragmentCompose extends FragmentEx { ivIdentityAdd.setVisibility(View.VISIBLE); // Get might select another identity - getLoaderManager().restartLoader(ActivityCompose.LOADER_COMPOSE_GET, getArguments(), getLoaderCallbacks).forceLoad(); + LoaderManager.getInstance(FragmentCompose.this) + .restartLoader(ActivityCompose.LOADER_COMPOSE_GET, getArguments(), getLoaderCallbacks).forceLoad(); } }); } @@ -305,7 +308,8 @@ public class FragmentCompose extends FragmentEx { args.putString("body", etBody.getText().toString()); args.putString("action", action); - getLoaderManager().restartLoader(ActivityCompose.LOADER_COMPOSE_PUT, args, putLoaderCallbacks).forceLoad(); + LoaderManager.getInstance(this) + .restartLoader(ActivityCompose.LOADER_COMPOSE_PUT, args, putLoaderCallbacks).forceLoad(); } private static class GetLoader extends AsyncTaskLoader { @@ -394,7 +398,7 @@ public class FragmentCompose extends FragmentEx { @Override public void onLoadFinished(@NonNull Loader loader, Bundle result) { - getLoaderManager().destroyLoader(loader.getId()); + LoaderManager.getInstance(FragmentCompose.this).destroyLoader(loader.getId()); long iid = result.getLong("iid", -1); long rid = result.getLong("rid", -1); @@ -618,7 +622,7 @@ public class FragmentCompose extends FragmentEx { @Override public void onLoadFinished(@NonNull Loader loader, Throwable ex) { - getLoaderManager().destroyLoader(loader.getId()); + LoaderManager.getInstance(FragmentCompose.this).destroyLoader(loader.getId()); String action = args.getString("action"); Log.i(Helper.TAG, "Put finished action=" + action + " ex=" + ex); diff --git a/app/src/main/java/eu/faircode/email/FragmentEula.java b/app/src/main/java/eu/faircode/email/FragmentEula.java index 08b79148..4dc027cb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentEula.java +++ b/app/src/main/java/eu/faircode/email/FragmentEula.java @@ -22,13 +22,14 @@ package eu.faircode.email; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + public class FragmentEula extends FragmentEx { @Override @@ -43,7 +44,7 @@ public class FragmentEula extends FragmentEx { @Override public void onClick(View view) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - prefs.edit().putBoolean("eula" , true).apply(); + prefs.edit().putBoolean("eula", true).apply(); } }); diff --git a/app/src/main/java/eu/faircode/email/FragmentEx.java b/app/src/main/java/eu/faircode/email/FragmentEx.java index 315c6635..c138aa6b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentEx.java +++ b/app/src/main/java/eu/faircode/email/FragmentEx.java @@ -1,11 +1,12 @@ package eu.faircode.email; -import android.support.v4.app.Fragment; -import android.support.v7.app.ActionBar; -import android.support.v7.app.AppCompatActivity; import android.view.View; import android.view.inputmethod.InputMethodManager; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; + public class FragmentEx extends Fragment { private String subtitle = " "; diff --git a/app/src/main/java/eu/faircode/email/FragmentFolder.java b/app/src/main/java/eu/faircode/email/FragmentFolder.java index 7ab269f5..b4304c58 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolder.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolder.java @@ -19,15 +19,8 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.content.Context; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.constraint.Group; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.AsyncTaskLoader; -import android.support.v4.content.Loader; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; @@ -39,6 +32,14 @@ import android.widget.EditText; import android.widget.ProgressBar; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.Group; +import androidx.lifecycle.Observer; +import androidx.loader.app.LoaderManager; +import androidx.loader.content.AsyncTaskLoader; +import androidx.loader.content.Loader; + public class FragmentFolder extends FragmentEx { private CheckBox cbSynchronize; private EditText etAfter; @@ -77,7 +78,8 @@ public class FragmentFolder extends FragmentEx { args.putBoolean("synchronize", cbSynchronize.isChecked()); args.putString("after", etAfter.getText().toString()); - getLoaderManager().restartLoader(ActivityView.LOADER_FOLDER_PUT, args, putLoaderCallbacks).forceLoad(); + LoaderManager.getInstance(FragmentFolder.this) + .restartLoader(ActivityView.LOADER_FOLDER_PUT, args, putLoaderCallbacks).forceLoad(); } }); @@ -163,7 +165,7 @@ public class FragmentFolder extends FragmentEx { @Override public void onLoadFinished(@NonNull Loader loader, Throwable ex) { - getLoaderManager().destroyLoader(loader.getId()); + LoaderManager.getInstance(FragmentFolder.this).destroyLoader(loader.getId()); btnSave.setEnabled(true); pbSave.setVisibility(View.GONE); diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index 7a5d855a..2d53ff80 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -19,22 +19,24 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.constraint.Group; -import android.support.design.widget.FloatingActionButton; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.Toast; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.Group; +import androidx.lifecycle.Observer; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + public class FragmentFolders extends FragmentEx { private RecyclerView rvFolder; private ProgressBar pbWait; diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentities.java b/app/src/main/java/eu/faircode/email/FragmentIdentities.java index 8930ca9c..72249e1b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentities.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentities.java @@ -19,22 +19,24 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.constraint.Group; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.app.FragmentTransaction; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + import java.util.List; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.Group; +import androidx.fragment.app.FragmentTransaction; +import androidx.lifecycle.Observer; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + public class FragmentIdentities extends FragmentEx { private RecyclerView rvIdentity; private ProgressBar pbWait; diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 89fd5bb3..6a9963cc 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -19,17 +19,9 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.design.widget.TextInputLayout; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.AsyncTaskLoader; -import android.support.v4.content.Loader; -import android.support.v7.app.AlertDialog; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -48,6 +40,8 @@ import android.widget.ProgressBar; import android.widget.Spinner; import android.widget.Toast; +import com.google.android.material.textfield.TextInputLayout; + import java.util.List; import java.util.Objects; import java.util.Properties; @@ -57,6 +51,14 @@ import java.util.concurrent.Executors; import javax.mail.Session; import javax.mail.Transport; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.lifecycle.Observer; +import androidx.loader.app.LoaderManager; +import androidx.loader.content.AsyncTaskLoader; +import androidx.loader.content.Loader; + public class FragmentIdentity extends FragmentEx { private List providers; @@ -179,7 +181,8 @@ public class FragmentIdentity extends FragmentEx { args.putBoolean("synchronize", cbSynchronize.isChecked()); args.putBoolean("primary", cbPrimary.isChecked()); - getLoaderManager().restartLoader(ActivityView.LOADER_IDENTITY_PUT, args, putLoaderCallbacks).forceLoad(); + LoaderManager.getInstance(FragmentIdentity.this) + .restartLoader(ActivityView.LOADER_IDENTITY_PUT, args, putLoaderCallbacks).forceLoad(); } }); @@ -341,7 +344,7 @@ public class FragmentIdentity extends FragmentEx { @Override public void onLoadFinished(@NonNull Loader loader, Throwable ex) { - getLoaderManager().destroyLoader(loader.getId()); + LoaderManager.getInstance(FragmentIdentity.this).destroyLoader(loader.getId()); btnSave.setEnabled(true); pbCheck.setVisibility(View.GONE); diff --git a/app/src/main/java/eu/faircode/email/FragmentMessage.java b/app/src/main/java/eu/faircode/email/FragmentMessage.java index 4e8c4c0e..cbb28c3d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessage.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessage.java @@ -19,26 +19,12 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.Observer; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Typeface; import android.net.Uri; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.constraint.Group; -import android.support.customtabs.CustomTabsIntent; -import android.support.design.widget.BottomNavigationView; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.AsyncTaskLoader; -import android.support.v4.content.Loader; -import android.support.v7.app.AlertDialog; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.PopupMenu; -import android.support.v7.widget.RecyclerView; import android.text.Html; import android.text.Layout; import android.text.Spannable; @@ -55,6 +41,8 @@ import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; +import com.google.android.material.bottomnavigation.BottomNavigationView; + import java.text.Collator; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -66,6 +54,20 @@ import java.util.Locale; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.widget.PopupMenu; +import androidx.browser.customtabs.CustomTabsIntent; +import androidx.constraintlayout.widget.Group; +import androidx.fragment.app.FragmentTransaction; +import androidx.lifecycle.Observer; +import androidx.loader.app.LoaderManager; +import androidx.loader.content.AsyncTaskLoader; +import androidx.loader.content.Loader; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + public class FragmentMessage extends FragmentEx { private TextView tvTime; private TextView tvFrom; @@ -471,7 +473,8 @@ public class FragmentMessage extends FragmentEx { private void onActionMove(final long id) { Bundle args = new Bundle(); args.putLong("id", id); - getLoaderManager().restartLoader(ActivityView.LOADER_MESSAGE_MOVE, args, moveLoaderCallbacks).forceLoad(); + LoaderManager.getInstance(this) + .restartLoader(ActivityView.LOADER_MESSAGE_MOVE, args, moveLoaderCallbacks).forceLoad(); } private void onActionArchive(final long id) { @@ -555,7 +558,7 @@ public class FragmentMessage extends FragmentEx { @Override public void onLoadFinished(@NonNull Loader> loader, List folders) { - getLoaderManager().destroyLoader(loader.getId()); + LoaderManager.getInstance(FragmentMessage.this).destroyLoader(loader.getId()); View anchor = top_navigation.findViewById(R.id.action_thread); PopupMenu popupMenu = new PopupMenu(getContext(), anchor); diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 24d46962..f3ea162c 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -19,23 +19,10 @@ package eu.faircode.email; Copyright 2018 by Marcel Bokhorst (M66B) */ -import android.arch.lifecycle.LiveData; -import android.arch.lifecycle.Observer; -import android.arch.paging.LivePagedListBuilder; -import android.arch.paging.PagedList; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.constraint.Group; -import android.support.design.widget.FloatingActionButton; -import android.support.v4.app.LoaderManager; -import android.support.v4.content.AsyncTaskLoader; -import android.support.v4.content.Loader; -import android.support.v7.widget.LinearLayoutManager; -import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; @@ -43,6 +30,21 @@ import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.Group; +import androidx.lifecycle.LiveData; +import androidx.lifecycle.Observer; +import androidx.loader.app.LoaderManager; +import androidx.loader.content.AsyncTaskLoader; +import androidx.loader.content.Loader; +import androidx.paging.LivePagedListBuilder; +import androidx.paging.PagedList; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + public class FragmentMessages extends FragmentEx { private RecyclerView rvMessage; private TextView tvNoEmail; @@ -149,7 +151,8 @@ public class FragmentMessages extends FragmentEx { } }); - getLoaderManager().restartLoader(ActivityView.LOADER_MESSAGES_INIT, new Bundle(), initLoaderCallbacks).forceLoad(); + LoaderManager.getInstance(this) + .restartLoader(ActivityView.LOADER_MESSAGES_INIT, new Bundle(), initLoaderCallbacks).forceLoad(); } private static class InitLoader extends AsyncTaskLoader { diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index ac4a82b5..17f3fa77 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -20,15 +20,10 @@ package eu.faircode.email; */ import android.Manifest; -import android.arch.lifecycle.Observer; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.Bundle; import android.preference.PreferenceManager; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.support.v4.app.FragmentTransaction; -import android.support.v4.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -42,6 +37,12 @@ import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.fragment.app.FragmentTransaction; +import androidx.lifecycle.Observer; + public class FragmentSetup extends FragmentEx { private Button btnAccount; private ProgressBar pbAccount; diff --git a/app/src/main/java/eu/faircode/email/FragmentWebView.java b/app/src/main/java/eu/faircode/email/FragmentWebView.java index 7ddb2da3..84fcea6b 100644 --- a/app/src/main/java/eu/faircode/email/FragmentWebView.java +++ b/app/src/main/java/eu/faircode/email/FragmentWebView.java @@ -20,8 +20,6 @@ package eu.faircode.email; */ import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -31,6 +29,9 @@ import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ProgressBar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + // https://developer.android.com/reference/android/webkit/WebView public class FragmentWebView extends FragmentEx { diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 2feccd41..b3ad4854 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -72,33 +72,33 @@ public class Helper { if (bytes < unit) return bytes + " B"; int exp = (int) (Math.log(bytes) / Math.log(unit)); String pre = (si ? "kMGTPE" : "KMGTPE").charAt(exp - 1) + (si ? "" : "i"); - return String.format("%.1f %sB" , bytes / Math.pow(unit, exp), pre); + return String.format("%.1f %sB", bytes / Math.pow(unit, exp), pre); } static StringBuilder getDebugInfo() { StringBuilder sb = new StringBuilder(); // Get version info - sb.append(String.format("%s: %s/%d\r\n" , BuildConfig.APPLICATION_ID, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)); - sb.append(String.format("Android: %s (SDK %d)\r\n" , Build.VERSION.RELEASE, Build.VERSION.SDK_INT)); + sb.append(String.format("%s: %s/%d\r\n", BuildConfig.APPLICATION_ID, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE)); + sb.append(String.format("Android: %s (SDK %d)\r\n", Build.VERSION.RELEASE, Build.VERSION.SDK_INT)); sb.append("\r\n"); // Get device info - sb.append(String.format("Brand: %s\r\n" , Build.BRAND)); - sb.append(String.format("Manufacturer: %s\r\n" , Build.MANUFACTURER)); - sb.append(String.format("Model: %s\r\n" , Build.MODEL)); - sb.append(String.format("Product: %s\r\n" , Build.PRODUCT)); - sb.append(String.format("Device: %s\r\n" , Build.DEVICE)); - sb.append(String.format("Host: %s\r\n" , Build.HOST)); - sb.append(String.format("Display: %s\r\n" , Build.DISPLAY)); - sb.append(String.format("Id: %s\r\n" , Build.ID)); + sb.append(String.format("Brand: %s\r\n", Build.BRAND)); + sb.append(String.format("Manufacturer: %s\r\n", Build.MANUFACTURER)); + sb.append(String.format("Model: %s\r\n", Build.MODEL)); + sb.append(String.format("Product: %s\r\n", Build.PRODUCT)); + sb.append(String.format("Device: %s\r\n", Build.DEVICE)); + sb.append(String.format("Host: %s\r\n", Build.HOST)); + sb.append(String.format("Display: %s\r\n", Build.DISPLAY)); + sb.append(String.format("Id: %s\r\n", Build.ID)); sb.append("\r\n"); // Get logcat Process proc = null; BufferedReader br = null; try { - String[] cmd = new String[]{"logcat" , "-d" , "-v" , "threadtime"}; + String[] cmd = new String[]{"logcat", "-d", "-v", "threadtime"}; proc = Runtime.getRuntime().exec(cmd); br = new BufferedReader(new InputStreamReader(proc.getInputStream())); String line; diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index a17f6a72..f84b19ee 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -58,20 +58,20 @@ public class HtmlHelper implements NodeVisitor { if (!refs.contains(ref)) refs.add(ref); String alt = context.getString(R.string.title_link); - text = text.replace(ref, String.format("%s [%d]" , ref, alt, refs.size())); + text = text.replace(ref, String.format("%s [%d]", ref, alt, refs.size())); } sb.append(text); } else if (name.equals("li")) sb.append(newline).append(" * "); else if (name.equals("dt")) sb.append(" "); - else if (StringUtil.in(name, "p" , "h1" , "h2" , "h3" , "h4" , "h5" , "tr" , "div")) + else if (StringUtil.in(name, "p", "h1", "h2", "h3", "h4", "h5", "tr", "div")) sb.append(newline); } public void tail(Node node, int depth) { String name = node.nodeName(); - if (StringUtil.in(name, "br" , "dd" , "dt" , "p" , "h1" , "h2" , "h3" , "h4" , "h5" , "div")) + if (StringUtil.in(name, "br", "dd", "dt", "p", "h1", "h2", "h3", "h4", "h5", "div")) sb.append(newline); else if (name.equals("a")) { String ref = node.absUrl("href"); @@ -82,7 +82,7 @@ public class HtmlHelper implements NodeVisitor { if (TextUtils.isEmpty(alt)) alt = context.getString(R.string.title_link); alt = Html.escapeHtml(alt); - sb.append(" ").append(String.format("%s [%d]" , ref, alt, refs.size())); + sb.append(" ").append(String.format("%s [%d]", ref, alt, refs.size())); } } else if (name.equals("img")) { String ref = node.absUrl("src"); @@ -93,7 +93,7 @@ public class HtmlHelper implements NodeVisitor { if (TextUtils.isEmpty(alt)) alt = context.getString(R.string.title_image); alt = Html.escapeHtml(alt); - sb.append(" ").append(String.format("%s [%d]" , ref, alt, refs.size())); + sb.append(" ").append(String.format("%s [%d]", ref, alt, refs.size())); } } } @@ -103,7 +103,7 @@ public class HtmlHelper implements NodeVisitor { if (refs.size() > 0) sb.append(newline).append(newline); for (int i = 0; i < refs.size(); i++) - sb.append(String.format("[%d] %s " , i + 1, refs.get(i))).append(newline); + sb.append(String.format("[%d] %s ", i + 1, refs.get(i))).append(newline); return sb.toString(); } diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index e3dec372..e924893d 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -52,28 +52,28 @@ public class MessageHelper { Properties props = new Properties(); // https://javaee.github.io/javamail/docs/api/com/sun/mail/imap/package-summary.html#properties - props.put("mail.imaps.ssl.checkserveridentity" , "true"); - props.put("mail.imaps.ssl.trust" , "*"); - props.put("mail.imaps.starttls.enable" , "false"); - props.put("mail.imaps.timeout" , "20000"); - props.put("mail.imaps.connectiontimeout" , "20000"); + props.put("mail.imaps.ssl.checkserveridentity", "true"); + props.put("mail.imaps.ssl.trust", "*"); + props.put("mail.imaps.starttls.enable", "false"); + props.put("mail.imaps.timeout", "20000"); + props.put("mail.imaps.connectiontimeout", "20000"); // https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html#properties - props.put("mail.smtps.ssl.checkserveridentity" , "true"); - props.put("mail.smtps.ssl.trust" , "*"); - props.put("mail.smtps.starttls.enable" , "false"); - props.put("mail.smtps.starttls.required" , "false"); - props.put("mail.smtps.auth" , "true"); - props.put("mail.smtps.timeout" , "20000"); - props.put("mail.smtps.connectiontimeout" , "20000"); - - props.put("mail.smtp.ssl.checkserveridentity" , "true"); - props.put("mail.smtp.ssl.trust" , "*"); - props.put("mail.smtp.starttls.enable" , "true"); - props.put("mail.smtp.starttls.required" , "true"); - props.put("mail.smtp.auth" , "true"); - props.put("mail.smtp.timeout" , "20000"); - props.put("mail.smtp.connectiontimeout" , "20000"); + props.put("mail.smtps.ssl.checkserveridentity", "true"); + props.put("mail.smtps.ssl.trust", "*"); + props.put("mail.smtps.starttls.enable", "false"); + props.put("mail.smtps.starttls.required", "false"); + props.put("mail.smtps.auth", "true"); + props.put("mail.smtps.timeout", "20000"); + props.put("mail.smtps.connectiontimeout", "20000"); + + props.put("mail.smtp.ssl.checkserveridentity", "true"); + props.put("mail.smtp.ssl.trust", "*"); + props.put("mail.smtp.starttls.enable", "true"); + props.put("mail.smtp.starttls.required", "true"); + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.timeout", "20000"); + props.put("mail.smtp.connectiontimeout", "20000"); return props; } @@ -106,8 +106,8 @@ public class MessageHelper { static MimeMessageEx from(EntityMessage message, EntityMessage reply, Session isession) throws MessagingException { MimeMessageEx imessage = from(message, isession); - imessage.addHeader("In-Reply-To" , reply.msgid); - imessage.addHeader("References" , (reply.references == null ? "" : reply.references + " ") + reply.msgid); + imessage.addHeader("In-Reply-To", reply.msgid); + imessage.addHeader("References", (reply.references == null ? "" : reply.references + " ") + reply.msgid); return imessage; } @@ -126,16 +126,16 @@ public class MessageHelper { } String getMessageID() throws MessagingException { - return imessage.getHeader("Message-ID" , null); + return imessage.getHeader("Message-ID", null); } String[] getReferences() throws MessagingException { - String refs = imessage.getHeader("References" , null); + String refs = imessage.getHeader("References", null); return (refs == null ? new String[0] : refs.split("\\s+")); } String getInReplyTo() throws MessagingException { - return imessage.getHeader("In-Reply-To" , null); + return imessage.getHeader("In-Reply-To", null); } String getThreadId(long uid) throws MessagingException { @@ -181,7 +181,7 @@ public class MessageHelper { formatted.add(personal); } else formatted.add(address.toString()); - return TextUtils.join(", " , formatted); + return TextUtils.join(", ", formatted); } String getHtml() throws MessagingException { @@ -193,7 +193,7 @@ public class MessageHelper { try { String s = part.getContent().toString(); if (part.isMimeType("text/plain")) - s = "
" + s.replaceAll("\\r?\\n" , "
") + "
"; + s = "
" + s.replaceAll("\\r?\\n", "
") + "
"; return s; } catch (IOException ex) { Log.w(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex)); diff --git a/app/src/main/java/eu/faircode/email/MimeMessageEx.java b/app/src/main/java/eu/faircode/email/MimeMessageEx.java index 2e477f28..7e6bf8e7 100644 --- a/app/src/main/java/eu/faircode/email/MimeMessageEx.java +++ b/app/src/main/java/eu/faircode/email/MimeMessageEx.java @@ -30,7 +30,7 @@ public class MimeMessageEx extends MimeMessage { .append("anonymous@localhost") .append('>'); - setHeader("Message-ID" , sb.toString()); + setHeader("Message-ID", sb.toString()); Log.i(Helper.TAG, "Override Message-ID=" + sb.toString()); } catch (Throwable ex) { Log.e(Helper.TAG, ex + "\n" + Log.getStackTraceString(ex)); @@ -50,7 +50,7 @@ public class MimeMessageEx extends MimeMessage { String part = parts.get(0); parts.remove(0); - if (!TextUtils.join("." , parts).startsWith(BuildConfig.APPLICATION_ID)) + if (!TextUtils.join(".", parts).startsWith(BuildConfig.APPLICATION_ID)) return -1; long id = Long.parseLong(part.substring(1)); diff --git a/app/src/main/java/eu/faircode/email/Provider.java b/app/src/main/java/eu/faircode/email/Provider.java index 7a79579b..bd24d32e 100644 --- a/app/src/main/java/eu/faircode/email/Provider.java +++ b/app/src/main/java/eu/faircode/email/Provider.java @@ -62,11 +62,11 @@ public class Provider { provider.name = xml.getAttributeValue(null, "name"); } else if ("imap".equals(xml.getName())) { provider.imap_host = xml.getAttributeValue(null, "host"); - provider.imap_port = xml.getAttributeIntValue(null, "port" , 0); + provider.imap_port = xml.getAttributeIntValue(null, "port", 0); } else if ("smtp".equals(xml.getName())) { provider.smtp_host = xml.getAttributeValue(null, "host"); - provider.smtp_port = xml.getAttributeIntValue(null, "port" , 0); - provider.starttls = xml.getAttributeBooleanValue(null, "starttls" , false); + provider.smtp_port = xml.getAttributeIntValue(null, "port", 0); + provider.starttls = xml.getAttributeBooleanValue(null, "starttls", false); } else throw new IllegalAccessException(xml.getName()); } else if (eventType == XmlPullParser.END_TAG) { diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 44e0ba8b..f96afea6 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -23,8 +23,6 @@ import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; -import android.arch.lifecycle.LifecycleService; -import android.arch.lifecycle.Observer; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -37,9 +35,6 @@ import android.net.NetworkRequest; import android.net.Uri; import android.os.Build; import android.os.SystemClock; -import android.support.annotation.Nullable; -import android.support.v4.content.ContextCompat; -import android.support.v4.content.LocalBroadcastManager; import android.text.TextUtils; import android.util.Log; @@ -93,6 +88,12 @@ import javax.mail.internet.MimeMessage; import javax.mail.search.ComparisonTerm; import javax.mail.search.ReceivedDateTerm; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; +import androidx.lifecycle.LifecycleService; +import androidx.lifecycle.Observer; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + public class ServiceSynchronize extends LifecycleService { private ServiceState state = new ServiceState(); private ExecutorService executor = Executors.newSingleThreadExecutor(); diff --git a/app/src/main/java/eu/faircode/email/TupleAttachment.java b/app/src/main/java/eu/faircode/email/TupleAttachment.java index 3b73f3d1..61b2682d 100644 --- a/app/src/main/java/eu/faircode/email/TupleAttachment.java +++ b/app/src/main/java/eu/faircode/email/TupleAttachment.java @@ -1,6 +1,6 @@ package eu.faircode.email; -import android.support.annotation.NonNull; +import androidx.annotation.NonNull; public class TupleAttachment { @NonNull diff --git a/app/src/main/res/layout/activity_compose.xml b/app/src/main/res/layout/activity_compose.xml index 97bcce76..7178bf64 100644 --- a/app/src/main/res/layout/activity_compose.xml +++ b/app/src/main/res/layout/activity_compose.xml @@ -1,4 +1,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_setup.xml b/app/src/main/res/layout/activity_setup.xml index 97bcce76..7178bf64 100644 --- a/app/src/main/res/layout/activity_setup.xml +++ b/app/src/main/res/layout/activity_setup.xml @@ -1,4 +1,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_view.xml b/app/src/main/res/layout/activity_view.xml index e2f62c64..b3c57ae1 100644 --- a/app/src/main/res/layout/activity_view.xml +++ b/app/src/main/res/layout/activity_view.xml @@ -1,4 +1,4 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index 49c4ae28..36cc09a8 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - @@ -59,5 +59,5 @@ android:textAppearance="@style/TextAppearance.AppCompat.Small" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvEula" /> - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_account.xml b/app/src/main/res/layout/fragment_account.xml index af292322..aa8593af 100644 --- a/app/src/main/res/layout/fragment_account.xml +++ b/app/src/main/res/layout/fragment_account.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context=".ActivityView"> - @@ -142,7 +142,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/etUser" /> - - - + - - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_accounts.xml b/app/src/main/res/layout/fragment_accounts.xml index f3360e5f..c35ae525 100644 --- a/app/src/main/res/layout/fragment_accounts.xml +++ b/app/src/main/res/layout/fragment_accounts.xml @@ -1,12 +1,12 @@ - - - - - + diff --git a/app/src/main/res/layout/fragment_compose.xml b/app/src/main/res/layout/fragment_compose.xml index 6b59e916..dff685da 100644 --- a/app/src/main/res/layout/fragment_compose.xml +++ b/app/src/main/res/layout/fragment_compose.xml @@ -1,5 +1,5 @@ - @@ -146,7 +146,7 @@ android:textAppearance="@style/TextAppearance.AppCompat.Small" /> - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_eula.xml b/app/src/main/res/layout/fragment_eula.xml index 9ada3fec..bef5bc94 100644 --- a/app/src/main/res/layout/fragment_eula.xml +++ b/app/src/main/res/layout/fragment_eula.xml @@ -4,7 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - @@ -37,5 +37,5 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/btnCancel" app:layout_constraintTop_toBottomOf="@id/tvEula" /> - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_folder.xml b/app/src/main/res/layout/fragment_folder.xml index c966dc57..62a2f4a7 100644 --- a/app/src/main/res/layout/fragment_folder.xml +++ b/app/src/main/res/layout/fragment_folder.xml @@ -8,7 +8,7 @@ android:orientation="vertical" tools:context=".ActivityView"> - @@ -75,10 +75,10 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_folders.xml b/app/src/main/res/layout/fragment_folders.xml index 9d23c5c7..e7b0167a 100644 --- a/app/src/main/res/layout/fragment_folders.xml +++ b/app/src/main/res/layout/fragment_folders.xml @@ -1,12 +1,12 @@ - - - - - + diff --git a/app/src/main/res/layout/fragment_identities.xml b/app/src/main/res/layout/fragment_identities.xml index 8a13a4b8..656b1491 100644 --- a/app/src/main/res/layout/fragment_identities.xml +++ b/app/src/main/res/layout/fragment_identities.xml @@ -1,12 +1,12 @@ - - - - - + diff --git a/app/src/main/res/layout/fragment_identity.xml b/app/src/main/res/layout/fragment_identity.xml index b0e274c6..1bb99458 100644 --- a/app/src/main/res/layout/fragment_identity.xml +++ b/app/src/main/res/layout/fragment_identity.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context=".ActivityView"> - @@ -194,7 +194,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/etUser" /> - - - + - - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_message.xml b/app/src/main/res/layout/fragment_message.xml index e579f30f..1791d04a 100644 --- a/app/src/main/res/layout/fragment_message.xml +++ b/app/src/main/res/layout/fragment_message.xml @@ -1,5 +1,5 @@ - - - - - - - - + diff --git a/app/src/main/res/layout/fragment_messages.xml b/app/src/main/res/layout/fragment_messages.xml index e707f114..dd0277b9 100644 --- a/app/src/main/res/layout/fragment_messages.xml +++ b/app/src/main/res/layout/fragment_messages.xml @@ -1,5 +1,5 @@ - - - - - + diff --git a/app/src/main/res/layout/fragment_setup.xml b/app/src/main/res/layout/fragment_setup.xml index 113d5261..44b3e07c 100644 --- a/app/src/main/res/layout/fragment_setup.xml +++ b/app/src/main/res/layout/fragment_setup.xml @@ -7,7 +7,7 @@ android:orientation="vertical" tools:context=".ActivityView"> - @@ -156,5 +156,5 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/cbDarkTheme" /> - + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_webview.xml b/app/src/main/res/layout/fragment_webview.xml index 25a1cc48..bd324132 100644 --- a/app/src/main/res/layout/fragment_webview.xml +++ b/app/src/main/res/layout/fragment_webview.xml @@ -1,5 +1,5 @@ - @@ -22,4 +22,4 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/progressbar" /> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_account.xml b/app/src/main/res/layout/item_account.xml index ce603f4e..a9e0bc4f 100644 --- a/app/src/main/res/layout/item_account.xml +++ b/app/src/main/res/layout/item_account.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_attachment.xml b/app/src/main/res/layout/item_attachment.xml index d34923c4..82cfdb44 100644 --- a/app/src/main/res/layout/item_attachment.xml +++ b/app/src/main/res/layout/item_attachment.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_drawer.xml b/app/src/main/res/layout/item_drawer.xml index c51e455a..95106a5a 100644 --- a/app/src/main/res/layout/item_drawer.xml +++ b/app/src/main/res/layout/item_drawer.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_folder.xml b/app/src/main/res/layout/item_folder.xml index f1f07dbb..08090ef8 100644 --- a/app/src/main/res/layout/item_folder.xml +++ b/app/src/main/res/layout/item_folder.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_identity.xml b/app/src/main/res/layout/item_identity.xml index 05853514..51b74793 100644 --- a/app/src/main/res/layout/item_identity.xml +++ b/app/src/main/res/layout/item_identity.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/item_message.xml b/app/src/main/res/layout/item_message.xml index e90506d7..c92dd762 100644 --- a/app/src/main/res/layout/item_message.xml +++ b/app/src/main/res/layout/item_message.xml @@ -1,5 +1,5 @@ - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/spinner_dropdown_item.xml b/app/src/main/res/layout/spinner_dropdown_item.xml index a7009f08..e9627702 100644 --- a/app/src/main/res/layout/spinner_dropdown_item.xml +++ b/app/src/main/res/layout/spinner_dropdown_item.xml @@ -6,5 +6,6 @@ android:layout_height="?android:attr/listPreferredItemHeightSmall" android:ellipsize="marquee" android:singleLine="true" + android:text="Title" android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textColor="?android:textColorPrimary" /> diff --git a/app/src/main/res/layout/spinner_item.xml b/app/src/main/res/layout/spinner_item.xml index 0cc30d8f..32c6e6bf 100644 --- a/app/src/main/res/layout/spinner_item.xml +++ b/app/src/main/res/layout/spinner_item.xml @@ -6,6 +6,7 @@ android:layout_height="wrap_content" android:ellipsize="marquee" android:singleLine="true" + android:text="Title" android:textAlignment="inherit" android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textColor="?android:textColorPrimary" />