Commit f6be3525 authored by Lucio Maciel's avatar Lucio Maciel Committed by GitHub

Merge branch 'develop' into fix/crash-on-drawable-mutate

parents d4b22f9a 86fba9d0
package chat.rocket.android.fragment.chatroom.dialog; package chat.rocket.android.fragment.chatroom.dialog;
import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import chat.rocket.android.R; import chat.rocket.android.R;
import chat.rocket.android.renderer.FileUploadingRenderer;
import chat.rocket.core.SyncState; import chat.rocket.core.SyncState;
import chat.rocket.persistence.realm.models.internal.FileUploading;
import chat.rocket.persistence.realm.RealmObjectObserver; import chat.rocket.persistence.realm.RealmObjectObserver;
import chat.rocket.android.renderer.FileUploadingRenderer; import chat.rocket.persistence.realm.models.internal.FileUploading;
/** /**
* dialog fragment to display progress of file uploading. * dialog fragment to display progress of file uploading.
...@@ -76,11 +75,14 @@ public class FileUploadProgressDialogFragment extends AbstractChatRoomDialogFrag ...@@ -76,11 +75,14 @@ public class FileUploadProgressDialogFragment extends AbstractChatRoomDialogFrag
//TODO: prompt retry. //TODO: prompt retry.
dismiss(); dismiss();
} else { } else {
final Dialog dialog = getDialog();
if (dialog != null) {
new FileUploadingRenderer(getContext(), state) new FileUploadingRenderer(getContext(), state)
.progressInto((ProgressBar) getDialog().findViewById(R.id.progressBar)) .progressInto(dialog.findViewById(R.id.progressBar))
.progressTextInto( .progressTextInto(
(TextView) getDialog().findViewById(R.id.txt_filesize_uploaded), dialog.findViewById(R.id.txt_filesize_uploaded),
(TextView) getDialog().findViewById(R.id.txt_filesize_total)); dialog.findViewById(R.id.txt_filesize_total));
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment