mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-12-18 00:22:17 +03:00
feat(theming): Align theming closer to files app
Follow-Up to https://github.com/nextcloud/notes-android/pull/1680 Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
parent
1dbde30c46
commit
8eb9890c8a
10 changed files with 33 additions and 13 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationIcon="@drawable/ic_arrow_back_grey600_24dp"
|
||||
app:title="@string/action_formatting_help"
|
||||
app:titleMarginStart="0dp" />
|
||||
app:title="@string/action_formatting_help" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView"
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationIcon="@drawable/ic_arrow_back_grey600_24dp"
|
||||
app:title="@string/manage_accounts"
|
||||
app:titleMarginStart="0dp" />
|
||||
app:title="@string/manage_accounts" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/accounts"
|
||||
|
|
|
@ -38,8 +38,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:contentInsetStartWithNavigation="0dp"
|
||||
app:titleMarginStart="0dp">
|
||||
app:contentInsetStartWithNavigation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -86,11 +85,11 @@
|
|||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/search_toolbar"
|
||||
style="@style/searchToolbarStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone"
|
||||
app:navigationIcon="@drawable/ic_arrow_back_grey600_24dp"
|
||||
app:titleMarginStart="0dp"
|
||||
tools:title="@string/app_name">
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:navigationIcon="@drawable/ic_arrow_back_grey600_24dp"
|
||||
app:title="@string/action_settings"
|
||||
app:titleMarginStart="0dp" />
|
||||
app:title="@string/action_settings" />
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_container_view"
|
||||
|
|
|
@ -51,6 +51,11 @@
|
|||
<item name="android:paddingEnd">@dimen/spacer_activity_sides</item>
|
||||
</style>
|
||||
|
||||
<style name="searchToolbarStyle" parent="@style/Widget.Material3.Toolbar">
|
||||
<item name="android:paddingStart">@dimen/spacer_activity_sides</item>
|
||||
<item name="android:paddingEnd">@dimen/spacer_activity_sides</item>
|
||||
</style>
|
||||
|
||||
<style name="tabStyle" parent="Widget.Material3.TabLayout">
|
||||
<item name="backgroundColor">@android:color/transparent</item>
|
||||
<item name="itemBackground">@android:color/transparent</item>
|
||||
|
|
Loading…
Reference in a new issue