本文整理汇总了Java中com.uservoice.uservoicesdk.model.User类的典型用法代码示例。如果您正苦于以下问题:Java User类的具体用法?Java User怎么用?Java User使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
User类属于com.uservoice.uservoicesdk.model包,在下文中一共展示了User类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: clearUserVoiceUser
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
@SuppressLint("ApplySharedPref")
private static void clearUserVoiceUser(Context context, Session session) {
if (session != null) {
session.setUser(context, new User());
SharedPreferences.Editor edit = session.getSharedPreferences(context).edit();
edit.remove("user_name");
edit.remove("user_email");
edit.commit();
}
}
示例5: toUser
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
public static User toUser(MemberData member) {
User user = new User();
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("id", member.sherpa_id);
jsonObject.put("name", member.getFullname());
jsonObject.put("email", member.epost);
user.load(jsonObject);
} catch (JSONException ignored) {
}
return user;
}
示例6: setRavenUser
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
public static void setRavenUser(Context context) {
if (context != null && Raven.getStoredInstance() != null && PreferenceUtils.hasUserId(context) && PreferenceUtils.hasUserFullname(context) && PreferenceUtils.hasUserEmail(context)) {
com.getsentry.raven.event.User user = new UserBuilder()
.setId(PreferenceUtils.getUserId(context))
.setEmail(PreferenceUtils.getUserEmail(context))
.setUsername(PreferenceUtils.getUserFullname(context))
.build();
Raven.getStoredInstance().getContext().setUser(user);
}
}
示例7: sendForgotPassword
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
private void sendForgotPassword() {
final Activity activity = getActivity();
User.sendForgotPassword(emailField.getText().toString(), new DefaultCallback<User>(getActivity()) {
@Override
public void onModel(User model) {
Toast.makeText(activity, R.string.uv_msg_forgot_password, Toast.LENGTH_SHORT).show();
}
});
}
示例8: sendForgotPassword
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
private void sendForgotPassword() {
final Activity activity = getActivity();
User.sendForgotPassword(getActivity(), emailField.getText().toString(), new DefaultCallback<User>(getActivity()) {
@Override
public void onModel(User model) {
Toast.makeText(activity, R.string.uv_msg_forgot_password, Toast.LENGTH_SHORT).show();
}
});
}
示例9: 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();
}
}
}
示例10: getUser
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
public User getUser() {
return user;
}
示例11: setUser
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
public void setUser(User user) {
this.user = user;
persistIdentity(user.getName(), user.getEmail());
}
示例12: setUser
import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
public void setUser(Context context, User user) {
this.user = user;
persistIdentity(context, user.getName(), user.getEmail());
}