Customer Text Input Control
The Nuance Messaging SDK comes with a custom edit-text view that is tailored for a messaging app layout.
CustomerTextInput included in the SDK implements following functions
Prerequisites
CustomerTextInput class does all the heavy lifting to send a message to an agent or to create an engagement if one is not available. It needs the engagement parameters for performing these tasks.
- Do not use the SDK API EngageMessagingAPI to create an engagement. Instead use the createMessagingEngagment method exposed from NuanMessaging class.
public void createMessagingEngagment(HashMap<String,String> engageParams , HashMap<String,String> agentAttributes, com.nuance.Listener.OnSuccessListener<EngageStatusResponse> sListener, OnErrorListener fListener)
To know more about the engage parameter keys ,refer NuanceMessagingActivity Launch section
Properties
There are various properties that can be set to change the CustomerTextInput behavior.
Name | type | |
---|---|---|
sendMessageOnEnter | boolean | Setting this property allows the customerTextInput control to send a message to an agent. |
hintText | string | Place holder text displayed in the input. |
inputBorderColor | color | Sets the border color of customerTextInput. |
inputBorderSize | dimention | Sets the border size of customerTextInput. |
inputBorderRadius | integer | Sets the border radius of customerTextInput. |
inputBackgroundColor | color | Sets the background color of customerTextInput. |
<com.nuance.chatui.CustomerTextInput
android:id="@+id/customer_input_editText"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/sendButton"
android:paddingLeft="8dp"
android:paddingRight="2dp"
app:hintText="Hello Type your message"
app:sendMessageOnEnter="true"
app:inputBorderColor="@color/nuan_green"
app:inputBorderSize="5dp"/>