use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class SecurityScene method onPatternDetected.
@Override
public void onPatternDetected(List<LockPatternView.Cell> pattern) {
MainActivity activity = getActivity2();
if (null == activity || null == mPatternView) {
return;
}
String enteredPatter = LockPatternUtils.patternToString(pattern);
String targetPatter = Settings.getSecurity();
if (ObjectUtils.equal(enteredPatter, targetPatter)) {
startSceneForCheckStep(CHECK_STEP_SECURITY, getArguments());
finish();
} else {
mPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
mRetryTimes--;
if (mRetryTimes <= 0) {
finish();
}
}
}
use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class SignInScene method onClick.
@Override
public void onClick(View v) {
MainActivity activity = getActivity2();
if (null == activity) {
return;
}
if (mRegister == v) {
UrlOpener.openUrl(activity, EhUrl.URL_REGISTER, false);
} else if (mSignIn == v) {
signIn();
} else if (mSignInViaWebView == v) {
startScene(new Announcer(WebViewSignInScene.class).setRequestCode(this, REQUEST_CODE_WEBVIEW));
} else if (mSignInViaCookies == v) {
startScene(new Announcer(CookieSignInScene.class).setRequestCode(this, REQUEST_CODE_COOKIE));
} else if (mSkipSigningIn == v) {
// Set gallery size SITE_E if skip sign in
Settings.putGallerySite(EhUrl.SITE_E);
redirectTo();
}
}
use of com.hippo.ehviewer.ui.MainActivity in project EhViewer by seven332.
the class SignInScene method getProfile.
private void getProfile() {
Context context = getContext2();
MainActivity activity = getActivity2();
if (null == context || null == activity) {
return;
}
hideSoftInput();
showProgress(true);
EhCallback callback = new GetProfileListener(context, activity.getStageId(), getTag());
mRequestId = ((EhApplication) context.getApplicationContext()).putGlobalStuff(callback);
EhRequest request = new EhRequest().setMethod(EhClient.METHOD_GET_PROFILE).setCallback(callback);
EhApplication.getEhClient(context).execute(request);
}
Aggregations