Commit 42dca0e7 authored by Grigory Fedorov's avatar Grigory Fedorov

ChatViewer: action bar customized.

Several xml drawable removed, color arrays used.
parent ff216cbb
...@@ -16,11 +16,18 @@ package com.xabber.android.ui; ...@@ -16,11 +16,18 @@ package com.xabber.android.ui;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import com.xabber.android.data.ActivityManager; import com.xabber.android.data.ActivityManager;
import com.xabber.android.data.Application; import com.xabber.android.data.Application;
import com.xabber.android.data.account.AccountManager;
import com.xabber.android.data.account.OnAccountChangedListener; import com.xabber.android.data.account.OnAccountChangedListener;
import com.xabber.android.data.entity.BaseEntity; import com.xabber.android.data.entity.BaseEntity;
import com.xabber.android.data.extension.archive.MessageArchiveManager; import com.xabber.android.data.extension.archive.MessageArchiveManager;
...@@ -34,6 +41,7 @@ import com.xabber.android.data.roster.AbstractContact; ...@@ -34,6 +41,7 @@ import com.xabber.android.data.roster.AbstractContact;
import com.xabber.android.data.roster.OnContactChangedListener; import com.xabber.android.data.roster.OnContactChangedListener;
import com.xabber.android.data.roster.RosterManager; import com.xabber.android.data.roster.RosterManager;
import com.xabber.android.ui.adapter.ChatViewerAdapter; import com.xabber.android.ui.adapter.ChatViewerAdapter;
import com.xabber.android.ui.helper.ContactTitleInflater;
import com.xabber.android.ui.helper.ManagedActivity; import com.xabber.android.ui.helper.ManagedActivity;
import com.xabber.androiddev.R; import com.xabber.androiddev.R;
...@@ -67,12 +75,17 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -67,12 +75,17 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
ChatViewerAdapter chatViewerAdapter; ChatViewerAdapter chatViewerAdapter;
ViewPager viewPager; ViewPager viewPager;
private View actionBarView;
Collection<ChatViewerFragment> registeredChats = new HashSet<>(); Collection<ChatViewerFragment> registeredChats = new HashSet<>();
Collection<RecentChatFragment> recentChatFragments = new HashSet<>(); Collection<RecentChatFragment> recentChatFragments = new HashSet<>();
private String actionWithAccount = null; private String actionWithAccount = null;
private String actionWithUser = null; private String actionWithUser = null;
private int[] accountActionBarColors;
private int[] accountStatusBarColors;
private Window window;
private int defaultStatusBarColor;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -98,7 +111,30 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -98,7 +111,30 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
exitOnSend = savedInstanceState.getBoolean(SAVED_EXIT_ON_SEND); exitOnSend = savedInstanceState.getBoolean(SAVED_EXIT_ON_SEND);
} }
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
defaultStatusBarColor = window.getStatusBarColor();
accountActionBarColors = getResources().getIntArray(R.array.account_action_bar);
accountStatusBarColors = getResources().getIntArray(R.array.account_status_bar);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowCustomEnabled(true);
actionBarView = LayoutInflater.from(this).inflate(R.layout.chat_viewer_action_bar, null);
actionBar.setCustomView(actionBarView, new ActionBar.LayoutParams(
ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.MATCH_PARENT));
setContentView(R.layout.activity_chat_viewer); setContentView(R.layout.activity_chat_viewer);
...@@ -132,6 +168,10 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -132,6 +168,10 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
exitOnSend = true; exitOnSend = true;
} }
} }
if (actionWithAccount != null && actionWithUser != null) {
updateActionBar(actionWithAccount, actionWithUser);
}
} }
@Override @Override
...@@ -267,6 +307,11 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -267,6 +307,11 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
} }
} }
if (actionWithAccount != null && actionWithAccount.equals(account)
&& actionWithUser != null && actionWithUser.equals(user)) {
updateActionBar(account, user);
}
} }
...@@ -274,12 +319,20 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -274,12 +319,20 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
public void onContactsChanged(Collection<BaseEntity> entities) { public void onContactsChanged(Collection<BaseEntity> entities) {
updateRegisteredChats(); updateRegisteredChats();
updateRegisteredRecentChatsFragments(); updateRegisteredRecentChatsFragments();
if (actionWithAccount != null && actionWithUser != null) {
updateActionBar(actionWithAccount, actionWithUser);
}
} }
@Override @Override
public void onAccountsChanged(Collection<String> accounts) { public void onAccountsChanged(Collection<String> accounts) {
updateRegisteredChats(); updateRegisteredChats();
updateRegisteredRecentChatsFragments(); updateRegisteredRecentChatsFragments();
if (actionWithAccount != null && actionWithUser != null) {
updateActionBar(actionWithAccount, actionWithUser);
}
} }
void onSent() { void onSent() {
...@@ -308,6 +361,10 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -308,6 +361,10 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
AbstractChat selectedChat = chatViewerAdapter.getChatByPageNumber(position); AbstractChat selectedChat = chatViewerAdapter.getChatByPageNumber(position);
if (selectedChat == null) { if (selectedChat == null) {
window.setStatusBarColor(defaultStatusBarColor);
getSupportActionBar().setBackgroundDrawable(null);
getSupportActionBar().setDisplayShowTitleEnabled(true);
actionBarView.setVisibility(View.GONE);
setTitle(getString(R.string.chat_list)); setTitle(getString(R.string.chat_list));
MessageManager.getInstance().removeVisibleChat(); MessageManager.getInstance().removeVisibleChat();
return; return;
...@@ -316,9 +373,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -316,9 +373,7 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
String account = selectedChat.getAccount(); String account = selectedChat.getAccount();
String user = selectedChat.getUser(); String user = selectedChat.getUser();
final AbstractContact abstractContact = RosterManager.getInstance().getBestContact(account, user); updateActionBar(account, user);
setTitle(abstractContact.getName());
MessageManager.getInstance().setVisibleChat(account, user); MessageManager.getInstance().setVisibleChat(account, user);
...@@ -332,6 +387,18 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener ...@@ -332,6 +387,18 @@ public class ChatViewer extends ManagedActivity implements OnChatChangedListener
actionWithUser = user; actionWithUser = user;
} }
private void updateActionBar(String account, String user) {
actionBarView.setVisibility(View.VISIBLE);
getSupportActionBar().setDisplayShowTitleEnabled(false);
final AbstractContact abstractContact = RosterManager.getInstance().getBestContact(account, user);
ContactTitleInflater.updateTitle(actionBarView, this, abstractContact);
int colorLevel = AccountManager.getInstance().getColorLevel(abstractContact.getAccount());
window.setStatusBarColor(accountStatusBarColors[colorLevel]);
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(accountActionBarColors[colorLevel]));
}
private void updateRegisteredChats() { private void updateRegisteredChats() {
for (ChatViewerFragment chat : registeredChats) { for (ChatViewerFragment chat : registeredChats) {
chat.updateChat(false); chat.updateChat(false);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
package com.xabber.android.ui.adapter; package com.xabber.android.ui.adapter;
import android.app.Activity; import android.app.Activity;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
...@@ -52,6 +53,7 @@ public class AccountToggleAdapter implements UpdatableAdapter { ...@@ -52,6 +53,7 @@ public class AccountToggleAdapter implements UpdatableAdapter {
* List of accounts. * List of accounts.
*/ */
private final ArrayList<String> accounts; private final ArrayList<String> accounts;
private int[] accountActionBarColors;
public AccountToggleAdapter(Activity activity, public AccountToggleAdapter(Activity activity,
OnClickListener onClickListener, LinearLayout linearLayout) { OnClickListener onClickListener, LinearLayout linearLayout) {
...@@ -72,6 +74,9 @@ public class AccountToggleAdapter implements UpdatableAdapter { ...@@ -72,6 +74,9 @@ public class AccountToggleAdapter implements UpdatableAdapter {
accounts.addAll(AccountManager.getInstance().getAccounts()); accounts.addAll(AccountManager.getInstance().getAccounts());
Collections.sort(accounts); Collections.sort(accounts);
final int size = accounts.size(); final int size = accounts.size();
accountActionBarColors = activity.getResources().getIntArray(R.array.account_action_bar);
final LayoutInflater inflater = (LayoutInflater) activity final LayoutInflater inflater = (LayoutInflater) activity
.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
while (linearLayout.getChildCount() < size) { while (linearLayout.getChildCount() < size) {
...@@ -97,7 +102,7 @@ public class AccountToggleAdapter implements UpdatableAdapter { ...@@ -97,7 +102,7 @@ public class AccountToggleAdapter implements UpdatableAdapter {
final String account = accounts.get(index); final String account = accounts.get(index);
StatusMode statusMode = AccountManager.getInstance().getAccount(account).getDisplayStatusMode(); StatusMode statusMode = AccountManager.getInstance().getAccount(account).getDisplayStatusMode();
int colorLevel = AccountManager.getInstance().getColorLevel(account); int colorLevel = AccountManager.getInstance().getColorLevel(account);
view.getBackground().setLevel(colorLevel); view.setBackgroundDrawable(new ColorDrawable(accountActionBarColors[colorLevel]));
if (selected == null || account.equals(selected)) { if (selected == null || account.equals(selected)) {
accountViewHolder.disabled.setVisibility(View.GONE); accountViewHolder.disabled.setVisibility(View.GONE);
} else { } else {
......
...@@ -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.ColorStateList; import android.content.res.ColorStateList;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -92,11 +93,16 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater ...@@ -92,11 +93,16 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
*/ */
private final LayoutInflater layoutInflater; private final LayoutInflater layoutInflater;
private int[] accountActionBarColors;
public GroupedContactAdapter(Activity activity, ListView listView, public GroupedContactAdapter(Activity activity, ListView listView,
Inflater inflater, StateProvider groupStateProvider) { Inflater inflater, StateProvider groupStateProvider) {
super(activity, listView, inflater); super(activity, listView, inflater);
layoutInflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); layoutInflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.groupStateProvider = groupStateProvider; this.groupStateProvider = groupStateProvider;
accountActionBarColors = activity.getResources().getIntArray(R.array.account_action_bar);
TypedArray typedArray; TypedArray typedArray;
typedArray = activity.getTheme().obtainStyledAttributes(R.styleable.ContactList); typedArray = activity.getTheme().obtainStyledAttributes(R.styleable.ContactList);
expanderAccountTextColor = typedArray.getColorStateList(R.styleable.ContactList_expanderAccountColor); expanderAccountTextColor = typedArray.getColorStateList(R.styleable.ContactList_expanderAccountColor);
...@@ -148,11 +154,13 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater ...@@ -148,11 +154,13 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
if (configuration instanceof AccountConfiguration) { if (configuration instanceof AccountConfiguration) {
level = AccountManager.getInstance().getColorLevel(configuration.getAccount()); level = AccountManager.getInstance().getColorLevel(configuration.getAccount());
viewHolder.name.setTextColor(expanderAccountTextColor); viewHolder.name.setTextColor(expanderAccountTextColor);
view.setBackgroundDrawable(new ColorDrawable(accountActionBarColors[level]));
} else { } else {
level = AccountManager.getInstance().getColorCount(); view.setBackgroundDrawable(
new ColorDrawable(activity.getResources().getColor(R.color.group_expander)));
viewHolder.name.setTextColor(expanderGroupTextColor); viewHolder.name.setTextColor(expanderGroupTextColor);
} }
view.getBackground().setLevel(level);
viewHolder.name.getBackground().setLevel(configuration.getShowOfflineMode().ordinal()); viewHolder.name.getBackground().setLevel(configuration.getShowOfflineMode().ordinal());
final String name = GroupManager.getInstance().getGroupName( final String name = GroupManager.getInstance().getGroupName(
configuration.getAccount(), configuration.getUser()); configuration.getAccount(), configuration.getUser());
......
...@@ -15,12 +15,11 @@ ...@@ -15,12 +15,11 @@
package com.xabber.android.ui.helper; package com.xabber.android.ui.helper;
import android.app.Activity; import android.app.Activity;
import android.content.res.TypedArray;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Shader.TileMode; import android.graphics.Shader.TileMode;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.ColorDrawable;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
...@@ -50,23 +49,18 @@ public class ContactTitleInflater { ...@@ -50,23 +49,18 @@ public class ContactTitleInflater {
*/ */
public static void updateTitle(View titleView, final Activity activity, public static void updateTitle(View titleView, final Activity activity,
AbstractContact abstractContact) { AbstractContact abstractContact) {
final TypedArray typedArray = activity.obtainStyledAttributes(R.styleable.ContactList);
final Drawable titleAccountBackground = typedArray
.getDrawable(R.styleable.ContactList_titleAccountBackground);
typedArray.recycle();
final TextView nameView = (TextView) titleView.findViewById(R.id.name); final TextView nameView = (TextView) titleView.findViewById(R.id.name);
final ImageView avatarView = (ImageView) titleView.findViewById(R.id.avatar); final ImageView avatarView = (ImageView) titleView.findViewById(R.id.avatar);
final ImageView statusModeView = (ImageView) titleView.findViewById(R.id.status_mode); final ImageView statusModeView = (ImageView) titleView.findViewById(R.id.status_mode);
final TextView statusTextView = (TextView) titleView.findViewById(R.id.status_text); final TextView statusTextView = (TextView) titleView.findViewById(R.id.status_text);
final View shadowView = titleView.findViewById(R.id.shadow); final View shadowView = titleView.findViewById(R.id.shadow);
titleView.setBackgroundDrawable(titleAccountBackground); int[] accountActionBarColors = activity.getResources().getIntArray(R.array.account_action_bar);
titleView.setBackgroundDrawable(new ColorDrawable(accountActionBarColors[
AccountManager.getInstance().getColorLevel(abstractContact.getAccount())]));
nameView.setText(abstractContact.getName()); nameView.setText(abstractContact.getName());
statusModeView.setImageLevel(abstractContact.getStatusMode().getStatusLevel()); statusModeView.setImageLevel(abstractContact.getStatusMode().getStatusLevel());
titleView.getBackground().setLevel(AccountManager.getInstance().getColorLevel(
abstractContact.getAccount()));
avatarView.setImageDrawable(abstractContact.getAvatar()); avatarView.setImageDrawable(abstractContact.getAvatar());
setStatusText(activity, abstractContact, statusTextView); setStatusText(activity, abstractContact, statusTextView);
......
<?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="@color/account_1"
android:minLevel="0"
android:maxLevel="0" />
<item
android:drawable="@color/account_2"
android:minLevel="1"
android:maxLevel="1" />
<item
android:drawable="@color/account_3"
android:minLevel="2"
android:maxLevel="2" />
<item
android:drawable="@color/account_4"
android:minLevel="3"
android:maxLevel="3" />
</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="@color/account_1"
android:minLevel="0"
android:maxLevel="0" />
<item
android:drawable="@color/account_2"
android:minLevel="1"
android:maxLevel="1" />
<item
android:drawable="@color/account_3"
android:minLevel="2"
android:maxLevel="2" />
<item
android:drawable="@color/account_4"
android:minLevel="3"
android:maxLevel="3" />
</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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_1" />
</selector>
<?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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_1" />
</selector>
<?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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_2" />
</selector>
<?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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_2" />
</selector>
<?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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_3" />
</selector>
<?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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_3" />
</selector>
<?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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_4" />
</selector>
<?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/.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/account_4" />
</selector>
<?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/expander_account_1_dark"
android:minLevel="0"
android:maxLevel="0" />
<item
android:drawable="@drawable/expander_account_2_dark"
android:minLevel="1"
android:maxLevel="1" />
<item
android:drawable="@drawable/expander_account_3_dark"
android:minLevel="2"
android:maxLevel="2" />
<item
android:drawable="@drawable/expander_account_4_dark"
android:minLevel="3"
android:maxLevel="3" />
<item
android:drawable="@drawable/expander_group_dark"
android:minLevel="4"
android:maxLevel="4" />
</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/expander_account_1_light"
android:minLevel="0"
android:maxLevel="0" />
<item
android:drawable="@drawable/expander_account_2_light"
android:minLevel="1"
android:maxLevel="1" />
<item
android:drawable="@drawable/expander_account_3_light"
android:minLevel="2"
android:maxLevel="2" />
<item
android:drawable="@drawable/expander_account_4_light"
android:minLevel="3"
android:maxLevel="3" />
<item
android:drawable="@drawable/expander_group_light"
android:minLevel="4"
android:maxLevel="4" />
</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="@color/account_1"
android:minLevel="0"
android:maxLevel="0" />
<item
android:drawable="@color/account_2"
android:minLevel="1"
android:maxLevel="1" />
<item
android:drawable="@color/account_3"
android:minLevel="2"
android:maxLevel="2" />
<item
android:drawable="@color/account_4"
android:minLevel="3"
android:maxLevel="3" />
</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="@color/account_1"
android:minLevel="0"
android:maxLevel="0" />
<item
android:drawable="@color/account_2"
android:minLevel="1"
android:maxLevel="1" />
<item
android:drawable="@color/account_3"
android:minLevel="2"
android:maxLevel="2" />
<item
android:drawable="@color/account_4"
android:minLevel="3"
android:maxLevel="3" />
</level-list>
\ No newline at end of file
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
android:layout_marginRight="3dp" android:layout_marginRight="3dp"
android:layout_marginEnd="3dp" android:layout_marginEnd="3dp"
android:src="@drawable/account_color"
/> />
<ImageView <ImageView
android:id="@+id/avatar" android:id="@+id/avatar"
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/account_background"
> >
<ImageView <ImageView
android:id="@+id/avatar" android:id="@+id/avatar"
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
android:layout_marginRight="3dp" android:layout_marginRight="3dp"
android:layout_marginEnd="3dp" android:layout_marginEnd="3dp"
android:src="@drawable/account_color"
/> />
<include layout="@layout/base_contact_avatar" /> <include layout="@layout/base_contact_avatar" />
<RelativeLayout <RelativeLayout
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/expander_height" android:layout_height="@dimen/expander_height"
android:gravity="center_vertical|start" android:gravity="center_vertical|start"
android:background="@drawable/expander_background_dark"
> >
<ImageView <ImageView
android:id="@+id/indicator" android:id="@+id/indicator"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
>
<LinearLayout
android:id="@+id/title_color"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_vertical">
<include layout="@layout/contact_title_avatar" />
</LinearLayout>
<ImageView
android:id="@+id/security"
android:src="@drawable/ic_security"
android:paddingLeft="6dip"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:visibility="gone"
/>
<LinearLayout
android:id="@+id/name_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:paddingLeft="6dip"
>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="bottom"
android:singleLine="true"
android:ellipsize="marquee"
android:textStyle="bold"
android:textColor="@color/secondary_text_default_material_light"
android:text="name"
/>
<TextView
android:id="@+id/status_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="top"
android:singleLine="true"
android:ellipsize="marquee"
android:textColor="@color/secondary_text_default_material_light"
android:text="status"
/>
</LinearLayout>
<ImageView
android:id="@+id/status_mode"
android:src="@drawable/ic_status"
android:paddingLeft="@dimen/active_chat_padding_right"
android:paddingRight="@dimen/active_chat_padding_right"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:visibility="gone" />
</LinearLayout>
<ImageView
android:id="@+id/shadow"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shadow"
android:visibility="gone"
/>
</RelativeLayout>
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
android:id="@+id/title" android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/title_height" android:layout_height="@dimen/title_height"
android:background="@drawable/title_account_background_light"
> >
<LinearLayout <LinearLayout
android:id="@+id/title_color" android:id="@+id/title_color"
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<QuickContactBadge <QuickContactBadge
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/avatar" android:id="@+id/avatar"
android:layout_width="36dip" android:layout_width="48dip"
android:layout_height="36dip" android:layout_height="48dip"
android:src="@drawable/avatar_1_1" android:src="@drawable/avatar_1_1"
/> />
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="account_action_bar">
<item>@color/green_500</item>
<item>@color/yellow_500</item>
<item>@color/red_500</item>
<item>@color/blue_500</item>
</array>
<array name="account_status_bar">
<item>@color/green_700</item>
<item>@color/yellow_700</item>
<item>@color/red_700</item>
<item>@color/blue_700</item>
</array>
<color name="account_disabled">@color/black_dividers</color>
<color name="group_expander">@color/blue_grey_800</color>
</resources>
\ No newline at end of file
This diff is collapsed.
...@@ -14,12 +14,8 @@ ...@@ -14,12 +14,8 @@
--> -->
<resources> <resources>
<style name="Theme" parent="Theme.AppCompat"> <style name="Theme" parent="Theme.AppCompat">
<item name="expanderBackground">@drawable/expander_background_dark</item>
<item name="expanderGroupColor">?android:attr/textColorPrimary</item> <item name="expanderGroupColor">?android:attr/textColorPrimary</item>
<item name="expanderAccountColor">?android:attr/textColorPrimaryInverse</item> <item name="expanderAccountColor">?android:attr/textColorPrimaryInverse</item>
<item name="accountBackground">@drawable/account_background</item>
<item name="expanderIndicator">@drawable/expander_indicator_dark</item> <item name="expanderIndicator">@drawable/expander_indicator_dark</item>
<item name="titleAccountBackground">@drawable/title_account_background_dark</item>
<item name="textColorPrimaryNoSelected">@color/bright_foreground_dark</item>
</style> </style>
</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