|
|
@ -79,6 +79,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
|
|
|
|
private ViewGroup playbackControlsContainer;
|
|
|
|
private ViewGroup playbackControlsContainer;
|
|
|
|
private TextView charactersLeft;
|
|
|
|
private TextView charactersLeft;
|
|
|
|
private View closeButton;
|
|
|
|
private View closeButton;
|
|
|
|
|
|
|
|
private View loader;
|
|
|
|
|
|
|
|
|
|
|
|
private ControllableViewPager fragmentPager;
|
|
|
|
private ControllableViewPager fragmentPager;
|
|
|
|
private MediaSendFragmentPagerAdapter fragmentPagerAdapter;
|
|
|
|
private MediaSendFragmentPagerAdapter fragmentPagerAdapter;
|
|
|
@ -137,6 +138,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
|
|
|
|
playbackControlsContainer = view.findViewById(R.id.mediasend_playback_controls_container);
|
|
|
|
playbackControlsContainer = view.findViewById(R.id.mediasend_playback_controls_container);
|
|
|
|
charactersLeft = view.findViewById(R.id.mediasend_characters_left);
|
|
|
|
charactersLeft = view.findViewById(R.id.mediasend_characters_left);
|
|
|
|
closeButton = view.findViewById(R.id.mediasend_close_button);
|
|
|
|
closeButton = view.findViewById(R.id.mediasend_close_button);
|
|
|
|
|
|
|
|
loader = view.findViewById(R.id.loader);
|
|
|
|
|
|
|
|
|
|
|
|
View sendButtonBkg = view.findViewById(R.id.mediasend_send_button_bkg);
|
|
|
|
View sendButtonBkg = view.findViewById(R.id.mediasend_send_button_bkg);
|
|
|
|
|
|
|
|
|
|
|
@ -342,18 +344,12 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
|
|
|
|
|
|
|
|
|
|
|
|
private Stopwatch renderTimer;
|
|
|
|
private Stopwatch renderTimer;
|
|
|
|
private Runnable progressTimer;
|
|
|
|
private Runnable progressTimer;
|
|
|
|
private AlertDialog dialog;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onPreExecute() {
|
|
|
|
protected void onPreExecute() {
|
|
|
|
renderTimer = new Stopwatch("ProcessMedia");
|
|
|
|
renderTimer = new Stopwatch("ProcessMedia");
|
|
|
|
progressTimer = () -> {
|
|
|
|
progressTimer = () -> {
|
|
|
|
dialog = new AlertDialog.Builder(new ContextThemeWrapper(requireContext(), R.style.Theme_TextSecure_Dialog_MediaSendProgress))
|
|
|
|
loader.setVisibility(View.VISIBLE);
|
|
|
|
.setView(R.layout.progress_dialog)
|
|
|
|
|
|
|
|
.setCancelable(false)
|
|
|
|
|
|
|
|
.create();
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
|
|
|
dialog.getWindow().setLayout(getResources().getDimensionPixelSize(R.dimen.mediasend_progress_dialog_size), getResources().getDimensionPixelSize(R.dimen.mediasend_progress_dialog_size));
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
Util.runOnMainDelayed(progressTimer, 250);
|
|
|
|
Util.runOnMainDelayed(progressTimer, 250);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -394,9 +390,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
|
|
|
|
protected void onPostExecute(List<Media> media) {
|
|
|
|
protected void onPostExecute(List<Media> media) {
|
|
|
|
controller.onSendClicked(media, composeText.getTextTrimmed());
|
|
|
|
controller.onSendClicked(media, composeText.getTextTrimmed());
|
|
|
|
Util.cancelRunnableOnMain(progressTimer);
|
|
|
|
Util.cancelRunnableOnMain(progressTimer);
|
|
|
|
if (dialog != null) {
|
|
|
|
loader.setVisibility(View.GONE);
|
|
|
|
dialog.dismiss();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
renderTimer.stop(TAG);
|
|
|
|
renderTimer.stop(TAG);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}.execute();
|
|
|
|
}.execute();
|
|
|
|