@@ -411,7 +411,41 @@ public void onTaskFailure(String result) {
411
411
412
412
homeList = MessageListFragment .newInstance (null );
413
413
pushListFragment (homeList , null );
414
+ streamActv = (AutoCompleteTextView ) findViewById (R .id .stream_actv );
415
+ topicActv = (AutoCompleteTextView ) findViewById (R .id .topic_actv );
416
+ messageEt = (EditText ) findViewById (R .id .message_et );
417
+ textView = (TextView ) findViewById (R .id .textView );
418
+ sendBtn = (ImageView ) findViewById (R .id .send_btn );
419
+ togglePrivateStreamBtn = (ImageView ) findViewById (R .id .togglePrivateStream_btn );
420
+ togglePrivateStreamBtn .setOnClickListener (new View .OnClickListener () {
421
+ @ Override
422
+ public void onClick (View v ) {
423
+ switchView ();
424
+ }
425
+ });
426
+ public void switchView () {
427
+ if (isCurrentModeStream ()) { //Person
428
+ togglePrivateStreamBtn .setImageDrawable (ContextCompat .getDrawable (this , R .drawable .ic_action_bullhorn ));
429
+ tempStreamSave = topicActv .getText ().toString ();
430
+ topicActv .setText (null );
431
+ topicActv .setHint (R .string .hint_person );
432
+ topicActv .setAdapter (emailActvAdapter );
433
+ streamActv .setVisibility (View .GONE );
434
+ textView .setVisibility (View .GONE );
435
+ } else { //Stream
436
+ topicActv .setText (tempStreamSave );
437
+ togglePrivateStreamBtn .setImageDrawable (ContextCompat .getDrawable (this , R .drawable .ic_action_person ));
438
+ streamActv .setEnabled (true );
439
+ topicActv .setHint (R .string .hint_subject );
440
+ streamActv .setHint (R .string .hint_stream );
441
+ streamActv .setVisibility (View .VISIBLE );
442
+ textView .setVisibility (View .VISIBLE );
443
+ topicActv .setVisibility (View .VISIBLE );
444
+ streamActv .setAdapter (streamActvAdapter );
445
+ topicActv .setAdapter (subjectActvAdapter );
446
+ }
414
447
}
448
+ String tempStreamSave = null ;
415
449
416
450
public void onBackPressed () {
417
451
if (narrowedList != null ) {
0 commit comments