diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
index 9ad86e6f44..59ad8e8d54 100644
--- a/.idea/codeStyles/Project.xml
+++ b/.idea/codeStyles/Project.xml
@@ -27,6 +27,8 @@
+
+
diff --git a/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java b/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java
index eb978cda1b..03e86037a3 100644
--- a/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java
+++ b/src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java
@@ -94,7 +94,7 @@ public class FirstRunActivity extends BaseActivity implements ViewPager.OnPageCh
});
Button providerButton = findViewById(R.id.signup);
- providerButton.setBackgroundColor(getResources().getColor(R.color.primary));
+ providerButton.setBackgroundColor(getResources().getColor(R.color.primary_dark));
providerButton.setTextColor(getResources().getColor(R.color.login_text_color));
providerButton.setVisibility(isProviderOrOwnInstallationVisible ? View.VISIBLE : View.GONE);
providerButton.setOnClickListener(v -> {
diff --git a/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java b/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java
index 0f8ec38430..a78ee9aa2f 100644
--- a/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java
+++ b/src/main/java/com/nextcloud/client/preferences/AppPreferencesImpl.java
@@ -68,8 +68,8 @@ public final class AppPreferencesImpl implements AppPreferences {
private static final String PREF__AUTO_UPLOAD_INIT = "autoUploadInit";
private static final String PREF__FOLDER_SORT_ORDER = "folder_sort_order";
private static final String PREF__FOLDER_LAYOUT = "folder_layout";
+ public static final String PREF__THEME = "darkTheme";
- private static final String PREF__DARK_THEME = "darkTheme";
private static final String PREF__LOCK_TIMESTAMP = "lock_timestamp";
private static final String PREF__SHOW_MEDIA_SCAN_NOTIFICATIONS = "show_media_scan_notifications";
private static final String PREF__LOCK = SettingsActivity.PREFERENCE_LOCK;
@@ -344,7 +344,7 @@ public final class AppPreferencesImpl implements AppPreferences {
@Override
public boolean isDarkThemeEnabled() {
- return preferences.getBoolean(PREF__DARK_THEME, false);
+ return preferences.getBoolean(PREF__THEME, false);
}
@Override
diff --git a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
index 94d2a2c4db..42651884a5 100644
--- a/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
+++ b/src/main/java/com/owncloud/android/datamodel/ThumbnailsCacheManager.java
@@ -1173,7 +1173,8 @@ public final class ThumbnailsCacheManager {
Bitmap resultBitmap = Bitmap.createBitmap(pxW, pxH, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(resultBitmap);
- c.drawColor(MainApp.getAppContext().getResources().getColor(R.color.bg_default));
+ // TODO check based on https://github.com/nextcloud/android/pull/3459#discussion_r339935975
+ c.drawColor(MainApp.getAppContext().getResources().getColor(R.color.background_color_png));
c.drawBitmap(bitmap, 0, 0, null);
return resultBitmap;
diff --git a/src/main/java/com/owncloud/android/ui/ThemeableSwitchPreference.java b/src/main/java/com/owncloud/android/ui/ThemeableSwitchPreference.java
index 1ff3f90efc..d86f25ac4e 100644
--- a/src/main/java/com/owncloud/android/ui/ThemeableSwitchPreference.java
+++ b/src/main/java/com/owncloud/android/ui/ThemeableSwitchPreference.java
@@ -85,7 +85,6 @@ public class ThemeableSwitchPreference extends SwitchPreference {
new int[][]{new int[]{android.R.attr.state_checked},
new int[]{}},
new int[]{trackColor, trackColorUnchecked});
-// new int[]{trackColor, Color.parseColor("#4D000000")});
}
// setting the thumb color
diff --git a/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java b/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java
index 0b3b487aac..f10bc8a290 100644
--- a/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java
+++ b/src/main/java/com/owncloud/android/ui/activity/BaseActivity.java
@@ -12,6 +12,7 @@ import android.os.Handler;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.di.Injectable;
+import com.nextcloud.client.preferences.AppPreferencesImpl;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.FileDataStorageManager;
@@ -27,29 +28,32 @@ import androidx.appcompat.app.AppCompatActivity;
/**
* Base activity with common behaviour for activities dealing with ownCloud {@link Account}s .
*/
-public abstract class BaseActivity extends AppCompatActivity implements Injectable, SharedPreferences.OnSharedPreferenceChangeListener {
+public abstract class BaseActivity
+ extends AppCompatActivity
+ implements Injectable, SharedPreferences.OnSharedPreferenceChangeListener {
+
private static final String TAG = BaseActivity.class.getSimpleName();
/**
* ownCloud {@link Account} where the main {@link OCFile} handled by the activity is located.
*/
- private Account mCurrentAccount;
+ private Account currentAccount;
/**
- * Capabilities of the server where {@link #mCurrentAccount} lives.
+ * Capabilities of the server where {@link #currentAccount} lives.
*/
- private OCCapability mCapabilities;
+ private OCCapability capabilities;
/**
* Access point to the cached database for the current ownCloud {@link Account}.
*/
- private FileDataStorageManager mStorageManager;
+ private FileDataStorageManager storageManager;
/**
* Tracks whether the activity should be recreate()'d after a theme change
*/
- private boolean mThemeChangePending;
- private boolean mPaused;
+ private boolean themeChangePending;
+ private boolean paused;
@Inject UserAccountManager accountManager;
@Inject SharedPreferences sharedPreferences;
@@ -73,16 +77,15 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
@Override
protected void onPause() {
super.onPause();
- mPaused = true;
+ paused = true;
}
@Override
protected void onResume() {
super.onResume();
- mPaused = false;
+ paused = false;
- if(mThemeChangePending) {
-// getDelegate().applyDayNight();
+ if(themeChangePending) {
recreate();
}
}
@@ -98,8 +101,8 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
Log_OC.v(TAG, "onNewIntent() start");
Account current = accountManager.getCurrentAccount();
- if (current != null && mCurrentAccount != null && !mCurrentAccount.name.equals(current.name)) {
- mCurrentAccount = current;
+ if (current != null && currentAccount != null && !currentAccount.name.equals(current.name)) {
+ currentAccount = current;
}
Log_OC.v(TAG, "onNewIntent() stop");
}
@@ -112,7 +115,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
protected void onRestart() {
Log_OC.v(TAG, "onRestart() start");
super.onRestart();
- boolean validAccount = mCurrentAccount != null && accountManager.exists(mCurrentAccount);
+ boolean validAccount = currentAccount != null && accountManager.exists(currentAccount);
if (!validAccount) {
swapToDefaultAccount();
}
@@ -121,12 +124,12 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
@Override
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key) {
- if (!getString(R.string.prefs_key_theme).equals(key)) {
+ if (!AppPreferencesImpl.PREF__THEME.equals(key)) {
return;
}
- if(mPaused) {
- mThemeChangePending = true;
+ if(paused) {
+ themeChangePending = true;
return;
}
recreate();
@@ -144,7 +147,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
protected void setAccount(Account account, boolean savedAccount) {
boolean validAccount = account != null && accountManager.setCurrentOwnCloudAccount(account.name);
if (validAccount) {
- mCurrentAccount = account;
+ currentAccount = account;
} else {
swapToDefaultAccount();
}
@@ -163,7 +166,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
/// no account available: force account creation
createAccount(true);
} else {
- mCurrentAccount = newAccount;
+ currentAccount = newAccount;
}
}
@@ -192,8 +195,8 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
@Deprecated
protected void onAccountSet() {
if (getAccount() != null) {
- mStorageManager = new FileDataStorageManager(getAccount(), getContentResolver());
- mCapabilities = mStorageManager.getCapability(mCurrentAccount.name);
+ storageManager = new FileDataStorageManager(getAccount(), getContentResolver());
+ capabilities = storageManager.getCapability(currentAccount.name);
} else {
Log_OC.e(TAG, "onAccountChanged was called with NULL account associated!");
}
@@ -201,7 +204,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
@Deprecated
protected void setAccount(Account account) {
- mCurrentAccount = account;
+ currentAccount = account;
}
/**
@@ -211,7 +214,7 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
* set yet.
*/
public OCCapability getCapabilities() {
- return mCapabilities;
+ return capabilities;
}
/**
@@ -222,20 +225,20 @@ public abstract class BaseActivity extends AppCompatActivity implements Injectab
* is located.
*/
public Account getAccount() {
- return mCurrentAccount;
+ return currentAccount;
}
@Override
protected void onStart() {
super.onStart();
- if(mCurrentAccount != null) {
+ if(currentAccount != null) {
onAccountSet();
}
}
public FileDataStorageManager getStorageManager() {
- return mStorageManager;
+ return storageManager;
}
/**
diff --git a/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java b/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java
index 5ce4882e57..8fb7bf954f 100644
--- a/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java
+++ b/src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java
@@ -991,12 +991,17 @@ public abstract class DrawerActivity extends ToolbarActivity
MenuItem menuItem = mNavigationView.getMenu().getItem(i);
if (menuItem.getIcon() != null) {
menuItem.getIcon().clearColorFilter();
- if(menuItem.getGroupId() != R.id.drawer_menu_accounts
+ if (menuItem.getGroupId() != R.id.drawer_menu_accounts
|| menuItem.getItemId() == R.id.drawer_menu_account_add
|| menuItem.getItemId() == R.id.drawer_menu_account_manage) {
- ThemeUtils.tintDrawable(menuItem.getIcon(), ContextCompat.getColor(this, R.color.drawer_menu_icon));
+ ThemeUtils.tintDrawable(
+ menuItem.getIcon(), ContextCompat.getColor(this, R.color.drawer_menu_icon));
}
- menuItem.setTitle(Html.fromHtml("" + menuItem.getTitle() + ""));
+ menuItem.setTitle(Html.fromHtml(
+ "" + menuItem.getTitle()
+ + ""));
}
}
diff --git a/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java b/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java
index aa2df629f5..ae8474d5eb 100644
--- a/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java
+++ b/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java
@@ -39,7 +39,6 @@ import android.os.Build;
import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
-import android.preference.PreferenceActivity;
import android.preference.PreferenceCategory;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
@@ -693,13 +692,12 @@ public class SettingsActivity extends ThemedPreferenceActivity
loadStoragePath();
- SwitchPreference themePref = (SwitchPreference) findPreference(getString(R.string.prefs_key_theme));
+ SwitchPreference themePref = (SwitchPreference) findPreference(AppPreferencesImpl.PREF__THEME);
themePref.setSummary(preferences.isDarkThemeEnabled() ?
getString(R.string.prefs_value_theme_dark) : getString(R.string.prefs_value_theme_light));
themePref.setOnPreferenceChangeListener((preference, newValue) -> {
MainApp.setAppTheme((Boolean) newValue);
-// recreate();
return true;
});
diff --git a/src/main/java/com/owncloud/android/ui/activity/ThemedPreferenceActivity.java b/src/main/java/com/owncloud/android/ui/activity/ThemedPreferenceActivity.java
index 3d420b02e6..1acc839a4f 100644
--- a/src/main/java/com/owncloud/android/ui/activity/ThemedPreferenceActivity.java
+++ b/src/main/java/com/owncloud/android/ui/activity/ThemedPreferenceActivity.java
@@ -15,7 +15,7 @@
* 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 .
+ * License along with this program. If not, see .
*/
package com.owncloud.android.ui.activity;
@@ -28,12 +28,15 @@ import javax.inject.Inject;
import androidx.annotation.Nullable;
-public class ThemedPreferenceActivity extends PreferenceActivity implements SharedPreferences.OnSharedPreferenceChangeListener {
+public class ThemedPreferenceActivity
+ extends PreferenceActivity
+ implements SharedPreferences.OnSharedPreferenceChangeListener {
+
/**
* Tracks whether the activity should be recreate()'d after a theme change
*/
- private boolean mThemeChangePending;
- private boolean mPaused;
+ private boolean themeChangePending;
+ private boolean paused;
@Inject SharedPreferences sharedPreferences;
@@ -52,23 +55,23 @@ public class ThemedPreferenceActivity extends PreferenceActivity implements Shar
@Override
protected void onPause() {
super.onPause();
- mPaused = true;
+ paused = true;
}
@Override
protected void onResume() {
super.onResume();
- mPaused = false;
+ paused = false;
- if(mThemeChangePending) {
+ if(themeChangePending) {
recreate();
}
}
@Override
public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key) {
- if(mPaused) {
- mThemeChangePending = true;
+ if(paused) {
+ themeChangePending = true;
return;
}
diff --git a/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java b/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java
index e600e1b713..32077c8060 100644
--- a/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java
+++ b/src/main/java/com/owncloud/android/ui/adapter/ActivityListAdapter.java
@@ -368,8 +368,12 @@ public class ActivityListAdapter extends RecyclerView.Adapter();
this.client = client;
this.notificationsActivity = notificationsActivity;
- foregroundColorSpanBlack = new ForegroundColorSpan(notificationsActivity.getResources().getColor(R.color.textColor));
+ foregroundColorSpanBlack = new ForegroundColorSpan(
+ notificationsActivity.getResources().getColor(R.color.textColor));
}
public void setNotificationItems(List notificationItems) {
diff --git a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java
index 1b8690d90f..a1032b363b 100644
--- a/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java
+++ b/src/main/java/com/owncloud/android/ui/fragment/ExtendedListFragment.java
@@ -194,13 +194,9 @@ public class ExtendedListFragment extends Fragment implements
searchView.setOnCloseListener(this);
ThemeUtils.themeSearchView(searchView, true, requireContext());
-
- SearchView.SearchAutoComplete theTextArea = (SearchView.SearchAutoComplete) searchView.findViewById(R.id.search_src_text);
+ SearchView.SearchAutoComplete theTextArea = searchView.findViewById(R.id.search_src_text);
theTextArea.setHighlightColor(ThemeUtils.primaryAccentColor(getContext()));
-// EditText searchText = searchView.findViewById(R.id.searchView);
-// searchText.setHighlightColor(ThemeUtils.primaryColor(getContext(), true));
-
final Handler handler = new Handler();
DisplayMetrics displaymetrics = new DisplayMetrics();
diff --git a/src/main/java/com/owncloud/android/utils/ThemeUtils.java b/src/main/java/com/owncloud/android/utils/ThemeUtils.java
index ffbb5db061..35d5ef6df8 100644
--- a/src/main/java/com/owncloud/android/utils/ThemeUtils.java
+++ b/src/main/java/com/owncloud/android/utils/ThemeUtils.java
@@ -126,8 +126,8 @@ public final class ThemeUtils {
}
public static int primaryColor(Account account, boolean replaceWhite, Context context) {
- if (context==null) {
- return 255;
+ if (context == null) {
+ return Color.GRAY;
}
try {
@@ -508,8 +508,7 @@ public final class ThemeUtils {
color = ContextCompat.getColor(context, R.color.themed_fg_inverse);
}
}
-
-// editText.setHintTextColor(color);
+
editText.setTextColor(color);
editText.setHighlightColor(context.getResources().getColor(R.color.fg_contrast));
setEditTextCursorColor(editText, color);
@@ -521,7 +520,7 @@ public final class ThemeUtils {
*
* @param searchView searchView to be changed
* @param themedBackground true if background is themed, e.g. on action bar; false if background is white
- * @param context
+ * @param context the app's context
*/
public static void themeSearchView(SearchView searchView, boolean themedBackground, Context context) {
// hacky as no default way is provided
diff --git a/src/main/res/drawable-night/round_bgnd.xml b/src/main/res/drawable-night/round_bgnd.xml
index 79f11e8d72..9d9d087d59 100644
--- a/src/main/res/drawable-night/round_bgnd.xml
+++ b/src/main/res/drawable-night/round_bgnd.xml
@@ -1,4 +1,23 @@
+
diff --git a/src/main/res/drawable-night/shared_via_link.xml b/src/main/res/drawable-night/shared_via_link.xml
index de7b86aaf7..5f9cdea103 100644
--- a/src/main/res/drawable-night/shared_via_link.xml
+++ b/src/main/res/drawable-night/shared_via_link.xml
@@ -1,3 +1,21 @@
+
.
+
+-->
+
-
\ No newline at end of file
+
diff --git a/src/main/res/drawable/round_bgnd_icons.xml b/src/main/res/drawable/round_bgnd_icons.xml
new file mode 100644
index 0000000000..f4f807528d
--- /dev/null
+++ b/src/main/res/drawable/round_bgnd_icons.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
diff --git a/src/main/res/drawable/shared_via_link.xml b/src/main/res/drawable/shared_via_link.xml
index b57c8f4432..35b7cb533d 100644
--- a/src/main/res/drawable/shared_via_link.xml
+++ b/src/main/res/drawable/shared_via_link.xml
@@ -1,3 +1,21 @@
+
.
+
+-->
diff --git a/src/main/res/layout/notification_list_item.xml b/src/main/res/layout/notification_list_item.xml
index 29162e6719..a73550ab25 100644
--- a/src/main/res/layout/notification_list_item.xml
+++ b/src/main/res/layout/notification_list_item.xml
@@ -39,7 +39,7 @@
android:layout_marginRight="@dimen/notification_icon_layout_right_end_margin"
android:padding="2dp"
android:alpha="0.5"
- android:background="@drawable/round_bgnd"
+ android:background="@drawable/round_bgnd_icons"
android:contentDescription="@string/notification_icon"
android:src="@drawable/ic_notification" />
diff --git a/src/main/res/layout/ssl_validator_layout.xml b/src/main/res/layout/ssl_validator_layout.xml
index d75f647763..34a9be94ae 100644
--- a/src/main/res/layout/ssl_validator_layout.xml
+++ b/src/main/res/layout/ssl_validator_layout.xml
@@ -30,9 +30,9 @@
android:layout_height="wrap_content"
android:text="@string/ssl_validator_header"
android:paddingBottom="@dimen/standard_padding"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/textColor_inverse"
- />
+ android:textStyle="bold"
+ android:textColor="@color/textColor"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
@@ -111,7 +111,7 @@
android:shadowDx="0.5"
android:shadowDy="0"
android:shadowRadius="2"
- android:textColor="@color/textColor"
+ android:textColor="@color/white"
android:textSize="@dimen/drawer_header_subtext"
tools:text="max@127.0.0.1/nextcloud"/>
diff --git a/src/main/res/values-night/colors.xml b/src/main/res/values-night/colors.xml
index cce1a0fd5b..d481f963c6 100644
--- a/src/main/res/values-night/colors.xml
+++ b/src/main/res/values-night/colors.xml
@@ -1,29 +1,28 @@
#00ddff
@color/secondaryTextColor
-
-
#ffffff
#ffffff
#ff888888
@@ -45,7 +44,6 @@
#e9322d
-
#0082c9
#006AA3
diff --git a/src/main/res/values-v21/styles.xml b/src/main/res/values-v21/styles.xml
index 8422152457..05f9a8e531 100644
--- a/src/main/res/values-v21/styles.xml
+++ b/src/main/res/values-v21/styles.xml
@@ -44,7 +44,6 @@
diff --git a/src/main/res/values/colors.xml b/src/main/res/values/colors.xml
index 67fd6657aa..a216ef863f 100644
--- a/src/main/res/values/colors.xml
+++ b/src/main/res/values/colors.xml
@@ -1,8 +1,8 @@
@@ -23,7 +23,7 @@
@color/secondaryTextColor
#000000
-
+ #ffffff
#000000
#ffffff
#ff888888
@@ -49,7 +49,6 @@
#e9322d
-
#0082c9
#006AA3
@@ -70,6 +69,8 @@
#ffffff
#000000
+ #FFFFFF
+
#201D2D44
#40162233
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 52967a7b73..b86a1aea32 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -58,7 +58,6 @@
Imprint
Light
Dark
- darkTheme
Theme
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index b2588535c4..4dae1b4f4b 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -1,4 +1,5 @@
-