diff --git a/Clover/app/src/main/java/org/floens/chan/ui/fragment/ReplyFragment.java b/Clover/app/src/main/java/org/floens/chan/ui/fragment/ReplyFragment.java index 7b695252..c56fe1e5 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/fragment/ReplyFragment.java +++ b/Clover/app/src/main/java/org/floens/chan/ui/fragment/ReplyFragment.java @@ -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); - flipPage(1); + if (ChanPreferences.getPassEnabled()) { + flipPage(0); + } else { + flipPage(1); + } getCaptcha(); captchaInput.setText(""); } else if (response.isSuccessful) { diff --git a/Clover/app/src/main/res/values/strings.xml b/Clover/app/src/main/res/values/strings.xml index 8f5513db..3f2d2d6a 100644 --- a/Clover/app/src/main/res/values/strings.xml +++ b/Clover/app/src/main/res/values/strings.xml @@ -270,7 +270,6 @@ along with this program. If not, see . Connection error Using 4chan pass Off - Using 4chan pass %1$s images will be downloaded to %2$s