diff --git a/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorView.kt b/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorView.kt index c56b3ac832..1bc50d31fd 100644 --- a/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorView.kt +++ b/vector/src/main/java/im/vector/app/features/attachments/AttachmentTypeSelectorView.kt @@ -30,6 +30,8 @@ import android.view.animation.TranslateAnimation import android.widget.ImageButton import android.widget.LinearLayout import android.widget.PopupWindow +import androidx.annotation.StringRes +import androidx.appcompat.widget.TooltipCompat import androidx.core.view.doOnNextLayout import androidx.core.view.isVisible import im.vector.app.R @@ -190,6 +192,7 @@ class AttachmentTypeSelectorView(context: Context, private fun ImageButton.configure(type: Type): ImageButton { this.setOnClickListener(TypeClickListener(type)) + TooltipCompat.setTooltipText(this, context.getString(type.tooltipRes)) return this } @@ -202,15 +205,15 @@ class AttachmentTypeSelectorView(context: Context, } /** - * The all possible types to pick with their required permissions. + * The all possible types to pick with their required permissions and tooltip resource */ - enum class Type(val permissions: List) { - CAMERA(PERMISSIONS_FOR_TAKING_PHOTO), - GALLERY(PERMISSIONS_EMPTY), - FILE(PERMISSIONS_EMPTY), - STICKER(PERMISSIONS_EMPTY), - AUDIO(PERMISSIONS_EMPTY), - CONTACT(PERMISSIONS_FOR_PICKING_CONTACT), - POLL(PERMISSIONS_EMPTY) + enum class Type(val permissions: List, @StringRes val tooltipRes: Int) { + CAMERA(PERMISSIONS_FOR_TAKING_PHOTO, R.string.option_take_photo_video), + GALLERY(PERMISSIONS_EMPTY, R.string.tooltip_select_item_from_gallery), + FILE(PERMISSIONS_EMPTY, R.string.tooltip_select_file), + STICKER(PERMISSIONS_EMPTY, R.string.option_send_sticker), + AUDIO(PERMISSIONS_EMPTY, R.string.tooltip_select_audio_file), + CONTACT(PERMISSIONS_FOR_PICKING_CONTACT, R.string.tooltip_select_contact), + POLL(PERMISSIONS_EMPTY, R.string.create_poll_title) } } diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 9886a9f009..ef1cb5abc8 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -3676,4 +3676,8 @@ Poll ended Remove poll Are you sure you want to remove this poll? You won\'t be able to recover it once removed. + Select photos and videos from your device + Select any files from your device + Select audio file from your device + Select contact from your device