Upgrade ktlint and add twitter compose rules.

This commit is contained in:
Alex Hart
2023-02-06 11:04:40 -04:00
committed by Greyson Parrelli
parent 52e9b31554
commit 605289aca4
174 changed files with 574 additions and 373 deletions

View File

@@ -29,7 +29,7 @@ class MediaPreviewV2Adapter(fragment: Fragment) : FragmentStateAdapter(fragment)
MediaPreviewFragment.DATA_CONTENT_TYPE to contentType,
MediaPreviewFragment.DATA_SIZE to attachment.size,
MediaPreviewFragment.AUTO_PLAY to attachment.isVideoGif,
MediaPreviewFragment.VIDEO_GIF to attachment.isVideoGif,
MediaPreviewFragment.VIDEO_GIF to attachment.isVideoGif
)
val fragment = if (MediaUtil.isVideo(contentType)) {
VideoMediaPreviewFragment()

View File

@@ -12,7 +12,7 @@ data class MediaPreviewV2State(
val allMediaInAlbumRail: Boolean = false,
val leftIsRecent: Boolean = false,
val albums: Map<Long, List<Media>> = mapOf(),
val messageBodies: Map<Long, SpannableString> = mapOf(),
val messageBodies: Map<Long, SpannableString> = mapOf()
) {
enum class LoadState { INIT, DATA_LOADED, MEDIA_READY }
}

View File

@@ -44,7 +44,7 @@ class MediaPreviewV2ViewModel : ViewModel() {
mediaRecords = result.records,
messageBodies = result.messageBodies,
albums = albums,
loadState = MediaPreviewV2State.LoadState.DATA_LOADED,
loadState = MediaPreviewV2State.LoadState.DATA_LOADED
)
} else {
oldState.copy(
@@ -52,7 +52,7 @@ class MediaPreviewV2ViewModel : ViewModel() {
mediaRecords = result.records.reversed(),
messageBodies = result.messageBodies,
albums = albums.mapValues { it.value.reversed() },
loadState = MediaPreviewV2State.LoadState.DATA_LOADED,
loadState = MediaPreviewV2State.LoadState.DATA_LOADED
)
}
}

View File

@@ -11,7 +11,7 @@ import org.thoughtcrime.securesms.components.emoji.EmojiTextView
class ExpandingCaptionView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0,
defStyleAttr: Int = 0
) : EmojiTextView(context, attrs, defStyleAttr) {
var expandedHeight = 0