Search in sources :

Example 1 with ActivityResult

use of eu.siacs.conversations.ui.util.ActivityResult in project Conversations by siacs.

the class ConversationFragment method onActivityResult.

@Override
public void onActivityResult(int requestCode, int resultCode, final Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    ActivityResult activityResult = ActivityResult.of(requestCode, resultCode, data);
    if (activity != null && activity.xmppConnectionService != null) {
        handleActivityResult(activityResult);
    } else {
        this.postponedActivityResult.push(activityResult);
    }
}
Also used : ActivityResult(eu.siacs.conversations.ui.util.ActivityResult)

Example 2 with ActivityResult

use of eu.siacs.conversations.ui.util.ActivityResult in project Conversations by siacs.

the class ChooseContactActivity method onBackendConnected.

@Override
void onBackendConnected() {
    filterContacts();
    this.mActivatedAccounts.clear();
    for (Account account : xmppConnectionService.getAccounts()) {
        if (account.getStatus() != Account.State.DISABLED) {
            if (Config.DOMAIN_LOCK != null) {
                this.mActivatedAccounts.add(account.getJid().getEscapedLocal());
            } else {
                this.mActivatedAccounts.add(account.getJid().asBareJid().toEscapedString());
            }
        }
    }
    ActivityResult activityResult = this.postponedActivityResult.pop();
    if (activityResult != null) {
        handleActivityResult(activityResult);
    }
    final Fragment fragment = getSupportFragmentManager().findFragmentByTag(FRAGMENT_TAG_DIALOG);
    if (fragment instanceof OnBackendConnected) {
        ((OnBackendConnected) fragment).onBackendConnected();
    }
}
Also used : Account(eu.siacs.conversations.entities.Account) OnBackendConnected(eu.siacs.conversations.ui.interfaces.OnBackendConnected) ActivityResult(eu.siacs.conversations.ui.util.ActivityResult) Fragment(androidx.fragment.app.Fragment)

Example 3 with ActivityResult

use of eu.siacs.conversations.ui.util.ActivityResult in project Conversations by siacs.

the class ConversationsActivity method onBackendConnected.

@Override
void onBackendConnected() {
    if (performRedirectIfNecessary(true)) {
        return;
    }
    xmppConnectionService.getNotificationService().setIsInForeground(true);
    Intent intent = pendingViewIntent.pop();
    if (intent != null) {
        if (processViewIntent(intent)) {
            if (binding.secondaryFragment != null) {
                notifyFragmentOfBackendConnected(R.id.main_fragment);
            }
            invalidateActionBarTitle();
            return;
        }
    }
    for (@IdRes int id : FRAGMENT_ID_NOTIFICATION_ORDER) {
        notifyFragmentOfBackendConnected(id);
    }
    ActivityResult activityResult = postponedActivityResult.pop();
    if (activityResult != null) {
        handleActivityResult(activityResult);
    }
    invalidateActionBarTitle();
    if (binding.secondaryFragment != null && ConversationFragment.getConversation(this) == null) {
        Conversation conversation = ConversationsOverviewFragment.getSuggestion(this);
        if (conversation != null) {
            openConversation(conversation, null);
        }
    }
    showDialogsIfMainIsOverview();
}
Also used : IdRes(androidx.annotation.IdRes) Intent(android.content.Intent) Conversation(eu.siacs.conversations.entities.Conversation) ActivityResult(eu.siacs.conversations.ui.util.ActivityResult) SuppressLint(android.annotation.SuppressLint)

Example 4 with ActivityResult

use of eu.siacs.conversations.ui.util.ActivityResult in project Conversations by siacs.

the class ConversationsActivity method onActivityResult.

@Override
public void onActivityResult(int requestCode, int resultCode, final Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    ActivityResult activityResult = ActivityResult.of(requestCode, resultCode, data);
    if (xmppConnectionService != null) {
        handleActivityResult(activityResult);
    } else {
        this.postponedActivityResult.push(activityResult);
    }
}
Also used : ActivityResult(eu.siacs.conversations.ui.util.ActivityResult)

Example 5 with ActivityResult

use of eu.siacs.conversations.ui.util.ActivityResult in project Conversations by siacs.

the class ConversationFragment method onBackendConnected.

@Override
public void onBackendConnected() {
    Log.d(Config.LOGTAG, "ConversationFragment.onBackendConnected()");
    String uuid = pendingConversationsUuid.pop();
    if (uuid != null) {
        if (!findAndReInitByUuidOrArchive(uuid)) {
            return;
        }
    } else {
        if (!activity.xmppConnectionService.isConversationStillOpen(conversation)) {
            clearPending();
            activity.onConversationArchived(conversation);
            return;
        }
    }
    ActivityResult activityResult = postponedActivityResult.pop();
    if (activityResult != null) {
        handleActivityResult(activityResult);
    }
    clearPending();
}
Also used : ActivityResult(eu.siacs.conversations.ui.util.ActivityResult)

Aggregations

ActivityResult (eu.siacs.conversations.ui.util.ActivityResult)6 SuppressLint (android.annotation.SuppressLint)1 Intent (android.content.Intent)1 IdRes (androidx.annotation.IdRes)1 Fragment (androidx.fragment.app.Fragment)1 Account (eu.siacs.conversations.entities.Account)1 Conversation (eu.siacs.conversations.entities.Conversation)1 OnBackendConnected (eu.siacs.conversations.ui.interfaces.OnBackendConnected)1