mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-02-22 14:27:49 +01:00
Merge pull request #355 from sdex/show_content_description_toast_on_long_click
Show a toast with content description on long click on action buttons
This commit is contained in:
commit
6b1f38ed19
@ -185,6 +185,18 @@ class CallActivity : SimpleActivity() {
|
||||
it.applyColorFilter(getProperTextColor())
|
||||
}
|
||||
|
||||
arrayOf(
|
||||
call_toggle_microphone, call_toggle_speaker, call_dialpad,
|
||||
call_toggle_hold, call_add, call_swap, call_merge, call_manage
|
||||
).forEach { imageView ->
|
||||
imageView.setOnLongClickListener {
|
||||
if (!imageView.contentDescription.isNullOrEmpty()) {
|
||||
toast(imageView.contentDescription.toString())
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
call_sim_id.setTextColor(getProperTextColor().getContrastColor())
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import android.view.Menu
|
||||
import android.view.ViewGroup
|
||||
import com.bumptech.glide.Glide
|
||||
import com.simplemobiletools.commons.adapters.MyRecyclerViewAdapter
|
||||
import com.simplemobiletools.commons.extensions.toast
|
||||
import com.simplemobiletools.commons.helpers.LOWER_ALPHA
|
||||
import com.simplemobiletools.commons.helpers.SimpleContactsHelper
|
||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||
@ -66,6 +67,12 @@ class ConferenceCallsAdapter(
|
||||
activity.finish()
|
||||
}
|
||||
}
|
||||
itemView.item_conference_call_split.setOnLongClickListener {
|
||||
if (!it.contentDescription.isNullOrEmpty()) {
|
||||
itemView.context.toast(it.contentDescription.toString())
|
||||
}
|
||||
true
|
||||
}
|
||||
itemView.item_conference_call_end.isEnabled = canDisconnect
|
||||
itemView.item_conference_call_end.alpha = if (canDisconnect) 1.0f else LOWER_ALPHA
|
||||
itemView.item_conference_call_end.setOnClickListener {
|
||||
@ -76,6 +83,12 @@ class ConferenceCallsAdapter(
|
||||
activity.finish()
|
||||
}
|
||||
}
|
||||
itemView.item_conference_call_end.setOnLongClickListener {
|
||||
if (!it.contentDescription.isNullOrEmpty()) {
|
||||
itemView.context.toast(it.contentDescription.toString())
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
bindViewHolder(holder)
|
||||
}
|
||||
|
@ -163,6 +163,7 @@
|
||||
android:layout_width="@dimen/dialpad_button_size"
|
||||
android:layout_height="@dimen/dialpad_button_size"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/turn_microphone_off"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_microphone_vector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@ -176,6 +177,7 @@
|
||||
android:layout_width="@dimen/dialpad_button_size"
|
||||
android:layout_height="@dimen/dialpad_button_size"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/turn_speaker_on"
|
||||
android:padding="@dimen/medium_margin"
|
||||
android:src="@drawable/ic_speaker_off_vector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
Loading…
x
Reference in New Issue
Block a user