Commit a636f99d authored by Grigory Fedorov's avatar Grigory Fedorov

Contact list: elevation set 4dp to accounts, 2dp to groups and 1dp to contacts.

 GroupedContactAdapter programmatically elevation set removed.
parent d2c2b54c
...@@ -18,7 +18,6 @@ import android.app.Activity; ...@@ -18,7 +18,6 @@ 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;
...@@ -93,8 +92,6 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater ...@@ -93,8 +92,6 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
private int[] accountColors; private int[] accountColors;
private final int[] accountSubgroupColors; private final int[] accountSubgroupColors;
private final int accountGroupElevation;
private final int accountSubgroupElevation;
private final int activeChatsColor; private final int activeChatsColor;
private final OnAccountClickListener onAccountClickListener; private final OnAccountClickListener onAccountClickListener;
...@@ -110,9 +107,6 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater ...@@ -110,9 +107,6 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
accountSubgroupColors = resources.getIntArray(R.array.account_50); accountSubgroupColors = resources.getIntArray(R.array.account_50);
activeChatsColor = resources.getColor(R.color.color_primary_light); activeChatsColor = resources.getColor(R.color.color_primary_light);
accountGroupElevation = resources.getDimensionPixelSize(R.dimen.account_group_elevation);
accountSubgroupElevation = resources.getDimensionPixelSize(R.dimen.account_subgroup_elevation);
this.onAccountClickListener = onAccountClickListener; this.onAccountClickListener = onAccountClickListener;
} }
...@@ -164,31 +158,23 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater ...@@ -164,31 +158,23 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
viewHolder.indicator.setImageLevel(configuration.isExpanded() ? 1 : 0); viewHolder.indicator.setImageLevel(configuration.isExpanded() ? 1 : 0);
viewHolder.groupOfflineIndicator.setImageLevel(configuration.getShowOfflineMode().ordinal()); viewHolder.groupOfflineIndicator.setImageLevel(configuration.getShowOfflineMode().ordinal());
int elevation;
int color; int color;
viewHolder.groupOfflineIndicator.setVisibility(View.GONE); viewHolder.groupOfflineIndicator.setVisibility(View.GONE);
if (configuration.getUser().equals(GroupManager.ACTIVE_CHATS)) { if (configuration.getUser().equals(GroupManager.ACTIVE_CHATS)) {
color = activeChatsColor; color = activeChatsColor;
elevation = accountGroupElevation;
viewHolder.name.setText(name); viewHolder.name.setText(name);
} else { } else {
viewHolder.name.setText(name + " (" + configuration.getOnline() viewHolder.name.setText(name + " (" + configuration.getOnline()
+ "/" + configuration.getTotal() + ")"); + "/" + configuration.getTotal() + ")");
color = accountSubgroupColors[level]; color = accountSubgroupColors[level];
elevation = accountSubgroupElevation;
viewHolder.groupOfflineIndicator.setVisibility(View.VISIBLE); viewHolder.groupOfflineIndicator.setVisibility(View.VISIBLE);
} }
view.setBackgroundDrawable(new ColorDrawable(color)); view.setBackgroundDrawable(new ColorDrawable(color));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
view.setElevation(elevation);
}
return view; return view;
} }
...@@ -245,10 +231,6 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater ...@@ -245,10 +231,6 @@ public abstract class GroupedContactAdapter<Inflater extends BaseContactInflater
viewHolder.offlineContactsIndicator.setImageLevel(showOfflineMode.ordinal()); viewHolder.offlineContactsIndicator.setImageLevel(showOfflineMode.ordinal());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
view.setElevation(accountGroupElevation);
}
return view; return view;
default: default:
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical" android:gravity="center_vertical"
android:background="@color/green_500" android:background="@color/green_500"
android:elevation="4dp"
> >
<ImageView <ImageView
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
android:layout_height="@dimen/contact_list_item_height" android:layout_height="@dimen/contact_list_item_height"
android:paddingTop="@dimen/contact_list_item_padding_top" android:paddingTop="@dimen/contact_list_item_padding_top"
android:paddingBottom="@dimen/contact_list_item_padding_bottom" android:paddingBottom="@dimen/contact_list_item_padding_bottom"
android:elevation="1dp"
android:background="@color/grey_300"
> >
<ImageView <ImageView
android:id="@+id/color" android:id="@+id/color"
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
android:layout_height="@dimen/expander_height" android:layout_height="@dimen/expander_height"
android:paddingRight="@dimen/active_chat_padding_right" android:paddingRight="@dimen/active_chat_padding_right"
android:paddingEnd="@dimen/active_chat_padding_right" android:paddingEnd="@dimen/active_chat_padding_right"
android:elevation="2dp"
> >
<ImageView <ImageView
......
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