本文整理汇总了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();
}
});
}
示例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();
}
}
}
示例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();
}
});
}
示例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();
}
}
}