Done for open link dialog

This commit is contained in:
M66B 2020-09-03 19:22:21 +02:00
parent 852e1bb6f7
commit 5e4d3ab5e8
2 changed files with 15 additions and 1 deletions

View File

@ -90,6 +90,7 @@ import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.view.textclassifier.ConversationAction;
import android.view.textclassifier.ConversationActions;
@ -5876,6 +5877,19 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
});
etLink.setHorizontallyScrolling(false);
etLink.setMaxLines(10);
etLink.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
((AlertDialog) getDialog()).getButton(DialogInterface.BUTTON_POSITIVE).performClick();
return true;
} else
return false;
}
});
ibShare.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:imeOptions="actionDone"
android:inputType="textUri|textMultiLine"
android:inputType="textUri"
android:text="https://email.faircode.eu/"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"