@@ -17,33 +17,38 @@ You can use it step by step
17
17
** Sample use**
18
18
19
19
``` java
20
- ChatBarView chatBarView ;
21
-
20
+ chatBarView = ( ChatBarView ) findViewById( R . id . chatbar) ;
21
+ chatBarView . setSendClickListener( new View . OnClickListener () {
22
22
@Override
23
- protected void onCreate(Bundle savedInstanceState) {
24
- super . onCreate(savedInstanceState);
25
- setContentView(R . layout. activity_main);
26
-
27
- chatBarView = (ChatBarView ) findViewById(R . id. chatbar);
28
-
29
- // To set a listener to the "send" button...
30
- chatBarView. setSendClickListener(... );
31
-
32
- // To get the message typed by the user...
33
- chatBarView. getMessageText();
23
+ public void onClick (View view ) {
24
+ // TODO what you want..
25
+ }
26
+ });
27
+ chatBarView. setOnMicListener(new View .OnLongClickListener () {
28
+ @Override
29
+ public boolean onLongClick (View view ) {
30
+ // TODO what you want..
31
+ return true ;
34
32
}
33
+ });
34
+ text = chatBarView. getMessageText();
35
35
```
36
36
** Layout**
37
37
38
- <com.cenkgun.chatbar.ChatBarView
39
- android:id="@+id/chatbar"
40
- android:layout_width="match_parent"
41
- android:layout_height="wrap_content"
42
- app:cb_isTextCleanerEnabled="true"
43
- app:cb_isSoftInputHidden="true"
44
- app:cb_messageBoxHint="sample text"
45
- app:cb_sendButtonColor="#ff5599"
46
- app:cb_sendButtonBackgroundColor="#000000"/>
38
+
39
+
40
+ <com.cenkgun.chatbar.ChatBarView
41
+ android:id="@+id/chatbar"
42
+ android:layout_width="match_parent"
43
+ android:layout_height="wrap_content"
44
+ android:layout_alignParentBottom="true"
45
+ android:layout_alignParentLeft="true"
46
+ android:layout_alignParentStart="true"
47
+ app:cb_isTextCleanerEnabled="true"
48
+ app:cb_isSoftInputHidden="true"
49
+ app:cb_messageBoxHint="sample text"
50
+ app:cb_micClickWarningMessage="warning message">
51
+
47
52
48
53
49
54
----------
@@ -56,6 +61,7 @@ You can use it step by step
56
61
| cb_isTextCleanerEnabled | boolean | true |
57
62
| cb_isSoftInputHidden | boolean | false |
58
63
| cb_messageBoxHint | String | |
64
+ | cb_micClickWarningMessage | String | Long press... |
59
65
| cb_sendButtonColor | Color | Color.WHITE |
60
66
| cb_sendButtonBackgroundColor | Color | Color.BLUE |
61
67
@@ -71,12 +77,12 @@ Add it in your root build.gradle at the end of repositories:
71
77
...
72
78
maven { url 'https://jitpack.io' }
73
79
}
74
- }
80
+ }
75
81
76
82
Add the dependency
77
83
78
84
dependencies {
79
- compile 'com.github.CenkGun:ChatBar:1.0.4 '
85
+ compile 'com.github.CenkGun:ChatBar:1.0.5 '
80
86
}
81
87
## Contributing
82
88
0 commit comments