Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Commit

Permalink
fixed an error in login when progress doesn't disappear onerror. rele…
Browse files Browse the repository at this point in the history
…asing 1.1.1
  • Loading branch information
Kosh committed Mar 12, 2017
1 parent d7901a5 commit 2d27f48
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ public static List<FragmentPagerAdapterModel> buildForRepoCode(@NonNull Context
@NonNull public static List<FragmentPagerAdapterModel> buildForRepoIssue(@NonNull Context context, @NonNull String login,
@NonNull String repoId) {
return Stream.of(new FragmentPagerAdapterModel(context.getString(R.string.opened),
RepoOpenedIssuesView.newInstance(repoId, login, IssueState.open)),
RepoOpenedIssuesView.newInstance(repoId, login)),
new FragmentPagerAdapterModel(context.getString(R.string.closed),
RepoClosedIssuesView.newInstance(repoId, login, IssueState.closed)))
RepoClosedIssuesView.newInstance(repoId, login)))
.collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class GithubActionService extends IntentService {


public static void startForRepo(@NonNull Context context, @NonNull String login, @NonNull String repo, @GitActionType int type) {
Intent intent = new Intent(context, GithubActionService.class);
Intent intent = new Intent(context.getApplicationContext(), GithubActionService.class);
intent.putExtras(Bundler.start()
.put(BundleConstant.ID, repo)
.put(BundleConstant.EXTRA, login)
Expand All @@ -56,7 +56,7 @@ public static void startForRepo(@NonNull Context context, @NonNull String login,
}

public static void startForGist(@NonNull Context context, @NonNull String id, @GitActionType int type) {
Intent intent = new Intent(context, GithubActionService.class);
Intent intent = new Intent(context.getApplicationContext(), GithubActionService.class);
intent.putExtras(Bundler.start()
.put(BundleConstant.ID, id)
.put(BundleConstant.EXTRA_TYPE, type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ReadNotificationService extends IntentService {
public static final int READ_ALL = 2;

public static void start(@NonNull Context context, long id) {
Intent intent = new Intent(context, ReadNotificationService.class);
Intent intent = new Intent(context.getApplicationContext(), ReadNotificationService.class);
intent.putExtras(Bundler.start()
.put(BundleConstant.EXTRA_TYPE, READ_SINGLE)
.put(BundleConstant.ID, id)
Expand All @@ -33,7 +33,7 @@ public static void start(@NonNull Context context, long id) {
}

public static void start(@NonNull Context context, @NonNull long[] ids) {
Intent intent = new Intent(context, ReadNotificationService.class);
Intent intent = new Intent(context.getApplicationContext(), ReadNotificationService.class);
intent.putExtras(Bundler.start()
.put(BundleConstant.EXTRA_TYPE, READ_ALL)
.put(BundleConstant.ID, ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ class LoginPresenter extends BasePresenter<LoginMvp.View> implements LoginMvp.Pr
sendToView(LoginMvp.View::onRequire2Fa);
return;
} else {
sendToView(LoginMvp.View::onRequireLogin);
sendToView(view -> {
view.hideProgress();
view.onRequireLogin();
});
return;
}
}
Expand Down
23 changes: 9 additions & 14 deletions app/src/main/java/com/fastaccess/ui/modules/login/LoginView.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,18 @@ public class LoginView extends BaseActivity<LoginMvp.View, LoginPresenter> imple
super.showMessage(titleRes, msgRes);
}

@Override public void showProgress(@StringRes int resId) {
AnimHelper.animateVisibility(login, false, new AnimHelper.AnimationCallback() {
@Override public void onAnimationEnd() {
AnimHelper.animateVisibility(progress, true);
}
@Override public void showMessage(@NonNull String titleRes, @NonNull String msgRes) {
hideProgress();
super.showMessage(titleRes, msgRes);
}

@Override public void onAnimationStart() {}
});
@Override public void showProgress(@StringRes int resId) {
login.hide();
AnimHelper.animateVisibility(progress, true);
}

@Override public void hideProgress() {
AnimHelper.animateVisibility(progress, false, new AnimHelper.AnimationCallback() {
@Override public void onAnimationEnd() {
AnimHelper.animateVisibility(login, true);
}

@Override public void onAnimationStart() {}
});
progress.setVisibility(View.GONE);
login.show();
}
}

0 comments on commit 2d27f48

Please sign in to comment.