diff --git a/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java b/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java
index 6901551b..1d32dc20 100644
--- a/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java
+++ b/Clover/app/src/main/java/org/floens/chan/core/presenter/ReplyPresenter.java
@@ -394,6 +394,7 @@ public class ReplyPresenter implements AuthenticationLayoutCallback, ImagePickDe
callback.openSpoiler(false, false);
callback.openPreview(false, null);
callback.openPreviewMessage(false, null);
+ callback.destroyCurrentAuthentication();
}
private void makeSubmitCall() {
@@ -419,7 +420,9 @@ public class ReplyPresenter implements AuthenticationLayoutCallback, ImagePickDe
case AUTHENTICATION:
SiteAuthentication authentication = loadable.site.actions().postAuthenticate();
- callback.initializeAuthentication(loadable.site, authentication, this);
+ // cleanup resources tied to the new captcha layout/presenter
+ callback.destroyCurrentAuthentication();
+ callback.initializeAuthentication(loadable.site, authentication, this, useV2NoJsCaptcha);
callback.setPage(Page.AUTHENTICATION, true);
break;
diff --git a/Clover/app/src/main/java/org/floens/chan/ui/view/WrappingGridView.java b/Clover/app/src/main/java/org/floens/chan/ui/view/WrappingGridView.java
new file mode 100644
index 00000000..7e681c07
--- /dev/null
+++ b/Clover/app/src/main/java/org/floens/chan/ui/view/WrappingGridView.java
@@ -0,0 +1,50 @@
+/*
+ * Clover - 4chan browser https://github.com/Floens/Clover/
+ * Copyright (C) 2014 Floens
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package org.floens.chan.ui.view;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.GridView;
+
+public class WrappingGridView extends GridView {
+
+ public WrappingGridView(Context context) {
+ super(context);
+ }
+
+ public WrappingGridView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public WrappingGridView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int heightSpec = heightMeasureSpec;
+ if (getLayoutParams().height == ViewGroup.LayoutParams.WRAP_CONTENT) {
+ heightSpec = View.MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, View.MeasureSpec.AT_MOST);
+ }
+
+ super.onMeasure(widthMeasureSpec, heightSpec);
+ }
+
+}
\ No newline at end of file
diff --git a/Clover/app/src/main/java/org/floens/chan/utils/BackgroundUtils.java b/Clover/app/src/main/java/org/floens/chan/utils/BackgroundUtils.java
index 6062d117..db57cc5b 100644
--- a/Clover/app/src/main/java/org/floens/chan/utils/BackgroundUtils.java
+++ b/Clover/app/src/main/java/org/floens/chan/utils/BackgroundUtils.java
@@ -17,11 +17,18 @@
*/
package org.floens.chan.utils;
+import android.os.Looper;
+
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicBoolean;
public class BackgroundUtils {
+
+ public static boolean isMainThread() {
+ return Thread.currentThread() == Looper.getMainLooper().getThread();
+ }
+
public static Cancelable runWithExecutor(Executor executor, final Callable background,
final BackgroundResult result) {
final AtomicBoolean cancelled = new AtomicBoolean(false);
diff --git a/Clover/app/src/main/res/values/strings.xml b/Clover/app/src/main/res/values/strings.xml
index b3d9994d..18685f89 100644
--- a/Clover/app/src/main/res/values/strings.xml
+++ b/Clover/app/src/main/res/values/strings.xml
@@ -577,4 +577,11 @@ Don't have a 4chan Pass?
"
Themes
+ Verify
+ Reload
+ Use old captcha
+ You have to selected at least one image (if you see a captcha that does not have any matching images then it is probably a bug fill an issue and use old captcha for a while)
+ Verification is already in progress
+ Captcha request is already in progress
+ You are requesting captcha too fast