From 1a110bb401fa5968b2604e108c02f8c1e2d80df2 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Fri, 19 Sep 2025 18:42:21 +0200 Subject: [PATCH 1/5] feat: Display the date of last edit Resolves #2835 Signed-off-by: Andy Scherzinger --- .../notes/main/items/NoteViewHolder.java | 20 +++ .../main/items/grid/NoteViewGridHolder.java | 1 + .../grid/NoteViewGridHolderOnlyTitle.java | 2 + .../items/list/NoteViewHolderWithExcerpt.java | 1 + .../list/NoteViewHolderWithoutExcerpt.java | 1 + .../layout/item_notes_list_note_item_grid.xml | 21 ++- ...m_notes_list_note_item_grid_only_title.xml | 148 ++++++++++++------ ...item_notes_list_note_item_with_excerpt.xml | 53 +++++-- ...m_notes_list_note_item_without_excerpt.xml | 37 +++-- .../layout/item_notes_list_section_item.xml | 2 +- 10 files changed, 203 insertions(+), 83 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java index ec2ae21a6..5fbe69ad4 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java @@ -12,6 +12,7 @@ import android.content.Context; import android.text.TextUtils; +import android.text.format.DateFormat; import android.view.View; import android.widget.ImageView; import android.widget.TextView; @@ -27,6 +28,10 @@ import com.google.android.material.chip.Chip; import com.nextcloud.android.common.ui.theme.utils.ColorRole; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Locale; + import it.niedermann.owncloud.notes.R; import it.niedermann.owncloud.notes.branding.BrandingUtil; import it.niedermann.owncloud.notes.persistence.entity.Note; @@ -37,10 +42,16 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder { @NonNull private final NoteClickListener noteClickListener; + private final SimpleDateFormat sdf; + public NoteViewHolder(@NonNull View v, @NonNull NoteClickListener noteClickListener) { super(v); this.noteClickListener = noteClickListener; this.setIsRecyclable(false); + + Locale locale = v.getResources().getConfiguration().locale; + String pattern = DateFormat.getBestDateTimePattern(locale, "dd.MM."); + this.sdf = new SimpleDateFormat(pattern, locale); } @CallSuper @@ -50,6 +61,15 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, @ itemView.setOnClickListener((view) -> noteClickListener.onNoteClick(getLayoutPosition(), view)); } + protected void bindModified(@NonNull TextView noteModified, @Nullable Calendar modified) { + if (modified != null && modified.getTimeInMillis() > 0) { + noteModified.setText(sdf.format(modified.getTime())); + noteModified.setVisibility(VISIBLE); + } else { + noteModified.setVisibility(INVISIBLE); + } + } + protected void bindStatus(AppCompatImageView noteStatus, DBStatus status, int color) { noteStatus.setVisibility(DBStatus.VOID.equals(status) ? INVISIBLE : VISIBLE); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolder.java index 8e2cb5401..e9760a313 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolder.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolder.java @@ -52,6 +52,7 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, @ bindCategory(context, binding.noteCategory, showCategory, note.getCategory(), color); bindStatus(binding.noteStatus, note.getStatus(), color); bindFavorite(binding.noteFavorite, note.getFavorite()); + bindModified(binding.noteModified, note.getModified()); bindSearchableContent(context, binding.noteTitle, searchQuery, note.getTitle(), color); bindSearchableContent(context, binding.noteExcerpt, searchQuery, note.getExcerpt().replace(EXCERPT_LINE_SEPARATOR, "\n"), color); binding.noteExcerpt.setVisibility(TextUtils.isEmpty(note.getExcerpt()) ? GONE : VISIBLE); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolderOnlyTitle.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolderOnlyTitle.java index b9fe26d59..49fd8a819 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolderOnlyTitle.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/grid/NoteViewGridHolderOnlyTitle.java @@ -41,8 +41,10 @@ public void showSwipe(boolean left) { public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, int color, @Nullable CharSequence searchQuery) { super.bind(isSelected, note, showCategory, color, searchQuery); @NonNull final Context context = itemView.getContext(); + bindCategory(context, binding.noteCategory, showCategory, note.getCategory(), color); bindStatus(binding.noteStatus, note.getStatus(), color); bindFavorite(binding.noteFavorite, note.getFavorite()); + bindModified(binding.noteModified, note.getModified()); bindSearchableContent(context, binding.noteTitle, searchQuery, note.getTitle(), color); } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithExcerpt.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithExcerpt.java index 0951d13f9..892ab456e 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithExcerpt.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithExcerpt.java @@ -41,6 +41,7 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, @ bindCategory(context, binding.noteCategory, showCategory, note.getCategory(), color); bindStatus(binding.noteStatus, note.getStatus(), color); bindFavorite(binding.noteFavorite, note.getFavorite()); + bindModified(binding.noteModified, note.getModified()); bindSearchableContent(context, binding.noteTitle, searchQuery, note.getTitle(), color); bindSearchableContent(context, binding.noteExcerpt, searchQuery, note.getExcerpt(), color); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithoutExcerpt.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithoutExcerpt.java index 07ad5aaad..70a4da13b 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithoutExcerpt.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/list/NoteViewHolderWithoutExcerpt.java @@ -41,6 +41,7 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, i bindCategory(context, binding.noteCategory, showCategory, note.getCategory(), color); bindStatus(binding.noteStatus, note.getStatus(), color); bindFavorite(binding.noteFavorite, note.getFavorite()); + bindModified(binding.noteModified, note.getModified()); bindSearchableContent(context, binding.noteTitle, searchQuery, note.getTitle(), color); } diff --git a/app/src/main/res/layout/item_notes_list_note_item_grid.xml b/app/src/main/res/layout/item_notes_list_note_item_grid.xml index 46c953d6b..36bab5e4b 100644 --- a/app/src/main/res/layout/item_notes_list_note_item_grid.xml +++ b/app/src/main/res/layout/item_notes_list_note_item_grid.xml @@ -49,8 +49,6 @@ - + android:layout_marginTop="@dimen/spacer_2x" + android:orientation="vertical"> - + + + + + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/spacer_2x" + android:orientation="vertical"> - + - + android:layout_marginHorizontal="@dimen/spacer_2x" + android:layout_marginTop="@dimen/spacer_2x" + android:hyphenationFrequency="full" + android:textAppearance="?attr/textAppearanceHeadline5" + android:textColor="@color/fg_default" + tools:maxLength="50" + tools:text="@tools:sample/lorem/random" /> + + - + + + + + + + + + - + android:layout_marginTop="@dimen/spacer_2x" + android:orientation="vertical"> - + - + + + + + + - \ No newline at end of file + + diff --git a/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml b/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml index 1d1d17b7f..793647d0f 100644 --- a/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml +++ b/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml @@ -9,11 +9,11 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/noteSwipeFrame" - android:clickable="true" - android:focusable="true" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/bg_attention"> + android:background="@color/bg_attention" + android:clickable="true" + android:focusable="true"> @@ -72,8 +73,8 @@ android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical" - android:paddingStart="0dp" android:paddingVertical="@dimen/spacer_2x" + android:paddingStart="0dp" android:paddingEnd="@dimen/spacer_2x"> - - + android:gravity="bottom" + android:orientation="vertical"> + + + + + + diff --git a/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml b/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml index 2eed4a816..3be33ba53 100644 --- a/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml +++ b/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml @@ -95,17 +95,34 @@ tools:maxLength="15" tools:text="@tools:sample/lorem/random" /> - - + android:gravity="center_vertical" + android:orientation="vertical"> + + + + + + diff --git a/app/src/main/res/layout/item_notes_list_section_item.xml b/app/src/main/res/layout/item_notes_list_section_item.xml index c2a434886..71f9935e8 100644 --- a/app/src/main/res/layout/item_notes_list_section_item.xml +++ b/app/src/main/res/layout/item_notes_list_section_item.xml @@ -19,4 +19,4 @@ android:padding="@dimen/spacer_1x" android:textColor="@color/fg_default_selection" android:textStyle="bold" - android:textSize="@dimen/secondary_font_size" /> \ No newline at end of file + android:textSize="@dimen/primary_font_size" /> From 09cf90d556fa2914cc00c5031030596ad8316d5c Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 22 Sep 2025 18:36:10 +0200 Subject: [PATCH 2/5] feat: Add conditional/relative date/time formatting Signed-off-by: Andy Scherzinger --- app/build.gradle | 3 +- .../notes/main/items/ItemAdapter.java | 1 + .../notes/main/items/NoteViewHolder.java | 14 +- .../layout/item_notes_list_note_item_grid.xml | 23 +- ...m_notes_list_note_item_grid_only_title.xml | 22 +- ...item_notes_list_note_item_with_excerpt.xml | 61 +- ...m_notes_list_note_item_without_excerpt.xml | 92 +-- gradle/verification-metadata.xml | 538 ++++++++++++++++++ 8 files changed, 638 insertions(+), 116 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 25b613ea5..cb2381238 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -119,7 +119,8 @@ dependencies { } // Nextcloud SSO - implementation 'com.github.nextcloud.android-common:ui:0.28.0' + implementation 'com.github.nextcloud.android-common:ui:f686054406' + implementation 'com.github.nextcloud.android-common:core:f686054406' implementation("com.github.nextcloud:Android-SingleSignOn:$singleSignOnVersion") { version { strictly(singleSignOnVersion) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java index c7466c312..48ceea073 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/ItemAdapter.java @@ -181,6 +181,7 @@ public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int ((ImageView) holder.itemView.findViewById(R.id.custom_checkbox)).setImageResource(R.drawable.ic_checkbox_blank_outline); } holder.itemView.findViewById(R.id.custom_checkbox).setVisibility(isMultiSelect ? View.VISIBLE : View.GONE); + holder.itemView.findViewById(R.id.noteFavorite).setVisibility(isMultiSelect ? View.GONE : View.VISIBLE); ((NoteViewHolder) holder).bind(isSelected, (Note) itemList.get(position), showCategory, color, searchQuery); } } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java index 5fbe69ad4..54f0afdad 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/main/items/NoteViewHolder.java @@ -12,7 +12,6 @@ import android.content.Context; import android.text.TextUtils; -import android.text.format.DateFormat; import android.view.View; import android.widget.ImageView; import android.widget.TextView; @@ -26,11 +25,10 @@ import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.chip.Chip; +import com.nextcloud.android.common.core.utils.DateFormatter; import com.nextcloud.android.common.ui.theme.utils.ColorRole; -import java.text.SimpleDateFormat; import java.util.Calendar; -import java.util.Locale; import it.niedermann.owncloud.notes.R; import it.niedermann.owncloud.notes.branding.BrandingUtil; @@ -42,16 +40,14 @@ public abstract class NoteViewHolder extends RecyclerView.ViewHolder { @NonNull private final NoteClickListener noteClickListener; - private final SimpleDateFormat sdf; + @NonNull + private final DateFormatter dateFormatter; public NoteViewHolder(@NonNull View v, @NonNull NoteClickListener noteClickListener) { super(v); this.noteClickListener = noteClickListener; this.setIsRecyclable(false); - - Locale locale = v.getResources().getConfiguration().locale; - String pattern = DateFormat.getBestDateTimePattern(locale, "dd.MM."); - this.sdf = new SimpleDateFormat(pattern, locale); + this.dateFormatter = new DateFormatter(v.getContext()); } @CallSuper @@ -63,7 +59,7 @@ public void bind(boolean isSelected, @NonNull Note note, boolean showCategory, @ protected void bindModified(@NonNull TextView noteModified, @Nullable Calendar modified) { if (modified != null && modified.getTimeInMillis() > 0) { - noteModified.setText(sdf.format(modified.getTime())); + noteModified.setText(dateFormatter.getConditionallyRelativeFormattedTimeSpan(modified)); noteModified.setVisibility(VISIBLE); } else { noteModified.setVisibility(INVISIBLE); diff --git a/app/src/main/res/layout/item_notes_list_note_item_grid.xml b/app/src/main/res/layout/item_notes_list_note_item_grid.xml index 36bab5e4b..4f881bc77 100644 --- a/app/src/main/res/layout/item_notes_list_note_item_grid.xml +++ b/app/src/main/res/layout/item_notes_list_note_item_grid.xml @@ -64,6 +64,17 @@ android:padding="@dimen/spacer_2x" tools:src="@drawable/ic_star_yellow_24dp" /> + + - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_notes_list_note_item_grid_only_title.xml b/app/src/main/res/layout/item_notes_list_note_item_grid_only_title.xml index 12558d960..6d33a561a 100644 --- a/app/src/main/res/layout/item_notes_list_note_item_grid_only_title.xml +++ b/app/src/main/res/layout/item_notes_list_note_item_grid_only_title.xml @@ -58,6 +58,16 @@ android:padding="@dimen/spacer_2x" tools:src="@drawable/ic_star_yellow_24dp" /> + + - - diff --git a/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml b/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml index 793647d0f..2bff2f604 100644 --- a/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml +++ b/app/src/main/res/layout/item_notes_list_note_item_with_excerpt.xml @@ -28,9 +28,8 @@ android:id="@+id/noteDeleteRight" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="end|top" - android:layout_marginEnd="@dimen/spacer_1x" - android:layout_marginTop="@dimen/spacer_1x" + android:layout_gravity="end|center_vertical" + android:layout_marginEnd="@dimen/spacer_2x" android:contentDescription="@string/menu_delete" app:srcCompat="@drawable/ic_delete_white_24dp" /> @@ -40,6 +39,7 @@ android:layout_height="wrap_content" android:background="@drawable/list_item_background_selector" android:baselineAligned="false" + android:gravity="center_vertical" android:paddingStart="@dimen/spacer_activity_sides" android:paddingEnd="@null"> @@ -49,13 +49,23 @@ + + - + + + @@ -126,35 +145,5 @@ - - - - - - - diff --git a/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml b/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml index 3be33ba53..a8ae9c73e 100644 --- a/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml +++ b/app/src/main/res/layout/item_notes_list_note_item_without_excerpt.xml @@ -27,7 +27,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="end|center_vertical" - android:layout_marginEnd="@dimen/button_padding" + android:layout_marginEnd="@dimen/spacer_2x" android:contentDescription="@string/menu_delete" app:srcCompat="@drawable/ic_delete_white_24dp" /> @@ -47,13 +47,23 @@ + + - - - + android:orientation="horizontal" + android:paddingStart="@dimen/zero" + android:paddingEnd="@dimen/spacer_2x"> - + - + android:layout_marginVertical="10sp" + android:layout_marginStart="@dimen/spacer_1x" + android:layout_marginTop="1dp" + android:background="@drawable/border" + android:maxLines="1" + android:paddingHorizontal="@dimen/spacer_1x" + android:paddingBottom="1dp" + android:singleLine="true" + android:textColor="?android:textColorPrimary" + android:textSize="@dimen/secondary_font_size" + tools:maxLength="15" + tools:text="@tools:sample/lorem/random" /> diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 3849138c6..8d75029f0 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -174,6 +174,7 @@ + @@ -770,6 +771,16 @@ + + + + + + + + + + @@ -795,6 +806,11 @@ + + + + + @@ -835,6 +851,14 @@ + + + + + + + + @@ -860,6 +884,11 @@ + + + + + @@ -900,6 +929,14 @@ + + + + + + + + @@ -925,6 +962,11 @@ + + + + + @@ -965,6 +1007,14 @@ + + + + + + + + @@ -990,6 +1040,11 @@ + + + + + @@ -1030,6 +1085,14 @@ + + + + + + + + @@ -1081,6 +1144,11 @@ + + + + + @@ -1121,6 +1189,14 @@ + + + + + + + + @@ -1131,6 +1207,11 @@ + + + + + @@ -1172,6 +1253,11 @@ + + + + + @@ -1212,11 +1298,24 @@ + + + + + + + + + + + + + @@ -1225,6 +1324,14 @@ + + + + + + + + @@ -1250,6 +1357,11 @@ + + + + + @@ -1290,6 +1402,14 @@ + + + + + + + + @@ -1315,6 +1435,16 @@ + + + + + + + + + + @@ -1355,6 +1485,14 @@ + + + + + + + + @@ -1380,6 +1518,11 @@ + + + + + @@ -1420,6 +1563,14 @@ + + + + + + + + @@ -1445,6 +1596,16 @@ + + + + + + + + + + @@ -1485,6 +1646,14 @@ + + + + + + + + @@ -1510,6 +1679,11 @@ + + + + + @@ -1550,6 +1724,14 @@ + + + + + + + + @@ -1575,6 +1757,11 @@ + + + + + @@ -1615,6 +1802,14 @@ + + + + + + + + @@ -1640,6 +1835,11 @@ + + + + + @@ -1680,6 +1880,14 @@ + + + + + + + + @@ -2494,6 +2702,14 @@ + + + + + + + + @@ -2526,6 +2742,14 @@ + + + + + + + + @@ -2558,6 +2782,14 @@ + + + + + + + + @@ -2645,6 +2877,9 @@ + + + @@ -2683,6 +2918,14 @@ + + + + + + + + @@ -2715,6 +2958,14 @@ + + + + + + + + @@ -2744,6 +2995,14 @@ + + + + + + + + @@ -2776,6 +3035,14 @@ + + + + + + + + @@ -2818,6 +3085,14 @@ + + + + + + + + @@ -2850,6 +3125,14 @@ + + + + + + + + @@ -2870,6 +3153,11 @@ + + + + + @@ -2902,6 +3190,14 @@ + + + + + + + + @@ -2934,6 +3230,14 @@ + + + + + + + + @@ -2966,6 +3270,14 @@ + + + + + + + + @@ -2998,6 +3310,14 @@ + + + + + + + + @@ -3057,6 +3377,17 @@ + + + + + + + + + + + @@ -3089,6 +3420,14 @@ + + + + + + + + @@ -3121,6 +3460,14 @@ + + + + + + + + @@ -3158,6 +3505,14 @@ + + + + + + + + @@ -3182,6 +3537,14 @@ + + + + + + + + @@ -3952,6 +4315,14 @@ + + + + + + + + @@ -10453,6 +10824,14 @@ + + + + + + + + @@ -10493,6 +10872,22 @@ + + + + + + + + + + + + + + + + @@ -10589,6 +10984,14 @@ + + + + + + + + @@ -10633,6 +11036,22 @@ + + + + + + + + + + + + + + + + @@ -10729,6 +11148,14 @@ + + + + + + + + @@ -10769,6 +11196,22 @@ + + + + + + + + + + + + + + + + @@ -11458,6 +11901,11 @@ + + + + + @@ -11596,6 +12044,14 @@ + + + + + + + + @@ -11666,6 +12122,11 @@ + + + + + @@ -11764,6 +12225,11 @@ + + + + + @@ -12447,6 +12913,14 @@ + + + + + + + + @@ -13052,8 +13526,12 @@ + + + + @@ -13144,6 +13622,14 @@ + + + + + + + + @@ -13168,6 +13654,14 @@ + + + + + + + + @@ -13183,6 +13677,11 @@ + + + + + @@ -13277,6 +13776,11 @@ + + + + + @@ -13335,6 +13839,11 @@ + + + + + @@ -13948,6 +14457,14 @@ + + + + + + + + @@ -14740,6 +15257,14 @@ + + + + + + + + @@ -15855,6 +16380,11 @@ + + + + + @@ -15908,6 +16438,14 @@ + + + + + + + + From f3b94cf599fef0e8c638ba276b0a6590c04569c3 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Tue, 7 Oct 2025 14:46:24 +0200 Subject: [PATCH 3/5] fix: use correct android lib and configure correctly Signed-off-by: alperozturk --- app/build.gradle | 13 +++++++-- gradle.properties | 4 ++- gradle/verification-metadata.xml | 48 ++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cb2381238..b12712c05 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -118,9 +118,10 @@ dependencies { exclude group: 'org.ogce', module: 'xpp3' } + implementation("com.github.nextcloud.android-common:ui:$nextcloudAndroidCommonLib") + implementation("com.github.nextcloud.android-common:core:$nextcloudAndroidCommonLib") + // Nextcloud SSO - implementation 'com.github.nextcloud.android-common:ui:f686054406' - implementation 'com.github.nextcloud.android-common:core:f686054406' implementation("com.github.nextcloud:Android-SingleSignOn:$singleSignOnVersion") { version { strictly(singleSignOnVersion) @@ -174,6 +175,14 @@ dependencies { testImplementation 'org.robolectric:robolectric:4.16' } +configurations.configureEach { + resolutionStrategy.eachDependency { details -> + if (details.requested.group == "com.github.nextcloud.android-common") { + details.useVersion(nextcloudAndroidCommonLib) + } + } +} + // Run the compiler as a separate process tasks.withType(JavaCompile).configureEach { options.fork = true diff --git a/gradle.properties b/gradle.properties index 5e2474b85..e05780710 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,6 @@ org.gradle.parallel=true org.gradle.configureondemand=true kapt.incremental.apt=true org.gradle.daemon=true -org.gradle.configuration-cache=true \ No newline at end of file +org.gradle.configuration-cache=true + +nextcloudAndroidCommonLib=ab22edd0cf diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 8d75029f0..bf84dde3f 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -10880,6 +10880,22 @@ + + + + + + + + + + + + + + + + @@ -11044,6 +11060,22 @@ + + + + + + + + + + + + + + + + @@ -11204,6 +11236,22 @@ + + + + + + + + + + + + + + + + From 9a2951449f1e4565bafb3be65aa679387cf39077 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 8 Oct 2025 08:20:59 +0200 Subject: [PATCH 4/5] move nextcloudAndroidCommonLib to build.gradle Signed-off-by: tobiasKaminsky --- build.gradle | 4 +--- gradle.properties | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 39f36191d..22f1ed294 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,6 @@ * SPDX-FileCopyrightText: 2023 Álvaro Brey * SPDX-License-Identifier: GPL-3.0-or-later */ - -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { @@ -16,6 +13,7 @@ buildscript { kotlinVersion = '2.2.20' commonsVersion = '2.3.7' androidCommonsVersion = '1.1.0' + nextcloudAndroidCommonLib = "ab22edd0cf" singleSignOnVersion = "17df25ce03d98b9d868249b41f7300bff6c54f3e" } repositories { diff --git a/gradle.properties b/gradle.properties index e05780710..01a5d516e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,4 +13,3 @@ kapt.incremental.apt=true org.gradle.daemon=true org.gradle.configuration-cache=true -nextcloudAndroidCommonLib=ab22edd0cf From a2d802fcaecd15ecb0d50dedcaebddc0729da24a Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 8 Oct 2025 08:54:59 +0200 Subject: [PATCH 5/5] use 0.29.0 common ui Signed-off-by: tobiasKaminsky --- build.gradle | 2 +- gradle/verification-metadata.xml | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 22f1ed294..688dfe7f6 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { kotlinVersion = '2.2.20' commonsVersion = '2.3.7' androidCommonsVersion = '1.1.0' - nextcloudAndroidCommonLib = "ab22edd0cf" + nextcloudAndroidCommonLib = "0.29.0" singleSignOnVersion = "17df25ce03d98b9d868249b41f7300bff6c54f3e" } repositories { diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index bf84dde3f..dce1ec5a7 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -2010,6 +2010,12 @@ + + + + + @@ -10855,6 +10861,16 @@ + + + + + + + + @@ -11031,6 +11047,17 @@ + + + + + + + + @@ -11211,6 +11238,16 @@ + + + + + + + +