diff --git a/app/build.gradle b/app/build.gradle index e41e0fcc2b..a6e72127fb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -109,6 +109,7 @@ dependencies { def lifecycle_version = "2.0.0" def room_version = "2.0.0" def paging_version = "2.1.0" + def preference_version = "1.0.0" def work_version = "1.0.0" def billingclient_version = "1.2.1" def javamail_version = "1.6.3" @@ -149,6 +150,9 @@ dependencies { // https://mvnrepository.com/artifact/androidx.paging/paging-runtime implementation "androidx.paging:paging-runtime:$paging_version" + // https://mvnrepository.com/artifact/androidx.preference/preference + implementation "androidx.preference:preference:$preference_version" + // https://mvnrepository.com/artifact/android.arch.work/work-runtime implementation "android.arch.work:work-runtime:$work_version" diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index 860813b90a..0149fabffd 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -24,7 +24,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.os.Bundle; -import android.preference.PreferenceManager; import android.view.View; import java.util.ArrayList; @@ -34,6 +33,7 @@ import java.util.List; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; +import androidx.preference.PreferenceManager; abstract class ActivityBase extends AppCompatActivity implements SharedPreferences.OnSharedPreferenceChangeListener { private boolean contacts; diff --git a/app/src/main/java/eu/faircode/email/ActivityBilling.java b/app/src/main/java/eu/faircode/email/ActivityBilling.java index 61dd58a822..a35eec0ec8 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBilling.java +++ b/app/src/main/java/eu/faircode/email/ActivityBilling.java @@ -27,7 +27,6 @@ import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.os.Handler; -import android.preference.PreferenceManager; import android.provider.Settings; import android.util.Base64; import android.view.View; @@ -50,6 +49,7 @@ import androidx.annotation.Nullable; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedListener { private BillingClient billingClient = null; diff --git a/app/src/main/java/eu/faircode/email/ActivityMain.java b/app/src/main/java/eu/faircode/email/ActivityMain.java index b51aab23fb..a7e0ed24ae 100644 --- a/app/src/main/java/eu/faircode/email/ActivityMain.java +++ b/app/src/main/java/eu/faircode/email/ActivityMain.java @@ -24,13 +24,13 @@ import android.content.Intent; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; -import android.preference.PreferenceManager; import java.util.List; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; +import androidx.preference.PreferenceManager; public class ActivityMain extends AppCompatActivity implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener { @Override diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 0f94aa6f86..1cbf4b7868 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -31,7 +31,6 @@ import android.content.res.AssetFileDescriptor; import android.content.res.Configuration; import android.net.Uri; import android.os.Bundle; -import android.preference.PreferenceManager; import android.provider.Settings; import android.text.TextUtils; import android.view.LayoutInflater; @@ -79,6 +78,7 @@ import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Observer; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; public class ActivitySetup extends ActivityBilling implements FragmentManager.OnBackStackChangedListener { private View view; diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index c587f1c7d1..3273ecd6ca 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -33,7 +33,6 @@ import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.ParcelFileDescriptor; -import android.preference.PreferenceManager; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.MenuItem; @@ -91,6 +90,7 @@ import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Observer; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; public class ActivityView extends ActivityBilling implements FragmentManager.OnBackStackChangedListener { private boolean unified; diff --git a/app/src/main/java/eu/faircode/email/AdapterAttachment.java b/app/src/main/java/eu/faircode/email/AdapterAttachment.java index a4960bc628..578a0dd881 100644 --- a/app/src/main/java/eu/faircode/email/AdapterAttachment.java +++ b/app/src/main/java/eu/faircode/email/AdapterAttachment.java @@ -27,7 +27,6 @@ import android.content.pm.ResolveInfo; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; -import android.preference.PreferenceManager; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -50,6 +49,7 @@ import androidx.annotation.NonNull; import androidx.core.content.FileProvider; import androidx.lifecycle.LifecycleOwner; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.ListUpdateCallback; import androidx.recyclerview.widget.RecyclerView; diff --git a/app/src/main/java/eu/faircode/email/AdapterFolder.java b/app/src/main/java/eu/faircode/email/AdapterFolder.java index 0209bfc523..7ba5c48db3 100644 --- a/app/src/main/java/eu/faircode/email/AdapterFolder.java +++ b/app/src/main/java/eu/faircode/email/AdapterFolder.java @@ -27,7 +27,6 @@ import android.content.res.ColorStateList; import android.graphics.Color; import android.graphics.Typeface; import android.os.Bundle; -import android.preference.PreferenceManager; import android.text.TextUtils; import android.util.TypedValue; import android.view.LayoutInflater; @@ -48,6 +47,7 @@ import androidx.annotation.NonNull; import androidx.appcompat.widget.PopupMenu; import androidx.lifecycle.LifecycleOwner; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.ListUpdateCallback; import androidx.recyclerview.widget.RecyclerView; diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index a9e01f01ba..080fa5293d 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -41,7 +41,6 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.preference.PreferenceManager; import android.print.PrintAttributes; import android.print.PrintDocumentAdapter; import android.print.PrintManager; @@ -123,6 +122,7 @@ import androidx.lifecycle.Observer; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.paging.AsyncPagedListDiffer; import androidx.paging.PagedList; +import androidx.preference.PreferenceManager; import androidx.recyclerview.selection.ItemDetailsLookup; import androidx.recyclerview.selection.SelectionTracker; import androidx.recyclerview.widget.DiffUtil; diff --git a/app/src/main/java/eu/faircode/email/AdapterOperation.java b/app/src/main/java/eu/faircode/email/AdapterOperation.java index 834fd12f0f..d86cf69cc2 100644 --- a/app/src/main/java/eu/faircode/email/AdapterOperation.java +++ b/app/src/main/java/eu/faircode/email/AdapterOperation.java @@ -23,7 +23,6 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; import android.text.format.DateUtils; import android.view.LayoutInflater; import android.view.View; @@ -39,6 +38,7 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.lifecycle.LifecycleOwner; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.DiffUtil; import androidx.recyclerview.widget.ListUpdateCallback; import androidx.recyclerview.widget.RecyclerView; diff --git a/app/src/main/java/eu/faircode/email/ContactInfo.java b/app/src/main/java/eu/faircode/email/ContactInfo.java index 38a759ba6c..c48570fbab 100644 --- a/app/src/main/java/eu/faircode/email/ContactInfo.java +++ b/app/src/main/java/eu/faircode/email/ContactInfo.java @@ -8,7 +8,6 @@ import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; -import android.preference.PreferenceManager; import android.provider.ContactsContract; import java.io.InputStream; @@ -19,6 +18,8 @@ import java.util.Map; import javax.mail.Address; import javax.mail.internet.InternetAddress; +import androidx.preference.PreferenceManager; + public class ContactInfo { private String email; private Bitmap bitmap; diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 4d901bc073..e641c6f1c7 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -13,7 +13,6 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.SystemClock; -import android.preference.PreferenceManager; import android.text.TextUtils; import com.sun.mail.iap.ConnectionException; @@ -86,6 +85,7 @@ import javax.net.ssl.SSLException; import androidx.annotation.NonNull; import androidx.core.app.NotificationCompat; +import androidx.preference.PreferenceManager; import static android.os.Process.THREAD_PRIORITY_BACKGROUND; diff --git a/app/src/main/java/eu/faircode/email/DB.java b/app/src/main/java/eu/faircode/email/DB.java index b57542d6c6..43415988ec 100644 --- a/app/src/main/java/eu/faircode/email/DB.java +++ b/app/src/main/java/eu/faircode/email/DB.java @@ -3,7 +3,6 @@ package eu.faircode.email; import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; -import android.preference.PreferenceManager; import android.text.TextUtils; import org.json.JSONArray; @@ -19,6 +18,7 @@ import java.util.concurrent.Executors; import javax.mail.Address; import javax.mail.internet.InternetAddress; +import androidx.preference.PreferenceManager; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index 5e5f5503d0..79a02eb35c 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -21,7 +21,6 @@ package eu.faircode.email; import android.content.Context; import android.content.SharedPreferences; -import android.preference.PreferenceManager; import org.json.JSONArray; import org.json.JSONException; @@ -33,6 +32,7 @@ import java.util.Date; import java.util.Objects; import androidx.annotation.NonNull; +import androidx.preference.PreferenceManager; import androidx.room.Entity; import androidx.room.ForeignKey; import androidx.room.Index; diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 68dd83d6aa..157c347bbe 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -45,7 +45,6 @@ import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.os.Looper; -import android.preference.PreferenceManager; import android.provider.ContactsContract; import android.provider.OpenableColumns; import android.text.Editable; @@ -127,6 +126,7 @@ import androidx.cursoradapter.widget.SimpleCursorAdapter; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Observer; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; diff --git a/app/src/main/java/eu/faircode/email/FragmentEula.java b/app/src/main/java/eu/faircode/email/FragmentEula.java index 4386187e0f..2906379f97 100644 --- a/app/src/main/java/eu/faircode/email/FragmentEula.java +++ b/app/src/main/java/eu/faircode/email/FragmentEula.java @@ -21,7 +21,6 @@ package eu.faircode.email; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -29,6 +28,7 @@ import android.widget.Button; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.preference.PreferenceManager; public class FragmentEula extends FragmentBase { @Override diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index 429ddd2177..4ce9bb6f45 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -24,7 +24,6 @@ import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Color; import android.os.Bundle; -import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -45,6 +44,7 @@ import androidx.constraintlayout.widget.Group; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Observer; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index d48d9adcb3..70b78e62cb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -36,7 +36,6 @@ import android.os.Bundle; import android.os.Handler; import android.os.Parcel; import android.os.Parcelable; -import android.preference.PreferenceManager; import android.text.Spanned; import android.text.TextUtils; import android.util.LongSparseArray; @@ -87,6 +86,7 @@ import androidx.lifecycle.ViewModelProviders; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.paging.LivePagedListBuilder; import androidx.paging.PagedList; +import androidx.preference.PreferenceManager; import androidx.recyclerview.selection.Selection; import androidx.recyclerview.selection.SelectionTracker; import androidx.recyclerview.selection.StorageStrategy; diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index e08882db71..4d211dc330 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -32,7 +32,6 @@ import android.net.NetworkRequest; import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.preference.PreferenceManager; import android.text.format.DateFormat; import android.view.LayoutInflater; import android.view.Menu; @@ -59,6 +58,7 @@ import androidx.fragment.app.DialogFragment; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; +import androidx.preference.PreferenceManager; import static android.app.Activity.RESULT_OK; diff --git a/app/src/main/java/eu/faircode/email/FragmentPro.java b/app/src/main/java/eu/faircode/email/FragmentPro.java index 490fb22a23..2a3515d35d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPro.java +++ b/app/src/main/java/eu/faircode/email/FragmentPro.java @@ -22,7 +22,6 @@ package eu.faircode.email; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; -import android.preference.PreferenceManager; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; @@ -34,6 +33,7 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import androidx.preference.PreferenceManager; public class FragmentPro extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener { private TextView tvActivated; diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 169d2fb422..1e36a7e4da 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -41,7 +41,6 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.PowerManager; -import android.preference.PreferenceManager; import android.text.TextUtils; import android.view.Menu; import android.view.View; @@ -104,6 +103,7 @@ import androidx.browser.customtabs.CustomTabsIntent; import androidx.core.content.ContextCompat; import androidx.lifecycle.Lifecycle; import androidx.lifecycle.LifecycleOwner; +import androidx.preference.PreferenceManager; import static android.os.Process.THREAD_PRIORITY_BACKGROUND; import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION; diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 6f707442aa..6d1d6703cf 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -26,7 +26,6 @@ import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; -import android.preference.PreferenceManager; import android.text.Html; import android.text.Spanned; import android.text.TextUtils; @@ -60,6 +59,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.text.HtmlCompat; import androidx.core.util.PatternsCompat; +import androidx.preference.PreferenceManager; import static androidx.core.text.HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM; import static androidx.core.text.HtmlCompat.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE; diff --git a/app/src/main/java/eu/faircode/email/ServiceExternal.java b/app/src/main/java/eu/faircode/email/ServiceExternal.java index a3bd753460..41d0b34a9e 100644 --- a/app/src/main/java/eu/faircode/email/ServiceExternal.java +++ b/app/src/main/java/eu/faircode/email/ServiceExternal.java @@ -4,10 +4,10 @@ import android.app.Service; import android.content.Intent; import android.content.SharedPreferences; import android.os.IBinder; -import android.preference.PreferenceManager; import androidx.annotation.Nullable; import androidx.core.app.NotificationCompat; +import androidx.preference.PreferenceManager; public class ServiceExternal extends Service { private final static String ACTION_ENABLE = "eu.faircode.email.ENABLE"; diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index ad91a128fa..6095c20ba5 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -34,7 +34,6 @@ import android.net.NetworkRequest; import android.os.Build; import android.os.Handler; import android.os.PowerManager; -import android.preference.PreferenceManager; import com.sun.mail.imap.IMAPFolder; import com.sun.mail.imap.IMAPMessage; @@ -79,6 +78,7 @@ import androidx.core.app.NotificationCompat; import androidx.core.content.ContextCompat; import androidx.lifecycle.LifecycleService; import androidx.lifecycle.Observer; +import androidx.preference.PreferenceManager; import static android.os.Process.THREAD_PRIORITY_BACKGROUND; diff --git a/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java index ebbbb737ba..b53ab6a639 100644 --- a/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceTileSynchronize.java @@ -23,10 +23,11 @@ import android.annotation.TargetApi; import android.content.SharedPreferences; import android.graphics.drawable.Icon; import android.os.Build; -import android.preference.PreferenceManager; import android.service.quicksettings.Tile; import android.service.quicksettings.TileService; +import androidx.preference.PreferenceManager; + @TargetApi(Build.VERSION_CODES.N) public class ServiceTileSynchronize extends TileService implements SharedPreferences.OnSharedPreferenceChangeListener { public void onStartListening() { diff --git a/app/src/main/java/eu/faircode/email/ViewModelBrowse.java b/app/src/main/java/eu/faircode/email/ViewModelBrowse.java index ba4f16dd06..7e207a3660 100644 --- a/app/src/main/java/eu/faircode/email/ViewModelBrowse.java +++ b/app/src/main/java/eu/faircode/email/ViewModelBrowse.java @@ -21,7 +21,6 @@ package eu.faircode.email; import android.content.Context; import android.content.SharedPreferences; -import android.preference.PreferenceManager; import com.sun.mail.iap.Argument; import com.sun.mail.iap.Response; @@ -56,6 +55,7 @@ import javax.mail.search.SearchTerm; import javax.mail.search.SubjectTerm; import androidx.lifecycle.ViewModel; +import androidx.preference.PreferenceManager; public class ViewModelBrowse extends ViewModel { private State currentState = null;