Explorar el Código

Merge pull request #7513 from nextcloud/drop44

Drop Android 4.4 Support
Tobias Kaminsky hace 4 años
padre
commit
ad54939b39
Se han modificado 30 ficheros con 123 adiciones y 376 borrados
  1. 1 6
      build.gradle
  2. 1 1
      scripts/analysis/findbugs-results.txt
  3. 1 1
      scripts/analysis/lint-results.txt
  4. 1 13
      src/main/java/com/nextcloud/client/jobs/FilesSyncWork.kt
  5. 1 10
      src/main/java/com/nextcloud/client/jobs/OfflineSyncWork.kt
  6. 28 38
      src/main/java/com/owncloud/android/MainApp.java
  7. 2 10
      src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java
  8. 14 46
      src/main/java/com/owncloud/android/datastorage/DataStorageProvider.java
  9. 1 2
      src/main/java/com/owncloud/android/files/FileMenuFilter.java
  10. 0 3
      src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java
  11. 0 1
      src/main/java/com/owncloud/android/ui/activity/EditorWebView.java
  12. 4 5
      src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java
  13. 0 3
      src/main/java/com/owncloud/android/ui/activity/RichDocumentsEditorWebView.java
  14. 4 14
      src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java
  15. 0 4
      src/main/java/com/owncloud/android/ui/adapter/PrintAdapter.java
  16. 0 4
      src/main/java/com/owncloud/android/ui/asynctasks/PrintAsyncTask.java
  17. 1 5
      src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java
  18. 8 18
      src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java
  19. 1 6
      src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java
  20. 1 4
      src/main/java/com/owncloud/android/ui/helpers/UriUploader.java
  21. 2 10
      src/main/java/com/owncloud/android/ui/preview/PreviewTextFileFragment.java
  22. 4 9
      src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java
  23. 7 10
      src/main/java/com/owncloud/android/utils/ThemeUtils.java
  24. 1 3
      src/main/java/org/nextcloud/providers/cursors/FileCursor.java
  25. 5 4
      src/main/java/org/nextcloud/providers/cursors/RootCursor.java
  26. 0 38
      src/main/res/values-night-v21/styles.xml
  27. 0 90
      src/main/res/values-v21/styles.xml
  28. 3 7
      src/main/res/values-v27/styles.xml
  29. 0 2
      src/main/res/values/strings.xml
  30. 32 9
      src/main/res/values/styles.xml

+ 1 - 6
build.gradle

@@ -90,7 +90,6 @@ def versionMinor = 15
 def versionPatch = 0
 def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
 
-def testMinSdk = 21
 for (TaskExecutionRequest tr : getGradle().getStartParameter().getTaskRequests()) {
     for (String arg : tr.args) {
         // any gplay, but only exact "build", as e.g. buildGeneric shall not apply gplay.grade
@@ -98,9 +97,6 @@ for (TaskExecutionRequest tr : getGradle().getStartParameter().getTaskRequests()
             apply from: 'gplay.gradle'
             System.console().println("Applying gplay.gradle")
         }
-        if (arg.contains("lint")) {
-            testMinSdk = 19
-        }
     }
 }
 
