Commit 9b305a5f authored by Grigory Fedorov's avatar Grigory Fedorov

Security button moved to the right and get hidden during typing.

parent 24b7b728
......@@ -210,7 +210,8 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
@Override
public void afterTextChanged(Editable text) {
setSendButtonColor();
setUpInputViewButtons();
if (!skipOnTextChanges) {
ChatStateManager.getInstance().onComposing(account, user, text);
......@@ -367,7 +368,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
popup.show();
}
private void setSendButtonColor() {
private void setUpInputViewButtons() {
boolean empty = inputView.getText().toString().trim().isEmpty();
if (empty != isInputEmpty) {
......@@ -375,14 +376,17 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
if (isInputEmpty) {
sendButton.setImageResource(R.drawable.ic_button_send_inactive_24dp);
securityButton.setVisibility(View.VISIBLE);
} else {
sendButton.setImageResource(R.drawable.ic_button_send);
sendButton.setImageLevel(AccountManager.getInstance().getColorLevel(account));
securityButton.setVisibility(View.GONE);
}
}
}
public void restoreInputState() {
skipOnTextChanges = true;
......
......@@ -63,17 +63,6 @@
android:orientation="horizontal"
>
<ImageButton
android:id="@+id/button_security"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/ripple_background"
android:contentDescription="@string/otr_encryption"
android:padding="8dp"
android:src="@drawable/ic_security_grey_24dp"
/>
<ImageButton
android:id="@+id/button_emoticon"
android:layout_width="wrap_content"
......@@ -108,6 +97,16 @@
android:scrollbars="vertical"
/>
<ImageButton
android:id="@+id/button_security"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background"
android:contentDescription="@string/otr_encryption"
android:padding="8dp"
android:src="@drawable/ic_security_grey_24dp"
/>
<ImageButton
android:id="@+id/button_send_message"
android:layout_width="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment