adding a Change Photo button at the edit screen

This commit is contained in:
tibbi 2020-10-26 20:41:58 +01:00
parent 5800e8ae2e
commit fd52ddfedc
2 changed files with 18 additions and 2 deletions

View file

@ -221,6 +221,7 @@ class EditContactActivity : ContactActivity() {
contact_toggle_favorite.setOnClickListener { toggleFavorite() }
contact_photo.setOnClickListener { trySetPhoto() }
contact_change_photo.setOnClickListener { trySetPhoto() }
contact_send_sms.setOnClickListener { trySendSMS() }
contact_start_call.setOnClickListener { tryStartCall(contact!!) }
contact_send_email.setOnClickListener { trySendEmail() }
@ -1136,7 +1137,10 @@ class EditContactActivity : ContactActivity() {
when (it as Int) {
TAKE_PHOTO -> startTakePhotoIntent()
CHOOSE_PHOTO -> startChoosePhotoIntent()
else -> showPhotoPlaceholder(contact_photo)
else -> {
showPhotoPlaceholder(contact_photo)
contact_photo_bottom_shadow.beGone()
}
}
}
}

View file

@ -39,11 +39,23 @@
android:layout_height="@dimen/contact_actions_size"
android:layout_alignStart="@+id/contact_photo"
android:layout_alignBottom="@id/contact_photo"
android:layout_margin="@dimen/medium_margin"
android:layout_marginStart="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/tiny_margin"
android:src="@drawable/ic_star_off_vector" />
<ImageView
android:id="@+id/contact_change_photo"
android:layout_width="@dimen/contact_actions_size"
android:layout_height="@dimen/contact_actions_size"
android:layout_above="@+id/contact_toggle_favorite"
android:layout_alignStart="@+id/contact_photo"
android:layout_marginStart="@dimen/medium_margin"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/medium_margin"
android:src="@drawable/ic_camera_vector" />
<LinearLayout
android:id="@+id/contact_actions_holder"
android:layout_width="match_parent"