Commit 9557d51a authored by Grigory Fedorov's avatar Grigory Fedorov

Chats and recent chats toolbar made light in tablet mode.

parent 6b2aab89
...@@ -383,7 +383,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem ...@@ -383,7 +383,7 @@ public class ChatViewerFragment extends Fragment implements PopupMenu.OnMenuItem
private void setToolbarColor() { private void setToolbarColor() {
int toolbarColor; int toolbarColor;
if (getResources().getBoolean(R.bool.tablet_mode)) { if (getResources().getBoolean(R.bool.tablet_mode)) {
toolbarColor = accountPainter.getAccountLightColor(account); toolbarColor = accountPainter.getAccountLightestColor(account);
} else { } else {
toolbarColor = accountPainter.getAccountMainColor(account); toolbarColor = accountPainter.getAccountMainColor(account);
} }
......
...@@ -95,7 +95,7 @@ public class RecentChatFragment extends ListFragment implements Toolbar.OnMenuIt ...@@ -95,7 +95,7 @@ public class RecentChatFragment extends ListFragment implements Toolbar.OnMenuIt
private void setToolbarColor() { private void setToolbarColor() {
int toolbarColor; int toolbarColor;
if (getResources().getBoolean(R.bool.tablet_mode)) { if (getResources().getBoolean(R.bool.tablet_mode)) {
toolbarColor = accountPainter.getDefaultLightColor(); toolbarColor = accountPainter.getDefaultLightestColor();
} else { } else {
toolbarColor = accountPainter.getDefaultMainColor(); toolbarColor = accountPainter.getDefaultMainColor();
} }
......
...@@ -97,6 +97,15 @@ public class AccountPainter { ...@@ -97,6 +97,15 @@ public class AccountPainter {
} }
} }
public int getDefaultLightestColor() {
String firstAccount = getFirstAccount();
if (firstAccount == null) {
return themeMainColor;
} else {
return getAccountLightestColor(firstAccount);
}
}
public int getAccountDarkColor(String account) { public int getAccountDarkColor(String account) {
return accountDarkColors[getAccountColorLevel(account)]; return accountDarkColors[getAccountColorLevel(account)];
} }
...@@ -139,4 +148,6 @@ public class AccountPainter { ...@@ -139,4 +148,6 @@ public class AccountPainter {
} }
return null; return null;
} }
} }
...@@ -33,7 +33,7 @@ public class ContactTitleActionBarInflater { ...@@ -33,7 +33,7 @@ public class ContactTitleActionBarInflater {
actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true);
actionBarView = LayoutInflater.from(activity).inflate(R.layout.contact_title, null); actionBarView = LayoutInflater.from(activity).inflate(R.layout.contact_title_dark, null);
actionBar.setCustomView(actionBarView, new ActionBar.LayoutParams( actionBar.setCustomView(actionBarView, new ActionBar.LayoutParams(
ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.MATCH_PARENT)); ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.MATCH_PARENT));
......
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_default"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="8dp"
android:theme="@style/ThemeOverlay.AppCompat.Light"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<include
android:id="@+id/contact_title"
layout="@layout/contact_title_light" />
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.RecyclerView
android:id="@+id/chat_messages_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/input_layout"
android:layout_below="@+id/toolbar_default"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="@android:color/transparent"
android:scrollbars="vertical"
tools:listitem="@layout/chat_viewer_outgoing_message" />
<include layout="@layout/chat_input_panel" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey_300"
android:orientation="vertical">
<include layout="@layout/toolbar_default_light" />
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:divider="@null"
android:dividerHeight="0dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:elevation="8dp"
android:orientation="horizontal"
tools:showIn="@layout/chat_viewer_fragment">
<ImageButton
android:id="@+id/button_security"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@null"
android:contentDescription="@string/otr_encryption"
android:padding="8dp"
android:src="@drawable/ic_security_grey_24dp" />
<EditText
android:id="@+id/chat_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent"
android:cursorVisible="true"
android:fadingEdge="vertical"
android:gravity="center_vertical"
android:hint="@string/chat_input_hint"
android:imeOptions="flagNoExtractUi"
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:maxLines="4"
android:minHeight="40dp"
android:scrollbars="vertical" />
<ImageButton
android:id="@+id/button_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@null"
android:contentDescription="@string/chat_send"
android:padding="8dp"
android:src="@drawable/ic_button_send" />
</LinearLayout>
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<include <include
android:id="@+id/contact_title" android:id="@+id/contact_title"
layout="@layout/contact_title" layout="@layout/contact_title_dark"
/> />
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
...@@ -52,54 +52,6 @@ ...@@ -52,54 +52,6 @@
tools:listitem="@layout/chat_viewer_outgoing_message" tools:listitem="@layout/chat_viewer_outgoing_message"
/> />
<LinearLayout <include layout="@layout/chat_input_panel" />
android:id="@+id/input_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:elevation="8dp"
android:orientation="horizontal"
>
<ImageButton
android:id="@+id/button_security"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@null"
android:contentDescription="@string/otr_encryption"
android:padding="8dp"
android:src="@drawable/ic_security_grey_24dp"
/>
<EditText
android:id="@+id/chat_input"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@android:color/transparent"
android:cursorVisible="true"
android:fadingEdge="vertical"
android:gravity="center_vertical"
android:hint="@string/chat_input_hint"
android:imeOptions="flagNoExtractUi"
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:maxLines="4"
android:minHeight="40dp"
android:scrollbars="vertical"
/>
<ImageButton
android:id="@+id/button_send_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@null"
android:contentDescription="@string/chat_send"
android:padding="8dp"
android:src="@drawable/ic_button_send"
/>
</LinearLayout>
</RelativeLayout> </RelativeLayout>
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/actionBarSize" android:minHeight="?android:attr/actionBarSize"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"
> >
<ImageView <ImageView
...@@ -19,19 +19,19 @@ ...@@ -19,19 +19,19 @@
android:id="@+id/name_holder" android:id="@+id/name_holder"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="vertical"
> >
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/primary_text_default_material_dark"
android:text="Lorem Ipsum" android:text="Lorem Ipsum"
android:layout_marginLeft="6dp" android:textColor="@color/primary_text_default_material_dark"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold"
/> />
...@@ -40,19 +40,19 @@ ...@@ -40,19 +40,19 @@
android:id="@+id/status_text" android:id="@+id/status_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/grey_200"
android:text="Lorem ipsum dolor sit amet" android:text="Lorem ipsum dolor sit amet"
android:layout_marginLeft="6dp" android:textColor="@color/grey_200"
/> />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@+id/status_icon" android:id="@+id/status_icon"
android:src="@drawable/ic_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
android:src="@drawable/ic_status"
/> />
</LinearLayout> </LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/actionBarSize"
android:orientation="horizontal">
<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:src="@drawable/ic_avatar_1" />
<LinearLayout
android:id="@+id/name_holder"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:singleLine="true"
android:text="Lorem Ipsum"
android:textColor="@color/primary_text_default_material_light"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/status_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:singleLine="true"
android:text="Lorem ipsum dolor sit amet"
android:textColor="@color/grey_900" />
</LinearLayout>
<ImageView
android:id="@+id/status_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="8dp"
android:src="@drawable/ic_status" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_default"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="8dp"
android:theme="@style/ThemeOverlay.AppCompat.Light"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextAppearance="@style/ToolbarTitle" />
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_under_construction"
android:icon="@drawable/ic_alert_black_24dp"
android:orderInCategory="100"
android:title="@string/under_construction"
app:showAsAction="always" />
</menu>
\ 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