去掉隐私协议同意倒计时
This commit is contained in:
@@ -18,24 +18,16 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.mango.core.UriProvider;
|
||||||
import com.mango.moshen.R;
|
import com.mango.moshen.R;
|
||||||
import com.mango.moshen.common.widget.OriginalDrawStatusClickSpan;
|
import com.mango.moshen.common.widget.OriginalDrawStatusClickSpan;
|
||||||
import com.mango.moshen.ui.webview.SimpleWebViewActivity;
|
import com.mango.moshen.ui.webview.SimpleWebViewActivity;
|
||||||
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
import com.mango.moshen.ui.widget.magicindicator.buildins.UIUtil;
|
||||||
import com.mango.core.UriProvider;
|
|
||||||
import com.mango.xchat_android_library.utils.ScreenUtils;
|
import com.mango.xchat_android_library.utils.ScreenUtils;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
|
||||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
|
||||||
import io.reactivex.disposables.Disposable;
|
|
||||||
|
|
||||||
public class PrivacyAgreementDialog extends Dialog implements View.OnClickListener {
|
public class PrivacyAgreementDialog extends Dialog implements View.OnClickListener {
|
||||||
|
|
||||||
private final int intervalTimeCount = 2;
|
|
||||||
private OnCallBack onCallBack;
|
private OnCallBack onCallBack;
|
||||||
private Disposable disposable;
|
|
||||||
|
|
||||||
public PrivacyAgreementDialog(@NonNull Context context) {
|
public PrivacyAgreementDialog(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@@ -53,17 +45,6 @@ public class PrivacyAgreementDialog extends Dialog implements View.OnClickListen
|
|||||||
TextView tvConfirm = findViewById(R.id.tv_confirm);
|
TextView tvConfirm = findViewById(R.id.tv_confirm);
|
||||||
tvConfirm.setEnabled(false);
|
tvConfirm.setEnabled(false);
|
||||||
tvConfirm.setOnClickListener(this);
|
tvConfirm.setOnClickListener(this);
|
||||||
disposable = Observable.intervalRange(0, intervalTimeCount + 1, 0, 1, TimeUnit.SECONDS)
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(aLong -> {
|
|
||||||
long residueCount = intervalTimeCount - aLong;
|
|
||||||
if (residueCount == 0) {
|
|
||||||
tvConfirm.setEnabled(true);
|
|
||||||
tvConfirm.setText("同意");
|
|
||||||
} else {
|
|
||||||
tvConfirm.setText("同意(" + residueCount + "s)");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
findViewById(R.id.btn_cancel).setOnClickListener(this);
|
findViewById(R.id.btn_cancel).setOnClickListener(this);
|
||||||
TextView tvDesc = findViewById(R.id.tv_desc);
|
TextView tvDesc = findViewById(R.id.tv_desc);
|
||||||
String privacyAgreementTip = getContext().getString(R.string.tip_privacy_agreement);
|
String privacyAgreementTip = getContext().getString(R.string.tip_privacy_agreement);
|
||||||
@@ -115,7 +96,6 @@ public class PrivacyAgreementDialog extends Dialog implements View.OnClickListen
|
|||||||
if (onCallBack != null) {
|
if (onCallBack != null) {
|
||||||
onCallBack.onFinish(v.getId() == R.id.tv_confirm);
|
onCallBack.onFinish(v.getId() == R.id.tv_confirm);
|
||||||
}
|
}
|
||||||
if (disposable != null) disposable.dispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnCallBack {
|
public interface OnCallBack {
|
||||||
|
Reference in New Issue
Block a user