Media send fragment close button.

This commit is contained in:
Anton Chekulaev 2020-09-18 14:10:03 +10:00
parent 4b0179f859
commit c9db8c6fc9
2 changed files with 22 additions and 0 deletions

View File

@ -153,4 +153,22 @@
</org.thoughtcrime.securesms.components.InputAwareLayout>
<FrameLayout
android:id="@+id/mediasend_close_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/small_spacing"
android:padding="@dimen/small_spacing"
android:background="@drawable/circle_touch_highlight_background"
android:clickable="true"
android:focusable="true">
<ImageView
android:layout_width="36dp"
android:layout_height="36dp"
android:src="@drawable/ic_baseline_clear_24"
android:tint="@android:color/white"/>
</FrameLayout>
</FrameLayout>

View File

@ -91,6 +91,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
private Stub<MediaKeyboard> 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