Skip to content

Instantly share code, notes, and snippets.

@LondonAppDev
Created February 23, 2017 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LondonAppDev/f6c428f7c2d0c271320935ae4b147713 to your computer and use it in GitHub Desktop.
Save LondonAppDev/f6c428f7c2d0c271320935ae4b147713 to your computer and use it in GitHub Desktop.
1602 Helper Functions
private void clearRepoList() {
// This will clear the repo list (set it as a blank string).
this.tvRepoList.setText("");
}
private void addToRepoList(String repoName, String lastUpdated) {
// This will add a new repo to our list.
// It combines the repoName and lastUpdated strings together.
// And then adds them followed by a new line (\n\n make two new lines).
String strRow = repoName + " / " + lastUpdated;
String currentText = tvRepoList.getText().toString();
this.tvRepoList.setText(currentText + "\n\n" + strRow);
}
private void setRepoListText(String str) {
// This is used for setting the text of our repo list box to a specific string.
// We will use this to write a "No repos found" message if the user doens't have any.
this.tvRepoList.setText(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment