This repository was archived by the owner on Jul 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
app/src/main/java/com/zulip/android/activities Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -653,6 +653,27 @@ private Cursor makePeopleCursor(CharSequence email) throws SQLException {
653
653
DatabaseHelper .likeEscape (piece ) + "%" )
654
654
.closeableIterator ().getRawResults ()).getRawCursor ();
655
655
}
656
+ public void switchToStream () {
657
+ removeEditTextErrors ();
658
+ if (!isCurrentModeStream ()) switchView ();
659
+ }
660
+
661
+ public void switchToPrivate () {
662
+ removeEditTextErrors ();
663
+ if (isCurrentModeStream ()) switchView ();
664
+ }
665
+
666
+ public boolean isCurrentModeStream () {
667
+ //The TextView is VISIBLE which means currently send to stream is on.
668
+ return (textView .getVisibility () == View .VISIBLE );
669
+ }
670
+
671
+ public void removeEditTextErrors () {
672
+ streamActv .setError (null );
673
+ topicActv .setError (null );
674
+ messageEt .setError (null );
675
+ }
676
+
656
677
public void switchView () {
657
678
if (isCurrentModeStream ()) { //Person
658
679
togglePrivateStreamBtn .setImageDrawable (ContextCompat .getDrawable (this , R .drawable .ic_action_bullhorn ));
You can’t perform that action at this time.
0 commit comments