@@ -0,0 +1,1996 @@
+package com.zulip.android.networking;%0A%0Aimport java.io.IOException;%0A%0Aimport okhttp3.MediaType;%0Aimport okhttp3.ResponseBody;%0Aimport okio.Buffer;%0Aimport okio.BufferedSource;%0Aimport okio.ForwardingSource;%0Aimport okio.Okio;%0Aimport okio.Source;%0A%0A/**%0A * TODO: add description%0A */%0A%0Apublic class UploadProgressResponse extends ResponseBody %7B%0A    private final ResponseBody responseBody;%0A    private final ProgressListener progressListener;%0A    private BufferedSource bufferedSource;%0A    private int mNotificationId;%0A%0A    public UploadProgressResponse(ResponseBody responseBody, ProgressListener progressListener,%0A                                  int notificationId) %7B%0A        this.responseBody = responseBody;%0A        this.progressListener = progressListener;%0A        this.mNotificationId = notificationId;%0A    %7D%0A%0A    @Override%0A    public MediaType contentType() %7B%0A        return responseBody.contentType();%0A    %7D%0A%0A    @Override%0A    public long contentLength() %7B%0A        return responseBody.contentLength();%0A    %7D%0A%0A    @Override%0A    public BufferedSource source() %7B%0A        if (bufferedSource == null) %7B%0A            bufferedSource = Okio.buffer(source(responseBody.source()));%0A        %7D%0A        return bufferedSource;%0A    %7D%0A%0A    private Source source(Source source) %7B%0A        return new ForwardingSource(source) %7B%0A            long totalBytesRead = 0L;%0A%0A            @Override%0A            public long read(Buffer sink, long byteCount) throws IOException %7B%0A                long bytesRead = super.read(sink, byteCount);%0A                // read() returns the number of bytes read, or -1 if this source is exhausted.%0A                totalBytesRead += bytesRead != -1 ? bytesRead : 0;%0A                progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1, mNotificationId);%0A                return bytesRead;%0A            %7D%0A        %7D;%0A    %7D%0A%0A    public interface ProgressListener %7B%0A        void update(long bytesRead, long contentLength, boolean done, int notificationId);%0A    %7D%0A%7D%0A

Add custom upload progress RequestBody.