mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -93,12 +93,16 @@ public abstract class BaseConversationListFragment extends Fragment implements A
|
||||
if (isForwarding(getActivity())) {
|
||||
message = String.format(Util.getLocale(), getString(R.string.ask_forward_multiple), selectedChats.size());
|
||||
} else if (!uris.isEmpty()) {
|
||||
message = String.format(Util.getLocale(), getString(R.string.share_multiple_attachments_multiple_chats), uris.size(), selectedChats.size());
|
||||
message = String.format(Util.getLocale(), getString(R.string.ask_send_files_to_selected_chats), uris.size(), selectedChats.size());
|
||||
} else {
|
||||
message = String.format(Util.getLocale(), getString(R.string.share_text_multiple_chats), selectedChats.size(), getSharedText(getActivity()));
|
||||
}
|
||||
|
||||
Context context = getContext();
|
||||
if (context != null) {
|
||||
if (SendRelayedMessageUtil.containsVideoType(context, uris)) {
|
||||
message += "\n\n" + getString(R.string.videos_sent_without_recoding);
|
||||
}
|
||||
new AlertDialog.Builder(context)
|
||||
.setMessage(message)
|
||||
.setCancelable(false)
|
||||
|
||||
@@ -660,7 +660,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
ArrayList<Uri> uriList = RelayUtil.getSharedUris(this);
|
||||
int sharedContactId = RelayUtil.getSharedContactId(this);
|
||||
if (uriList.size() > 1) {
|
||||
String message = String.format(getString(R.string.share_multiple_attachments), uriList.size());
|
||||
String message = String.format(getString(R.string.ask_send_files_to_selected_chat), uriList.size());
|
||||
if (SendRelayedMessageUtil.containsVideoType(context, uriList)) {
|
||||
message += "\n\n" + getString(R.string.videos_sent_without_recoding);
|
||||
}
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage(message)
|
||||
.setCancelable(false)
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.b44t.messenger.rpc.Rpc;
|
||||
import com.b44t.messenger.rpc.RpcException;
|
||||
|
||||
import org.thoughtcrime.securesms.ConnectivityActivity;
|
||||
import org.thoughtcrime.securesms.ConversationListActivity;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.components.AvatarView;
|
||||
import org.thoughtcrime.securesms.connect.AccountManager;
|
||||
@@ -180,6 +181,11 @@ public class AccountSelectionListFragment extends DialogFragment implements DcEv
|
||||
} else {
|
||||
AccountManager.getInstance().showSwitchAccountMenu(activity);
|
||||
}
|
||||
|
||||
// title update needed to show "Delta Chat" in case there is only one profile left
|
||||
if (activity instanceof ConversationListActivity) {
|
||||
((ConversationListActivity)activity).refreshTitle();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
Util.redPositiveButton(dialog);
|
||||
|
||||
@@ -104,7 +104,7 @@ public class AccountSelectionListItem extends LinearLayout {
|
||||
nameView.setTypeface(null, Typeface.BOLD);
|
||||
} else {
|
||||
addrView.setTypeface(null, Typeface.NORMAL);
|
||||
nameView.setTypeface(null, accountId == DcContact.DC_CONTACT_ID_ADD_ACCOUNT? Typeface.BOLD : Typeface.NORMAL);
|
||||
nameView.setTypeface(null, Typeface.NORMAL);
|
||||
}
|
||||
|
||||
updateUnreadIndicator(unreadCount, isMuted);
|
||||
|
||||
@@ -27,6 +27,7 @@ public class SearchToolbar extends LinearLayout {
|
||||
private static final String TAG = SearchToolbar.class.getSimpleName();
|
||||
private float x, y;
|
||||
private MenuItem searchItem;
|
||||
private EditText searchText;
|
||||
private SearchListener listener;
|
||||
|
||||
public SearchToolbar(Context context) {
|
||||
@@ -63,7 +64,7 @@ public class SearchToolbar extends LinearLayout {
|
||||
|
||||
this.searchItem = toolbar.getMenu().findItem(R.id.action_filter_search);
|
||||
SearchView searchView = (SearchView) searchItem.getActionView();
|
||||
EditText searchText = searchView.findViewById(androidx.appcompat.R.id.search_src_text);
|
||||
searchText = searchView.findViewById(androidx.appcompat.R.id.search_src_text);
|
||||
searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);
|
||||
|
||||
searchView.setSubmitButtonEnabled(false);
|
||||
@@ -107,6 +108,17 @@ public class SearchToolbar extends LinearLayout {
|
||||
}
|
||||
});
|
||||
|
||||
MenuItem searchUnread = toolbar.getMenu().findItem(R.id.search_unread);
|
||||
searchUnread.setOnMenuItemClickListener(item -> {
|
||||
String t = searchText.getText().toString();
|
||||
if (!t.contains("is:unread")) {
|
||||
t += (t.isEmpty() ? "" : " ") + "is:unread ";
|
||||
}
|
||||
searchText.setText(t);
|
||||
searchText.setSelection(t.length(), t.length());
|
||||
return true;
|
||||
});
|
||||
|
||||
toolbar.setNavigationOnClickListener(v -> hide());
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ public class QrCodeHandler {
|
||||
builder.setPositiveButton(R.string.proxy_use_proxy, (dlg, btn) -> {
|
||||
dcContext.setConfigFromQr(rawString);
|
||||
dcContext.restartIo();
|
||||
showDoneToast(activity);
|
||||
});
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
builder.setCancelable(false);
|
||||
|
||||
@@ -84,6 +84,16 @@ public class SendRelayedMessageUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean containsVideoType(Context context, ArrayList<Uri> uris) {
|
||||
for (final Uri uri : uris) {
|
||||
final String mimeType = MediaUtil.getMimeType(context, uri);
|
||||
if (MediaUtil.isVideoType(mimeType)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static DcMsg createMessage(Context context, Uri uri, String type, String html, String subject, String text) throws NullPointerException {
|
||||
DcContext dcContext = DcHelper.getContext(context);
|
||||
DcMsg message;
|
||||
|
||||
Reference in New Issue
Block a user