~singpolyma/cheogram-android

d0c05dfc0c84f78e3b7454e7e7b0af42648783df — Stephen Paul Weber 1 year, 4 months ago bb58364
Fix selection display with account colours
M src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java => src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java +6 -3
@@ 56,20 56,23 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> {
		LayoutInflater inflater = activity.getLayoutInflater();
		ListItem item = getItem(position);
		ViewHolder viewHolder;
		View innerView;
		if (view == null) {
			ContactBinding binding = DataBindingUtil.inflate(inflater,R.layout.contact,parent,false);
			viewHolder = ViewHolder.get(binding);
			view = binding.getRoot();
			innerView = binding.inner;
		} else {
			viewHolder = (ViewHolder) view.getTag();
			innerView = view;
		}

		if (activity.xmppConnectionService != null && activity.xmppConnectionService.getAccounts().size() > 1) {
			view.setBackgroundColor(item.getAccount().getColor(activity.isDarkTheme()));
		} else {
			view.setBackground(StyledAttributes.getDrawable(view.getContext(),R.attr.list_item_background));
			innerView.setBackgroundColor(item.getAccount().getColor(activity.isDarkTheme()));
		}

		view.setBackground(StyledAttributes.getDrawable(view.getContext(),R.attr.list_item_background));

		List<ListItem.Tag> tags = item.getTags(activity);
		if (tags.size() == 0 || !this.showDynamicTags) {
			viewHolder.tags.setVisibility(View.GONE);

M src/main/res/layout/contact.xml => src/main/res/layout/contact.xml +6 -1
@@ 2,10 2,14 @@
<layout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?selectableItemBackground">
    <RelativeLayout
        android:id="@+id/inner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?selectableItemBackground"
        android:padding="@dimen/list_padding">

        <com.google.android.material.imageview.ShapeableImageView


@@ 56,4 60,5 @@
        </LinearLayout>

    </RelativeLayout>
    </FrameLayout>
</layout>