Clean code

This commit is contained in:
ganfra 2021-02-15 15:35:11 +01:00
parent 96b02d3154
commit 5e3e5d2648
4 changed files with 2 additions and 11 deletions

View file

@ -26,9 +26,7 @@ import im.vector.app.features.call.VectorCallActivity
import im.vector.app.features.call.audio.CallAudioManager
import im.vector.app.features.call.utils.EglUtils
import im.vector.app.push.fcm.FcmHelper
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.launch
import org.matrix.android.sdk.api.extensions.tryOrNull
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.call.CallListener
@ -81,7 +79,6 @@ class WebRtcCallManager @Inject constructor(
val supportsPSTNProtocol: Boolean
get() = supportedPSTNProtocol != null
fun addPstnSupportListener(listener: PSTNSupportListener) {
pstnProtocolChecker.addPstnSupportListener(listener)
}
@ -112,7 +109,6 @@ class WebRtcCallManager @Inject constructor(
private val executor = Executors.newSingleThreadExecutor()
private val dispatcher = executor.asCoroutineDispatcher()
private val rootEglBase by lazy { EglUtils.rootEglBase }
private var isInBackground: Boolean = true

View file

@ -19,7 +19,6 @@ package im.vector.app.features.home.room.detail
import androidx.recyclerview.widget.LinearLayoutManager
import im.vector.app.core.platform.DefaultListUpdateCallback
import im.vector.app.features.home.room.detail.timeline.TimelineEventController
import im.vector.app.features.home.room.detail.timeline.item.BaseEventItem
import im.vector.app.features.home.room.detail.timeline.item.IsEventItem
import timber.log.Timber
import java.util.concurrent.CopyOnWriteArrayList

View file

@ -118,10 +118,9 @@ class TimelineItemFactory @Inject constructor(private val messageItemFactory: Me
return (computedModel ?: buildEmptyItem(event))
}
private fun buildEmptyItem(timelineEvent: TimelineEvent): TimelineEmptyItem{
private fun buildEmptyItem(timelineEvent: TimelineEvent): TimelineEmptyItem {
return TimelineEmptyItem_()
.id(timelineEvent.localId)
.eventId(timelineEvent.eventId)
}
}

View file

@ -20,7 +20,6 @@ import com.airbnb.epoxy.EpoxyModel
import im.vector.app.features.call.webrtc.WebRtcCallManager
import im.vector.app.features.home.room.detail.UnreadState
import im.vector.app.features.home.room.detail.timeline.TimelineEventController
import im.vector.app.features.home.room.detail.timeline.item.BaseEventItem
import com.airbnb.epoxy.VisibilityState
import im.vector.app.features.home.room.detail.timeline.item.CallTileTimelineItem
import im.vector.app.features.settings.VectorPreferences
@ -32,7 +31,6 @@ import im.vector.app.features.home.room.detail.timeline.item.IsEventItem
import timber.log.Timber
import kotlin.reflect.KMutableProperty0
private const val DEFAULT_PREFETCH_THRESHOLD = 30
class TimelineControllerInterceptorHelper(private val positionOfReadMarker: KMutableProperty0<Int?>,
@ -130,7 +128,7 @@ class TimelineControllerInterceptorHelper(private val positionOfReadMarker: KMut
}
}
private fun MutableList<EpoxyModel<*>>.addForwardPrefetchIfNeeded(timeline: Timeline?,callback: TimelineEventController.Callback?) {
private fun MutableList<EpoxyModel<*>>.addForwardPrefetchIfNeeded(timeline: Timeline?, callback: TimelineEventController.Callback?) {
val shouldAddForwardPrefetch = timeline?.hasMoreToLoad(Timeline.Direction.FORWARDS) ?: false
if (shouldAddForwardPrefetch) {
val indexOfPrefetchForward = DEFAULT_PREFETCH_THRESHOLD.coerceAtMost(size - 1)
@ -152,5 +150,4 @@ class TimelineControllerInterceptorHelper(private val positionOfReadMarker: KMut
}
}
}
}