Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 99c787d

Browse files
kunall17niftynei
authored andcommitted
Methods to switch private and stream views and remove EditText Errors.
1 parent 034e40b commit 99c787d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,27 @@ private Cursor makePeopleCursor(CharSequence email) throws SQLException {
653653
DatabaseHelper.likeEscape(piece) + "%")
654654
.closeableIterator().getRawResults()).getRawCursor();
655655
}
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+
656677
public void switchView() {
657678
if (isCurrentModeStream()) { //Person
658679
togglePrivateStreamBtn.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_action_bullhorn));

0 commit comments

Comments
 (0)