Don't show "Using pass" screen, skip directly to submit.

captchafix2
Floens 11 years ago
parent c37c1b77ae
commit e6a6771848
  1. 27
      Clover/app/src/main/java/org/floens/chan/ui/fragment/ReplyFragment.java
  2. 1
      Clover/app/src/main/res/values/strings.xml

@ -74,6 +74,7 @@ public class ReplyFragment extends DialogFragment {
private final Reply draft = new Reply();
private boolean shouldSaveDraft = true;
private boolean gotInitialCaptcha = false;
private boolean gettingCaptcha = false;
private String captchaChallenge = "";
@ -203,8 +204,6 @@ public class ReplyFragment extends DialogFragment {
}
});
showCommentCount();
getCaptcha();
} else {
Logger.e(TAG, "Loadable in ReplyFragment was null");
closeReply();
@ -268,12 +267,6 @@ public class ReplyFragment extends DialogFragment {
});
captchaInput = (TextView) container.findViewById(R.id.reply_captcha);
if (ChanPreferences.getPassEnabled()) {
((TextView) container.findViewById(R.id.reply_captcha_text)).setText(R.string.pass_using);
container.findViewById(R.id.reply_captcha_container).setVisibility(View.GONE);
container.findViewById(R.id.reply_captcha).setVisibility(View.GONE);
}
cancelButton = (Button) container.findViewById(R.id.reply_cancel);
cancelButton.setOnClickListener(new OnClickListener() {
@Override
@ -313,11 +306,11 @@ public class ReplyFragment extends DialogFragment {
submitButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
if (page == 0) {
flipPage(1);
} else if (page == 1) {
if (page == 1 || ChanPreferences.getPassEnabled()) {
flipPage(2);
submit();
} else {
flipPage(1);
}
}
});
@ -405,12 +398,11 @@ public class ReplyFragment extends DialogFragment {
if (flipBack) {
flipper.setInAnimation(ViewFlipperAnimations.BACK_IN);
flipper.setOutAnimation(ViewFlipperAnimations.BACK_OUT);
flipper.showPrevious();
} else {
flipper.setInAnimation(ViewFlipperAnimations.NEXT_IN);
flipper.setOutAnimation(ViewFlipperAnimations.NEXT_OUT);
flipper.showNext();
}
flipper.setDisplayedChild(position);
if (page == 0) {
cancelButton.setText(R.string.cancel);
@ -419,6 +411,11 @@ public class ReplyFragment extends DialogFragment {
} else if (page == 2) {
cancelButton.setText(R.string.close);
}
if (page == 1 && !gotInitialCaptcha) {
gotInitialCaptcha = true;
getCaptcha();
}
}
/**
@ -608,7 +605,11 @@ public class ReplyFragment extends DialogFragment {
submitButton.setEnabled(true);
cancelButton.setEnabled(true);
setClosable(true);
if (ChanPreferences.getPassEnabled()) {
flipPage(0);
} else {
flipPage(1);
}
getCaptcha();
captchaInput.setText("");
} else if (response.isSuccessful) {

@ -270,7 +270,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<string name="pass_error">Connection error</string>
<string name="pass_summary_enabled">Using 4chan pass</string>
<string name="pass_summary_disabled">Off</string>
<string name="pass_using">Using 4chan pass</string>
<string name="download_confirm">%1$s images will be downloaded to %2$s</string>

Loading…
Cancel
Save