mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
@@ -4,7 +4,6 @@ import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
@@ -198,7 +197,7 @@ public class GroupActivity extends
|
||||
|
||||
private void setGroupEnabled(boolean enabled) {
|
||||
isDissolved = !enabled;
|
||||
textInput.setEnabled(enabled);
|
||||
sendController.setReady(enabled);
|
||||
list.getRecyclerView().setAlpha(enabled ? 1f : 0.5f);
|
||||
|
||||
if (!enabled) {
|
||||
|
||||
@@ -28,6 +28,7 @@ public abstract class BaseMessageFragment extends BaseFragment
|
||||
implements SendListener {
|
||||
|
||||
protected LargeTextInputView message;
|
||||
private TextSendController sendController;
|
||||
private MessageFragmentListener listener;
|
||||
|
||||
@Override
|
||||
@@ -45,8 +46,7 @@ public abstract class BaseMessageFragment extends BaseFragment
|
||||
View v = inflater.inflate(R.layout.fragment_message, container,
|
||||
false);
|
||||
message = v.findViewById(R.id.messageView);
|
||||
TextSendController sendController =
|
||||
new TextSendController(message, this, true);
|
||||
sendController = new TextSendController(message, this, true);
|
||||
message.setSendController(sendController);
|
||||
message.setMaxTextLength(listener.getMaximumTextLength());
|
||||
message.setButtonText(getString(getButtonText()));
|
||||
@@ -85,7 +85,7 @@ public abstract class BaseMessageFragment extends BaseFragment
|
||||
@Override
|
||||
public void onSendClick(@Nullable String text, List<Uri> imageUris) {
|
||||
// disable button to prevent accidental double actions
|
||||
message.setEnabled(false);
|
||||
sendController.setReady(false);
|
||||
message.hideSoftKeyboard();
|
||||
|
||||
listener.onButtonClick(text);
|
||||
|
||||
@@ -62,6 +62,7 @@ public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadI
|
||||
protected BriarRecyclerView list;
|
||||
private LinearLayoutManager layoutManager;
|
||||
protected TextInputView textInput;
|
||||
protected TextSendController sendController;
|
||||
protected GroupId groupId;
|
||||
@Nullable
|
||||
private Parcelable layoutManagerState;
|
||||
@@ -87,8 +88,7 @@ public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadI
|
||||
getController().setGroupId(groupId);
|
||||
|
||||
textInput = findViewById(R.id.text_input_container);
|
||||
TextSendController sendController =
|
||||
new TextSendController(textInput, this, false);
|
||||
sendController = new TextSendController(textInput, this, false);
|
||||
textInput.setSendController(sendController);
|
||||
textInput.setMaxTextLength(getMaxTextLength());
|
||||
textInput.setReady(true);
|
||||
|
||||
Reference in New Issue
Block a user