Skip to content
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

Commit bea5af8

Browse files
author
Cenk Gun
committed
Update README.md
1 parent 7c788ec commit bea5af8

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

README.md

+30-24
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,38 @@ You can use it step by step
1717
**Sample use**
1818

1919
``` java
20-
ChatBarView chatBarView;
21-
20+
chatBarView = (ChatBarView) findViewById(R.id.chatbar);
21+
chatBarView.setSendClickListener(new View.OnClickListener() {
2222
@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;
3432
}
33+
});
34+
text = chatBarView.getMessageText();
3535
```
3636
**Layout**
3737

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+
4752

4853

4954
----------
@@ -56,6 +61,7 @@ You can use it step by step
5661
| cb_isTextCleanerEnabled | boolean | true |
5762
| cb_isSoftInputHidden | boolean | false |
5863
| cb_messageBoxHint | String | |
64+
| cb_micClickWarningMessage | String | Long press... |
5965
| cb_sendButtonColor | Color | Color.WHITE |
6066
| cb_sendButtonBackgroundColor | Color | Color.BLUE |
6167

@@ -71,12 +77,12 @@ Add it in your root build.gradle at the end of repositories:
7177
...
7278
maven { url 'https://jitpack.io' }
7379
}
74-
}
80+
}
7581

7682
Add the dependency
7783

7884
dependencies {
79-
compile 'com.github.CenkGun:ChatBar:1.0.4'
85+
compile 'com.github.CenkGun:ChatBar:1.0.5'
8086
}
8187
## Contributing
8288

0 commit comments

Comments
 (0)