Skip to content

Commit c8a7a70

Browse files
Merge pull request #2060 from nextcloud/renovate/com.github.nextcloud.android-common-ui-0.x
fix(deps): update dependency com.github.nextcloud.android-common:ui to v0.18.0
2 parents b75bc0e + f5a7707 commit c8a7a70

3 files changed

Lines changed: 48 additions & 15 deletions

File tree

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ dependencies {
9292
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
9393

9494
// Nextcloud SSO
95-
implementation 'com.github.nextcloud.android-common:ui:0.17.0'
95+
implementation 'com.github.nextcloud.android-common:ui:0.18.0'
9696
implementation 'com.github.nextcloud:Android-SingleSignOn:1.1.0'
9797
implementation 'com.github.stefan-niedermann:android-commons:1.0.0'
9898
implementation "com.github.stefan-niedermann.nextcloud-commons:sso-glide:$commonsVersion"

app/src/main/java/it/niedermann/owncloud/notes/branding/NotesViewThemeUtils.java

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import androidx.annotation.ColorInt;
2323
import androidx.annotation.IdRes;
2424
import androidx.annotation.NonNull;
25+
import androidx.appcompat.widget.AppCompatAutoCompleteTextView;
2526
import androidx.appcompat.widget.SearchView;
2627
import androidx.appcompat.widget.Toolbar;
2728
import androidx.core.content.ContextCompat;
@@ -34,6 +35,7 @@
3435
import com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase;
3536
import com.nextcloud.android.common.ui.theme.utils.MaterialViewThemeUtils;
3637

38+
import dynamiccolor.MaterialDynamicColors;
3739
import it.niedermann.android.util.ColorUtil;
3840
import it.niedermann.owncloud.notes.R;
3941
import it.niedermann.owncloud.notes.main.navigation.NavigationItem;
@@ -44,6 +46,8 @@ public class NotesViewThemeUtils extends ViewThemeUtilsBase {
4446

4547
private static final String TAG = NotesViewThemeUtils.class.getSimpleName();
4648

49+
private final MaterialDynamicColors dynamicColor = new MaterialDynamicColors();
50+
4751
public NotesViewThemeUtils(@NonNull MaterialSchemes schemes) {
4852
super(schemes);
4953
}
@@ -55,7 +59,7 @@ public NotesViewThemeUtils(@NonNull MaterialSchemes schemes) {
5559
public void colorNavigationViewItem(@NonNull View view) {
5660
withScheme(view, scheme -> {
5761
view.setBackgroundTintList(buildColorStateList(
58-
new Pair<>(android.R.attr.state_selected, scheme.getSecondaryContainer()),
62+
new Pair<>(android.R.attr.state_selected, dynamicColor.secondaryContainer().getArgb(scheme)),
5963
new Pair<>(-android.R.attr.state_selected, Color.TRANSPARENT)
6064
));
6165
return view;
@@ -69,8 +73,8 @@ public void colorNavigationViewItem(@NonNull View view) {
6973
public void colorNavigationViewItemIcon(@NonNull ImageView view) {
7074
withScheme(view, scheme -> {
7175
view.setImageTintList(buildColorStateList(
72-
new Pair<>(android.R.attr.state_selected, scheme.getOnSecondaryContainer()),
73-
new Pair<>(-android.R.attr.state_selected, scheme.getOnSurfaceVariant())
76+
new Pair<>(android.R.attr.state_selected, dynamicColor.onSecondaryContainer().getArgb(scheme)),
77+
new Pair<>(-android.R.attr.state_selected, dynamicColor.onSurfaceVariant().getArgb(scheme))
7478
));
7579
return view;
7680
});
@@ -83,8 +87,8 @@ public void colorNavigationViewItemIcon(@NonNull ImageView view) {
8387
public void colorNavigationViewItemText(@NonNull TextView view) {
8488
withScheme(view, scheme -> {
8589
view.setTextColor(buildColorStateList(
86-
new Pair<>(android.R.attr.state_selected, scheme.getOnSecondaryContainer()),
87-
new Pair<>(-android.R.attr.state_selected, scheme.getOnSurfaceVariant())
90+
new Pair<>(android.R.attr.state_selected, dynamicColor.onSecondaryContainer().getArgb(scheme)),
91+
new Pair<>(-android.R.attr.state_selected, dynamicColor.onSurfaceVariant().getArgb(scheme))
8892
));
8993
return view;
9094
});
@@ -167,7 +171,7 @@ public int getTextHighlightBackgroundColor(@NonNull Context context,
167171
@Deprecated
168172
public void themeSearchCardView(@NonNull MaterialCardView searchBarWrapper) {
169173
withScheme(searchBarWrapper, scheme -> {
170-
searchBarWrapper.setBackgroundTintList(ColorStateList.valueOf(scheme.getSurface()));
174+
searchBarWrapper.setBackgroundTintList(ColorStateList.valueOf(dynamicColor.surface().getArgb(scheme)));
171175
return searchBarWrapper;
172176
});
173177
}
@@ -179,8 +183,8 @@ public void themeSearchCardView(@NonNull MaterialCardView searchBarWrapper) {
179183
@Deprecated
180184
public void themeSearchToolbar(@NonNull MaterialToolbar toolbar) {
181185
withScheme(toolbar, scheme -> {
182-
toolbar.setNavigationIconTint(scheme.getOnSurface());
183-
toolbar.setTitleTextColor(scheme.getOnSurface());
186+
toolbar.setNavigationIconTint(dynamicColor.onSurface().getArgb(scheme));
187+
toolbar.setTitleTextColor(dynamicColor.onSurface().getArgb(scheme));
184188
return toolbar;
185189
});
186190
}
@@ -193,15 +197,15 @@ public void themeSearchToolbar(@NonNull MaterialToolbar toolbar) {
193197
public void themeToolbarSearchView(@NonNull SearchView searchView) {
194198
withScheme(searchView, scheme -> {
195199
// hacky as no default way is provided
196-
final var editText = (SearchView.SearchAutoComplete) searchView
200+
final var editText = (AppCompatAutoCompleteTextView) searchView
197201
.findViewById(androidx.appcompat.R.id.search_src_text);
198202
final var closeButton = (ImageView) searchView.findViewById(androidx.appcompat.R.id.search_close_btn);
199203
final var searchButton = (ImageView) searchView.findViewById(androidx.appcompat.R.id.search_button);
200-
editText.setHintTextColor(scheme.getOnSurfaceVariant());
201-
editText.setHighlightColor(scheme.getInverseOnSurface());
202-
editText.setTextColor(scheme.getOnSurface());
203-
closeButton.setColorFilter(scheme.getOnSurface());
204-
searchButton.setColorFilter(scheme.getOnSurface());
204+
editText.setHintTextColor(dynamicColor.onSurfaceVariant().getArgb(scheme));
205+
editText.setHighlightColor(dynamicColor.inverseOnSurface().getArgb(scheme));
206+
editText.setTextColor(dynamicColor.onSurface().getArgb(scheme));
207+
closeButton.setColorFilter(dynamicColor.onSurface().getArgb(scheme));
208+
searchButton.setColorFilter(dynamicColor.onSurface().getArgb(scheme));
205209
return searchView;
206210
});
207211
}

gradle/verification-metadata.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@
309309
<sha256 value="a1fd8a9bd0a80c9f203065d01b76616d6675a3874c6b8bd1e87736dbfb318005" origin="Generated by Gradle" reason="Artifact is not signed"/>
310310
</artifact>
311311
</component>
312+
<component group="androidx.compose" name="compose-bom" version="2024.02.02">
313+
<artifact name="compose-bom-2024.02.02.pom">
314+
<sha256 value="9bfe92a8fa26491d64fc4c94621a8bdd0f61375fb815515236204503ec7cae6b" origin="Generated by Gradle" reason="Artifact is not signed"/>
315+
</artifact>
316+
</component>
312317
<component group="androidx.concurrent" name="concurrent-futures" version="1.0.0">
313318
<artifact name="concurrent-futures-1.0.0.pom">
314319
<sha256 value="4505b9a5e30a9418b59a9ad6702c3e4193aea6e691a3d03cf220c7640ad083e2" origin="Generated by Gradle" reason="Artifact is not signed"/>
@@ -1654,6 +1659,14 @@
16541659
<sha256 value="c566a8a9d41b8e804c52539975cfc017d105e9fe2730e74f936ed948f55bc6dc" origin="Generated by Gradle" reason="Artifact is not signed"/>
16551660
</artifact>
16561661
</component>
1662+
<component group="com.github.nextcloud.android-common" name="core" version="0.18.0">
1663+
<artifact name="core-0.18.0.aar">
1664+
<sha256 value="6df9110e5ab50846414102cc75d541fcb488d36a10b7c8b6c12908c344ad3a82" origin="Generated by Gradle"/>
1665+
</artifact>
1666+
<artifact name="core-0.18.0.module">
1667+
<sha256 value="1e92c76d638cb275a3f9432641a0c5664b1eaabcc2da67bd809e787c3371fca5" origin="Generated by Gradle" reason="Artifact is not signed"/>
1668+
</artifact>
1669+
</component>
16571670
<component group="com.github.nextcloud.android-common" name="material-color-utilities" version="0.14.0">
16581671
<artifact name="material-color-utilities-0.14.0.jar">
16591672
<sha256 value="bfcd5205b056b948bc6ff9a556898188f4a4e92179c723906e10f1164b776eed" origin="Generated by Gradle" reason="Artifact is not signed"/>
@@ -1686,6 +1699,14 @@
16861699
<sha256 value="c6239f76c0d68b7126c4233e84fd3de9063b86e76084c602f296010192536a74" origin="Generated by Gradle" reason="Artifact is not signed"/>
16871700
</artifact>
16881701
</component>
1702+
<component group="com.github.nextcloud.android-common" name="material-color-utilities" version="0.18.0">
1703+
<artifact name="material-color-utilities-0.18.0.jar">
1704+
<sha256 value="e04a3f4a3caff6e4b2ce3f14f91f0485ab1f012af652102eba61ab6bcf3d8240" origin="Generated by Gradle" reason="Artifact is not signed"/>
1705+
</artifact>
1706+
<artifact name="material-color-utilities-0.18.0.module">
1707+
<sha256 value="708823ec85484322da28afa177689bc2adadf0d88f766407328353e0c755e63b" origin="Generated by Gradle" reason="Artifact is not signed"/>
1708+
</artifact>
1709+
</component>
16891710
<component group="com.github.nextcloud.android-common" name="ui" version="0.14.0">
16901711
<artifact name="ui-0.14.0.aar">
16911712
<sha256 value="2ff1b8ca1ce4d4151ce967c4704a4def19a128d3f710491872e007217f3ac84f" origin="Generated by Gradle" reason="Artifact is not signed"/>
@@ -1718,6 +1739,14 @@
17181739
<sha256 value="2ac34079e37123543bfc0fa78271424978b81baa5866d21884ec4084d6157573" origin="Generated by Gradle" reason="Artifact is not signed"/>
17191740
</artifact>
17201741
</component>
1742+
<component group="com.github.nextcloud.android-common" name="ui" version="0.18.0">
1743+
<artifact name="ui-0.18.0.aar">
1744+
<sha256 value="7d900a930d7ad1f7de91177b8b661abef13deef032493cee99fe9842f85bcf16" origin="Generated by Gradle"/>
1745+
</artifact>
1746+
<artifact name="ui-0.18.0.module">
1747+
<sha256 value="abbece3fec4a3a1b706401b26e10d0290ac394d04d89343d32da682527579846" origin="Generated by Gradle" reason="Artifact is not signed"/>
1748+
</artifact>
1749+
</component>
17211750
<component group="com.github.stefan-niedermann" name="android-commons" version="1.0.0">
17221751
<artifact name="android-commons-1.0.0.jar">
17231752
<sha256 value="670f84d9ef31964f1b548204d83c81a44142106c69d4188b20556bc32f4ee3dc" origin="Generated by Gradle" reason="Artifact is not signed"/>

0 commit comments

Comments
 (0)