Commit 3b651f6e authored by Grigory Fedorov's avatar Grigory Fedorov

ContactTitleActionBarInflater - used in FingerprintViewer and QuestionViewer.

parent 825de168
......@@ -14,8 +14,6 @@
*/
package com.xabber.android.ui;
import java.util.Collection;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
......@@ -49,11 +47,14 @@ import com.xabber.android.ui.dialog.ConfirmDialogListener;
import com.xabber.android.ui.dialog.DialogBuilder;
import com.xabber.android.ui.dialog.NotificationDialogBuilder;
import com.xabber.android.ui.dialog.NotificationDialogListener;
import com.xabber.android.ui.helper.ContactTitleActionBarInflater;
import com.xabber.android.ui.helper.ContactTitleInflater;
import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.androiddev.R;
import com.xabber.xmpp.address.Jid;
import java.util.Collection;
public class FingerprintViewer extends ManagedActivity implements
OnCheckedChangeListener, OnAccountChangedListener,
OnContactChangedListener, OnClickListener, ConfirmDialogListener,
......@@ -82,6 +83,8 @@ public class FingerprintViewer extends ManagedActivity implements
*/
private IntentIntegrator integrator;
ContactTitleActionBarInflater contactTitleActionBarInflater;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -120,7 +123,8 @@ public class FingerprintViewer extends ManagedActivity implements
copyView.setOnClickListener(this);
isUpdating = false;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
contactTitleActionBarInflater = new ContactTitleActionBarInflater(this);
contactTitleActionBarInflater.setActionBarView();
}
@Override
......@@ -298,6 +302,9 @@ public class FingerprintViewer extends ManagedActivity implements
((TextView) findViewById(R.id.otr_local_fingerprint))
.setText(localFingerprint == null ? getString(R.string.unknown)
: CertificateManager.showFingerprint(localFingerprint));
contactTitleActionBarInflater.update(abstractContact);
isUpdating = false;
}
......
......@@ -14,8 +14,6 @@
*/
package com.xabber.android.ui;
import java.util.Collection;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
......@@ -35,11 +33,14 @@ import com.xabber.android.data.intent.EntityIntentBuilder;
import com.xabber.android.data.roster.AbstractContact;
import com.xabber.android.data.roster.OnContactChangedListener;
import com.xabber.android.data.roster.RosterManager;
import com.xabber.android.ui.helper.ContactTitleActionBarInflater;
import com.xabber.android.ui.helper.ContactTitleInflater;
import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.androiddev.R;
import com.xabber.xmpp.address.Jid;
import java.util.Collection;
/**
* Represents OTR question.
*
......@@ -58,6 +59,8 @@ public class QuestionViewer extends ManagedActivity implements
private boolean answerRequest;
private EditText questionView;
ContactTitleActionBarInflater contactTitleActionBarInflater;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -98,7 +101,8 @@ public class QuestionViewer extends ManagedActivity implements
findViewById(R.id.cancel).setOnClickListener(this);
findViewById(R.id.send).setOnClickListener(this);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
contactTitleActionBarInflater = new ContactTitleActionBarInflater(this);
contactTitleActionBarInflater.setActionBarView();
}
@Override
......@@ -173,6 +177,8 @@ public class QuestionViewer extends ManagedActivity implements
.getBestContact(account, user);
ContactTitleInflater.updateTitle(findViewById(R.id.title), this,
abstractContact);
contactTitleActionBarInflater.update(abstractContact);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment