Skip to content

Commit 6d2caf6

Browse files
authored
Merge pull request #7264 from vector-im/dependabot/gradle/epoxy-5.0.0
Bump epoxy from 4.6.2 to 5.0.0
2 parents 38ca3b6 + 27e408f commit 6d2caf6

28 files changed

+82
-51
lines changed

build.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ plugins {
4444
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
4545
// Detekt
4646
id "io.gitlab.arturbosch.detekt" version "1.21.0"
47+
// Ksp
48+
id "com.google.devtools.ksp" version "1.7.20-1.0.6"
4749

4850
// Dependency Analysis
4951
id 'com.autonomousapps.dependency-analysis' version "1.13.1"
@@ -327,3 +329,31 @@ ext.initScreenshotTests = { project ->
327329
}
328330
}
329331
}
332+
333+
// Workaround to have KSP generated Kotlin code available in the IDE (for code completion)
334+
// Ref: https://github.com/airbnb/epoxy/releases/tag/5.0.0beta02
335+
subprojects { project ->
336+
afterEvaluate {
337+
if (project.hasProperty("android")) {
338+
android {
339+
if (it instanceof com.android.build.gradle.LibraryExtension) {
340+
libraryVariants.all { variant ->
341+
def outputFolder = new File("build/generated/ksp/${variant.name}/kotlin")
342+
variant.addJavaSourceFoldersToModel(outputFolder)
343+
android.sourceSets.getAt(variant.name).java {
344+
srcDir(outputFolder)
345+
}
346+
}
347+
} else if (it instanceof com.android.build.gradle.AppExtension) {
348+
applicationVariants.all { variant ->
349+
def outputFolder = new File("build/generated/ksp/${variant.name}/kotlin")
350+
variant.addJavaSourceFoldersToModel(outputFolder)
351+
android.sourceSets.getAt(variant.name).java {
352+
srcDir(outputFolder)
353+
}
354+
}
355+
}
356+
}
357+
}
358+
}
359+
}

dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def moshi = "1.14.0"
2020
def lifecycle = "2.5.1"
2121
def flowBinding = "1.2.0"
2222
def flipper = "0.164.0"
23-
def epoxy = "4.6.2"
23+
def epoxy = "5.0.0"
2424
def mavericks = "3.0.1"
2525
def glide = "4.14.1"
2626
def bigImageViewer = "1.8.1"

