this commit fixes #141 and the rest of the icons.

This commit is contained in:
Kosh 2017-03-13 20:48:23 +08:00
parent c4ed5f5b28
commit ba23425ac3
5 changed files with 29 additions and 13 deletions

View File

@ -4,6 +4,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.Snackbar;
import android.view.Menu;
import android.view.MenuItem;
@ -158,12 +159,30 @@ public class EditorView extends BaseActivity<EditorMvp.View, EditorPresenter> im
@Override public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.submit) {
item.setEnabled(false);
getPresenter().onHandleSubmission(savedText, extraType, itemId, commentId, login, issueNumber, sha);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override public boolean onPrepareOptionsMenu(Menu menu) {
if (menu.findItem(R.id.submit) != null) {
menu.findItem(R.id.submit).setEnabled(true);
}
return super.onPrepareOptionsMenu(menu);
}
@Override public void showProgress(@StringRes int resId) {
super.showProgress(resId);
supportInvalidateOptionsMenu();
}
@Override public void hideProgress() {
supportInvalidateOptionsMenu();
super.hideProgress();
}
@Override public void onBackPressed() {
if (InputHelper.isEmpty(editText)) {
super.onBackPressed();

View File

@ -64,7 +64,7 @@ public class LoginView extends BaseActivity<LoginMvp.View, LoginPresenter> imple
}
@Override public void onRequire2Fa() {
showMessage(R.string.error, R.string.two_fectors_otp_error);
showMessage(R.string.error, R.string.two_factors_otp_error);
twoFactor.setVisibility(View.VISIBLE);
hideProgress();
}

View File

@ -60,6 +60,7 @@ public class RepoPagerView extends BaseActivity<RepoPagerMvp.View, RepoPagerPres
@BindView(R.id.watchRepo) FontTextView watchRepo;
@BindView(R.id.license) FontTextView license;
@BindColor(R.color.accent) int accentColor;
@BindColor(R.color.primary_text) int blackColor;
@BindView(R.id.bottomNavigation) BottomNavigation bottomNavigation;
@BindView(R.id.fab) FloatingActionButton fab;
@State @RepoPagerMvp.RepoNavigationType int navType;
@ -201,10 +202,6 @@ public class RepoPagerView extends BaseActivity<RepoPagerMvp.View, RepoPagerPres
if (getPresenter().getRepo() == null) {
return;
}
license.tintDrawables(accentColor);
watchRepo.tintDrawables(accentColor);
starRepo.tintDrawables(accentColor);
forkRepo.tintDrawables(accentColor);
bottomNavigation.setOnMenuItemClickListener(getPresenter());
RepoModel repoModel = getPresenter().getRepo();
hideProgress();
@ -257,17 +254,17 @@ public class RepoPagerView extends BaseActivity<RepoPagerMvp.View, RepoPagerPres
}
@Override public void onRepoWatched(boolean isWatched) {
watchRepo.setTopDrawable(isWatched ? R.drawable.ic_eye_off : R.drawable.ic_eye, accentColor);
watchRepo.setTopDrawable(R.drawable.ic_eye, isWatched ? accentColor : blackColor);
onEnableDisableWatch(true);
}
@Override public void onRepoStarred(boolean isStarred) {
starRepo.setTopDrawable(isStarred ? R.drawable.ic_star_filled : R.drawable.ic_star, accentColor);
starRepo.setTopDrawable(isStarred ? R.drawable.ic_star_filled : R.drawable.ic_star, isStarred ? accentColor : blackColor);
onEnableDisableStar(true);
}
@Override public void onRepoForked(boolean isForked) {
forkRepo.setTopDrawable(isForked ? R.drawable.ic_fork_filled : R.drawable.ic_fork, accentColor);
forkRepo.setTopDrawable(R.drawable.ic_fork, isForked ? accentColor : blackColor);
onEnableDisableFork(true);
}

View File

@ -13,6 +13,4 @@
<item>@string/twenty_minutes</item>
<item>@string/thirty_minutes</item>
</string-array>
<string name="turn_off">Turn off</string>
</resources>

View File

@ -182,14 +182,14 @@
\nScroll the Markdown editor icons for more options.</string>
<string name="creation_date">Creation date</string>
<string name="creation_date_hint">When the file was created</string>
<string name="last_updated_hint">When the file file was last updated</string>
<string name="last_updated_hint">When the file was last updated</string>
<string name="bbn_fab_default_behavior" translatable="false">com.fastaccess.ui.widgets.FloatingActionButtonBehavior</string>
<string name="mark_all_as_read">Mark all as read</string>
<string name="all_notifications">All notifications</string>
<string name="unread">Unread</string>
<string name="all">All</string>
<string name="delete_repo">Delete Repo</string>
<string name="delete_repo_warning">Deleting this repo can't be undone</string>
<string name="delete_repo_warning">Deleting this repo can\'t be undone</string>
<string name="thirty_minutes">30 minutes</string>
<string name="twenty_minutes">20 minutes</string>
<string name="ten_minutes">10 minutes</string>
@ -255,5 +255,7 @@
<string name="report_issue_here">Having an issue? Report it here</string>
<string name="about">About</string>
<string name="notification_settings">Notification</string>
<string name="turn_off">Turn off</string>
<string name="unauthorized_user">Unauthorized user</string>
</resources>
<string name="two_factors_otp_error">Two factor OTP is required</string>
</resources>