Commit 0c09a94e authored by Grigory Fedorov's avatar Grigory Fedorov

ChatViewer is shows on avatar click from Chat.

parent 9f95a828
......@@ -57,6 +57,7 @@ import com.xabber.android.ui.dialog.ChatExportDialogFragment;
import com.xabber.android.ui.helper.ContactTitleActionBarInflater;
import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.android.ui.preferences.ChatEditor;
import com.xabber.android.ui.preferences.ContactViewer;
import com.xabber.androiddev.R;
import java.util.Collection;
......@@ -70,7 +71,7 @@ import java.util.HashSet;
*/
public class ChatViewer extends ManagedActivity implements OnChatChangedListener,
OnContactChangedListener, OnAccountChangedListener, ViewPager.OnPageChangeListener,
ChatViewerAdapter.FinishUpdateListener, RecentChatFragment.RecentChatFragmentInteractionListener {
ChatViewerAdapter.FinishUpdateListener, RecentChatFragment.RecentChatFragmentInteractionListener, View.OnClickListener {
/**
* Attention request.
......@@ -137,6 +138,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
}
});
contactTitleActionBarInflater.setOnAvatarClickListener(this);
setContentView(R.layout.activity_chat_viewer);
if (account != null && user != null) {
......@@ -793,4 +796,11 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
}
}
@Override
public void onClick(View v) {
if (v.getId() == R.id.avatar) {
startActivity(ContactViewer.createIntent(this, actionWithAccount, actionWithUser));
}
}
}
......@@ -106,6 +106,10 @@ public class ContactTitleActionBarInflater {
actionBarView.setOnClickListener(onClickListener);
}
public void setOnAvatarClickListener(View.OnClickListener onClickListener) {
actionBarView.findViewById(R.id.avatar).setOnClickListener(onClickListener);
}
public void setName(String name) {
((TextView) actionBarView.findViewById(R.id.name)).setText(name);
}
......
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