Merge pull request #1266 from deltachat/less-clicks

less clicks on save-message and start-chat
This commit is contained in:
bjoern 2020-03-11 22:10:19 +01:00 committed by GitHub
commit 091a049f7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 14 deletions

View file

@ -38,6 +38,7 @@ public class DcContext {
public final static int DC_GCL_ARCHIVED_ONLY = 0x01;
public final static int DC_GCL_NO_SPECIALS = 0x02;
public final static int DC_GCL_ADD_ALLDONE_HINT = 0x04;
public final static int DC_GCL_FOR_FORWARDING = 0x08;
public final static int DC_GCM_ADDDAYMARKER = 0x01;

View file

@ -603,6 +603,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
private void handleForwarding() {
DcChat dcChat = dcContext.getChat(chatId);
if (dcChat.isSelfTalk()) {
new RelayingTask(this, chatId).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
String name = dcChat.getName();
if (!dcChat.isGroup()) {
int[] contactIds = dcContext.getChatContacts(chatId);
@ -616,6 +619,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
.setNegativeButton(R.string.cancel, (dialogInterface, i) -> finish())
.show();
}
}
private void handleSharing() {
ArrayList<Uri> uriList = RelayUtil.getSharedUris(this);

View file

@ -90,7 +90,10 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
searchToolbar = findViewById(R.id.search_toolbar);
searchAction = findViewById(R.id.search_action);
fragmentContainer = findViewById(R.id.fragment_container);
conversationListFragment = initFragment(R.id.fragment_container, new ConversationListFragment(), dynamicLanguage.getCurrentLocale());
Bundle bundle = new Bundle();
bundle.putBoolean(ConversationListFragment.FORWARDING, isForwarding(this));
conversationListFragment = initFragment(R.id.fragment_container, new ConversationListFragment(), dynamicLanguage.getCurrentLocale(), bundle);
initializeSearchListener();

View file

@ -80,6 +80,7 @@ public class ConversationListFragment extends Fragment
implements LoaderManager.LoaderCallbacks<DcChatlist>, ActionMode.Callback, ItemClickListener, DcEventCenter.DcEventDelegate
{
public static final String ARCHIVE = "archive";
public static final String FORWARDING = "for_forwarding";
@SuppressWarnings("unused")
private static final String TAG = ConversationListFragment.class.getSimpleName();
@ -93,12 +94,14 @@ public class ConversationListFragment extends Fragment
private Locale locale;
private String queryFilter = "";
private boolean archive;
private boolean forwarding;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
locale = (Locale) getArguments().getSerializable(PassphraseRequiredActionBarActivity.LOCALE_EXTRA);
archive = getArguments().getBoolean(ARCHIVE, false);
forwarding = getArguments().getBoolean(FORWARDING, false);
ApplicationDcContext dcContext = DcHelper.getContext(getActivity());
dcContext.eventCenter.addObserver(DcContext.DC_EVENT_CHAT_MODIFIED, this);
@ -349,8 +352,9 @@ public class ConversationListFragment extends Fragment
int listflags = 0;
if (archive) {
listflags |= DcContext.DC_GCL_ARCHIVED_ONLY;
}
else {
} else if (forwarding) {
listflags |= DcContext.DC_GCL_FOR_FORWARDING;
} else {
listflags |= DcContext.DC_GCL_ADD_ALLDONE_HINT;
}
return new DcChatlistLoader(getActivity(), listflags, queryFilter.isEmpty()? null : queryFilter, 0);