From c9db8c6fc9aeed6e171f8ae207a784ee1ee5803f Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Fri, 18 Sep 2020 14:10:03 +1000 Subject: [PATCH] Media send fragment close button. --- res/layout/mediasend_fragment.xml | 18 ++++++++++++++++++ .../securesms/mediasend/MediaSendFragment.java | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/res/layout/mediasend_fragment.xml b/res/layout/mediasend_fragment.xml index fd15041ea9..7f05206915 100644 --- a/res/layout/mediasend_fragment.xml +++ b/res/layout/mediasend_fragment.xml @@ -153,4 +153,22 @@ + + + + + + \ No newline at end of file diff --git a/src/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java b/src/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java index a563f3546f..73d8468724 100644 --- a/src/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java +++ b/src/org/thoughtcrime/securesms/mediasend/MediaSendFragment.java @@ -91,6 +91,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl private Stub emojiDrawer; private ViewGroup playbackControlsContainer; private TextView charactersLeft; + private View closeButton; private ControllableViewPager fragmentPager; private MediaSendFragmentPagerAdapter fragmentPagerAdapter; @@ -154,6 +155,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl mediaRail = view.findViewById(R.id.mediasend_media_rail); playbackControlsContainer = view.findViewById(R.id.mediasend_playback_controls_container); charactersLeft = view.findViewById(R.id.mediasend_characters_left); + closeButton = view.findViewById(R.id.mediasend_close_button); View sendButtonBkg = view.findViewById(R.id.mediasend_send_button_bkg); @@ -227,6 +229,8 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl } else { emojiToggle.setOnClickListener(this::onEmojiToggleClicked); } + + closeButton.setOnClickListener(v -> requireActivity().onBackPressed()); } @Override