当前位置: 首页>>代码示例>>Java>>正文


Java User.discover方法代码示例

本文整理汇总了Java中com.uservoice.uservoicesdk.model.User.discover方法的典型用法代码示例。如果您正苦于以下问题:Java User.discover方法的具体用法?Java User.discover怎么用?Java User.discover使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.uservoice.uservoicesdk.model.User的用法示例。


在下文中一共展示了User.discover方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: discoverUser

import com.uservoice.uservoicesdk.model.User; //导入方法依赖的package包/类
private void discoverUser() {
    User.discover(emailField.getText().toString(), new Callback<User>() {
        @Override
        public void onModel(User model) {
            passwordFields.setVisibility(View.VISIBLE);
            nameField.setVisibility(View.GONE);
            passwordField.requestFocus();
        }

        @Override
        public void onError(RestResult error) {
            passwordFields.setVisibility(View.GONE);
            nameField.setVisibility(View.VISIBLE);
            nameField.requestFocus();
        }
    });
}
 
开发者ID:goodev,项目名称:android-discourse,代码行数:18,代码来源:SigninDialogFragment.java

示例2: signIn

import com.uservoice.uservoicesdk.model.User; //导入方法依赖的package包/类
private void signIn() {
    User currentUser = Session.getInstance().getUser();
    if (currentUser != null && (email == null || email.equals(currentUser.getEmail()))) {
        callback.run();
    } else {
        email = email == null ? Session.getInstance().getEmail() : email;
        name = name == null ? Session.getInstance().getName() : name;
        if (email != null) {
            User.discover(email, new Callback<User>() {
                @Override
                public void onModel(User model) {
                    promptToSignIn();
                }

                @Override
                public void onError(RestResult error) {
                    createUser();
                }
            });
        } else {
            promptToSignIn();
        }
    }
}
 
开发者ID:goodev,项目名称:android-discourse,代码行数:25,代码来源:SigninManager.java

示例3: discoverUser

import com.uservoice.uservoicesdk.model.User; //导入方法依赖的package包/类
private void discoverUser() {
    User.discover(getActivity(), emailField.getText().toString(), new Callback<User>() {
        @Override
        public void onModel(User model) {
            passwordFields.setVisibility(View.VISIBLE);
            nameField.setVisibility(View.GONE);
            passwordField.requestFocus();
        }

        @Override
        public void onError(RestResult error) {
            passwordFields.setVisibility(View.GONE);
            nameField.setVisibility(View.VISIBLE);
            nameField.requestFocus();
        }
    });
}
 
开发者ID:uservoice,项目名称:uservoice-android-sdk,代码行数:18,代码来源:SigninDialogFragment.java

示例4: signIn

import com.uservoice.uservoicesdk.model.User; //导入方法依赖的package包/类
private void signIn() {
    User currentUser = Session.getInstance().getUser();
    if (currentUser != null && (email == null || email.equals(currentUser.getEmail()))) {
        callback.onSuccess();
    } else if (Session.getInstance().getAccessToken() != null) {
        // If we have an access token but no user, they have signed in in this session. Don't prompt again.
        callback.onSuccess();
    } else if (!isValidEmail(email)) {
        Toast.makeText(activity, R.string.uv_msg_bad_email_format, Toast.LENGTH_SHORT).show();
        callback.onFailure();
    } else {
        email = email == null ? Session.getInstance().getEmail(activity) : email;
        name = name == null ? Session.getInstance().getName(activity) : name;
        if (email != null) {
            User.discover(activity, email, new Callback<User>() {
                @Override
                public void onModel(User model) {
                    promptToSignIn();
                }

                @Override
                public void onError(RestResult error) {
                    createUser();
                }
            });
        } else {
            promptToSignIn();
        }
    }
}
 
开发者ID:uservoice,项目名称:uservoice-android-sdk,代码行数:31,代码来源:SigninManager.java


注:本文中的com.uservoice.uservoicesdk.model.User.discover方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。