show a cross for removing selected contacts

This commit is contained in:
tibbi 2019-03-14 23:42:47 +01:00
parent 770eab4525
commit 33a63c4e72
2 changed files with 20 additions and 2 deletions

View File

@ -1167,6 +1167,7 @@ class EventActivity : SimpleActivity() {
val selectedAttendeeHolder = attendeeHolder.event_contact_attendee
val selectedAttendeeName = selectedAttendeeHolder.event_contact_name
val selectedAttendeeImage = attendeeHolder.event_contact_image
val selectedAttendeeDismiss = attendeeHolder.event_contact_dismiss
mAttendeeViews.add(autoCompleteView)
autoCompleteView.onTextChangeListener {
@ -1185,8 +1186,10 @@ class EventActivity : SimpleActivity() {
selectedAttendeeHolder.layoutParams.height = autoCompleteView.height
}
autoCompleteView.setColors(config.textColor, getAdjustedPrimaryColor(), config.backgroundColor)
selectedAttendeeName.setColors(config.textColor, getAdjustedPrimaryColor(), config.backgroundColor)
val textColor = config.textColor
autoCompleteView.setColors(textColor, getAdjustedPrimaryColor(), config.backgroundColor)
selectedAttendeeName.setColors(textColor, getAdjustedPrimaryColor(), config.backgroundColor)
selectedAttendeeDismiss.applyColorFilter(textColor)
if (value != null) {
autoCompleteView.setText(value)
@ -1205,6 +1208,7 @@ class EventActivity : SimpleActivity() {
selectedAttendeeHolder.beVisible()
selectedAttendeeImage.beVisible()
selectedAttendee.updateImage(applicationContext, selectedAttendeeImage, mAttendeePlaceholder)
selectedAttendeeDismiss.beVisible()
}
}

View File

@ -43,10 +43,24 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/medium_margin"
android:layout_toStartOf="@+id/event_contact_dismiss"
android:layout_toEndOf="@+id/event_contact_image"
android:ellipsize="end"
android:lines="1"
android:textSize="@dimen/bigger_text_size"
tools:text="Simple Mobile"/>
<ImageView
android:id="@+id/event_contact_dismiss"
android:layout_width="@dimen/avatar_size"
android:layout_height="@dimen/avatar_size"
android:layout_alignParentEnd="true"
android:layout_marginStart="@dimen/medium_margin"
android:layout_marginEnd="@dimen/normal_margin"
android:alpha="0.8"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/small_margin"
android:src="@drawable/ic_cross_big"/>
</RelativeLayout>
</RelativeLayout>