@@ -129,7 +125,7 @@ android {
     compileSdkVersion 29
 
     defaultConfig {
-        minSdkVersion 19
+        minSdkVersion 21
         targetSdkVersion 29
 
         // arguments to be passed to functional tests
@@ -192,7 +188,6 @@ android {
         testOptions {
             unitTests.returnDefaultValues = true
             animationsDisabled true
-            minSdkVersion testMinSdk
         }
     }
 

+ 1 - 1
scripts/analysis/findbugs-results.txt

@@ -1 +1 @@
-311
+310

+ 1 - 1
scripts/analysis/lint-results.txt

@@ -1,2 +1,2 @@
 DO NOT TOUCH; GENERATED BY DRONE
-      <span class="mdl-layout-title">Lint Report: 276 warnings</span>
+      <span class="mdl-layout-title">Lint Report: 273 warnings</span>

+ 1 - 13
src/main/java/com/nextcloud/client/jobs/FilesSyncWork.kt

@@ -25,8 +25,6 @@ package com.nextcloud.client.jobs
 import android.content.ContentResolver
 import android.content.Context
 import android.content.res.Resources
-import android.os.Build
-import android.os.PowerManager
 import android.os.PowerManager.WakeLock
 import android.text.TextUtils
 import androidx.exifinterface.media.ExifInterface
@@ -37,7 +35,6 @@ import com.nextcloud.client.core.Clock
 import com.nextcloud.client.device.PowerManagementService
 import com.nextcloud.client.network.ConnectivityService
 import com.nextcloud.client.preferences.AppPreferences
-import com.owncloud.android.MainApp
 import com.owncloud.android.R
 import com.owncloud.android.datamodel.ArbitraryDataProvider
 import com.owncloud.android.datamodel.FilesystemDataProvider
@@ -82,16 +79,7 @@ class FilesSyncWork(
     }
 
     override fun doWork(): Result {
-        var wakeLock: WakeLock? = null
-        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
-            val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
-            wakeLock = powerManager.newWakeLock(
-                PowerManager.PARTIAL_WAKE_LOCK,
-                MainApp.getAuthority() +
-                    WAKELOCK_TAG_SEPARATION + TAG
-            )
-            wakeLock.acquire(WAKELOCK_ACQUIRE_TIMEOUT_MS)
-        }
+        val wakeLock: WakeLock? = null
         val overridePowerSaving = inputData.getBoolean(OVERRIDE_POWER_SAVING, false)
         // If we are in power save mode, better to postpone upload
         if (powerManagementService.isPowerSavingEnabled && !overridePowerSaving) {

+ 1 - 10
src/main/java/com/nextcloud/client/jobs/OfflineSyncWork.kt

@@ -23,8 +23,6 @@ package com.nextcloud.client.jobs
 
 import android.content.ContentResolver
 import android.content.Context
-import android.os.Build
-import android.os.PowerManager
 import android.os.PowerManager.WakeLock
 import androidx.work.Worker
 import androidx.work.WorkerParameters
@@ -32,7 +30,6 @@ import com.nextcloud.client.account.User
 import com.nextcloud.client.account.UserAccountManager
 import com.nextcloud.client.device.PowerManagementService
 import com.nextcloud.client.network.ConnectivityService
-import com.owncloud.android.MainApp
 import com.owncloud.android.datamodel.FileDataStorageManager
 import com.owncloud.android.datamodel.OCFile
 import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode
@@ -59,14 +56,8 @@ class OfflineSyncWork constructor(
     }
 
     override fun doWork(): Result {
-        var wakeLock: WakeLock? = null
+        val wakeLock: WakeLock? = null
         if (!powerManagementService.isPowerSavingEnabled && !connectivityService.isInternetWalled) {
-            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
-                val powerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
-                val wakeLockTag = MainApp.getAuthority() + WAKELOCK_TAG_SEPARATION + TAG
-                wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, wakeLockTag)
-                wakeLock.acquire(WAKELOCK_ACQUISITION_TIMEOUT_MS)
-            }
             val users = userAccountManager.allUsers
             for (user in users) {
                 val storageManager = FileDataStorageManager(user.toPlatformAccount(), contentResolver)

+ 28 - 38
src/main/java/com/owncloud/android/MainApp.java

@@ -384,21 +384,30 @@ public class MainApp extends MultiDexApplication implements HasAndroidInjector {
     @SuppressLint("ApplySharedPref") // commit is done on purpose to write immediately
     private void fixStoragePath() {
         if (!preferences.isStoragePathFixEnabled()) {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                StoragePoint[] storagePoints = DataStorageProvider.getInstance().getAvailableStoragePoints();
-                String storagePath = preferences.getStoragePath("");
-
-                if (TextUtils.isEmpty(storagePath)) {
-                    if (preferences.getLastSeenVersionCode() != 0) {
-                        // We already used the app, but no storage is set - fix that!
-                        preferences.setStoragePath(Environment.getExternalStorageDirectory().getAbsolutePath());
-                        preferences.removeKeysMigrationPreference();
-                    } else {
-                        // find internal storage path that's indexable
-                        boolean set = false;
+            StoragePoint[] storagePoints = DataStorageProvider.getInstance().getAvailableStoragePoints();
+            String storagePath = preferences.getStoragePath("");
+
+            if (TextUtils.isEmpty(storagePath)) {
+                if (preferences.getLastSeenVersionCode() != 0) {
+                    // We already used the app, but no storage is set - fix that!
+                    preferences.setStoragePath(Environment.getExternalStorageDirectory().getAbsolutePath());
+                    preferences.removeKeysMigrationPreference();
+                } else {
+                    // find internal storage path that's indexable
+                    boolean set = false;
+                    for (StoragePoint storagePoint : storagePoints) {
+                        if (storagePoint.getStorageType() == StoragePoint.StorageType.INTERNAL &&
+                            storagePoint.getPrivacyType() == StoragePoint.PrivacyType.PUBLIC) {
+                            preferences.setStoragePath(storagePoint.getPath());
+                            preferences.removeKeysMigrationPreference();
+                            set = true;
+                            break;
+                        }
+                    }
+
+                    if (!set) {
                         for (StoragePoint storagePoint : storagePoints) {
-                            if (storagePoint.getStorageType() == StoragePoint.StorageType.INTERNAL &&
-                                storagePoint.getPrivacyType() == StoragePoint.PrivacyType.PUBLIC) {
+                            if (storagePoint.getPrivacyType() == StoragePoint.PrivacyType.PUBLIC) {
                                 preferences.setStoragePath(storagePoint.getPath());
                                 preferences.removeKeysMigrationPreference();
                                 set = true;
@@ -406,27 +415,10 @@ public class MainApp extends MultiDexApplication implements HasAndroidInjector {
                             }
                         }
 
-                        if (!set) {
-                            for (StoragePoint storagePoint : storagePoints) {
-                                if (storagePoint.getPrivacyType() == StoragePoint.PrivacyType.PUBLIC) {
-                                    preferences.setStoragePath(storagePoint.getPath());
-                                    preferences.removeKeysMigrationPreference();
-                                    set = true;
-                                    break;
-                                }
-                            }
-
-                        }
                     }
-                    preferences.setStoragePathFixEnabled(true);
-                } else {
-                    preferences.removeKeysMigrationPreference();
-                    preferences.setStoragePathFixEnabled(true);
                 }
+                preferences.setStoragePathFixEnabled(true);
             } else {
-                if (TextUtils.isEmpty(storagePath)) {
-                    preferences.setStoragePath(Environment.getExternalStorageDirectory().getAbsolutePath());
-                }
                 preferences.removeKeysMigrationPreference();
                 preferences.setStoragePathFixEnabled(true);
             }
@@ -479,12 +471,10 @@ public class MainApp extends MultiDexApplication implements HasAndroidInjector {
                                                     connectivityService,
                                                     powerManagementService);
 
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            ReceiversHelper.registerPowerSaveReceiver(uploadsStorageManager,
-                                                      accountManager,
-                                                      connectivityService,
-                                                      powerManagementService);
-        }
+        ReceiversHelper.registerPowerSaveReceiver(uploadsStorageManager,
+                                                  accountManager,
+                                                  connectivityService,
+                                                  powerManagementService);
     }
 
     public static void notificationChannels() {

+ 2 - 10
src/main/java/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -330,13 +330,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     private void deleteCookies() {
         try {
             CookieSyncManager.createInstance(this);
-            CookieManager cookieManager = CookieManager.getInstance();
-
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                cookieManager.removeAllCookies(null);
-            } else {
-                cookieManager.removeAllCookie();
-            }
+            CookieManager.getInstance().removeAllCookies(null);
         } catch (AndroidRuntimeException e) {
             Log_OC.e(TAG, e.getMessage());
         }
@@ -439,9 +433,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 mLoginWebView.setVisibility(View.VISIBLE);
 
                 ThemeUtils.colorStatusBar(AuthenticatorActivity.this, primaryColor);
-                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                    getWindow().setNavigationBarColor(primaryColor);
-                }
+                getWindow().setNavigationBarColor(primaryColor);
             }
 
             @Override

+ 14 - 46
src/main/java/com/owncloud/android/datastorage/DataStorageProvider.java

@@ -1,4 +1,4 @@
-/**
+/*
  *   Nextcloud Android client application
  *
  *   @author Bartosz Przybylski
@@ -21,7 +21,6 @@
 
 package com.owncloud.android.datastorage;
 
-import android.os.Build;
 import android.os.Environment;
 
 import com.owncloud.android.MainApp;
@@ -41,18 +40,8 @@ import java.util.List;
  */
 public class DataStorageProvider {
 
-    private static final List<IStoragePointProvider> mStorageProviders = new ArrayList<>();
     private static final UniqueStorageList mCachedStoragePoints = new UniqueStorageList();
-    private static final DataStorageProvider sInstance = new DataStorageProvider() {{
-        // There is no system wide way to get usb storage so we need to provide multiple
-        // handcrafted ways to add those.
-        addStoragePointProvider(new SystemDefaultStoragePointProvider());
-        addStoragePointProvider(new EnvironmentStoragePointProvider());
-        addStoragePointProvider(new VDCStoragePointProvider());
-        addStoragePointProvider(new MountCommandStoragePointProvider());
-        addStoragePointProvider(new HardcodedStoragePointProvider());
-    }};
-
+    private static final DataStorageProvider sInstance = new DataStorageProvider();
 
     public static DataStorageProvider getInstance() {
         return sInstance;
@@ -67,34 +56,22 @@ public class DataStorageProvider {
 
         List<String> paths = new ArrayList<>();
         StoragePoint storagePoint;
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            for (File f : MainApp.getAppContext().getExternalMediaDirs()) {
-                if (f != null && !paths.contains(f.getAbsolutePath())) {
-                    storagePoint = new StoragePoint();
-                    storagePoint.setPath(f.getAbsolutePath());
-                    storagePoint.setDescription(f.getAbsolutePath());
-                    storagePoint.setPrivacyType(StoragePoint.PrivacyType.PUBLIC);
-                    if (f.getAbsolutePath().startsWith("/storage/emulated/0")) {
-                        storagePoint.setStorageType(StoragePoint.StorageType.INTERNAL);
+        for (File f : MainApp.getAppContext().getExternalMediaDirs()) {
+            if (f != null && !paths.contains(f.getAbsolutePath())) {
+                storagePoint = new StoragePoint();
+                storagePoint.setPath(f.getAbsolutePath());
+                storagePoint.setDescription(f.getAbsolutePath());
+                storagePoint.setPrivacyType(StoragePoint.PrivacyType.PUBLIC);
+                if (f.getAbsolutePath().startsWith("/storage/emulated/0")) {
+                    storagePoint.setStorageType(StoragePoint.StorageType.INTERNAL);
+                    mCachedStoragePoints.add(storagePoint);
+                } else {
+                    storagePoint.setStorageType(StoragePoint.StorageType.EXTERNAL);
+                    if (isExternalStorageWritable()) {
                         mCachedStoragePoints.add(storagePoint);
-                    } else {
-                        storagePoint.setStorageType(StoragePoint.StorageType.EXTERNAL);
-                        if (isExternalStorageWritable()) {
-                            mCachedStoragePoints.add(storagePoint);
-                        }
                     }
                 }
             }
-        } else {
-            for (IStoragePointProvider p : mStorageProviders) {
-                if (p.canProvideStoragePoints()) {
-                    mCachedStoragePoints.addAll(p.getAvailableStoragePoint());
-                }
-            }
-
-            for (int i = 0; i < mCachedStoragePoints.size(); i++) {
-                paths.add(mCachedStoragePoints.get(i).getPath());
-            }
         }
 
         // Now we go add private ones
@@ -139,18 +116,9 @@ public class DataStorageProvider {
         return path;
     }
 
-    public void addStoragePointProvider(IStoragePointProvider provider) {
-        mStorageProviders.add(provider);
-    }
-
-    public void removeStoragePointProvider(IStoragePointProvider provider) {
-        mStorageProviders.remove(provider);
-    }
-
     /* Checks if external storage is available for read and write */
     public boolean isExternalStorageWritable() {
         String state = Environment.getExternalStorageState();
         return Environment.MEDIA_MOUNTED.equals(state);
     }
-
 }

+ 1 - 2
src/main/java/com/owncloud/android/files/FileMenuFilter.java

@@ -23,7 +23,6 @@ package com.owncloud.android.files;
 
 import android.content.ContentResolver;
 import android.content.Context;
-import android.os.Build;
 import android.view.Menu;
 import android.view.MenuItem;
 
@@ -333,7 +332,7 @@ public class FileMenuFilter {
      */
     @NextcloudServer(max = 18)
     private boolean isRichDocumentEditingSupported(OCCapability capability, String mimeType) {
-        return isSingleFile() && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
+        return isSingleFile() &&
             (capability.getRichDocumentsMimeTypeList().contains(mimeType) ||
                 capability.getRichDocumentsOptionalMimeTypeList().contains(mimeType)) &&
             capability.getRichDocumentsDirectEditing().isTrue();

+ 0 - 3
src/main/java/com/owncloud/android/providers/DocumentsStorageProvider.java

@@ -26,7 +26,6 @@ import android.accounts.Account;
 import android.accounts.AuthenticatorException;
 import android.accounts.OperationCanceledException;
 import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.res.AssetFileDescriptor;
@@ -34,7 +33,6 @@ import android.database.Cursor;
 import android.graphics.Point;
 import android.net.Uri;
 import android.os.AsyncTask;
-import android.os.Build;
 import android.os.Bundle;
 import android.os.CancellationSignal;
 import android.os.Handler;
@@ -574,7 +572,6 @@ public class DocumentsStorageProvider extends DocumentsProvider {
         context.getContentResolver().notifyChange(toNotifyUri(parentFolder), null, false);
     }
 
-    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
     private void recursiveRevokePermission(Document document) {
         FileDataStorageManager storageManager = document.getStorageManager();
         OCFile file = document.getFile();

+ 0 - 1
src/main/java/com/owncloud/android/ui/activity/EditorWebView.java

@@ -112,7 +112,6 @@ public abstract class EditorWebView extends ExternalSiteWebView {
         finish();
     }
 
-    @SuppressLint("AddJavascriptInterface") // suppress warning as webview is only used >= Lollipop
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         webViewLayout = R.layout.richdocuments_webview; // TODO rename

+ 4 - 5
src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java

@@ -23,7 +23,6 @@
 package com.owncloud.android.ui.activity;
 
 import android.content.Intent;
-import android.os.Build;
 import android.os.Bundle;
 import android.os.SystemClock;
 import android.text.Editable;
@@ -364,12 +363,12 @@ public class PassCodeActivity extends AppCompatActivity implements Injectable {
      * @return              'True' when the key event was processed by this method.
      */
     @Override
-    public boolean onKeyDown(int keyCode, KeyEvent event){
-        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount()== 0){
-            if(ACTION_CHECK.equals(getIntent().getAction()) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
+            if (ACTION_CHECK.equals(getIntent().getAction())) {
                 moveTaskToBack(true);
                 finishAndRemoveTask();
-            }else if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction()) ||
+            } else if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction()) ||
                 ACTION_CHECK_WITH_RESULT.equals(getIntent().getAction())) {
                 finish();
             }// else, do nothing, but report that the key was consumed to stay alive

+ 0 - 3
src/main/java/com/owncloud/android/ui/activity/RichDocumentsEditorWebView.java

@@ -62,7 +62,6 @@ import java.lang.ref.WeakReference;
 import javax.inject.Inject;
 
 import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
 import butterknife.ButterKnife;
 import butterknife.Unbinder;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -70,7 +69,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 /**
  * Opens document for editing via Richdocuments app in a web view
  */
-@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
 public class RichDocumentsEditorWebView extends EditorWebView {
     public static final int REQUEST_LOCAL_FILE = 101;
     private static final int REQUEST_REMOTE_FILE = 100;
@@ -92,7 +90,6 @@ public class RichDocumentsEditorWebView extends EditorWebView {
     protected ClientFactory clientFactory;
 
     @SuppressFBWarnings("ANDROID_WEB_VIEW_JAVASCRIPT_INTERFACE")
-    @SuppressLint("AddJavascriptInterface") // suppress warning as webview is only used >= Lollipop
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

+ 4 - 14
src/main/java/com/owncloud/android/ui/activity/ToolbarActivity.java

@@ -27,7 +27,6 @@ import android.annotation.SuppressLint;
 import android.graphics.Bitmap;
 import android.graphics.Color;
 import android.graphics.drawable.Drawable;
-import android.os.Build;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.FrameLayout;
@@ -50,7 +49,6 @@ import androidx.appcompat.app.ActionBar;
 import androidx.appcompat.widget.AppCompatSpinner;
 import androidx.appcompat.widget.Toolbar;
 import androidx.core.content.ContextCompat;
-import androidx.core.view.ViewCompat;
 
 /**
  * Base class providing toolbar registration functionality, see {@link #setupToolbar(boolean, boolean)}.
@@ -161,22 +159,14 @@ public abstract class ToolbarActivity extends BaseActivity {
     @SuppressLint("PrivateResource")
     private void showHomeSearchToolbar(boolean isShow) {
         if (isShow) {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                mAppBar.setStateListAnimator(AnimatorInflater.loadStateListAnimator(mAppBar.getContext(),
-                                                                                    R.animator.appbar_elevation_off));
-            } else {
-                ViewCompat.setElevation(mAppBar, 0);
-            }
+            mAppBar.setStateListAnimator(AnimatorInflater.loadStateListAnimator(mAppBar.getContext(),
+                                                                                R.animator.appbar_elevation_off));
             mDefaultToolbar.setVisibility(View.GONE);
             mHomeSearchToolbar.setVisibility(View.VISIBLE);
             ThemeUtils.colorStatusBar(this, ContextCompat.getColor(this, R.color.bg_default));
         } else {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                mAppBar.setStateListAnimator(AnimatorInflater.loadStateListAnimator(mAppBar.getContext(),
-                                                                                    R.animator.appbar_elevation_on));
-            } else {
-                ViewCompat.setElevation(mAppBar, getResources().getDimension(R.dimen.design_appbar_elevation));
-            }
+            mAppBar.setStateListAnimator(AnimatorInflater.loadStateListAnimator(mAppBar.getContext(),
+                                                                                R.animator.appbar_elevation_on));
             mDefaultToolbar.setVisibility(View.VISIBLE);
             mHomeSearchToolbar.setVisibility(View.GONE);
             ThemeUtils.colorStatusBar(this);

+ 0 - 4
src/main/java/com/owncloud/android/ui/adapter/PrintAdapter.java

@@ -21,7 +21,6 @@
 
 package com.owncloud.android.ui.adapter;
 
-import android.os.Build;
 import android.os.Bundle;
 import android.os.CancellationSignal;
 import android.os.ParcelFileDescriptor;
@@ -40,9 +39,6 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Objects;
 
-import androidx.annotation.RequiresApi;
-
-@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
 public class PrintAdapter extends PrintDocumentAdapter {
     private static final String TAG = PrintAdapter.class.getSimpleName();
     private static final String PDF_NAME = "finalPrint.pdf";

+ 0 - 4
src/main/java/com/owncloud/android/ui/asynctasks/PrintAsyncTask.java

@@ -22,7 +22,6 @@
 package com.owncloud.android.ui.asynctasks;
 
 import android.os.AsyncTask;
-import android.os.Build;
 import android.print.PrintAttributes;
 import android.print.PrintDocumentAdapter;
 import android.print.PrintManager;
@@ -44,11 +43,8 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.lang.ref.WeakReference;
 
-import androidx.annotation.RequiresApi;
-
 import static android.content.Context.PRINT_SERVICE;
 
-@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
 public class PrintAsyncTask extends AsyncTask<Void, Void, Boolean> {
     private static final String TAG = PrintAsyncTask.class.getSimpleName();
     private static final String JOB_NAME = "Document";

+ 1 - 5
src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java

@@ -21,7 +21,6 @@
 package com.owncloud.android.ui.fragment;
 
 import android.content.Context;
-import android.os.Build;
 import android.os.Bundle;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -127,7 +126,6 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog {
         OCCapability capability = fileActivity.getCapabilities();
         if (capability.getRichDocuments().isTrue() &&
             capability.getRichDocumentsDirectEditing().isTrue() &&
-            android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
             capability.getRichDocumentsTemplatesAvailable().isTrue() &&
             !file.isEncrypted()) {
             templates.setVisibility(View.VISIBLE);
@@ -137,7 +135,6 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog {
             .getValue(user, ArbitraryDataProvider.DIRECT_EDITING);
 
         if (!json.isEmpty() &&
-            android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
             !file.isEncrypted()) {
             DirectEditing directEditing = new Gson().fromJson(json, DirectEditing.class);
 
@@ -174,8 +171,7 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog {
         }
 
         // create rich workspace
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
-            FileMenuFilter.isEditorAvailable(getContext().getContentResolver(),
+        if (FileMenuFilter.isEditorAvailable(getContext().getContentResolver(),
                                              user,
                                              MimeTypeUtil.MIMETYPE_TEXT_MARKDOWN) &&
             file != null && !file.isEncrypted()) {

+ 8 - 18
src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java

@@ -29,7 +29,6 @@ import android.content.Context;
 import android.content.Intent;
 import android.graphics.Color;
 import android.os.AsyncTask;
-import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
@@ -1021,11 +1020,9 @@ public class OCFileListFragment extends ExtendedListFragment implements
                         } else if (FileMenuFilter.isEditorAvailable(requireContext().getContentResolver(),
                                                                     accountManager.getUser(),
                                                                     file.getMimeType()) &&
-                            !file.isEncrypted() &&
-                            android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                            !file.isEncrypted()) {
                             mContainerActivity.getFileOperationsHelper().openFileWithTextEditor(file, getContext());
                         } else if (capability.getRichDocumentsMimeTypeList().contains(file.getMimeType()) &&
-                            android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
                             capability.getRichDocumentsDirectEditing().isTrue() && !file.isEncrypted()) {
                             mContainerActivity.getFileOperationsHelper().openFileAsRichDocument(file, getContext());
                         } else {
@@ -1091,22 +1088,15 @@ public class OCFileListFragment extends ExtendedListFragment implements
                 }
                 case R.id.action_edit: {
                     // should not be necessary, as menu item is filtered, but better play safe
-                    if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                        if (FileMenuFilter.isEditorAvailable(requireContext().getContentResolver(),
-                                                             accountManager.getUser(),
-                                                             singleFile.getMimeType())) {
-                            mContainerActivity.getFileOperationsHelper().openFileWithTextEditor(singleFile,
-                                                                                                getContext());
-                        } else {
-                            mContainerActivity.getFileOperationsHelper().openFileAsRichDocument(singleFile,
-                                                                                                getContext());
-                        }
-
-                        return true;
+                    if (FileMenuFilter.isEditorAvailable(requireContext().getContentResolver(),
+                                                         accountManager.getUser(),
+                                                         singleFile.getMimeType())) {
+                        mContainerActivity.getFileOperationsHelper().openFileWithTextEditor(singleFile, getContext());
                     } else {
-                        DisplayUtils.showSnackMessage(getView(), "Not supported on older than Android 5");
-                        return false;
+                        mContainerActivity.getFileOperationsHelper().openFileAsRichDocument(singleFile, getContext());
                     }
+
+                    return true;
                 }
                 case R.id.action_rename_file: {
                     RenameFileDialogFragment dialog = RenameFileDialogFragment.newInstance(singleFile);

+ 1 - 6
src/main/java/com/owncloud/android/ui/helpers/FileOperationsHelper.java

@@ -104,7 +104,6 @@ import java.util.regex.Pattern;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
 import androidx.core.content.FileProvider;
 import androidx.fragment.app.FragmentManager;
 import androidx.fragment.app.FragmentTransaction;
@@ -288,14 +287,12 @@ public class FileOperationsHelper {
 
                 if (optionalUser.isPresent() && FileMenuFilter.isEditorAvailable(fileActivity.getContentResolver(),
                                                                                  optionalUser.get(),
-                                                                                 file.getMimeType()) &&
-                    android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+                                                                                 file.getMimeType())) {
                     openFileWithTextEditor(file, fileActivity);
                 } else {
                     Account account = fileActivity.getAccount();
                     OCCapability capability = fileActivity.getStorageManager().getCapability(account.name);
                     if (capability.getRichDocumentsMimeTypeList().contains(file.getMimeType()) &&
-                        android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
                         capability.getRichDocumentsDirectEditing().isTrue()) {
                         openFileAsRichDocument(file, fileActivity);
                         return;
@@ -360,7 +357,6 @@ public class FileOperationsHelper {
         }
     }
 
-    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
     public void openFileAsRichDocument(OCFile file, Context context) {
         Intent collaboraWebViewIntent = new Intent(context, RichDocumentsEditorWebView.class);
         collaboraWebViewIntent.putExtra(ExternalSiteWebView.EXTRA_TITLE, "Collabora");
@@ -369,7 +365,6 @@ public class FileOperationsHelper {
         context.startActivity(collaboraWebViewIntent);
     }
 
-    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
     public void openFileWithTextEditor(OCFile file, Context context) {
         Intent textEditorIntent = new Intent(context, TextEditorWebView.class);
         textEditorIntent.putExtra(ExternalSiteWebView.EXTRA_TITLE, "Text");

+ 1 - 4
src/main/java/com/owncloud/android/ui/helpers/UriUploader.java

@@ -1,4 +1,4 @@
-/**
+/*
  *   ownCloud Android client application
  *
  *   Copyright (C) 2016 ownCloud Inc.
@@ -102,9 +102,6 @@ public class UriUploader {
                 Uri sourceUri = (Uri) sourceStream;
                 if (sourceUri != null) {
                     String displayName = UriUtils.getDisplayNameForUri(sourceUri, mActivity);
-                    if (displayName == null) {
-                        displayName = generateDiplayName();
-                    }
                     String remotePath = mUploadPath + displayName;
 
                     if (ContentResolver.SCHEME_CONTENT.equals(sourceUri.getScheme())) {

+ 2 - 10
src/main/java/com/owncloud/android/ui/preview/PreviewTextFileFragment.java

@@ -24,7 +24,6 @@ package com.owncloud.android.ui.preview;
 
 import android.accounts.Account;
 import android.os.AsyncTask;
-import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.view.Menu;
@@ -289,10 +288,6 @@ public class PreviewTextFileFragment extends PreviewTextFragment {
             menu.findItem(R.id.action_unset_favorite)
         );
 
-        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
-            FileMenuFilter.hideMenuItem(menu.findItem(R.id.action_edit));
-        }
-
         if (getFile().isSharedWithMe() && !getFile().canReshare()) {
             FileMenuFilter.hideMenuItem(menu.findItem(R.id.action_send_share_file));
         }
@@ -331,11 +326,8 @@ public class PreviewTextFileFragment extends PreviewTextFragment {
             }
 
             case R.id.action_edit:
-                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                    containerActivity.getFileOperationsHelper().openFileWithTextEditor(getFile(), getContext());
-                    return true;
-                }
-                return false;
+                containerActivity.getFileOperationsHelper().openFileWithTextEditor(getFile(), getContext());
+                return true;
 
             default:
                 return super.onOptionsItemSelected(item);

+ 4 - 9
src/main/java/com/owncloud/android/ui/preview/PreviewTextStringFragment.java

@@ -104,15 +104,10 @@ public class PreviewTextStringFragment extends PreviewTextFragment {
         }
 
         FloatingActionButton fabMain = requireActivity().findViewById(R.id.fab_main);
-
-        if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
-            fabMain.setVisibility(View.GONE);
-        } else {
-            fabMain.setVisibility(View.VISIBLE);
-            fabMain.setEnabled(true);
-            fabMain.setOnClickListener(v -> edit());
-            ThemeUtils.colorFloatingActionButton(fabMain, R.drawable.ic_edit, requireContext());
-        }
+        fabMain.setVisibility(View.VISIBLE);
+        fabMain.setEnabled(true);
+        fabMain.setOnClickListener(v -> edit());
+        ThemeUtils.colorFloatingActionButton(fabMain, R.drawable.ic_edit, requireContext());
 
         return view;
     }

+ 7 - 10
src/main/java/com/owncloud/android/utils/ThemeUtils.java

@@ -122,7 +122,7 @@ public final class ThemeUtils {
         }
     }
 
-    public static int calculateDarkColor(int color, Context context){
+    public static int calculateDarkColor(int color, Context context) {
         try {
             return adjustLightness(-0.2f, color, -1f);
         } catch (Exception e) {
@@ -364,7 +364,7 @@ public final class ThemeUtils {
     }
 
     public static void setStatusBarColor(Activity activity, @ColorInt int color) {
-        if (activity != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+        if (activity != null) {
             activity.getWindow().setStatusBarColor(color);
         }
     }
@@ -450,11 +450,7 @@ public final class ThemeUtils {
      */
     public static void colorProgressBar(ProgressBar progressBar, @ColorInt int color) {
         if (progressBar != null) {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-                progressBar.setProgressTintList(ColorStateList.valueOf(color));
-            } else {
-                ThemeUtils.colorHorizontalProgressBar(progressBar, color);
-            }
+            progressBar.setProgressTintList(ColorStateList.valueOf(color));
         }
     }
 
@@ -491,7 +487,7 @@ public final class ThemeUtils {
     }
 
     /**
-     * Sets the color of the status bar to {@code color} on devices with OS version lollipop or higher.
+     * Sets the color of the status bar to {@code color}.
      *
      * @param fragmentActivity fragment activity
      * @param color            the color
@@ -499,7 +495,7 @@ public final class ThemeUtils {
     public static void colorStatusBar(Activity fragmentActivity, @ColorInt int color) {
         Window window = fragmentActivity.getWindow();
         boolean isLightTheme = lightTheme(color);
-        if (window != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+        if (window != null) {
             window.setStatusBarColor(color);
             if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                 View decor = window.getDecorView();
@@ -668,7 +664,8 @@ public final class ThemeUtils {
 
     /**
      * Will change a menu item text tint
-     * @param item the menu item object
+     *
+     * @param item  the menu item object
      * @param color the wanted color (as resource or color)
      */
     public static void tintMenuItemText(MenuItem item, int color) {

+ 1 - 3
src/main/java/org/nextcloud/providers/cursors/FileCursor.java

@@ -88,9 +88,7 @@ public class FileCursor extends MatrixCursor {
             flags = flags | Document.FLAG_DIR_SUPPORTS_CREATE;
         }
 
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
-            flags = Document.FLAG_SUPPORTS_RENAME | flags;
-        }
+        flags = Document.FLAG_SUPPORTS_RENAME | flags;
 
         newRow().add(Document.COLUMN_DOCUMENT_ID, document.getDocumentId())
                 .add(Document.COLUMN_DISPLAY_NAME, file.getFileName())

+ 5 - 4
src/main/java/org/nextcloud/providers/cursors/RootCursor.java

@@ -43,10 +43,11 @@ public class RootCursor extends MatrixCursor {
     public void addRoot(DocumentsStorageProvider.Document document, Context context) {
         Account account = document.getAccount();
 
-        int rootFlags = Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_RECENTS | Root.FLAG_SUPPORTS_SEARCH;
-        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
-            rootFlags = rootFlags | Root.FLAG_SUPPORTS_IS_CHILD;
-        }
+        int rootFlags =
+            Root.FLAG_SUPPORTS_CREATE |
+                Root.FLAG_SUPPORTS_RECENTS |
+                Root.FLAG_SUPPORTS_SEARCH |
+                Root.FLAG_SUPPORTS_IS_CHILD;
 
         newRow().add(Root.COLUMN_ROOT_ID, account.name)
             .add(Root.COLUMN_DOCUMENT_ID, document.getDocumentId())

+ 0 - 38
src/main/res/values-night-v21/styles.xml

@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Nextcloud Android client application
-
-  Copyright (C) 2020 Nextcloud
-
-  This program is free software; you can redistribute it and/or
-  modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-  License as published by the Free Software Foundation; either
-  version 3 of the License, or any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-
-  You should have received a copy of the GNU Affero General Public
-  License along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
-
-    <style name="Theme.ownCloud.Toolbar.Drawer">
-        <item name="android:navigationBarColor">@color/bg_default</item>
-    </style>
-
-    <style name="Theme.ownCloud.Toolbar" parent="Theme.ownCloud.ToolbarBase">
-        <item name="android:navigationBarColor">@color/bg_default</item>
-    </style>
-
-    <style name="Theme.ownCloud" parent="Theme.ownCloudBase">
-        <item name="android:navigationBarColor">@color/bg_default</item>
-    </style>
-
-    <style name="FallbackThemingTheme" parent="FallbackThemingThemeBase21">
-        <item name="android:navigationBarColor">@color/bg_default</item>
-    </style>
-
-</resources>

+ 0 - 90
src/main/res/values-v21/styles.xml

@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ownCloud Android client application
-
-  Copyright (C) 2015 ownCloud Inc.
-
-  This program is free software: you can redistribute it and/or modify
-  it under the terms of the GNU General Public License version 2,
-  as published by the Free Software Foundation.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program.  If not, see <http://www.gnu.org/licenses/>.
--->
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
-    <!-- General ownCloud app style -->
-    <style name="Theme.ownCloudBase" parent="BaseTheme.ownCloud">
-        <item name="android:actionModeBackground">@color/action_mode_background</item>
-        <item name="android:datePickerDialogTheme">@style/FallbackDatePickerDialogTheme</item>
-    </style>
-
-    <style name="Theme.ownCloud" parent="Theme.ownCloudBase" />
-
-    <style name="FallbackThemingThemeBase21" parent="FallbackThemingThemeBase">
-        <item name="android:actionModeBackground">@color/action_mode_background</item>
-        <item name="android:datePickerDialogTheme">@style/FallbackDatePickerDialogTheme</item>
-    </style>
-
-    <style name="FallbackThemingTheme" parent="FallbackThemingThemeBase21" />
-
-    <style name="FallbackDatePickerDialogTheme" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
-        <item name="colorPrimary">@color/bg_default</item>
-        <item name="android:textAllCaps">false</item>
-        <item name="android:windowBackground">@color/bg_default</item>
-        <item name="android:textColor">@color/fg_inverse</item>
-        <item name="android:datePickerStyle">@style/DatePickerStyle</item>
-        <item name="colorControlHighlight">@color/bg_fallback_highlight</item>
-        <item name="colorControlActivated">@color/bg_fallback_highlight</item>
-    </style>
-
-    <style name="DatePickerStyle" parent="">
-        <item name="android:headerBackground">@color/bg_fallback_highlight</item>
-        <item name="android:datePickerMode">calendar</item>
-    </style>
-
-    <style name="FallbackTheming.Dialog" parent="Theme.MaterialComponents.DayNight.Dialog">
-        <item name="colorPrimary">#424242</item>
-        <item name="colorPrimaryDark">#212121</item>
-        <item name="colorAccent">#757575</item>
-        <item name="windowNoTitle">false</item>
-        <item name="android:windowBackground">@color/bg_default</item>
-        <item name="android:textAllCaps">false</item>
-    </style>
-
-    <style name="Theme.ownCloud.ToolbarBase" parent="BaseTheme.ownCloud.Toolbar">
-        <item name="android:actionModeBackground">@color/action_mode_background</item>
-        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
-    </style>
-
-    <style name="Theme.ownCloud.Toolbar" parent="Theme.ownCloud.ToolbarBase" />
-
-    <style name="Theme.ownCloud.Toolbar.DrawerBase" parent="Theme.ownCloud.Toolbar">
-        <item name="android:statusBarColor">@android:color/transparent</item>
-    </style>
-
-    <style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar.DrawerBase" />
-
-    <!-- Launch screen -->
-    <style name="Theme.ownCloud.Launcher">
-        <item name="android:statusBarColor">@color/primary</item>
-        <item name="android:navigationBarColor">@color/primary</item>
-        <item name="android:windowBackground">@drawable/launch_screen</item>
-        <item name="android:textColorHint">@color/secondary_text_color</item>
-    </style>
-
-    <style name="Theme.ownCloud.noActionBar.LoginBase21" parent="Theme.ownCloud.noActionBar.LoginBase">
-        <item name="android:navigationBarColor">@color/primary</item>
-    </style>
-
-    <style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.noActionBar.LoginBase21" />
-
-    <style name="Theme.ownCloud.Overlay" parent="Theme.ownCloud.OverlayBase">
-        <item name="android:navigationBarColor">@color/black</item>
-    </style>
-
-</resources>

+ 3 - 7
src/main/res/values-v27/styles.xml

@@ -22,25 +22,21 @@
 
     <style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar.DrawerBase">
         <item name="android:windowLightNavigationBar">true</item>
-        <item name="android:navigationBarColor">@color/bg_default</item>
     </style>
 
     <style name="Theme.ownCloud.Toolbar" parent="Theme.ownCloud.ToolbarBase">
         <item name="android:windowLightNavigationBar">true</item>
-        <item name="android:navigationBarColor">@color/bg_default</item>
     </style>
 
-    <style name="Theme.ownCloud" parent="Theme.ownCloudBase">
+    <style name="Theme.ownCloud" parent="BaseTheme.ownCloud">
         <item name="android:windowLightNavigationBar">true</item>
-        <item name="android:navigationBarColor">@color/bg_default</item>
     </style>
 
-    <style name="FallbackThemingTheme" parent="FallbackThemingThemeBase21">
+    <style name="FallbackThemingTheme" parent="FallbackThemingThemeBase">
         <item name="android:windowLightNavigationBar">true</item>
-        <item name="android:navigationBarColor">@color/bg_default</item>
     </style>
 
-    <style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.noActionBar.LoginBase21">
+    <style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.noActionBar.LoginBase">
         <item name="android:windowLightNavigationBar">false</item>
     </style>
 

+ 0 - 2
src/main/res/values/strings.xml

@@ -519,7 +519,6 @@
     <string name="choose_remote_folder">Choose remote folder…</string>
     <string name="choose_local_folder">Choose local folder…</string>
     <string name="local_folder_friendly_path">%1$s/%2$s</string>
-    <string name="synced_folders_loading_folders">Loading folders…</string>
     <string name="synced_folders_no_results">No media folders found</string>
     <plurals name="synced_folders_show_hidden_folders">
         <item quantity="one">Show %1$d hidden folder</item>
@@ -541,7 +540,6 @@
         <item quantity="other">%d selected</item>
     </plurals>
 
-    <string name="notifications_loading_activity">Loading notifications…</string>
     <string name="notifications_no_results_headline">No notifications</string>
     <string name="notifications_no_results_message">Please check back later.</string>
 

+ 32 - 9
src/main/res/values/styles.xml

@@ -35,6 +35,9 @@
         <item name="colorPrimaryDark">@color/primary_dark</item>
         <item name="colorSecondary">@color/secondary_text_color</item>
         <item name="searchViewStyle">@style/ownCloud.SearchView</item>
+        <item name="android:actionModeBackground">@color/action_mode_background</item>
+        <item name="android:datePickerDialogTheme">@style/FallbackDatePickerDialogTheme</item>
+        <item name="android:navigationBarColor">@color/bg_default</item>
     </style>
 
     <style name="Theme.ownCloud" parent="BaseTheme.ownCloud" />
@@ -48,6 +51,9 @@
         <item name="android:windowBackground">@color/bg_default</item>
         <item name="colorSecondary">@color/secondary_text_color</item>
         <item name="dialogTheme">@style/FallbackTheming.Dialog</item>
+        <item name="android:actionModeBackground">@color/action_mode_background</item>
+        <item name="android:datePickerDialogTheme">@style/FallbackDatePickerDialogTheme</item>
+        <item name="android:navigationBarColor">@color/bg_default</item>
     </style>
 
     <style name="FallbackThemingTheme" parent="FallbackThemingThemeBase" />
@@ -64,13 +70,14 @@
 
     <style name="DatePickerStyle" parent="">
         <item name="android:headerBackground">@color/bg_fallback_highlight</item>
+        <item name="android:datePickerMode">calendar</item>
     </style>
 
     <style name="FallbackTheming.Dialog" parent="Theme.MaterialComponents.DayNight.Dialog">
-		<item name="colorPrimary">#424242</item>
-		<item name="colorPrimaryDark">#212121</item>
-		<item name="colorAccent">#757575</item>
-		<item name="windowNoTitle">false</item>
+        <item name="colorPrimary">#424242</item>
+        <item name="colorPrimaryDark">#212121</item>
+        <item name="colorAccent">#757575</item>
+        <item name="windowNoTitle">false</item>
         <item name="android:windowBackground">@color/bg_default</item>
         <item name="android:textAllCaps">false</item>
 	</style>
@@ -91,10 +98,21 @@
         <item name="windowNoTitle">true</item>
     </style>
 
-    <style name="Theme.ownCloud.Toolbar" parent="BaseTheme.ownCloud.Toolbar" />
+    <style name="Theme.ownCloud.ToolbarBase" parent="BaseTheme.ownCloud.Toolbar">
+        <item name="android:actionModeBackground">@color/action_mode_background</item>
+        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
+        <item name="android:navigationBarColor">@color/bg_default</item>
+    </style>
+
+    <style name="Theme.ownCloud.Toolbar" parent="Theme.ownCloud.ToolbarBase" />
 
-	<!-- separate style for Drawer activities needed for v21+ theming -->
-	<style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar"/>
+    <style name="Theme.ownCloud.Toolbar.DrawerBase" parent="Theme.ownCloud.Toolbar">
+        <item name="android:statusBarColor">@android:color/transparent</item>
+    </style>
+
+    <style name="Theme.ownCloud.Toolbar.Drawer" parent="Theme.ownCloud.Toolbar.DrawerBase">
+        <item name="android:navigationBarColor">@color/bg_default</item>
+    </style>
 
     <style name="Theme.ownCloud.noActionBar.LoginBase" parent="Theme.ownCloud.Toolbar">
 		<item name="android:windowBackground">@color/primary</item>
@@ -103,6 +121,7 @@
         <item name="colorControlHighlight">@color/login_text_color</item>
 		<item name="colorAccent">@color/login_text_hint_color</item>
 		<item name="android:textColorHint">@color/login_text_hint_color</item>
+        <item name="android:navigationBarColor">@color/primary</item>
 	</style>
 
     <style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.noActionBar.LoginBase" />
@@ -204,7 +223,9 @@
 		<item name="windowActionBarOverlay">true</item>
 	</style>
 
-    <style name="Theme.ownCloud.Overlay" parent="Theme.ownCloud.OverlayBase" />
+    <style name="Theme.ownCloud.Overlay" parent="Theme.ownCloud.OverlayBase">
+        <item name="android:navigationBarColor">@color/black</item>
+    </style>
 
 	<!-- ACTION BAR STYLES -->
 	<style name="Theme.ownCloud.Overlay.ActionBar" parent="@style/Widget.MaterialComponents.Toolbar">
@@ -217,7 +238,9 @@
 
 	<!-- Launch screen -->
 	<style name="Theme.ownCloud.Launcher">
-		<item name="android:windowBackground">@drawable/launch_screen</item>
+        <item name="android:statusBarColor">@color/primary</item>
+        <item name="android:navigationBarColor">@color/primary</item>
+        <item name="android:windowBackground">@drawable/launch_screen</item>
         <item name="android:textColorHint">@color/secondary_text_color</item>
 	</style>