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 ...@@ -210,7 +210,8 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
@Override @Override
public void afterTextChanged(Editable text) { public void afterTextChanged(Editable text) {
setSendButtonColor(); setUpInputViewButtons();
if (!skipOnTextChanges) { if (!skipOnTextChanges) {
ChatStateManager.getInstance().onComposing(account, user, text); ChatStateManager.getInstance().onComposing(account, user, text);
...@@ -367,7 +368,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem ...@@ -367,7 +368,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
popup.show(); popup.show();
} }
private void setSendButtonColor() { private void setUpInputViewButtons() {
boolean empty = inputView.getText().toString().trim().isEmpty(); boolean empty = inputView.getText().toString().trim().isEmpty();
if (empty != isInputEmpty) { if (empty != isInputEmpty) {
...@@ -375,14 +376,17 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem ...@@ -375,14 +376,17 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
if (isInputEmpty) { if (isInputEmpty) {
sendButton.setImageResource(R.drawable.ic_button_send_inactive_24dp); sendButton.setImageResource(R.drawable.ic_button_send_inactive_24dp);
securityButton.setVisibility(View.VISIBLE);
} else { } else {
sendButton.setImageResource(R.drawable.ic_button_send); sendButton.setImageResource(R.drawable.ic_button_send);
sendButton.setImageLevel(AccountManager.getInstance().getColorLevel(account)); sendButton.setImageLevel(AccountManager.getInstance().getColorLevel(account));
securityButton.setVisibility(View.GONE);
} }
} }
} }
public void restoreInputState() { public void restoreInputState() {
skipOnTextChanges = true; skipOnTextChanges = true;
......
...@@ -63,17 +63,6 @@ ...@@ -63,17 +63,6 @@
android:orientation="horizontal" 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 <ImageButton
android:id="@+id/button_emoticon" android:id="@+id/button_emoticon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -108,6 +97,16 @@ ...@@ -108,6 +97,16 @@
android:scrollbars="vertical" 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 <ImageButton
android:id="@+id/button_send_message" android:id="@+id/button_send_message"
android:layout_width="wrap_content" 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