File tree Expand file tree Collapse file tree 10 files changed +33
-13
lines changed
java/it/niedermann/owncloud/notes Expand file tree Collapse file tree 10 files changed +33
-13
lines changed Original file line number Diff line number Diff line change 1616import androidx .annotation .ColorInt ;
1717import androidx .annotation .IdRes ;
1818import androidx .annotation .NonNull ;
19+ import androidx .appcompat .widget .SearchView ;
1920import androidx .appcompat .widget .Toolbar ;
2021import androidx .core .content .ContextCompat ;
2122import androidx .core .graphics .drawable .DrawableCompat ;
@@ -171,4 +172,24 @@ public void themeSearchToolbar(@NonNull MaterialToolbar toolbar) {
171172 return toolbar ;
172173 });
173174 }
175+
176+ /**
177+ * @deprecated Should be replaced with {@link com.google.android.material.search.SearchView}
178+ * @see com.nextcloud.android.common.ui.theme.utils.AndroidXViewThemeUtils#themeToolbarSearchView(SearchView)
179+ */
180+ @ Deprecated
181+ public void themeToolbarSearchView (@ NonNull SearchView searchView ) {
182+ withScheme (searchView , scheme -> {
183+ // hacky as no default way is provided
184+ final var editText = (SearchView .SearchAutoComplete ) searchView .findViewById (androidx .appcompat .R .id .search_src_text );
185+ final var closeButton = (ImageView ) searchView .findViewById (androidx .appcompat .R .id .search_close_btn );
186+ final var searchButton = (ImageView ) searchView .findViewById (androidx .appcompat .R .id .search_button );
187+ editText .setHintTextColor (scheme .getOnSurfaceVariant ());
188+ editText .setHighlightColor (scheme .getInverseOnSurface ());
189+ editText .setTextColor (scheme .getOnSurface ());
190+ closeButton .setColorFilter (scheme .getOnSurface ());
191+ searchButton .setColorFilter (scheme .getOnSurface ());
192+ return searchView ;
193+ });
194+ }
174195}
Original file line number Diff line number Diff line change @@ -594,12 +594,13 @@ public void onIconClick(NavigationItem item) {
594594 @ Override
595595 public void applyBrand (int color ) {
596596 final var util = BrandingUtil .of (color , this );
597- util .material .themeFAB (activityBinding .fabCreate );
598597 util .androidx .themeSwipeRefreshLayout (activityBinding .swiperefreshlayout );
599598 util .platform .colorCircularProgressBar (activityBinding .progressCircular , ColorRole .PRIMARY );
600599 util .platform .colorNavigationView (binding .navigationView );
600+ util .material .themeFAB (activityBinding .fabCreate );
601601 util .notes .themeSearchCardView (binding .activityNotesListView .searchBarWrapper );
602602 util .notes .themeSearchToolbar (binding .activityNotesListView .searchToolbar );
603+ util .notes .themeToolbarSearchView (binding .activityNotesListView .searchView );
603604
604605 binding .headerView .setBackgroundColor (color );
605606 @ ColorInt final int headerTextColor = ColorUtil .INSTANCE .getForegroundColorForBackgroundColor (color );
Original file line number Diff line number Diff line change 1616 android : layout_width =" match_parent"
1717 android : layout_height =" wrap_content"
1818 app : navigationIcon =" @drawable/ic_arrow_back_grey600_24dp"
19- app : titleMarginStart =" 0dp"
2019 tools : title =" @string/simple_about" />
2120
2221 <com .google.android.material.tabs.TabLayout
Original file line number Diff line number Diff line change 1111 android : layout_width =" match_parent"
1212 android : layout_height =" wrap_content"
1313 app : navigationIcon =" @drawable/ic_arrow_back_grey600_24dp"
14- app : titleMarginStart =" 0dp"
1514 tools : title =" Edit Sample note" />
1615
1716 <androidx .fragment.app.FragmentContainerView
Original file line number Diff line number Diff line change 1111 android : layout_width =" match_parent"
1212 android : layout_height =" wrap_content"
1313 app : elevation =" 4dp"
14- app : titleMarginStart =" 0dp"
1514 tools : title =" @string/simple_exception" />
1615
1716 <TextView
Original file line number Diff line number Diff line change 1111 android : layout_width =" match_parent"
1212 android : layout_height =" wrap_content"
1313 app : navigationIcon =" @drawable/ic_arrow_back_grey600_24dp"
14- app : title =" @string/action_formatting_help"
15- app : titleMarginStart =" 0dp" />
14+ app : title =" @string/action_formatting_help" />
1615
1716 <ScrollView
1817 android : id =" @+id/scrollView"
Original file line number Diff line number Diff line change 1111 android : layout_width =" match_parent"
1212 android : layout_height =" wrap_content"
1313 app : navigationIcon =" @drawable/ic_arrow_back_grey600_24dp"
14- app : title =" @string/manage_accounts"
15- app : titleMarginStart =" 0dp" />
14+ app : title =" @string/manage_accounts" />
1615
1716 <androidx .recyclerview.widget.RecyclerView
1817 android : id =" @+id/accounts"
Original file line number Diff line number Diff line change 3838 android : layout_width =" match_parent"
3939 android : layout_height =" wrap_content"
4040 android : orientation =" horizontal"
41- app : contentInsetStartWithNavigation =" 0dp"
42- app : titleMarginStart =" 0dp" >
41+ app : contentInsetStartWithNavigation =" 0dp" >
4342
4443 <LinearLayout
4544 android : layout_width =" match_parent"
8685
8786 <com .google.android.material.appbar.MaterialToolbar
8887 android : id =" @+id/search_toolbar"
88+ style =" @style/searchToolbarStyle"
8989 android : layout_width =" match_parent"
9090 android : layout_height =" match_parent"
9191 android : visibility =" gone"
9292 app : navigationIcon =" @drawable/ic_arrow_back_grey600_24dp"
93- app : titleMarginStart =" 0dp"
9493 tools : title =" @string/app_name" >
9594
9695 <androidx .appcompat.widget.SearchView
Original file line number Diff line number Diff line change 1010 android : layout_width =" match_parent"
1111 android : layout_height =" wrap_content"
1212 app : navigationIcon =" @drawable/ic_arrow_back_grey600_24dp"
13- app : title =" @string/action_settings"
14- app : titleMarginStart =" 0dp" />
13+ app : title =" @string/action_settings" />
1514
1615 <androidx .fragment.app.FragmentContainerView
1716 android : id =" @+id/fragment_container_view"
Original file line number Diff line number Diff line change 5151 <item name =" android:paddingEnd" >@dimen/spacer_activity_sides</item >
5252 </style >
5353
54+ <style name =" searchToolbarStyle" parent =" @style/Widget.Material3.Toolbar" >
55+ <item name =" android:paddingStart" >@dimen/spacer_activity_sides</item >
56+ <item name =" android:paddingEnd" >@dimen/spacer_activity_sides</item >
57+ </style >
58+
5459 <style name =" tabStyle" parent =" Widget.Material3.TabLayout" >
5560 <item name =" backgroundColor" >@android:color/transparent</item >
5661 <item name =" itemBackground" >@android:color/transparent</item >
You can’t perform that action at this time.
0 commit comments