mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
avoid input_area wrapper
This commit is contained in:
@@ -174,7 +174,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
protected ConversationTitleView titleView;
|
||||
private ConversationFragment fragment;
|
||||
private InputAwareLayout container;
|
||||
private View inputArea;
|
||||
private ScaleStableImageView backgroundView;
|
||||
private MessageRequestsBottomView messageRequestBottomView;
|
||||
private ProgressDialog progressDialog;
|
||||
@@ -1018,7 +1017,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
attachButton = ViewUtil.findById(this, R.id.attach_button);
|
||||
composeText = ViewUtil.findById(this, R.id.embedded_text_editor);
|
||||
emojiPickerContainer = ViewUtil.findById(this, R.id.emoji_picker_container);
|
||||
inputArea = ViewUtil.findById(this, R.id.input_area);
|
||||
container = ViewUtil.findById(this, R.id.layout_container);
|
||||
quickAttachmentToggle = ViewUtil.findById(this, R.id.quick_attachment_toggle);
|
||||
inputPanel = ViewUtil.findById(this, R.id.bottom_panel);
|
||||
@@ -1143,14 +1141,18 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
private void setInputPanelVisibility(boolean isInitialization) {
|
||||
if (dcChat.canSend()) {
|
||||
inputPanel.setVisibility(View.VISIBLE);
|
||||
beforeSearchInputPanelVisibility = View.VISIBLE;
|
||||
attachmentManager.setHidden(false);
|
||||
beforeSearchAttachmentEditorHidden = false;
|
||||
// FIXME: disabled for now to avoid problems with chat scrolling and keyboard covering input
|
||||
// bar
|
||||
// ViewUtil.forceApplyWindowInsets(findViewById(R.id.root_layout), true, false, true, true);
|
||||
// fragment.handleRemoveBottomInsets();
|
||||
} else {
|
||||
inputPanel.setVisibility(View.GONE);
|
||||
beforeSearchInputPanelVisibility = View.GONE;
|
||||
attachmentManager.setHidden(true);
|
||||
beforeSearchAttachmentEditorHidden = true;
|
||||
hideSoftKeyboard();
|
||||
// FIXME: disabled for now to avoid problems with chat scrolling and keyboard covering input
|
||||
// bar
|
||||
@@ -1861,6 +1863,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
// in-chat search
|
||||
|
||||
private boolean beforeSearchAttachmentEditorHidden;
|
||||
private int beforeSearchMsgRequestVisibility;
|
||||
private int beforeSearchInputPanelVisibility;
|
||||
|
||||
private Menu searchMenu = null;
|
||||
private int[] searchResult = {};
|
||||
private int searchResultPosition = -1;
|
||||
@@ -1881,13 +1887,22 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
private void searchExpand(final Menu menu, final MenuItem searchItem) {
|
||||
searchMenu = menu;
|
||||
inputArea.setVisibility(View.GONE);
|
||||
|
||||
beforeSearchAttachmentEditorHidden = attachmentManager.isHidden();
|
||||
beforeSearchMsgRequestVisibility = messageRequestBottomView.getVisibility();
|
||||
beforeSearchInputPanelVisibility = inputPanel.getVisibility();
|
||||
attachmentManager.setHidden(true);
|
||||
messageRequestBottomView.setVisibility(View.GONE);
|
||||
inputPanel.setVisibility(View.GONE);
|
||||
|
||||
ConversationActivity.this.makeSearchMenuVisible(menu, searchItem);
|
||||
}
|
||||
|
||||
private void searchCollapse() {
|
||||
searchMenu = null;
|
||||
inputArea.setVisibility(View.VISIBLE);
|
||||
attachmentManager.setHidden(beforeSearchAttachmentEditorHidden);
|
||||
messageRequestBottomView.setVisibility(beforeSearchMsgRequestVisibility);
|
||||
inputPanel.setVisibility(beforeSearchInputPanelVisibility);
|
||||
|
||||
// trigger onPrepareOptionsMenu() to restore correct menu visibility
|
||||
invalidateOptionsMenu();
|
||||
@@ -1949,9 +1964,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
public void initializeContactRequest() {
|
||||
if (!dcChat.isContactRequest()) {
|
||||
messageRequestBottomView.setVisibility(View.GONE);
|
||||
beforeSearchMsgRequestVisibility = View.GONE;
|
||||
return;
|
||||
}
|
||||
|
||||
beforeSearchMsgRequestVisibility = View.VISIBLE;
|
||||
messageRequestBottomView.setVisibility(View.VISIBLE);
|
||||
messageRequestBottomView.setAcceptOnClickListener(
|
||||
v -> {
|
||||
|
||||
@@ -787,6 +787,10 @@ public class AttachmentManager {
|
||||
updateVisibility();
|
||||
}
|
||||
|
||||
public boolean isHidden() {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
private void setAttachmentPresent(boolean isPresent) {
|
||||
this.attachmentPresent = isPresent;
|
||||
updateVisibility();
|
||||
|
||||
@@ -36,40 +36,33 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/input_area"
|
||||
<ViewStub
|
||||
android:id="@+id/attachment_editor_stub"
|
||||
android:inflatedId="@+id/attachment_editor"
|
||||
android:layout="@layout/conversation_activity_attachment_editor_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<org.thoughtcrime.securesms.messagerequests.MessageRequestsBottomView
|
||||
android:id="@+id/conversation_activity_message_request_bottom_bar"
|
||||
android:background="?android:attr/windowBackground"
|
||||
android:visibility="gone"
|
||||
android:clickable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:focusable="true" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/attachment_editor_stub"
|
||||
android:inflatedId="@+id/attachment_editor"
|
||||
android:layout="@layout/conversation_activity_attachment_editor_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<include layout="@layout/conversation_input_panel" />
|
||||
|
||||
<org.thoughtcrime.securesms.messagerequests.MessageRequestsBottomView
|
||||
android:id="@+id/conversation_activity_message_request_bottom_bar"
|
||||
android:background="?android:attr/windowBackground"
|
||||
android:visibility="gone"
|
||||
android:clickable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:focusable="true" />
|
||||
<FrameLayout
|
||||
android:id="@+id/emoji_picker_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<include layout="@layout/conversation_input_panel" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/emoji_picker_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</org.thoughtcrime.securesms.components.InputAwareLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
Reference in New Issue
Block a user