Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07735922 authored by Stefan Niedermann's avatar Stefan Niedermann
Browse files

Workaround for #889 Start/end padding in lighter black that rest of appbar

parent fe329d26
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ public class AboutActivity extends LockedActivity {

    @Override
    public void applyBrand(int mainColor, int textColor) {
        applyBrandToPrimaryToolbar(binding.toolbar);
        applyBrandToPrimaryToolbar(binding.appBar, binding.toolbar);
        @ColorInt int finalMainColor = BrandingUtil.getSecondaryForegroundColorDependingOnTheme(this, mainColor);
        binding.tabs.setSelectedTabIndicatorColor(finalMainColor);
    }
+1 −1
Original line number Diff line number Diff line
@@ -277,6 +277,6 @@ public class EditNoteActivity extends LockedActivity implements BaseNoteFragment

    @Override
    public void applyBrand(int mainColor, int textColor) {
        applyBrandToPrimaryToolbar(binding.toolbar);
        applyBrandToPrimaryToolbar(binding.appBar, binding.toolbar);
    }
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -471,7 +471,7 @@ public class NotesListViewActivity extends LockedActivity implements NoteClickLi

    @Override
    public void applyBrand(int mainColor, int textColor) {
        applyBrandToPrimaryToolbar(activityBinding.toolbar);
        applyBrandToPrimaryToolbar(activityBinding.appBar, activityBinding.toolbar);
        applyBrandToFAB(mainColor, textColor, activityBinding.fabCreate);

        binding.headerView.setBackgroundColor(mainColor);
+1 −1
Original line number Diff line number Diff line
@@ -32,6 +32,6 @@ public class PreferencesActivity extends LockedActivity {

    @Override
    public void applyBrand(int mainColor, int textColor) {
        applyBrandToPrimaryToolbar(binding.toolbar);
        applyBrandToPrimaryToolbar(binding.appBar, binding.toolbar);
    }
}
+6 −2
Original line number Diff line number Diff line
@@ -10,7 +10,9 @@ import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;

import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.floatingactionbutton.FloatingActionButton;

import it.niedermann.owncloud.notes.R;
@@ -50,7 +52,10 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand
        return super.onCreateOptionsMenu(menu);
    }

    public void applyBrandToPrimaryToolbar(@NonNull Toolbar toolbar) {
    public void applyBrandToPrimaryToolbar(@NonNull AppBarLayout appBarLayout, @NonNull Toolbar toolbar) {
        // FIXME Workaround for https://github.com/stefan-niedermann/nextcloud-notes/issues/889
        appBarLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.primary));

        final Drawable overflowDrawable = toolbar.getOverflowIcon();
        if (overflowDrawable != null) {
            overflowDrawable.setColorFilter(colorAccent, PorterDuff.Mode.SRC_ATOP);
@@ -63,5 +68,4 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand
            toolbar.setNavigationIcon(navigationDrawable);
        }
    }

}
Loading