mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-21 12:35:30 +03:00
wip
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
f1e10f7479
commit
ac9d96d3ba
2 changed files with 3 additions and 10 deletions
|
@ -44,7 +44,6 @@ import com.nextcloud.android.common.ui.theme.utils.ColorRole
|
|||
import com.nextcloud.talk.R
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication
|
||||
import com.nextcloud.talk.components.filebrowser.models.BrowserFile
|
||||
import com.nextcloud.talk.components.filebrowser.webdav.ReadFilesystemOperation
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding
|
||||
|
@ -56,6 +55,7 @@ import com.nextcloud.talk.utils.DisplayUtils
|
|||
import com.nextcloud.talk.utils.DrawableUtils.getDrawableResourceIdForMimeType
|
||||
import com.nextcloud.talk.utils.FileViewerUtils
|
||||
import com.nextcloud.talk.utils.FileViewerUtils.ProgressUi
|
||||
import com.owncloud.android.lib.resources.files.model.RemoteFile
|
||||
import com.stfalcon.chatkit.messages.MessageHolders.IncomingImageMessageViewHolder
|
||||
import io.reactivex.Single
|
||||
import io.reactivex.SingleObserver
|
||||
|
@ -287,7 +287,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) :
|
|||
override fun onSuccess(readFilesystemOperation: ReadFilesystemOperation) {
|
||||
val davResponse = readFilesystemOperation.readRemotePath()
|
||||
if (davResponse.data != null) {
|
||||
val browserFileList = davResponse.data as List<BrowserFile>
|
||||
val browserFileList = davResponse.data as List<RemoteFile>
|
||||
if (browserFileList.isNotEmpty()) {
|
||||
Handler(context!!.mainLooper).post {
|
||||
val resourceId = getDrawableResourceIdForMimeType(browserFileList[0].mimeType)
|
||||
|
|
|
@ -23,7 +23,6 @@ package com.nextcloud.talk.components.filebrowser.webdav;
|
|||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import com.nextcloud.talk.components.filebrowser.models.BrowserFile;
|
||||
import com.nextcloud.talk.components.filebrowser.models.DavResponse;
|
||||
import com.nextcloud.talk.dagger.modules.RestModule;
|
||||
import com.nextcloud.talk.data.user.model.User;
|
||||
|
@ -73,8 +72,6 @@ public class ReadFilesystemOperation {
|
|||
DavResponse davResponse = new DavResponse();
|
||||
final List<Response> memberElements = new ArrayList<>();
|
||||
final Response[] rootElement = new Response[1];
|
||||
final List<BrowserFile> browserFiles = new ArrayList<>();
|
||||
final List<RemoteFile> remoteFiles = new ArrayList<>();
|
||||
|
||||
try {
|
||||
new DavResource(okHttpClient, HttpUrl.parse(url)).propfind(depth,
|
||||
|
@ -101,16 +98,12 @@ public class ReadFilesystemOperation {
|
|||
|
||||
WebDavFileUtils webDavFileUtils = new WebDavFileUtils();
|
||||
|
||||
browserFiles.add(BrowserFile.Companion.getModelFromResponse(rootElement[0],
|
||||
rootElement[0].getHref().toString().substring(basePath.length())));
|
||||
final List<RemoteFile> remoteFiles = new ArrayList<>(1 + memberElements.size());
|
||||
|
||||
remoteFiles.add(webDavFileUtils.parseResponse(rootElement[0],
|
||||
Uri.parse(basePath)));
|
||||
|
||||
for (Response memberElement : memberElements) {
|
||||
browserFiles.add(BrowserFile.Companion.getModelFromResponse(memberElement,
|
||||
memberElement.getHref().toString().substring(basePath.length())));
|
||||
|
||||
remoteFiles.add(webDavFileUtils.parseResponse(memberElement,
|
||||
Uri.parse(basePath)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue