Search in sources :

Example 1 with ContactTitleActionBarInflater

use of com.xabber.android.ui.helper.ContactTitleActionBarInflater in project xabber-android by redsolution.

the class FingerprintViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    setContentView(R.layout.fingerprint_viewer);
    integrator = new IntentIntegrator(this);
    Intent intent = getIntent();
    account = getAccount(intent);
    user = getUser(intent);
    if (AccountManager.getInstance().getAccount(account) == null || user == null) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        finish();
        return;
    }
    if (savedInstanceState != null) {
        remoteFingerprint = savedInstanceState.getString(SAVED_REMOTE_FINGERPRINT);
        localFingerprint = savedInstanceState.getString(SAVED_LOCAL_FINGERPRINT);
    } else {
        remoteFingerprint = OTRManager.getInstance().getRemoteFingerprint(account, user);
        localFingerprint = OTRManager.getInstance().getLocalFingerprint(account);
    }
    verifiedView = (CheckBox) findViewById(R.id.verified);
    verifiedView.setOnCheckedChangeListener(this);
    scanView = findViewById(R.id.scan);
    scanView.setOnClickListener(this);
    showView = findViewById(R.id.show);
    showView.setOnClickListener(this);
    copyView = findViewById(R.id.copy);
    copyView.setOnClickListener(this);
    isUpdating = false;
    contactTitleActionBarInflater = new ContactTitleActionBarInflater(this, (Toolbar) findViewById(R.id.toolbar_default));
    contactTitleActionBarInflater.setUpActionBarView();
}
Also used : ContactTitleActionBarInflater(com.xabber.android.ui.helper.ContactTitleActionBarInflater) IntentIntegrator(com.google.zxing.integration.android.IntentIntegrator) Intent(android.content.Intent) Toolbar(android.support.v7.widget.Toolbar)

Example 2 with ContactTitleActionBarInflater

use of com.xabber.android.ui.helper.ContactTitleActionBarInflater in project xabber-android by redsolution.

the class GroupEditor method onCreate.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_with_toolbar_and_container);
    contactTitleActionBarInflater = new ContactTitleActionBarInflater(this, (Toolbar) findViewById(R.id.toolbar_default));
    contactTitleActionBarInflater.setUpActionBarView();
    Intent intent = getIntent();
    account = GroupEditor.getAccount(intent);
    user = GroupEditor.getUser(intent);
    if (AccountManager.getInstance().getAccount(account) == null || user == null) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        finish();
    }
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, GroupEditorFragment.newInstance(account, user)).commit();
    }
}
Also used : ContactTitleActionBarInflater(com.xabber.android.ui.helper.ContactTitleActionBarInflater) Intent(android.content.Intent) Toolbar(android.support.v7.widget.Toolbar)

Example 3 with ContactTitleActionBarInflater

use of com.xabber.android.ui.helper.ContactTitleActionBarInflater in project xabber-android by redsolution.

the class GroupEditActivity method onCreate.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_with_toolbar_and_container);
    contactTitleActionBarInflater = new ContactTitleActionBarInflater(this);
    contactTitleActionBarInflater.setUpActionBarView();
    Intent intent = getIntent();
    account = GroupEditActivity.getAccount(intent);
    user = GroupEditActivity.getUser(intent);
    if (AccountManager.getInstance().getAccount(account) == null || user == null) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        finish();
    }
    if (savedInstanceState == null) {
        getFragmentManager().beginTransaction().add(R.id.fragment_container, GroupEditorFragment.newInstance(account, user)).commit();
    }
}
Also used : ContactTitleActionBarInflater(com.xabber.android.ui.helper.ContactTitleActionBarInflater) Intent(android.content.Intent)

Example 4 with ContactTitleActionBarInflater

use of com.xabber.android.ui.helper.ContactTitleActionBarInflater in project xabber-android by redsolution.

the class QuestionViewer method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    Intent intent = getIntent();
    account = QuestionViewer.getAccount(intent);
    user = QuestionViewer.getUser(intent);
    if (AccountManager.getInstance().getAccount(account) == null || user == null) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        finish();
        return;
    }
    if (intent.getBooleanExtra(EXTRA_FIELD_CANCEL, false)) {
        try {
            OTRManager.getInstance().abortSmp(account, user);
        } catch (NetworkException e) {
            Application.getInstance().onError(e);
        }
        finish();
        return;
    }
    showQuestion = intent.getBooleanExtra(EXTRA_FIELD_SHOW_QUESTION, true);
    answerRequest = intent.getBooleanExtra(EXTRA_FIELD_ANSWER_REQUEST, false);
    if (showQuestion) {
        setContentView(R.layout.question_viewer);
        questionView = (EditText) findViewById(R.id.question);
        questionView.setEnabled(!answerRequest);
        if (answerRequest) {
            questionView.setText(intent.getStringExtra(Intent.EXTRA_TEXT));
        } else {
            findViewById(R.id.cancel).setVisibility(View.GONE);
        }
    } else {
        setContentView(R.layout.secret_viewer);
    }
    findViewById(R.id.cancel).setOnClickListener(this);
    findViewById(R.id.send).setOnClickListener(this);
    contactTitleActionBarInflater = new ContactTitleActionBarInflater(this, (Toolbar) findViewById(R.id.toolbar_default));
    contactTitleActionBarInflater.setUpActionBarView();
}
Also used : ContactTitleActionBarInflater(com.xabber.android.ui.helper.ContactTitleActionBarInflater) Intent(android.content.Intent) NetworkException(com.xabber.android.data.NetworkException) Toolbar(android.support.v7.widget.Toolbar)

Example 5 with ContactTitleActionBarInflater

use of com.xabber.android.ui.helper.ContactTitleActionBarInflater in project xabber-android by redsolution.

the class FingerprintActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (isFinishing()) {
        return;
    }
    setContentView(R.layout.activity_fingerprint);
    integrator = new IntentIntegrator(this);
    Intent intent = getIntent();
    account = getAccount(intent);
    user = getUser(intent);
    if (AccountManager.getInstance().getAccount(account) == null || user == null) {
        Application.getInstance().onError(R.string.ENTRY_IS_NOT_FOUND);
        finish();
        return;
    }
    if (savedInstanceState != null) {
        remoteFingerprint = savedInstanceState.getString(SAVED_REMOTE_FINGERPRINT);
        localFingerprint = savedInstanceState.getString(SAVED_LOCAL_FINGERPRINT);
    } else {
        remoteFingerprint = OTRManager.getInstance().getRemoteFingerprint(account, user);
        localFingerprint = OTRManager.getInstance().getLocalFingerprint(account);
    }
    verifiedView = (CheckBox) findViewById(R.id.verified);
    verifiedView.setOnCheckedChangeListener(this);
    scanView = findViewById(R.id.scan);
    scanView.setOnClickListener(this);
    showView = findViewById(R.id.show);
    showView.setOnClickListener(this);
    copyView = findViewById(R.id.copy);
    copyView.setOnClickListener(this);
    isUpdating = false;
    contactTitleActionBarInflater = new ContactTitleActionBarInflater(this);
    contactTitleActionBarInflater.setUpActionBarView();
}
Also used : ContactTitleActionBarInflater(com.xabber.android.ui.helper.ContactTitleActionBarInflater) IntentIntegrator(com.google.zxing.integration.android.IntentIntegrator) Intent(android.content.Intent)

Aggregations

Intent (android.content.Intent)6 ContactTitleActionBarInflater (com.xabber.android.ui.helper.ContactTitleActionBarInflater)6 Toolbar (android.support.v7.widget.Toolbar)3 IntentIntegrator (com.google.zxing.integration.android.IntentIntegrator)2 NetworkException (com.xabber.android.data.NetworkException)2