dependencies_groups.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ ext.groups = [
8484
'com.google',
8585
'com.google.android',
8686
'com.google.api.grpc',
87+
'com.google.auto',
8788
'com.google.auto.service',
8889
'com.google.auto.value',
8990
'com.google.code.findbugs',
@@ -101,6 +102,7 @@ ext.groups = [
101102
'com.googlecode.json-simple',
102103
'com.googlecode.libphonenumber',
103104
'com.ibm.icu',
105+
'com.intellij',
104106
'com.jakewharton.android.repackaged',
105107
'com.jakewharton.timber',
106108
'com.kgurgul.flipper',

library/external/jsonviewer/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-parcelize'
44
apply plugin: 'kotlin-kapt'
5+
apply plugin: 'com.google.devtools.ksp'
56

67
buildscript {
78
repositories {
@@ -51,7 +52,7 @@ dependencies {
5152
implementation libs.androidx.recyclerview
5253

5354
implementation libs.airbnb.epoxy
54-
kapt libs.airbnb.epoxyProcessor
55+
ksp libs.airbnb.epoxyProcessor
5556

5657
implementation libs.airbnb.mavericks
5758
// Span utils

library/external/jsonviewer/src/main/java/org/billcarsonfr/jsonviewer/JSonViewerFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class JSonViewerFragment : Fragment(), MavericksView {
6262
}
6363
recyclerView = inflate.findViewById(R.id.jvRecyclerView)
6464
recyclerView.layoutManager =
65-
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
65+
LinearLayoutManager(requireContext(), LinearLayoutManager.VERTICAL, false)
6666
recyclerView.setController(epoxyController)
6767
epoxyController.setStyle(args?.styleProvider)
6868
registerForContextMenu(recyclerView)

vector-app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ apply plugin: 'com.google.android.gms.oss-licenses-plugin'
66
apply plugin: 'kotlin-android'
77
apply plugin: 'kotlin-parcelize'
88
apply plugin: 'kotlin-kapt'
9+
apply plugin: 'com.google.devtools.ksp'
910
apply plugin: 'dagger.hilt.android.plugin'
1011
apply plugin: 'kotlinx-knit'
1112
apply plugin: 'com.likethesalad.stem'
@@ -387,7 +388,7 @@ dependencies {
387388
// OSS License, gplay flavor only
388389
gplayImplementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
389390
kapt libs.dagger.hiltCompiler
390-
kapt libs.airbnb.epoxyProcessor
391+
ksp libs.airbnb.epoxyProcessor
391392

392393
androidTestImplementation libs.androidx.testCore
393394
androidTestImplementation libs.androidx.testRunner

vector/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-parcelize'
44
apply plugin: 'kotlin-kapt'
5+
apply plugin: 'com.google.devtools.ksp'
56
apply plugin: 'dagger.hilt.android.plugin'
67

78
if (project.hasProperty("coverage")) {
@@ -156,7 +157,7 @@ dependencies {
156157

157158
api libs.airbnb.epoxy
158159
implementation libs.airbnb.epoxyGlide
159-
kapt libs.airbnb.epoxyProcessor
160+
ksp libs.airbnb.epoxyProcessor
160161
implementation libs.airbnb.epoxyPaging
161162
api libs.airbnb.mavericks
162163

vector/src/main/java/im/vector/app/features/attachments/preview/AttachmentsPreviewFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@ class AttachmentsPreviewFragment :
207207
attachmentMiniaturePreviewController.callback = this
208208

209209
views.attachmentPreviewerMiniatureList.let {
210-
it.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
210+
it.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
211211
it.setHasFixedSize(true)
212212
it.adapter = attachmentMiniaturePreviewController.adapter
213213
}
214214

215215
views.attachmentPreviewerBigList.let {
216-
it.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
216+
it.layoutManager = LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false)
217217
it.attachSnapHelperWithListener(
218218
PagerSnapHelper(),
219219
SnapOnScrollListener.Behavior.NOTIFY_ON_SCROLL_STATE_IDLE,

vector/src/main/java/im/vector/app/features/home/room/detail/TimelineFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,8 +1436,8 @@ class TimelineFragment :
14361436
timelineEventController.timeline = timelineViewModel.timeline
14371437

14381438
views.timelineRecyclerView.trackItemsVisibilityChange()
1439-
layoutManager = object : LinearLayoutManager(context, RecyclerView.VERTICAL, true) {
1440-
override fun onLayoutCompleted(state: RecyclerView.State?) {
1439+
layoutManager = object : LinearLayoutManager(requireContext(), RecyclerView.VERTICAL, true) {
1440+
override fun onLayoutCompleted(state: RecyclerView.State) {
14411441
super.onLayoutCompleted(state)
14421442
updateJumpToReadMarkerViewVisibility()
14431443
jumpToBottomViewVisibilityManager.maybeShowJumpToBottomViewVisibilityWithDelay()

vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class MessageItemFactory @Inject constructor(
245245
.pollQuestion(createPollQuestion(informationData, pollViewState.question, callback))
246246
.canVote(pollViewState.canVote)
247247
.votesStatus(pollViewState.votesStatus)
248-
.optionViewStates(pollViewState.optionViewStates)
248+
.optionViewStates(pollViewState.optionViewStates.orEmpty())
249249
.edited(informationData.hasBeenEdited)
250250
.highlighted(highlight)
251251
.leftGuideline(avatarSizeProvider.leftGuideline)
@@ -279,7 +279,7 @@ class MessageItemFactory @Inject constructor(
279279
.duration(messageContent.audioInfo?.duration ?: 0)
280280
.playbackControlButtonClickListener(playbackControlButtonClickListener)
281281
.audioMessagePlaybackTracker(audioMessagePlaybackTracker)
282-
.isLocalFile(localFilesHelper.isLocalFile(fileUrl))
282+
.izLocalFile(localFilesHelper.isLocalFile(fileUrl))
283283
.fileSize(messageContent.audioInfo?.size ?: 0L)
284284
.onSeek { params.callback?.onAudioSeekBarMovedTo(informationData.eventId, duration, it) }
285285
.mxcUrl(fileUrl)
@@ -339,7 +339,7 @@ class MessageItemFactory @Inject constructor(
339339
.playbackControlButtonClickListener(playbackControlButtonClickListener)
340340
.waveformTouchListener(waveformTouchListener)
341341
.audioMessagePlaybackTracker(audioMessagePlaybackTracker)
342-
.isLocalFile(localFilesHelper.isLocalFile(fileUrl))
342+
.izLocalFile(localFilesHelper.isLocalFile(fileUrl))
343343
.mxcUrl(fileUrl)
344344
.contentUploadStateTrackerBinder(contentUploadStateTrackerBinder)
345345
.contentDownloadStateTrackerBinder(contentDownloadStateTrackerBinder)
@@ -399,8 +399,8 @@ class MessageItemFactory @Inject constructor(
399399
return MessageFileItem_()
400400
.attributes(attributes)
401401
.leftGuideline(avatarSizeProvider.leftGuideline)
402-
.isLocalFile(localFilesHelper.isLocalFile(messageContent.getFileUrl()))
403-
.isDownloaded(session.fileService().isFileInCache(messageContent))
402+
.izLocalFile(localFilesHelper.isLocalFile(messageContent.getFileUrl()))
403+
.izDownloaded(session.fileService().isFileInCache(messageContent))
404404
.mxcUrl(mxcUrl)
405405
.contentUploadStateTrackerBinder(contentUploadStateTrackerBinder)
406406
.contentDownloadStateTrackerBinder(contentDownloadStateTrackerBinder)

0 commit comments

Comments
 (0)