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