From 897e176f0d1ff3f01800df4498488366159995ed Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Fri, 17 Jun 2022 14:22:14 -0300 Subject: [PATCH] Revert shade removal and add nav bar coloring. --- .../conversation/AttachmentKeyboard.java | 3 +-- .../AttachmentKeyboardButtonAdapter.java | 7 +------ .../ConversationParentFragment.java | 18 +++++------------- .../main/res/layout/conversation_activity.xml | 9 +++++++++ 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java index 9400518399..46ea402ae3 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboard.java @@ -117,14 +117,13 @@ public class AttachmentKeyboard extends FrameLayout implements InputAwareLayout. public void setWallpaperEnabled(boolean wallpaperEnabled) { if (wallpaperEnabled) { - container.setBackground(null); + container.setBackgroundColor(getContext().getResources().getColor(R.color.wallpaper_compose_background)); } else { container.setBackgroundColor(getContext().getResources().getColor(R.color.signal_background_primary)); } buttonAdapter.setWallpaperEnabled(wallpaperEnabled); } - @Override public void show(int height, boolean immediate) { ViewGroup.LayoutParams params = getLayoutParams(); diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButtonAdapter.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButtonAdapter.java index 51dbcb5eae..3ab4cd10dc 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButtonAdapter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/AttachmentKeyboardButtonAdapter.java @@ -1,5 +1,6 @@ package org.thoughtcrime.securesms.conversation; +import android.graphics.Color; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -88,12 +89,6 @@ class AttachmentKeyboardButtonAdapter extends RecyclerView.Adapter listener.onClick(button)); } diff --git a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java index ec701cb866..2469caeba4 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java +++ b/app/src/main/java/org/thoughtcrime/securesms/conversation/ConversationParentFragment.java @@ -406,6 +406,7 @@ public class ConversationParentFragment extends Fragment private MessageRequestsBottomView messageRequestBottomView; private ConversationReactionDelegate reactionDelegate; private Stub voiceNotePlayerViewStub; + private View navigationBarBackground; private AttachmentManager attachmentManager; private AudioRecorder audioRecorder; @@ -1197,6 +1198,7 @@ public class ConversationParentFragment extends Fragment reactionDelegate.hide(); } else if (container.isInputOpen()) { container.hideCurrentInput(composeText); + navigationBarBackground.setVisibility(View.GONE); } else if (isSearchRequested) { if (searchViewItem != null) { searchViewItem.collapseActionView(); @@ -1213,6 +1215,7 @@ public class ConversationParentFragment extends Fragment emojiDrawerStub.get().hide(true); } if (attachmentKeyboardStub.resolved() && attachmentKeyboardStub.get().isShowing()) { + navigationBarBackground.setVisibility(View.GONE); attachmentKeyboardStub.get().hide(true); } } @@ -1550,6 +1553,7 @@ public class ConversationParentFragment extends Fragment updatePaymentsAvailable(); container.show(composeText, attachmentKeyboardStub.get()); + navigationBarBackground.setVisibility(View.VISIBLE); viewModel.onAttachmentKeyboardOpen(); } @@ -2136,6 +2140,7 @@ public class ConversationParentFragment extends Fragment wallpaper = view.findViewById(R.id.conversation_wallpaper); wallpaperDim = view.findViewById(R.id.conversation_wallpaper_dim); voiceNotePlayerViewStub = ViewUtil.findStubById(view, R.id.voice_note_player_stub); + navigationBarBackground = view.findViewById(R.id.navbar_background); ImageButton quickCameraToggle = view.findViewById(R.id.quick_camera_toggle); ImageButton inlineAttachmentButton = view.findViewById(R.id.inline_attachment_button); @@ -4059,19 +4064,6 @@ public class ConversationParentFragment extends Fragment updateLinkPreviewState(); } - private int inputAreaHeight() { - int height = panelParent.getMeasuredHeight(); - - if (attachmentKeyboardStub.resolved()) { - View keyboard = attachmentKeyboardStub.get(); - if (keyboard.getVisibility() == View.VISIBLE) { - return height + keyboard.getMeasuredHeight(); - } - } - - return height; - } - private void onMessageRequestDeleteClicked(@NonNull MessageRequestViewModel requestModel) { Recipient recipient = requestModel.getRecipient().getValue(); if (recipient == null) { diff --git a/app/src/main/res/layout/conversation_activity.xml b/app/src/main/res/layout/conversation_activity.xml index 0245ad224c..53e92e79d9 100644 --- a/app/src/main/res/layout/conversation_activity.xml +++ b/app/src/main/res/layout/conversation_activity.xml @@ -160,6 +160,15 @@ + +