From 26497dff787199a1c0190665539b9beb5b6ad202 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Tue, 21 Feb 2023 11:54:51 +0600 Subject: [PATCH] 6685-Fix_accent_color_issue issue: https://gitlab.e.foundation/e/backlog/-/issues/6685 --- .../owncloud/notes/branding/BrandedActivity.java | 5 ----- .../notes/edit/SearchableBaseNoteFragment.java | 2 -- .../notes/importaccount/ImportAccountActivity.java | 3 +++ .../niedermann/owncloud/notes/main/MainActivity.java | 1 - .../res/drawable/ic_keyboard_arrow_up_white_24dp.xml | 11 +++++------ app/src/main/res/layout/fragment_note_edit.xml | 1 + app/src/main/res/layout/fragment_note_preview.xml | 1 + 7 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java index 92d0d8972..aa91251d6 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java @@ -25,11 +25,6 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand @ColorInt protected int colorAccent; - public static void applyBrandToFAB(@ColorInt int mainColor, @ColorInt int textColor, @NonNull FloatingActionButton fab) { - fab.setSupportBackgroundTintList(ColorStateList.valueOf(mainColor)); - fab.setColorFilter(textColor); - } - @Override protected void onStart() { super.onStart(); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java b/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java index 0fc3dcc96..91fb0f6bf 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/edit/SearchableBaseNoteFragment.java @@ -295,7 +295,5 @@ public abstract class SearchableBaseNoteFragment extends BaseNoteFragment { public void applyBrand(int mainColor, int textColor) { this.mainColor = mainColor; this.textColor = textColor; - BrandedActivity.applyBrandToFAB(mainColor, textColor, getSearchPrevButton()); - BrandedActivity.applyBrandToFAB(mainColor, textColor, getSearchNextButton()); } } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java index 649d4b0c4..1f5143665 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/importaccount/ImportAccountActivity.java @@ -60,6 +60,7 @@ public class ImportAccountActivity extends AppCompatActivity { binding.welcomeText.setText(getString(R.string.welcome_text, getString(R.string.app_name))); binding.addButton.setOnClickListener((v) -> { binding.addButton.setEnabled(false); + binding.addButton.setVisibility(View.INVISIBLE); binding.status.setVisibility(View.GONE); try { AccountImporter.pickNewAccount(this); @@ -70,6 +71,7 @@ public class ImportAccountActivity extends AppCompatActivity { e.printStackTrace(); } catch (AndroidGetAccountsPermissionNotGranted e) { binding.addButton.setEnabled(true); + binding.addButton.setVisibility(View.VISIBLE); AccountImporter.requestAndroidAccountPermissionsAndPickAccount(this); } }); @@ -171,6 +173,7 @@ public class ImportAccountActivity extends AppCompatActivity { private void restoreCleanState() { runOnUiThread(() -> { binding.addButton.setEnabled(true); + binding.addButton.setVisibility(View.VISIBLE); binding.progressCircular.setVisibility(View.GONE); binding.progressText.setVisibility(View.GONE); }); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java index 00d54c48f..ebdfaa795 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java @@ -595,7 +595,6 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A @Override public void applyBrand(int mainColor, int textColor) { applyBrandToPrimaryToolbar(activityBinding.appBar, activityBinding.searchToolbar); - applyBrandToFAB(mainColor, textColor, activityBinding.fabCreate); binding.headerView.setBackgroundColor(mainColor); binding.appName.setTextColor(textColor); diff --git a/app/src/main/res/drawable/ic_keyboard_arrow_up_white_24dp.xml b/app/src/main/res/drawable/ic_keyboard_arrow_up_white_24dp.xml index e0c3e9012..b63f2c5e3 100644 --- a/app/src/main/res/drawable/ic_keyboard_arrow_up_white_24dp.xml +++ b/app/src/main/res/drawable/ic_keyboard_arrow_up_white_24dp.xml @@ -1,11 +1,10 @@ - + android:viewportHeight="24.0"> diff --git a/app/src/main/res/layout/fragment_note_edit.xml b/app/src/main/res/layout/fragment_note_edit.xml index 9a4883742..eebd5a02b 100644 --- a/app/src/main/res/layout/fragment_note_edit.xml +++ b/app/src/main/res/layout/fragment_note_edit.xml @@ -50,6 +50,7 @@ android:visibility="gone" app:backgroundTint="@color/defaultBrand" app:srcCompat="@drawable/ic_keyboard_arrow_up_white_24dp" + android:tint="@color/e_background" tools:visibility="visible" /> -- GitLab