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