本文整理汇总了Java中com.umeng.comm.core.beans.CommUser类的典型用法代码示例。如果您正苦于以下问题:Java CommUser类的具体用法?Java CommUser怎么用?Java CommUser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CommUser类属于com.umeng.comm.core.beans包,在下文中一共展示了CommUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillOneItem
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
/**
* 填充feed每项数据</br>
*
* @param item
*/
private void fillOneItem(FeedItem item) {
if (item == null) {
return;
}
DBRelationOP<CommUser> feedCreator = EntityRelationFactory.createFeedCreator();
DBRelationOP<List<CommUser>> feedFriends = EntityRelationFactory.createFeedFriends();
DBRelationOP<List<Topic>> feedTopic = EntityRelationFactory.createFeedTopic();
// DBRelationOP<List<Like>> feedLike =
// EntityRelationFactory.createFeedLike();
// DBRelationOP<List<Comment>> feedComment =
// EntityRelationFactory.createFeedComment();
item.creator = feedCreator.queryById(item.id);
item.atFriends = feedFriends.queryById(item.id);
item.imageUrls = selectImagesForFeed(item.id);
item.topics = feedTopic.queryById(item.id);
// item.likes = feedLike.queryById(item.id);
// item.comments = feedComment.queryById(item.id);
}
示例2: setupItemClickListener
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
public void setupItemClickListener(View rootView, final CommUser user) {
if (!isFromFindPage) {
return;
}
rootView.setOnClickListener(new Listeners.LoginOnViewClickListener() {
@Override
protected void doAfterLogin(View v) {
Intent intent = new Intent();
ComponentName componentName = new ComponentName(mContext,
UserInfoActivity.class);
intent.setComponent(componentName);
intent.putExtra(Constants.TAG_USER, user);
((Activity) mContext).startActivity(intent);
}
});
}
示例3: bindItemData
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
@Override
protected void bindItemData(SearchUserViewHolder viewHolder, final CommUser user, int position) {
ImgDisplayOption option = ImgDisplayOption.getOptionByGender(user.gender);
if (TextUtils.isEmpty(user.iconUrl)) {
viewHolder.mImg.setImageResource(option.mLoadingResId);
} else {
mImageLoader.displayImage(user.iconUrl, viewHolder.mImg, option);
}
viewHolder.mTxt.setText(user.name);
viewHolder.itemView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mActivity, UserInfoActivity.class);
intent.putExtra(Constants.TAG_USER, user);
mActivity.startActivity(intent);
}
});
}
示例4: initWidgets
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
@Override
protected void initWidgets() {
super.initWidgets();
List<CommUser> users = getArguments().getParcelableArrayList(Constants.TAG_USERS);
mAdapter.addData(users);
mRefreshLvLayout.setRefreshing(true);
String nextPageUrl = getArguments().getString(HttpProtocol.NAVIGATOR_KEY);
mPresenter.setNextPageUrl(nextPageUrl);
mRootView.findViewById(ResFinder.getId("umeng_comm_save_bt")).setVisibility(View.GONE);
mBackView = mRootView.findViewById(ResFinder.getId("umeng_comm_setting_back"));
mBackView.setVisibility(View.VISIBLE);
mBackView.setOnClickListener(this);
mTitleTextView.setText(ResFinder.getString("umeng_comm_relation_user"));
mRefreshLvLayout.setOnLoadListener(new OnLoadListener() {
@Override
public void onLoad() {
mPresenter.loadMoreData();
}
});
BroadcastUtils.registerUserBroadcast(getActivity(), mReceiver);
}
示例5: onReceiveUser
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
public void onReceiveUser(android.content.Intent intent) {
CommUser newUser = getUser(intent);
BROADCAST_TYPE type = getType(intent);
boolean follow = true;
if (type == BROADCAST_TYPE.TYPE_USER_FOLLOW) {
follow = true;
} else if (type == BROADCAST_TYPE.TYPE_USER_CANCEL_FOLLOW) {
follow = false;
}
List<CommUser> users = mAdapter.getDataSource();
for (CommUser user : users) {
if (user.id.equals(newUser.id)) {
user.extraData.putBoolean(Constants.IS_FOCUSED, follow);
break;
}
}
mAdapter.notifyDataSetChanged();
}
示例6: loadDataFromDB
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
@Override
public void loadDataFromDB() {
if (!mUid.equals(CommConfig.getConfig().loginedUser.id)) {
return;
}
mFollowDBAPI.loadFollowedUsersFromDB(mUid, new
SimpleFetchListener<List<CommUser>>() {
@Override
public void onComplete(List<CommUser> fans) {
if (CommonUtils.isActivityAlive(convertContextToActivity())
&& !CommonUtils.isListEmpty(fans)) {
List<CommUser> dataSource = mFollowedUserView.getBindDataSource();
fans.removeAll(dataSource);
if (fans.size() > 0) {
dataSource.addAll(fans);
mFollowedUserView.notifyDataSetChanged();
}
mFollowedUserView.executeCallback(fans.size());
}
}
});
}
示例7: onFollowOrUnFollow
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
@Override
public void onFollowOrUnFollow(final CommUser user, final ToggleButton toggleButton,
final boolean isFollow) {
CommonUtils.checkLoginAndFireCallback(getActivity(),
new SimpleFetchListener<LoginResponse>() {
@Override
public void onComplete(LoginResponse response) {
if (response.errCode != ErrorCode.NO_ERROR) {
toggleButton.setChecked(!toggleButton.isChecked());
return;
}
if (isFollow) {
mPresenter.followUser(user, toggleButton);
} else {
mPresenter.cancelFollowUser(user, toggleButton);
}
}
});
}
示例8: updateUserProfile
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
public void updateUserProfile(final CommUser user) {
mCommunitySDK.updateUserProfile(user, new CommListener() {
@Override
public void onStart() {
mProfileSettingView.showLoading(true);
}
@Override
public void onComplete(Response response) {
mProfileSettingView.showLoading(false);
showResponseToast(response);
if (response.errCode == ErrorCode.NO_ERROR) {
CommConfig.getConfig().loginedUser = user;
saveUserInfo(response, user);
BroadcastUtils.sendUserUpdateBroadcast(mActivity, user);
} else {
showResponseToast(response);
}
}
});
}
示例9: createView
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
/**
* 创建每个子View</br>
*
* @param user
* @return
*/
private View createView(final CommUser user) {
RoundImageView userImageView = new RoundImageView(getContext());
userImageView.setScaleType(ScaleType.FIT_XY);
LayoutParams params = new LayoutParams(mItemWidth, mItemWidth);
params.setMargins(0, 0, mItemPadding, 0);
params.gravity = Gravity.CENTER_VERTICAL;
userImageView.setLayoutParams(params);
userImageView.setOnClickListener(new LoginOnViewClickListener() {
@Override
protected void doAfterLogin(View v) {
Intent intent = new Intent();
intent.setClass(getContext(), UserInfoActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Constants.TAG_USER, user);
getContext().startActivity(intent);
}
});
userImageView.setImageUrl(user.iconUrl,
ImgDisplayOption.getOptionByGender(user.gender));
return userImageView;
}
示例10: onClick
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
@Override
public void onClick(View v) {
int id = v.getId();
if (id == ResFinder.getId("umeng_comm_back")) {// 返回事件
hideInputMethod();
getActivity().finish();
} else if (id == mMoreView.getId()) {// 点击更多按钮
// 跳转到相关用户页面
Intent intent = new Intent(getActivity(), RelativeUserActivity.class);
Bundle bundle = new Bundle();
ArrayList<CommUser> users = new ArrayList<CommUser>(mAdapter.getDataSource());
bundle.putParcelableArrayList(Constants.TAG_USERS, users);
String nextUrl = ((SearchPresenter) mPresenter).getUserNextUrl();
bundle.putString(HttpProtocol.NAVIGATOR_KEY, nextUrl);
intent.putExtras(bundle);
getActivity().startActivity(intent);
}
}
示例11: mockLoginData
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
/**
* 模拟用户登录操作,自定义过程中用户可以构造用户名、密码输入界面
*/
private void mockLoginData() {
Log.d("", "### 使用自己的账户系统登录,然后将标识用户唯一性的id和source传递给社区SDK ");
Random random = new Random();
CommUser loginedUser = new CommUser();
String userId = "id" + random.nextInt(Integer.MAX_VALUE);
loginedUser.id = userId; // 用户id
loginedUser.name = "name" + random.nextInt(Integer.MAX_VALUE); // 用户名
loginedUser.source = Source.SELF_ACCOUNT;// 登录系统来源
loginedUser.gender = Gender.FEMALE;// 用户性别
loginedUser.level = random.nextInt(100); // 用户等级
loginedUser.score = random.nextInt(100);// 积分
if (sLoginListener != null) {
// 登录完成回调给社区SDK,200代表登录成功
sLoginListener.onComplete(200, loginedUser);
}
}
示例12: setupUserInfo
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
/**
* 设置用户相关的信息 </br>
*
* @param user
*/
public void setupUserInfo(CommUser user) {
if ( !user.id.equals(mUser.id)) {
return ;
}
mUser = user;
mUserNameTv.setText(user.name);
if (user.gender == Gender.MALE) {
mGenderImageView.setImageDrawable(ResFinder.getDrawable("umeng_comm_gender_male"));
} else if (user.gender == Gender.FEMALE) {
mGenderImageView.setImageDrawable(ResFinder.getDrawable("umeng_comm_gender_female"));
}
ImgDisplayOption option = ImgDisplayOption.getOptionByGender(mUser.gender);
// 设置用户头像
mHeaderImageView.setImageUrl(user.iconUrl, option);
ImageLoaderManager.getInstance().getCurrentSDK().resume();
if (isHideFollowStatus()) {
mFollowToggleButton.setVisibility(View.GONE);
} else {
mFollowToggleButton.setVisibility(View.VISIBLE);
mFollowToggleButton.setChecked(mUser.isFollowed);
}
}
示例13: findFollowedByMe
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
/**
* 检查该用户是否是当前登录用户的好友 [ 关注 ]
*/
public void findFollowedByMe() {
DatabaseAPI.getInstance().getFollowDBAPI().isFollowed(mUser.id, new
SimpleFetchListener<List<CommUser>>() {
@Override
public void onComplete(List<CommUser> results) {
// 确保activity没有被销毁
if (!CommonUtils.isActivityAlive(mActivity)) {
return;
}
if (!CommonUtils.isListEmpty(results)) {
mUserInfoView.setToggleButtonStatus(true);
} else {
mUserInfoView.setToggleButtonStatus(false);
}
}
});
}
示例14: setupAdater
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
@Override
protected void setupAdater() {
mAdapter = new PickerAdapter<CommUser>(getContext()) {
@Override
public void bindData(FriendItemViewHolder viewHolder, CommUser item, int position) {
viewHolder.mTextView.setText(item.name);
viewHolder.mDetailTextView.setVisibility(View.GONE);
ImgDisplayOption option = ImgDisplayOption.getOptionByGender(item.gender);
viewHolder.mImageView.setImageUrl(item.iconUrl, option);
}
};
mRefreshLvLayout.setAdapter(mAdapter);
String title = ResFinder.getString("umeng_comm_my_friends");
mTitleTextView.setText(title);
mListView.setFooterDividersEnabled(true);
mListView.setOverscrollFooter(null);
}
示例15: setupUserIcon
import com.umeng.comm.core.beans.CommUser; //导入依赖的package包/类
/**
* 设置用户头像
*
* @param userIconImageView 用户头像的SquareImageView
* @param iconUrl 用户头像的url
*/
private void setupUserIcon(final NetworkImageView userIconImageView,
final CommUser user) {
if (user == null || userIconImageView == null) {
return;
}
ImgDisplayOption option = ImgDisplayOption.getOptionByGender(user.gender);
userIconImageView.setImageUrl(user.iconUrl, option);
userIconImageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// 跳转用户中心前检查是否登录
mPresenter.gotoUserInfoActivity(user, mContainerClzName);
}
});
}