35
35
public class UserChatBotActivity extends AppCompatActivity implements BotReply {
36
36
37
37
RecyclerView chatView ;
38
- MessageAdapter messageAdapter ;
39
- List <MessageObj > messageList = new ArrayList <>();
40
38
EditText editMessage ;
41
39
ImageButton btnSend ;
42
40
41
+ MessageAdapter messageAdapter ;
42
+ List <MessageObj > messageList = new ArrayList <>();
43
+
43
44
//dialogFlow
44
45
private SessionsClient sessionsClient ;
45
46
private SessionName sessionName ;
@@ -53,8 +54,6 @@ protected void onCreate(Bundle savedInstanceState) {
53
54
54
55
getSupportActionBar ().setTitle ("Nobuli Chatbot" );
55
56
56
- // getSupportActionBar().setDisplayHomeAsUpEnabled(true);
57
-
58
57
chatView = findViewById (R .id .chatRecyclerView );
59
58
editMessage = findViewById (R .id .messageBoxEditText );
60
59
btnSend = findViewById (R .id .sendButton );
@@ -82,18 +81,6 @@ public void onClick(View view) {
82
81
setUpBot ();
83
82
}
84
83
85
- // @Override
86
- // public boolean onOptionsItemSelected(MenuItem item) {
87
- // switch (item.getItemId()) {
88
- // case android.R.id.home:
89
- // NavUtils.navigateUpFromSameTask(this);
90
- // return true;
91
- // default:
92
- // return super.onOptionsItemSelected(item);
93
- // }
94
- // }
95
-
96
-
97
84
private void setUpBot () {
98
85
try {
99
86
InputStream stream = this .getResources ().openRawResource (R .raw .credential );
@@ -126,7 +113,6 @@ public void callback(DetectIntentResponse returnResponse) {
126
113
if (!botReply .isEmpty ()) {
127
114
messageList .add (new MessageObj (botReply , true ));
128
115
messageAdapter .notifyDataSetChanged ();
129
- System .out .println ("fuck" );
130
116
Objects .requireNonNull (chatView .getLayoutManager ()).scrollToPosition (messageList .size () - 1 );
131
117
} else {
132
118
Toast .makeText (this , "something went wrong" , Toast .LENGTH_SHORT ).show ();
0 commit comments