Skip to content

Commit 42d56e4

Browse files
stefan-niedermannAndyScherzinger
authored andcommitted
chore(deps): Update dependencies and fix API changes
Signed-off-by: Stefan Niedermann <info@niedermann.it>
1 parent 189f54f commit 42d56e4

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ dependencies {
8484
// Nextcloud SSO
8585
implementation 'com.github.nextcloud.android-common:ui:0.13.0'
8686
implementation 'com.github.nextcloud:Android-SingleSignOn:1.0.0'
87-
implementation 'com.github.stefan-niedermann:android-commons:0.4.0'
87+
implementation 'com.github.stefan-niedermann:android-commons:1.0.0'
8888
implementation "com.github.stefan-niedermann.nextcloud-commons:sso-glide:$commonsVersion"
8989
implementation "com.github.stefan-niedermann.nextcloud-commons:exception:$commonsVersion"
9090
implementation("com.github.stefan-niedermann.nextcloud-commons:markdown:$commonsVersion") {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public int getTextHighlightBackgroundColor(@NonNull Context context,
125125
@ColorInt int colorPrimary,
126126
@ColorInt int colorAccent) {
127127
if (isDarkMode(context)) { // Dark background
128-
if (ColorUtil.INSTANCE.isColorDark(mainColor)) { // Dark brand color
128+
if (ColorUtil.isColorDark(mainColor)) { // Dark brand color
129129
if (NotesColorUtil.contrastRatioIsSufficient(mainColor, colorPrimary)) { // But also dark text
130130
return mainColor;
131131
} else {
@@ -139,7 +139,7 @@ public int getTextHighlightBackgroundColor(@NonNull Context context,
139139
}
140140
}
141141
} else { // Light background
142-
if (ColorUtil.INSTANCE.isColorDark(mainColor)) { // Dark brand color
142+
if (ColorUtil.isColorDark(mainColor)) { // Dark brand color
143143
if (NotesColorUtil.contrastRatioIsSufficient(mainColor, colorAccent)) { // But also dark text
144144
return Color.argb(77, Color.red(mainColor), Color.green(mainColor), Color.blue(mainColor));
145145
} else {

app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
3838
}
3939

4040
final var adapter = new TipsAdapter(this::startActivity);
41-
final String debugInfos = ExceptionUtil.INSTANCE.getDebugInfos(this, throwable, BuildConfig.FLAVOR);
41+
final String debugInfos = ExceptionUtil.getDebugInfos(this, throwable, BuildConfig.FLAVOR);
4242

4343
binding.tips.setAdapter(adapter);
4444
binding.tips.setNestedScrollingEnabled(false);
4545
binding.toolbar.setTitle(getString(R.string.simple_error));
4646
binding.message.setText(throwable.getMessage());
4747
binding.stacktrace.setText(debugInfos);
48-
binding.copy.setOnClickListener((v) -> ClipboardUtil.INSTANCE.copyToClipboard(this, getString(R.string.simple_exception), "```\n" + debugInfos + "\n```"));
48+
binding.copy.setOnClickListener((v) -> ClipboardUtil.copyToClipboard(this, getString(R.string.simple_exception), "```\n" + debugInfos + "\n```"));
4949
binding.close.setOnClickListener((v) -> finish());
5050

5151
adapter.setThrowables(Collections.singletonList(throwable));

app/src/main/java/it/niedermann/owncloud/notes/exception/ExceptionDialogFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
5757

5858
final var adapter = new TipsAdapter((actionIntent) -> requireActivity().startActivity(actionIntent));
5959

60-
final String debugInfos = ExceptionUtil.INSTANCE.getDebugInfos(requireContext(), throwables, BuildConfig.FLAVOR);
60+
final String debugInfos = ExceptionUtil.getDebugInfos(requireContext(), throwables, BuildConfig.FLAVOR);
6161

6262
binding.tips.setAdapter(adapter);
6363
binding.stacktrace.setText(debugInfos);
@@ -67,7 +67,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
6767
return new MaterialAlertDialogBuilder(requireActivity())
6868
.setView(binding.getRoot())
6969
.setTitle(R.string.error_dialog_title)
70-
.setPositiveButton(android.R.string.copy, (a, b) -> ClipboardUtil.INSTANCE.copyToClipboard(requireContext(), getString(R.string.simple_exception), "```\n" + debugInfos + "\n```"))
70+
.setPositiveButton(android.R.string.copy, (a, b) -> ClipboardUtil.copyToClipboard(requireContext(), getString(R.string.simple_exception), "```\n" + debugInfos + "\n```"))
7171
.setNegativeButton(R.string.simple_close, null)
7272
.create();
7373
}

app/src/main/java/it/niedermann/owncloud/notes/main/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ public void applyBrand(int color) {
595595
util.notes.themeToolbarSearchView(binding.activityNotesListView.searchView);
596596

597597
binding.headerView.setBackgroundColor(color);
598-
@ColorInt final int headerTextColor = ColorUtil.INSTANCE.getForegroundColorForBackgroundColor(color);
598+
@ColorInt final int headerTextColor = ColorUtil.getForegroundColorForBackgroundColor(color);
599599
binding.appName.setTextColor(headerTextColor);
600600
DrawableCompat.setTint(binding.logo.getDrawable(), headerTextColor);
601601

app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_20_21.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ private static void migrateAccounts(@NonNull SupportSQLiteDatabase db) {
113113
values.put("MODIFIED", cursor.getLong(COLUMN_POSITION_MODIFIED) * 1_000);
114114
values.put("APIVERSION", cursor.getString(COLUMN_POSITION_API_VERSION));
115115
try {
116-
values.put("COLOR", Color.parseColor(ColorUtil.INSTANCE.formatColorToParsableHexString(cursor.getString(COLUMN_POSITION_COLOR))));
116+
values.put("COLOR", Color.parseColor(ColorUtil.formatColorToParsableHexString(cursor.getString(COLUMN_POSITION_COLOR))));
117117
} catch (Exception e) {
118118
e.printStackTrace();
119119
values.put("COLOR", -16743735);
120120
}
121121
try {
122-
values.put("TEXTCOLOR", Color.parseColor(ColorUtil.INSTANCE.formatColorToParsableHexString(cursor.getString(COLUMN_POSITION_TEXT_COLOR))));
122+
values.put("TEXTCOLOR", Color.parseColor(ColorUtil.formatColorToParsableHexString(cursor.getString(COLUMN_POSITION_TEXT_COLOR))));
123123
} catch (Exception e) {
124124
e.printStackTrace();
125125
values.put("TEXTCOLOR", -16777216);

app/src/main/java/it/niedermann/owncloud/notes/persistence/sync/CapabilitiesDeserializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ public Capabilities deserialize(JsonElement json, Type typeOfT, JsonDeserializat
5151
final var theming = capabilities.getAsJsonObject(CAPABILITIES_THEMING);
5252
if (theming.has(CAPABILITIES_THEMING_COLOR)) {
5353
try {
54-
response.setColor(Color.parseColor(ColorUtil.INSTANCE.formatColorToParsableHexString(theming.get(CAPABILITIES_THEMING_COLOR).getAsString())));
54+
response.setColor(Color.parseColor(ColorUtil.formatColorToParsableHexString(theming.get(CAPABILITIES_THEMING_COLOR).getAsString())));
5555
} catch (Exception e) {
5656
e.printStackTrace();
5757
}
5858
}
5959
if (theming.has(CAPABILITIES_THEMING_COLOR_TEXT)) {
6060
try {
61-
response.setTextColor(Color.parseColor(ColorUtil.INSTANCE.formatColorToParsableHexString(theming.get(CAPABILITIES_THEMING_COLOR_TEXT).getAsString())));
61+
response.setTextColor(Color.parseColor(ColorUtil.formatColorToParsableHexString(theming.get(CAPABILITIES_THEMING_COLOR_TEXT).getAsString())));
6262
} catch (Exception e) {
6363
e.printStackTrace();
6464
}

app/src/main/java/it/niedermann/owncloud/notes/shared/util/NotesColorUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static boolean contrastRatioIsSufficient(@ColorInt int colorOne, @ColorIn
2121
final var key = new ColorPair(colorOne, colorTwo);
2222
Boolean ret = CONTRAST_RATIO_SUFFICIENT_CACHE.get(key);
2323
if (ret == null) {
24-
ret = ColorUtil.INSTANCE.getContrastRatio(colorOne, colorTwo) > 3d;
24+
ret = ColorUtil.getContrastRatio(colorOne, colorTwo) > 3d;
2525
CONTRAST_RATIO_SUFFICIENT_CACHE.put(key, ret);
2626
return ret;
2727
}
@@ -32,7 +32,7 @@ public static boolean contrastRatioIsSufficientBigAreas(@ColorInt int colorOne,
3232
final var key = new ColorPair(colorOne, colorTwo);
3333
var ret = CONTRAST_RATIO_SUFFICIENT_CACHE.get(key);
3434
if (ret == null) {
35-
ret = ColorUtil.INSTANCE.getContrastRatio(colorOne, colorTwo) > 1.47d;
35+
ret = ColorUtil.getContrastRatio(colorOne, colorTwo) > 1.47d;
3636
CONTRAST_RATIO_SUFFICIENT_CACHE.put(key, ret);
3737
return ret;
3838
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
55
buildscript {
66
ext {
77
kotlinVersion = '1.9.22'
8-
commonsVersion = '1.9.0'
8+
commonsVersion = '2.0.0'
99
}
1010
repositories {
1111
mavenCentral()

0 commit comments

Comments
 (0)