Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency com.github.nextcloud.android-common:ui to v0.18.0 #2060

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'

// Nextcloud SSO
implementation 'com.github.nextcloud.android-common:ui:0.17.0'
implementation 'com.github.nextcloud.android-common:ui:0.18.0'
implementation 'com.github.nextcloud:Android-SingleSignOn:1.1.0'
implementation 'com.github.stefan-niedermann:android-commons:1.0.0'
implementation "com.github.stefan-niedermann.nextcloud-commons:sso-glide:$commonsVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import androidx.annotation.ColorInt;
import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatAutoCompleteTextView;
import androidx.appcompat.widget.SearchView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
Expand All @@ -34,6 +35,7 @@
import com.nextcloud.android.common.ui.theme.ViewThemeUtilsBase;
import com.nextcloud.android.common.ui.theme.utils.MaterialViewThemeUtils;

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

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

private final MaterialDynamicColors dynamicColor = new MaterialDynamicColors();

public NotesViewThemeUtils(@NonNull MaterialSchemes schemes) {
super(schemes);
}
Expand All @@ -55,7 +59,7 @@ public NotesViewThemeUtils(@NonNull MaterialSchemes schemes) {
public void colorNavigationViewItem(@NonNull View view) {
withScheme(view, scheme -> {
view.setBackgroundTintList(buildColorStateList(
new Pair<>(android.R.attr.state_selected, scheme.getSecondaryContainer()),
new Pair<>(android.R.attr.state_selected, dynamicColor.secondaryContainer().getArgb(scheme)),
new Pair<>(-android.R.attr.state_selected, Color.TRANSPARENT)
));
return view;
Expand All @@ -69,8 +73,8 @@ public void colorNavigationViewItem(@NonNull View view) {
public void colorNavigationViewItemIcon(@NonNull ImageView view) {
withScheme(view, scheme -> {
view.setImageTintList(buildColorStateList(
new Pair<>(android.R.attr.state_selected, scheme.getOnSecondaryContainer()),
new Pair<>(-android.R.attr.state_selected, scheme.getOnSurfaceVariant())
new Pair<>(android.R.attr.state_selected, dynamicColor.onSecondaryContainer().getArgb(scheme)),
new Pair<>(-android.R.attr.state_selected, dynamicColor.onSurfaceVariant().getArgb(scheme))
));
return view;
});
Expand All @@ -83,8 +87,8 @@ public void colorNavigationViewItemIcon(@NonNull ImageView view) {
public void colorNavigationViewItemText(@NonNull TextView view) {
withScheme(view, scheme -> {
view.setTextColor(buildColorStateList(
new Pair<>(android.R.attr.state_selected, scheme.getOnSecondaryContainer()),
new Pair<>(-android.R.attr.state_selected, scheme.getOnSurfaceVariant())
new Pair<>(android.R.attr.state_selected, dynamicColor.onSecondaryContainer().getArgb(scheme)),
new Pair<>(-android.R.attr.state_selected, dynamicColor.onSurfaceVariant().getArgb(scheme))
));
return view;
});
Expand Down Expand Up @@ -167,7 +171,7 @@ public int getTextHighlightBackgroundColor(@NonNull Context context,
@Deprecated
public void themeSearchCardView(@NonNull MaterialCardView searchBarWrapper) {
withScheme(searchBarWrapper, scheme -> {
searchBarWrapper.setBackgroundTintList(ColorStateList.valueOf(scheme.getSurface()));
searchBarWrapper.setBackgroundTintList(ColorStateList.valueOf(dynamicColor.surface().getArgb(scheme)));
return searchBarWrapper;
});
}
Expand All @@ -179,8 +183,8 @@ public void themeSearchCardView(@NonNull MaterialCardView searchBarWrapper) {
@Deprecated
public void themeSearchToolbar(@NonNull MaterialToolbar toolbar) {
withScheme(toolbar, scheme -> {
toolbar.setNavigationIconTint(scheme.getOnSurface());
toolbar.setTitleTextColor(scheme.getOnSurface());
toolbar.setNavigationIconTint(dynamicColor.onSurface().getArgb(scheme));
toolbar.setTitleTextColor(dynamicColor.onSurface().getArgb(scheme));
return toolbar;
});
}
Expand All @@ -193,15 +197,15 @@ public void themeSearchToolbar(@NonNull MaterialToolbar toolbar) {
public void themeToolbarSearchView(@NonNull SearchView searchView) {
withScheme(searchView, scheme -> {
// hacky as no default way is provided
final var editText = (SearchView.SearchAutoComplete) searchView
final var editText = (AppCompatAutoCompleteTextView) 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());
editText.setHintTextColor(dynamicColor.onSurfaceVariant().getArgb(scheme));
editText.setHighlightColor(dynamicColor.inverseOnSurface().getArgb(scheme));
editText.setTextColor(dynamicColor.onSurface().getArgb(scheme));
closeButton.setColorFilter(dynamicColor.onSurface().getArgb(scheme));
searchButton.setColorFilter(dynamicColor.onSurface().getArgb(scheme));
return searchView;
});
}
Expand Down
29 changes: 29 additions & 0 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@
<sha256 value="a1fd8a9bd0a80c9f203065d01b76616d6675a3874c6b8bd1e87736dbfb318005" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="androidx.compose" name="compose-bom" version="2024.02.02">
<artifact name="compose-bom-2024.02.02.pom">
<sha256 value="9bfe92a8fa26491d64fc4c94621a8bdd0f61375fb815515236204503ec7cae6b" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="androidx.concurrent" name="concurrent-futures" version="1.0.0">
<artifact name="concurrent-futures-1.0.0.pom">
<sha256 value="4505b9a5e30a9418b59a9ad6702c3e4193aea6e691a3d03cf220c7640ad083e2" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down Expand Up @@ -1654,6 +1659,14 @@
<sha256 value="c566a8a9d41b8e804c52539975cfc017d105e9fe2730e74f936ed948f55bc6dc" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud.android-common" name="core" version="0.18.0">
<artifact name="core-0.18.0.aar">
<sha256 value="6df9110e5ab50846414102cc75d541fcb488d36a10b7c8b6c12908c344ad3a82" origin="Generated by Gradle"/>
</artifact>
<artifact name="core-0.18.0.module">
<sha256 value="1e92c76d638cb275a3f9432641a0c5664b1eaabcc2da67bd809e787c3371fca5" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud.android-common" name="material-color-utilities" version="0.14.0">
<artifact name="material-color-utilities-0.14.0.jar">
<sha256 value="bfcd5205b056b948bc6ff9a556898188f4a4e92179c723906e10f1164b776eed" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down Expand Up @@ -1686,6 +1699,14 @@
<sha256 value="c6239f76c0d68b7126c4233e84fd3de9063b86e76084c602f296010192536a74" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud.android-common" name="material-color-utilities" version="0.18.0">
<artifact name="material-color-utilities-0.18.0.jar">
<sha256 value="e04a3f4a3caff6e4b2ce3f14f91f0485ab1f012af652102eba61ab6bcf3d8240" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="material-color-utilities-0.18.0.module">
<sha256 value="708823ec85484322da28afa177689bc2adadf0d88f766407328353e0c755e63b" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud.android-common" name="ui" version="0.14.0">
<artifact name="ui-0.14.0.aar">
<sha256 value="2ff1b8ca1ce4d4151ce967c4704a4def19a128d3f710491872e007217f3ac84f" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down Expand Up @@ -1718,6 +1739,14 @@
<sha256 value="2ac34079e37123543bfc0fa78271424978b81baa5866d21884ec4084d6157573" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud.android-common" name="ui" version="0.18.0">
<artifact name="ui-0.18.0.aar">
<sha256 value="7d900a930d7ad1f7de91177b8b661abef13deef032493cee99fe9842f85bcf16" origin="Generated by Gradle"/>
</artifact>
<artifact name="ui-0.18.0.module">
<sha256 value="abbece3fec4a3a1b706401b26e10d0290ac394d04d89343d32da682527579846" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.stefan-niedermann" name="android-commons" version="1.0.0">
<artifact name="android-commons-1.0.0.jar">
<sha256 value="670f84d9ef31964f1b548204d83c81a44142106c69d4188b20556bc32f4ee3dc" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down
Loading