Skip to content

Commit 280cea7

Browse files
committed
--amend
1 parent 27ca3d0 commit 280cea7

File tree

1 file changed

+7
-12
lines changed
  • com.vogella.android.github.issuetracker/app/src/main/java/com/vogella/android/github/issuetracker

1 file changed

+7
-12
lines changed

com.vogella.android.github.issuetracker/app/src/main/java/com/vogella/android/github/issuetracker/MainActivity.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class MainActivity extends AppCompatActivity implements CredentialsDialog
2828
private String username = "";
2929
private CommunicationController communicationController;
3030
DisposableSingleObserver<List<Issue>> issuesObserver;
31+
3132
@Override
3233
protected void onCreate(Bundle savedInstanceState) {
3334
super.onCreate(savedInstanceState);
@@ -37,7 +38,7 @@ protected void onCreate(Bundle savedInstanceState) {
3738

3839
ownerEditText = (EditText) findViewById(R.id.owner_edittext);
3940
repositoryEditText = (EditText) findViewById(R.id.repository_edittext);
40-
if (BuildConfig.DEBUG){
41+
if (BuildConfig.DEBUG) {
4142
ownerEditText.setText(BuildConfig.GITHUB_REPO_OWNER);
4243
repositoryEditText.setText(BuildConfig.GITHUB_REPO);
4344
}
@@ -99,7 +100,7 @@ public void onError(Throwable e) {
99100
private void showCredentialsDialog() {
100101
CredentialsDialog dialog = new CredentialsDialog();
101102
Bundle arguments = new Bundle();
102-
if (BuildConfig.DEBUG && BuildConfig.GITHUB_USER.length() > 0){
103+
if (BuildConfig.DEBUG && BuildConfig.GITHUB_USER.length() > 0) {
103104
username = BuildConfig.GITHUB_USER;
104105
password = BuildConfig.GITHUB_PW;
105106
}
@@ -123,24 +124,18 @@ private void queryForIssues() {
123124
if (username.isEmpty() || password.isEmpty()) {
124125
Toast.makeText(MainActivity.this, "Please provide your credentials", Toast.LENGTH_SHORT).show();
125126
return;
126-
if(!username.isEmpty() && !password.isEmpty() && !owner.isEmpty() && !repository.isEmpty()) {
127+
}
128+
if (!username.isEmpty() && !password.isEmpty() && !owner.isEmpty() && !repository.isEmpty()) {
127129
issuesObserver = getIssuesObserver();
128-
communicationController.loadIssues(username, password, issuesObserver , owner, repository);
130+
communicationController.loadIssues(username, password, issuesObserver, owner, repository);
129131
}
130132
}
131133

132134
@Override
133135
protected void onStop() {
134136
super.onStop();
135-
if (issuesObserver!=null && !issuesObserver.isDisposed()) {
137+
if (issuesObserver != null && !issuesObserver.isDisposed()) {
136138
issuesObserver.dispose();
137139
}
138-
139-
if (owner.isEmpty() || repository.isEmpty()) {
140-
Toast.makeText(MainActivity.this, "Please provider repository owner and/or name", Toast.LENGTH_SHORT).show();
141-
return;
142-
}
143-
144-
communicationController.loadIssues(username, password, getIssuesObserver(), owner, repository);
145140
}
146141
}

0 commit comments

Comments
 (0)