本文整理匯總了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);
}
});
}