Commit 919ff218 authored by Grigory Fedorov's avatar Grigory Fedorov

ContactViewer and ContactEditor menu calls changed.

parent 9a91549a
...@@ -142,12 +142,12 @@ ...@@ -142,12 +142,12 @@
<activity <activity
android:label="@string/contact_editor" android:label="@string/contact_editor"
android:name="com.xabber.android.ui.ContactEditor" android:name="com.xabber.android.ui.ContactEditor"
android:parentActivityName="com.xabber.android.ui.ContactList" android:parentActivityName="com.xabber.android.ui.ContactViewer"
> >
<!-- Parent activity meta-data to support 4.0 and lower --> <!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" /> android:value="com.xabber.android.ui.ContactViewer" />
</activity> </activity>
<activity <activity
android:label="@string/contact_add" android:label="@string/contact_add"
...@@ -220,12 +220,12 @@ ...@@ -220,12 +220,12 @@
<activity <activity
android:label="@string/contact_viewer" android:label="@string/contact_viewer"
android:name="com.xabber.android.ui.ContactViewer" android:name="com.xabber.android.ui.ContactViewer"
android:parentActivityName="com.xabber.android.ui.ContactList" android:parentActivityName="com.xabber.android.ui.ChatViewer"
> >
<!-- Parent activity meta-data to support 4.0 and lower --> <!-- Parent activity meta-data to support 4.0 and lower -->
<meta-data <meta-data
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value="com.xabber.android.ui.ContactList" /> android:value="com.xabber.android.ui.ChatViewer" />
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
......
...@@ -221,7 +221,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -221,7 +221,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
} }
if (abstractChat instanceof RegularChat) { if (abstractChat instanceof RegularChat) {
menu.findItem(R.id.action_edit_contact).setVisible(true); menu.findItem(R.id.action_view_contact).setVisible(true);
menu.findItem(R.id.action_close_chat).setVisible(true); menu.findItem(R.id.action_close_chat).setVisible(true);
SecurityLevel securityLevel = OTRManager.getInstance().getSecurityLevel(account, user); SecurityLevel securityLevel = OTRManager.getInstance().getSecurityLevel(account, user);
...@@ -313,8 +313,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -313,8 +313,8 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
final String user = actionWithUser; final String user = actionWithUser;
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.action_edit_contact: case R.id.action_view_contact:
startActivity(ContactEditor.createIntent(this, account, user)); startActivity(ContactViewer.createIntent(this, account, user));
return true; return true;
case R.id.action_chat_list: case R.id.action_chat_list:
......
...@@ -63,17 +63,6 @@ public class ContextMenuHelper { ...@@ -63,17 +63,6 @@ public class ContextMenuHelper {
final String account = abstractContact.getAccount(); final String account = abstractContact.getAccount();
final String user = abstractContact.getUser(); final String user = abstractContact.getUser();
menu.setHeaderTitle(abstractContact.getName()); menu.setHeaderTitle(abstractContact.getName());
menu.add(R.string.chat_viewer).setOnMenuItemClickListener(
new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
MessageManager.getInstance().openChat(account, user);
activity.startActivity(ChatViewer.createIntent(
activity, account, user));
return true;
}
});
if (MUCManager.getInstance().hasRoom(account, user)) { if (MUCManager.getInstance().hasRoom(account, user)) {
if (!MUCManager.getInstance().inUse(account, user)) if (!MUCManager.getInstance().inUse(account, user))
menu.add(R.string.muc_edit).setIntent( menu.add(R.string.muc_edit).setIntent(
...@@ -121,10 +110,6 @@ public class ContextMenuHelper { ...@@ -121,10 +110,6 @@ public class ContextMenuHelper {
}); });
} else { } else {
menu.add(R.string.contact_viewer).setIntent(
ContactViewer.createIntent(activity, account, user));
menu.add(R.string.contact_editor).setIntent(
ContactEditor.createIntent(activity, account, user));
menu.add(R.string.contact_delete).setOnMenuItemClickListener( menu.add(R.string.contact_delete).setOnMenuItemClickListener(
new MenuItem.OnMenuItemClickListener() { new MenuItem.OnMenuItemClickListener() {
...@@ -290,7 +275,6 @@ public class ContextMenuHelper { ...@@ -290,7 +275,6 @@ public class ContextMenuHelper {
} }
return true; return true;
} }
}); });
menu.add(R.string.contact_add).setIntent( menu.add(R.string.contact_add).setIntent(
ContactAdd.createIntent(activity, account)); ContactAdd.createIntent(activity, account));
......
...@@ -17,12 +17,11 @@ ...@@ -17,12 +17,11 @@
android:visible="false" android:visible="false"
/> />
<item android:id="@+id/action_edit_contact" <item android:id="@+id/action_view_contact"
android:title="@string/contact_editor" android:title="@string/contact_viewer"
app:showAsAction="never" app:showAsAction="never"
android:orderInCategory="100" android:orderInCategory="100"
android:visible="false" android:visible="false"
android:icon="@drawable/ic_create_white_24dp"
/> />
<item android:id="@+id/action_chat_list" <item android:id="@+id/action_chat_list"
......
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