File tree 3 files changed +44
-93
lines changed
imagepipeline/src/main/java/com/facebook/imagepipeline/producers
imagepipeline-backends/imagepipeline-okhttp3/src/main/java/com/facebook/imagepipeline/backends/okhttp3
3 files changed +44
-93
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ constructor(
54
54
) : this (okHttpClient, okHttpClient.dispatcher().executorService())
55
55
56
56
class OkHttpNetworkFetchState (
57
- consumer : Consumer <EncodedImage >,
57
+ consumer : Consumer <EncodedImage ? >,
58
58
producerContext : ProducerContext
59
59
) : FetchState(consumer, producerContext) {
60
60
@JvmField var submitTime: Long = 0
@@ -66,7 +66,7 @@ constructor(
66
66
if (disableOkHttpCache) CacheControl .Builder ().noStore().build() else null
67
67
68
68
override fun createFetchState (
69
- consumer : Consumer <EncodedImage >,
69
+ consumer : Consumer <EncodedImage ? >,
70
70
context : ProducerContext
71
71
): OkHttpNetworkFetchState = OkHttpNetworkFetchState (consumer, context)
72
72
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ package com.facebook.imagepipeline.producers
9
+
10
+ import android.net.Uri
11
+ import com.facebook.imagepipeline.common.BytesRange
12
+ import com.facebook.imagepipeline.image.EncodedImage
13
+
14
+ /* *
15
+ * Used by [NetworkFetcher] to encapsulate the state of one network fetch.
16
+ *
17
+ * Implementations can subclass this to store additional fetch-scoped fields.
18
+ */
19
+ open class FetchState (val consumer : Consumer <EncodedImage ?>, val context : ProducerContext ) {
20
+ var lastIntermediateResultTimeMs: Long = 0
21
+
22
+ /* *
23
+ * EXPERIMENTAL: Allows the fetcher to set extra status flags to be included in calls to
24
+ * [ ][Consumer.onNewResult].
25
+ */
26
+ @get:Consumer.Status var onNewResultStatusFlags: Int = 0
27
+
28
+ /* *
29
+ * EXPERIMENTAL: Allows the fetcher to identify that the reponse is for an imcomplete portion of
30
+ * the whole image by defining the range of bytes being provided.
31
+ */
32
+ var responseBytesRange: BytesRange ? = null
33
+
34
+ val id: String
35
+ get() = context.id
36
+
37
+ val listener: ProducerListener2
38
+ get() = context.producerListener
39
+
40
+ val uri: Uri
41
+ get() = context.imageRequest.sourceUri
42
+ }
You can’t perform that action at this time.
0 commit comments