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

Commit 8eb9890c authored by Stefan Niedermann's avatar Stefan Niedermann Committed by Andy Scherzinger
Browse files

feat(theming): Align theming closer to files app

parent 1dbde30c
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ import android.widget.TextView;
import androidx.annotation.ColorInt;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
@@ -171,4 +172,24 @@ public class NotesViewThemeUtils extends ViewThemeUtilsBase {
            return toolbar;
        });
    }

    /**
     * @deprecated Should be replaced with {@link com.google.android.material.search.SearchView}
     * @see com.nextcloud.android.common.ui.theme.utils.AndroidXViewThemeUtils#themeToolbarSearchView(SearchView)
     */
    @Deprecated
    public void themeToolbarSearchView(@NonNull SearchView searchView) {
        withScheme(searchView, scheme -> {
            // hacky as no default way is provided
            final var editText = (SearchView.SearchAutoComplete) searchView.findViewById(androidx.appcompat.R.id.search_src_text);
            final var closeButton = (ImageView) searchView.findViewById(androidx.appcompat.R.id.search_close_btn);
            final var searchButton = (ImageView) searchView.findViewById(androidx.appcompat.R.id.search_button);
            editText.setHintTextColor(scheme.getOnSurfaceVariant());
            editText.setHighlightColor(scheme.getInverseOnSurface());
            editText.setTextColor(scheme.getOnSurface());
            closeButton.setColorFilter(scheme.getOnSurface());
            searchButton.setColorFilter(scheme.getOnSurface());
            return searchView;
        });
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -594,12 +594,13 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A
    @Override
    public void applyBrand(int color) {
        final var util = BrandingUtil.of(color, this);
        util.material.themeFAB(activityBinding.fabCreate);
        util.androidx.themeSwipeRefreshLayout(activityBinding.swiperefreshlayout);
        util.platform.colorCircularProgressBar(activityBinding.progressCircular, ColorRole.PRIMARY);
        util.platform.colorNavigationView(binding.navigationView);
        util.material.themeFAB(activityBinding.fabCreate);
        util.notes.themeSearchCardView(binding.activityNotesListView.searchBarWrapper);
        util.notes.themeSearchToolbar(binding.activityNotesListView.searchToolbar);
        util.notes.themeToolbarSearchView(binding.activityNotesListView.searchView);

        binding.headerView.setBackgroundColor(color);
        @ColorInt final int headerTextColor = ColorUtil.INSTANCE.getForegroundColorForBackgroundColor(color);
+0 −1
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:navigationIcon="@drawable/ic_arrow_back_grey600_24dp"
            app:titleMarginStart="0dp"
            tools:title="@string/simple_about" />

        <com.google.android.material.tabs.TabLayout
+0 −1
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:navigationIcon="@drawable/ic_arrow_back_grey600_24dp"
        app:titleMarginStart="0dp"
        tools:title="Edit Sample note" />

    <androidx.fragment.app.FragmentContainerView
+0 −1
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:elevation="4dp"
        app:titleMarginStart="0dp"
        tools:title="@string/simple_exception" />

    <TextView
Loading