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


Java User类代码示例

本文整理汇总了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();
        }
    });
}
 
开发者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: 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();
    }
}
 
开发者ID:Turistforeningen,项目名称:SjekkUT,代码行数:11,代码来源:Utils.java

示例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;
}
 
开发者ID:Turistforeningen,项目名称:SjekkUT,代码行数:13,代码来源:Utils.java

示例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);
    }
}
 
开发者ID:Turistforeningen,项目名称:SjekkUT,代码行数:11,代码来源:Utils.java

示例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();
        }
    });
}
 
开发者ID:goodev,项目名称:android-discourse,代码行数:10,代码来源:SigninDialogFragment.java

示例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();
        }
    });
}
 
开发者ID:uservoice,项目名称:uservoice-android-sdk,代码行数:10,代码来源:SigninDialogFragment.java

示例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();
        }
    }
}
 
开发者ID:uservoice,项目名称:uservoice-android-sdk,代码行数:31,代码来源:SigninManager.java

示例10: getUser

import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
public User getUser() {
    return user;
}
 
开发者ID:goodev,项目名称:android-discourse,代码行数:4,代码来源:Session.java

示例11: setUser

import com.uservoice.uservoicesdk.model.User; //导入依赖的package包/类
public void setUser(User user) {
    this.user = user;
    persistIdentity(user.getName(), user.getEmail());
}
 
开发者ID:goodev,项目名称:android-discourse,代码行数:5,代码来源:Session.java

示例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());
}
 
开发者ID:uservoice,项目名称:uservoice-android-sdk,代码行数:5,代码来源:Session.java


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