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

Same layout for account group, contact and active chat. New client icons.

parent 7a8b27e9
...@@ -111,6 +111,8 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -111,6 +111,8 @@ public abstract class AbstractChat extends BaseEntity {
protected Date creationTime = new Date(); protected Date creationTime = new Date();
private boolean isLastMessageIncoming;
protected AbstractChat(final String account, final String user) { protected AbstractChat(final String account, final String user) {
super(account, user); super(account, user);
threadId = StringUtils.randomString(12); threadId = StringUtils.randomString(12);
...@@ -341,8 +343,7 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -341,8 +343,7 @@ public abstract class AbstractChat extends BaseEntity {
* @param action * @param action
*/ */
public void newAction(String resource, String text, ChatAction action) { public void newAction(String resource, String text, ChatAction action) {
newMessage(resource, text, action, null, true, false, false, false, newMessage(resource, text, action, null, true, false, false, false, true);
true);
} }
/** /**
...@@ -451,10 +452,9 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -451,10 +452,9 @@ public abstract class AbstractChat extends BaseEntity {
for (int index = messages.size() - 1; index >= 0; index--) { for (int index = messages.size() - 1; index >= 0; index--) {
MessageItem messageItem = messages.get(index); MessageItem messageItem = messages.get(index);
if (messageItem.getAction() == null) { if (messageItem.getAction() == null) {
String lastMessage = messageItem.getText(); lastText = messageItem.getText();
lastText = messageItem.isIncoming() ? "< " + lastMessage : "> " + lastMessage;
lastTime = messageItem.getTimestamp(); lastTime = messageItem.getTimestamp();
isLastMessageIncoming = messageItem.isIncoming();
return; return;
} }
} }
...@@ -516,7 +516,7 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -516,7 +516,7 @@ public abstract class AbstractChat extends BaseEntity {
* @return Last incoming message's text. Empty string if last message is * @return Last incoming message's text. Empty string if last message is
* outgoing. * outgoing.
*/ */
protected String getLastText() { public String getLastText() {
return lastText; return lastText;
} }
...@@ -684,4 +684,8 @@ public abstract class AbstractChat extends BaseEntity { ...@@ -684,4 +684,8 @@ public abstract class AbstractChat extends BaseEntity {
public void updateCreationTime() { public void updateCreationTime() {
creationTime.setTime(System.currentTimeMillis()); creationTime.setTime(System.currentTimeMillis());
} }
public boolean isLastMessageIncoming() {
return isLastMessageIncoming;
}
} }
...@@ -2,15 +2,15 @@ package com.xabber.android.ui.adapter; ...@@ -2,15 +2,15 @@ package com.xabber.android.ui.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.xabber.android.data.SettingsManager; import com.xabber.android.data.SettingsManager;
import com.xabber.android.data.extension.capability.ClientSoftware; import com.xabber.android.data.extension.capability.ClientSoftware;
import com.xabber.android.data.extension.muc.MUCManager; import com.xabber.android.data.extension.muc.MUCManager;
import com.xabber.android.data.message.AbstractChat;
import com.xabber.android.data.message.MessageManager; import com.xabber.android.data.message.MessageManager;
import com.xabber.android.data.roster.AbstractContact; import com.xabber.android.data.roster.AbstractContact;
import com.xabber.android.ui.ContactEditor; import com.xabber.android.ui.ContactEditor;
...@@ -18,62 +18,48 @@ import com.xabber.android.ui.ContactViewer; ...@@ -18,62 +18,48 @@ import com.xabber.android.ui.ContactViewer;
import com.xabber.android.utils.StringUtils; import com.xabber.android.utils.StringUtils;
import com.xabber.androiddev.R; import com.xabber.androiddev.R;
import java.util.Date;
public class ContactItemInflater { public class ContactItemInflater {
static class ContactViewHolder {
final ImageView color;
final ImageView avatar;
final TextView name;
final TextView status;
final ImageView offlineShadow;
final ImageView statusMode;
final ImageView clientSoftware;
public ContactViewHolder(View view) {
color = (ImageView) view.findViewById(R.id.color);
avatar = (ImageView) view.findViewById(R.id.avatar);
name = (TextView) view.findViewById(R.id.name);
status = (TextView) view.findViewById(R.id.status);
offlineShadow = (ImageView) view.findViewById(R.id.offline_shadow);
statusMode = (ImageView) view.findViewById(R.id.status_icon);
clientSoftware = (ImageView) view.findViewById(R.id.client_software);
}
}
final Context context; final Context context;
private int[] accountMainColors; private int[] accountMainColors;
private final int elevation;
public ContactItemInflater(Context context) { public ContactItemInflater(Context context) {
this.context = context; this.context = context;
accountMainColors = context.getResources().getIntArray(R.array.account_action_bar); accountMainColors = context.getResources().getIntArray(R.array.account_action_bar);
elevation = context.getResources().getDimensionPixelSize(R.dimen.contact_elevation);
} }
public View setUpContactView(View convertView, ViewGroup parent, final AbstractContact abstractContact) { public View setUpContactView(View convertView, ViewGroup parent, final AbstractContact contact) {
final View view; final View view;
final ContactViewHolder viewHolder; final ContactListItemViewHolder viewHolder;
if (convertView == null) { if (convertView == null) {
view = LayoutInflater.from(context).inflate(R.layout.base_contact_item, parent, false); view = LayoutInflater.from(context).inflate(R.layout.contact_list_item, parent, false);
viewHolder = new ContactViewHolder(view); viewHolder = new ContactListItemViewHolder(view);
viewHolder.statusIconSeparator.setVisibility(View.INVISIBLE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
view.setElevation(elevation);
}
view.setTag(viewHolder); view.setTag(viewHolder);
} else { } else {
view = convertView; view = convertView;
viewHolder = (ContactViewHolder) view.getTag(); viewHolder = (ContactListItemViewHolder) view.getTag();
} }
if (abstractContact.isConnected()) { if (contact.isConnected()) {
viewHolder.offlineShadow.setVisibility(View.GONE); viewHolder.offlineShadow.setVisibility(View.GONE);
} else { } else {
viewHolder.offlineShadow.setVisibility(View.VISIBLE); viewHolder.offlineShadow.setVisibility(View.VISIBLE);
} }
int colorLevel = abstractContact.getColorLevel(); int colorLevel = contact.getColorLevel();
viewHolder.color.setImageDrawable(new ColorDrawable(accountMainColors[colorLevel])); viewHolder.color.setImageDrawable(new ColorDrawable(accountMainColors[colorLevel]));
viewHolder.color.setVisibility(View.VISIBLE);
if (SettingsManager.contactsShowAvatars()) { if (SettingsManager.contactsShowAvatars()) {
viewHolder.avatar.setVisibility(View.VISIBLE); viewHolder.avatar.setVisibility(View.VISIBLE);
viewHolder.avatar.setImageDrawable(abstractContact.getAvatarForContactList()); viewHolder.avatar.setImageDrawable(contact.getAvatarForContactList());
} else { } else {
viewHolder.avatar.setVisibility(View.GONE); viewHolder.avatar.setVisibility(View.GONE);
} }
...@@ -81,50 +67,54 @@ public class ContactItemInflater { ...@@ -81,50 +67,54 @@ public class ContactItemInflater {
viewHolder.avatar.setOnClickListener(new View.OnClickListener() { viewHolder.avatar.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
onAvatarClick(abstractContact); onAvatarClick(contact);
} }
}); });
viewHolder.name.setText(abstractContact.getName()); viewHolder.name.setText(contact.getName());
String statusText; String statusText;
if (MessageManager.getInstance() viewHolder.outgoingMessageIndicator.setVisibility(View.GONE);
.hasActiveChat(abstractContact.getAccount(), abstractContact.getUser())) {
String lastMessage = MessageManager.getInstance()
.getLastText(abstractContact.getAccount(), abstractContact.getUser());
Date lastTime = MessageManager.getInstance()
.getLastTime(abstractContact.getAccount(), abstractContact.getUser());
statusText = StringUtils.getSmartTimeText(context, lastTime) + " " + lastMessage;
} else { ClientSoftware clientSoftware = contact.getClientSoftware();
statusText = abstractContact.getStatusText();
}
statusText = statusText.trim(); MessageManager messageManager = MessageManager.getInstance();
if ("".equals(statusText)) { if (messageManager.hasActiveChat(contact.getAccount(), contact.getUser())) {
viewHolder.status.setVisibility(View.GONE);
} else {
viewHolder.status.setText(statusText);
viewHolder.status.setVisibility(View.VISIBLE);
}
viewHolder.statusMode.setImageLevel(abstractContact.getStatusMode().getStatusLevel()); AbstractChat chat = messageManager.getChat(contact.getAccount(), contact.getUser());
ClientSoftware clientSoftware = abstractContact.getClientSoftware(); statusText = chat.getLastText();
if (clientSoftware == ClientSoftware.unknown) {
viewHolder.clientSoftware.setVisibility(View.INVISIBLE); viewHolder.smallRightText.setText(StringUtils.getSmartTimeText(context, chat.getLastTime()));
} else { viewHolder.smallRightText.setVisibility(View.VISIBLE);
viewHolder.clientSoftware.setVisibility(View.VISIBLE);
viewHolder.clientSoftware.setImageLevel(clientSoftware.ordinal());
}
if (MessageManager.getInstance().hasActiveChat(abstractContact.getAccount(), abstractContact.getUser())) { if (!chat.isLastMessageIncoming()) {
viewHolder.outgoingMessageIndicator.setText(context.getString(R.string.sender_is_you) + ": ");
viewHolder.outgoingMessageIndicator.setVisibility(View.VISIBLE);
viewHolder.outgoingMessageIndicator.setTextColor(accountMainColors[colorLevel]);
}
view.setBackgroundColor(context.getResources().getColor(R.color.grey_50)); view.setBackgroundColor(context.getResources().getColor(R.color.grey_50));
viewHolder.smallRightIcon.setImageResource(R.drawable.ic_client_small);
viewHolder.smallRightIcon.setVisibility(View.VISIBLE);
viewHolder.smallRightIcon.setImageLevel(clientSoftware.ordinal());
viewHolder.largeClientIcon.setVisibility(View.GONE);
} else { } else {
statusText = contact.getStatusText().trim();
if (statusText.isEmpty()) {
statusText = context.getString(contact.getStatusMode().getStringID());
}
viewHolder.smallRightText.setVisibility(View.GONE);
view.setBackgroundColor(context.getResources().getColor(R.color.grey_300)); view.setBackgroundColor(context.getResources().getColor(R.color.grey_300));
viewHolder.smallRightIcon.setVisibility(View.GONE);
viewHolder.largeClientIcon.setVisibility(View.VISIBLE);
viewHolder.largeClientIcon.setImageLevel(clientSoftware.ordinal());
} }
viewHolder.secondLineMessage.setText(statusText.trim());
viewHolder.statusIcon.setImageLevel(contact.getStatusMode().getStatusLevel());
return view; return view;
} }
......
package com.xabber.android.ui.adapter;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.xabber.androiddev.R;
class ContactListItemViewHolder {
final ImageView color;
final ImageView avatar;
final TextView name;
final TextView outgoingMessageIndicator;
final TextView secondLineMessage;
final TextView smallRightText;
final ImageView smallRightIcon;
final ImageView largeClientIcon;
final View statusIconSeparator;
final ImageView statusIcon;
final ImageView offlineShadow;
public ContactListItemViewHolder(View view) {
color = (ImageView) view.findViewById(R.id.account_color_indicator);
avatar = (ImageView) view.findViewById(R.id.avatar);
name = (TextView) view.findViewById(R.id.contact_list_item_name);
outgoingMessageIndicator = (TextView) view.findViewById(R.id.outgoing_message_indicator);
secondLineMessage = (TextView) view.findViewById(R.id.second_line_message);
smallRightIcon = (ImageView) view.findViewById(R.id.small_right_icon);
smallRightText = (TextView) view.findViewById(R.id.small_right_text);
largeClientIcon = (ImageView) view.findViewById(R.id.client_icon_large);
statusIconSeparator = view.findViewById(R.id.status_icon_separator);
statusIcon = (ImageView) view.findViewById(R.id.contact_list_item_status_icon);
offlineShadow = (ImageView) view.findViewById(R.id.offline_shadow);
}
}
...@@ -18,6 +18,7 @@ import android.app.Activity; ...@@ -18,6 +18,7 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -31,14 +32,10 @@ import com.xabber.android.data.account.AccountManager; ...@@ -31,14 +32,10 @@ import com.xabber.android.data.account.AccountManager;
import com.xabber.android.data.account.StatusMode; import com.xabber.android.data.account.StatusMode;
import com.xabber.android.data.entity.BaseEntity; import com.xabber.android.data.entity.BaseEntity;
import com.xabber.android.data.extension.avatar.AvatarManager; import com.xabber.android.data.extension.avatar.AvatarManager;
import com.xabber.android.data.extension.capability.ClientSoftware;
import com.xabber.android.data.extension.muc.MUCManager;
import com.xabber.android.data.message.MessageManager;
import com.xabber.android.data.roster.AbstractContact; import com.xabber.android.data.roster.AbstractContact;
import com.xabber.android.data.roster.Group; import com.xabber.android.data.roster.Group;
import com.xabber.android.data.roster.GroupManager; import com.xabber.android.data.roster.GroupManager;
import com.xabber.android.data.roster.ShowOfflineMode; import com.xabber.android.data.roster.ShowOfflineMode;
import com.xabber.android.ui.ContactEditor;
import com.xabber.android.ui.ContactViewer; import com.xabber.android.ui.ContactViewer;
import com.xabber.androiddev.R; import com.xabber.androiddev.R;
...@@ -102,6 +99,7 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat ...@@ -102,6 +99,7 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
final ArrayList<BaseEntity> baseEntities = new ArrayList<>(); final ArrayList<BaseEntity> baseEntities = new ArrayList<>();
protected Locale locale = Locale.getDefault(); protected Locale locale = Locale.getDefault();
private final ContactItemInflater contactItemInflater; private final ContactItemInflater contactItemInflater;
private final int accountElevation;
public GroupedContactAdapter(Activity activity, OnClickListener onClickListener) { public GroupedContactAdapter(Activity activity, OnClickListener onClickListener) {
this.activity = activity; this.activity = activity;
...@@ -117,6 +115,8 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat ...@@ -117,6 +115,8 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
contactItemInflater = new ContactItemInflater(activity); contactItemInflater = new ContactItemInflater(activity);
accountElevation = activity.getResources().getDimensionPixelSize(R.dimen.account_group_elevation);
this.onClickListener = onClickListener; this.onClickListener = onClickListener;
} }
...@@ -226,15 +226,22 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat ...@@ -226,15 +226,22 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
private View getAccountView(int position, View convertView, ViewGroup parent) { private View getAccountView(int position, View convertView, ViewGroup parent) {
final View view; final View view;
final AccountViewHolder viewHolder; final ContactListItemViewHolder viewHolder;
if (convertView == null) { if (convertView == null) {
view = layoutInflater.inflate(R.layout.account_group_item, parent, false); view = layoutInflater.inflate(R.layout.contact_list_item, parent, false);
viewHolder = new ContactListItemViewHolder(view);
viewHolder.outgoingMessageIndicator.setVisibility(View.GONE);
viewHolder.color.setVisibility(View.INVISIBLE);
viewHolder.largeClientIcon.setVisibility(View.GONE);
viewHolder = new AccountViewHolder(view); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
view.setElevation(accountElevation);
}
view.setTag(viewHolder); view.setTag(viewHolder);
} else { } else {
view = convertView; view = convertView;
viewHolder = (AccountViewHolder) view.getTag(); viewHolder = (ContactListItemViewHolder) view.getTag();
} }
final AccountConfiguration configuration = (AccountConfiguration) getItem(position); final AccountConfiguration configuration = (AccountConfiguration) getItem(position);
...@@ -251,8 +258,8 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat ...@@ -251,8 +258,8 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
final int level = AccountManager.getInstance().getColorLevel(account); final int level = AccountManager.getInstance().getColorLevel(account);
view.setBackgroundDrawable(new ColorDrawable(accountGroupColors[level])); view.setBackgroundDrawable(new ColorDrawable(accountGroupColors[level]));
viewHolder.jid.setText(GroupManager.getInstance().getGroupName(account, configuration.getUser())); viewHolder.name.setText(GroupManager.getInstance().getGroupName(account, configuration.getUser()));
viewHolder.contactCounter.setText(configuration.getOnline() + "/" + configuration.getTotal()); viewHolder.smallRightText.setText(configuration.getOnline() + "/" + configuration.getTotal());
AccountItem accountItem = AccountManager.getInstance().getAccount(account); AccountItem accountItem = AccountManager.getInstance().getAccount(account);
String statusText = accountItem.getStatusText().trim(); String statusText = accountItem.getStatusText().trim();
...@@ -261,7 +268,7 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat ...@@ -261,7 +268,7 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
statusText = activity.getString(accountItem.getDisplayStatusMode().getStringID()); statusText = activity.getString(accountItem.getDisplayStatusMode().getStringID());
} }
viewHolder.status.setText(statusText); viewHolder.secondLineMessage.setText(statusText);
if (SettingsManager.contactsShowAvatars()) { if (SettingsManager.contactsShowAvatars()) {
viewHolder.avatar.setVisibility(View.VISIBLE); viewHolder.avatar.setVisibility(View.VISIBLE);
...@@ -288,7 +295,8 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat ...@@ -288,7 +295,8 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
} }
} }
viewHolder.offlineContactsIndicator.setImageLevel(showOfflineMode.ordinal()); viewHolder.smallRightIcon.setImageLevel(showOfflineMode.ordinal());
StatusMode statusMode = AccountManager.getInstance().getAccount(configuration.getAccount()).getDisplayStatusMode(); StatusMode statusMode = AccountManager.getInstance().getAccount(configuration.getAccount()).getDisplayStatusMode();
...@@ -563,29 +571,6 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat ...@@ -563,29 +571,6 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
} }
} }
private static class AccountViewHolder {
final TextView jid;
final TextView status;
final TextView contactCounter;
final ImageView statusIcon;
final ImageView avatar;
final ImageView offlineContactsIndicator;
final ImageView offlineShadow;
public AccountViewHolder(View view) {
jid = (TextView) view.findViewById(R.id.account_jid);
status = (TextView) view.findViewById(R.id.account_status);
contactCounter = (TextView) view.findViewById(R.id.contact_counter);
statusIcon = (ImageView) view.findViewById(R.id.account_status_icon);
avatar = (ImageView) view.findViewById(R.id.avatar);
offlineContactsIndicator = (ImageView) view.findViewById(R.id.offline_contacts_indicator);
offlineShadow = (ImageView) view.findViewById(R.id.offline_shadow);
}
}
public interface OnClickListener { public interface OnClickListener {
void onAccountMenuClick(View view, String account); void onAccountMenuClick(View view, String account);
} }
......
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
along with this program. If not, see http://www.gnu.org/licenses/. along with this program. If not, see http://www.gnu.org/licenses/.
--> -->
<level-list xmlns:android="http://schemas.android.com/apk/res/android"> <level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_client_adium" android:minLevel="0" android:maxLevel="0" /> <item android:drawable="@drawable/ic_client_adium_18dp" android:minLevel="0" android:maxLevel="0" />
<item android:drawable="@drawable/ic_client_empathy" android:minLevel="1" android:maxLevel="1" /> <item android:drawable="@drawable/ic_client_empathy_18dp" android:minLevel="1" android:maxLevel="1" />
<item android:drawable="@drawable/ic_client_gajim" android:minLevel="2" android:maxLevel="2" /> <item android:drawable="@drawable/ic_client_gajim_18dp" android:minLevel="2" android:maxLevel="2" />
<item android:drawable="@drawable/ic_client_gtalk" android:minLevel="3" android:maxLevel="3" /> <item android:drawable="@drawable/ic_client_gtalk_18dp" android:minLevel="3" android:maxLevel="3" />
<item android:drawable="@drawable/ic_client_ichat" android:minLevel="4" android:maxLevel="4" /> <item android:drawable="@drawable/ic_client_ichat_18dp" android:minLevel="4" android:maxLevel="4" />
<item android:drawable="@drawable/ic_client_miranda" android:minLevel="5" android:maxLevel="5" /> <item android:drawable="@drawable/ic_client_miranda_18dp" android:minLevel="5" android:maxLevel="5" />
<item android:drawable="@drawable/ic_client_pidgin" android:minLevel="6" android:maxLevel="6" /> <item android:drawable="@drawable/ic_client_pidgin_18dp" android:minLevel="6" android:maxLevel="6" />
<item android:drawable="@drawable/ic_client_psi" android:minLevel="7" android:maxLevel="7" /> <item android:drawable="@drawable/ic_client_psi_18dp" android:minLevel="7" android:maxLevel="7" />
<item android:drawable="@drawable/ic_client_qip" android:minLevel="8" android:maxLevel="8" /> <item android:drawable="@drawable/ic_client_qip_18dp" android:minLevel="8" android:maxLevel="8" />
<item android:drawable="@drawable/ic_client_vip" android:minLevel="9" android:maxLevel="9" /> <item android:drawable="@drawable/ic_client_vip_18dp" android:minLevel="9" android:maxLevel="9" />
<item android:drawable="@drawable/ic_client_xabber" android:minLevel="10" android:maxLevel="10" /> <item android:drawable="@drawable/ic_client_xabber_18dp" android:minLevel="10" android:maxLevel="10" />
</level-list> </level-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.
This file is part of Xabber project; you can redistribute it and/or
modify it under the terms of the GNU General Public License, Version 3.
Xabber is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_client_adium_10dp" android:minLevel="0" android:maxLevel="0" />
<item android:drawable="@drawable/ic_client_empathy_10dp" android:minLevel="1" android:maxLevel="1" />
<item android:drawable="@drawable/ic_client_gajim_10dp" android:minLevel="2" android:maxLevel="2" />
<item android:drawable="@drawable/ic_client_gtalk_10dp" android:minLevel="3" android:maxLevel="3" />
<item android:drawable="@drawable/ic_client_ichat_10dp" android:minLevel="4" android:maxLevel="4" />
<item android:drawable="@drawable/ic_client_miranda_10dp" android:minLevel="5" android:maxLevel="5" />
<item android:drawable="@drawable/ic_client_pidgin_10dp" android:minLevel="6" android:maxLevel="6" />
<item android:drawable="@drawable/ic_client_psi_10dp" android:minLevel="7" android:maxLevel="7" />
<item android:drawable="@drawable/ic_client_qip_10dp" android:minLevel="8" android:maxLevel="8" />
<item android:drawable="@drawable/ic_client_vip_10dp" android:minLevel="9" android:maxLevel="9" />
<item android:drawable="@drawable/ic_client_xabber_10dp" android:minLevel="10" android:maxLevel="10" />
</level-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2013, Redsolution LTD. All rights reserved.
This file is part of Xabber project; you can redistribute it and/or
modify it under the terms of the GNU General Public License, Version 3.
Xabber is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License,
along with this program. If not, see http://www.gnu.org/licenses/.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/contact_list_item_height"
android:elevation="1dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingRight="@dimen/active_chat_padding_right"
>
<ImageView
android:id="@+id/color"
android:layout_width="4dp"
android:layout_height="@dimen/avatar_size_toolbar"
android:layout_marginLeft="2dp"
android:layout_marginStart="2dp"
android:layout_marginRight="2dp"
android:layout_marginEnd="2dp"
android:src="@color/green_500"
/>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/avatar"
android:layout_width="@dimen/avatar_size_toolbar"
android:layout_height="@dimen/avatar_size_toolbar"
android:layout_toRightOf="@id/color"
android:src="@drawable/ic_avatar_1"
/>
<RelativeLayout
android:id="@+id/panel"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingLeft="@dimen/active_chat_padding_left"
>
<ImageView
android:id="@+id/client_software"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:paddingRight="16dp"
android:paddingEnd="16dp"
android:src="@drawable/ic_client"
android:alpha="0.05"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical"
>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:singleLine="true"
android:ellipsize="marquee"
android:text="name"
android:textColor="?android:attr/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold"
/>
<TextView
android:id="@+id/status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:singleLine="true"
android:ellipsize="marquee"
android:text="status"
android:visibility="visible"
android:textColor="?android:attr/textColorSecondary"
/>
</LinearLayout>
</RelativeLayout>
<ImageView
android:id="@+id/status_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_status"
/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/grey_400"
android:layout_alignParentBottom="true"
/>
<include layout="@layout/offline_shadow" />
</RelativeLayout>
\ No newline at end of file
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/contact_list_item_height" android:layout_height="@dimen/contact_list_item_height"
android:background="@color/green_200" android:elevation="1dp"
android:elevation="2.5dp"
> >
<LinearLayout <LinearLayout
...@@ -39,8 +38,6 @@ ...@@ -39,8 +38,6 @@
android:layout_marginRight="2dp" android:layout_marginRight="2dp"
android:layout_marginEnd="2dp" android:layout_marginEnd="2dp"
android:src="@color/red_500" android:src="@color/red_500"
android:visibility="invisible"
/> />
<ImageView <ImageView
...@@ -60,12 +57,12 @@ ...@@ -60,12 +57,12 @@
android:paddingLeft="@dimen/active_chat_padding_left" android:paddingLeft="@dimen/active_chat_padding_left"
> >
<TextView <TextView
android:id="@+id/account_jid" android:id="@+id/contact_list_item_name"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:text="name@example.com" android:text="Contact list item name"
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" android:textStyle="bold"
...@@ -79,22 +76,33 @@ ...@@ -79,22 +76,33 @@
> >
<TextView <TextView
android:id="@+id/account_status" android:id="@+id/outgoing_message_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:text="@string/sender_is_you"
android:visibility="visible"
android:textColor="@color/green_500"
/>
<TextView
android:id="@+id/second_line_message"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:text="Online" android:text="second line message long text"
/> />
<FrameLayout <FrameLayout
android:layout_width="14dp" android:layout_width="wrap_content"
android:layout_height="14dp" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
> >
<ImageView <ImageView
android:id="@+id/offline_contacts_indicator" android:id="@+id/small_right_icon"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:src="@drawable/ic_show_offline" android:src="@drawable/ic_show_offline"
...@@ -103,15 +111,15 @@ ...@@ -103,15 +111,15 @@
</FrameLayout> </FrameLayout>
<TextView <TextView
android:id="@+id/contact_counter" android:id="@+id/small_right_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:singleLine="true" android:singleLine="true"
android:ellipsize="marquee" android:ellipsize="marquee"
android:textColor="#32000000" android:textColor="#32000000"
android:textSize="12sp" android:textSize="12sp"
android:text="3/9" android:text="right text"
android:paddingLeft="4dp" android:paddingLeft="2dp"
android:paddingRight="6dp" android:paddingRight="6dp"
/> />
...@@ -125,10 +133,12 @@ ...@@ -125,10 +133,12 @@
android:background="@color/black" android:background="@color/black"
android:alpha="0.1" android:alpha="0.1"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:id="@+id/status_icon_separator"
/> />
<ImageView <ImageView
android:id="@+id/account_status_icon" android:id="@+id/contact_list_item_status_icon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/ic_status" android:src="@drawable/ic_status"
...@@ -144,6 +154,19 @@ ...@@ -144,6 +154,19 @@
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
/> />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:src="@drawable/ic_client_large"
android:alpha="0.05"
android:paddingRight="56dp"
android:paddingBottom="4dp"
android:id="@+id/client_icon_large"
/>
<include layout="@layout/offline_shadow" /> <include layout="@layout/offline_shadow" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:id="@android:id/list" android:id="@android:id/list"
android:layout_marginTop="20dp" android:layout_marginTop="24dp"
android:divider="@null" android:divider="@null"
android:dividerHeight="0dp" android:dividerHeight="0dp"
/> />
......
...@@ -112,4 +112,6 @@ ...@@ -112,4 +112,6 @@
<string name="start_at_boot_suggest">Вы хотите запускать Xabber при включении телефона?\nИзменить эту настройку можно в меню "Настройки" → "Настройки подключения" → "Запускать при включении телефона"</string> <string name="start_at_boot_suggest">Вы хотите запускать Xabber при включении телефона?\nИзменить эту настройку можно в меню "Настройки" → "Настройки подключения" → "Запускать при включении телефона"</string>
<string name="contact_search_hint">Поиск контактов</string> <string name="contact_search_hint">Поиск контактов</string>
<string name="sender_is_you">Вы</string>
</resources> </resources>
\ No newline at end of file
...@@ -112,4 +112,6 @@ ...@@ -112,4 +112,6 @@
<string name="start_at_boot_suggest">Do you want to run Xabber at startup?\nThis can be changed in "Settings" → "Connection settings" → "Run at boot"</string> <string name="start_at_boot_suggest">Do you want to run Xabber at startup?\nThis can be changed in "Settings" → "Connection settings" → "Run at boot"</string>
<string name="contact_search_hint">Search contacts</string> <string name="contact_search_hint">Search contacts</string>
<string name="sender_is_you">You</string>
</resources> </resources>
\ No newline at end of file
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
<dimen name="avatar_normal_size">48dp</dimen> <dimen name="avatar_normal_size">48dp</dimen>
<dimen name="avatar_radius">56dp</dimen> <dimen name="avatar_radius">56dp</dimen>
<dimen name="account_group_elevation">2dp</dimen> <dimen name="account_group_elevation">2.5dp</dimen>
<dimen name="account_subgroup_elevation">1dp</dimen> <dimen name="contact_elevation">1dp</dimen>
</resources> </resources>
\ No newline at end of file
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