Search in sources :

Example 16 with MainActivity

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();
        }
    }
}
Also used : MainActivity(com.hippo.ehviewer.ui.MainActivity)

Example 17 with MainActivity

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();
    }
}
Also used : Announcer(com.hippo.scene.Announcer) MainActivity(com.hippo.ehviewer.ui.MainActivity)

Example 18 with MainActivity

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);
}
Also used : Context(android.content.Context) MainActivity(com.hippo.ehviewer.ui.MainActivity) EhRequest(com.hippo.ehviewer.client.EhRequest)

Aggregations

MainActivity (com.hippo.ehviewer.ui.MainActivity)18 Context (android.content.Context)10 EhRequest (com.hippo.ehviewer.client.EhRequest)6 AlertDialog (android.support.v7.app.AlertDialog)3 GalleryInfo (com.hippo.ehviewer.client.data.GalleryInfo)3 DialogInterface (android.content.DialogInterface)2 Point (android.graphics.Point)2 ShowcaseView (com.github.amlcurran.showcaseview.ShowcaseView)2 SimpleShowcaseEventListener (com.github.amlcurran.showcaseview.SimpleShowcaseEventListener)2 CheckBoxDialogBuilder (com.hippo.app.CheckBoxDialogBuilder)2 Announcer (com.hippo.scene.Announcer)2 SuppressLint (android.annotation.SuppressLint)1 Dialog (android.app.Dialog)1 Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 RecyclerView (android.support.v7.widget.RecyclerView)1 SpannableString (android.text.SpannableString)1 Display (android.view.Display)1 PointTarget (com.github.amlcurran.showcaseview.targets.PointTarget)1 ViewTarget (com.github.amlcurran.showcaseview.targets.ViewTarget)1