mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
11a2cfbff7
Depends on https://github.com/deltachat/deltachat-core-rust/pull/4315/. Follow-up for https://github.com/deltachat/deltachat-android/pull/2541. - Show a "verified" icon on protection changed update messages - Add C API - Show a dialog over the input bar not only for contact requests, but also when the protection is broken (using the new method `isHalfBlocked()`) - The positive button reads "OK" (as opposed to contact requests where it reads "Accept") - Add SVG icons, remove PNG one - Translations - When tapping on the `DC_INFO_PROTECTION_{EN|DIS}ABLED` message, show more information (for now, it leads to the online preview of my FAQ PR) - Block loading remote images in the "Full Msg View" not only for contact requests, also when the protection is broken (using the new method `isHalfBlocked()`) - Show a big verified/crossed-out-verified symbol over the `DC_INFO_PROTECTION_{EN|DIS}ABLED` messages - Fix a bug that was kind of present before (for contact requests) but only became really visible now: - Set a draft with an image (or other attachment) - Your chat partner breaks verification - Expected: Both the input bar and the draft image are hidden by the input-bar-dialog. - Bug behavior (before c31de5bcf): The input bar is hidden, but the draft image stays visible.
67 lines
1.8 KiB
Java
67 lines
1.8 KiB
Java
package org.thoughtcrime.securesms.messagerequests;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.widget.Button;
|
|
|
|
import androidx.appcompat.widget.AppCompatTextView;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
|
import org.thoughtcrime.securesms.R;
|
|
import org.thoughtcrime.securesms.util.ViewUtil;
|
|
|
|
public class MessageRequestsBottomView extends ConstraintLayout {
|
|
|
|
private AppCompatTextView question;
|
|
private Button accept;
|
|
private Button block;
|
|
|
|
public MessageRequestsBottomView(Context context) {
|
|
super(context);
|
|
}
|
|
|
|
public MessageRequestsBottomView(Context context, AttributeSet attrs) {
|
|
super(context, attrs);
|
|
}
|
|
|
|
public MessageRequestsBottomView(Context context, AttributeSet attrs, int defStyleAttr) {
|
|
super(context, attrs, defStyleAttr);
|
|
}
|
|
|
|
@Override
|
|
protected void onFinishInflate() {
|
|
super.onFinishInflate();
|
|
|
|
inflate(getContext(), R.layout.message_request_bottom_bar, this);
|
|
|
|
question = findViewById(R.id.message_request_question);
|
|
accept = findViewById(R.id.message_request_accept);
|
|
block = findViewById(R.id.message_request_block);
|
|
}
|
|
|
|
public void setAcceptOnClickListener(OnClickListener acceptOnClickListener) {
|
|
accept.setOnClickListener(acceptOnClickListener);
|
|
}
|
|
|
|
public void setAcceptText(int text) {
|
|
accept.setText(text);
|
|
}
|
|
|
|
public void setBlockOnClickListener(OnClickListener deleteOnClickListener) {
|
|
block.setOnClickListener(deleteOnClickListener);
|
|
}
|
|
|
|
public void setBlockText(int text) {
|
|
block.setText(text);
|
|
}
|
|
|
|
public void setQuestion(String text) {
|
|
if (text == null || text.isEmpty()) {
|
|
question.setMaxHeight(ViewUtil.dpToPx(5));
|
|
} else {
|
|
question.setMaxHeight(Integer.MAX_VALUE);
|
|
question.setText(text);
|
|
}
|
|
}
|
|
}
|