本文整理汇总了Java中com.avos.avoscloud.AVUser.getUsername方法的典型用法代码示例。如果您正苦于以下问题:Java AVUser.getUsername方法的具体用法?Java AVUser.getUsername怎么用?Java AVUser.getUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avos.avoscloud.AVUser
的用法示例。
在下文中一共展示了AVUser.getUsername方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillFriendsData
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
private void fillFriendsData(List<AVUser> datas) {
friends.clear();
int total = datas.size();
for (int i = 0; i < total; i++) {
AVUser user = datas.get(i);
AVUser sortUser = new AVUser();
sortUser.put("avatar", user.getAVFile("avatar"));
sortUser.setUsername(user.getUsername());
sortUser.setObjectId(user.getObjectId());
String username = sortUser.getUsername();
if (username != null) {
String pinyin = CharacterParser.getPingYin(user.getUsername());
String sortString = pinyin.substring(0, 1).toUpperCase();
if (sortString.matches("[A-Z]")) {
Log.d("lan", sortString.toUpperCase());
} else {
Log.d("lan", "#");
}
} else {
Log.d("lan", "#");
}
friends.add(sortUser);
}
Collections.sort(friends, pinyinComparator);
}
示例2: getItem
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
final Map<String, Object> item = new HashMap<String, Object>();
AVUser user = (AVUser) MeetList.get(position).get("user");
String name = user.getUsername();
AVFile avatar = user.getAVFile("avatar");
String avatarUrl = getAvatarUrl(user);
String times = MeetList.get(position).get("times").toString();
times = "相遇" + times + "次";
item.put("name", name);
item.put("avatar", avatarUrl);
item.put("times", times);
return item;
}
示例3: addMeeting
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public static void addMeeting(AVObject meetinfo) {
AVUser adduser = meetinfo.getAVUser("YourUser");
String username = adduser.getUsername();
for (HashMap<String, Object> meet : list) {
AVUser user = (AVUser) meet.get("user");
String name = user.getUsername();
if (name.equals(username)) {
int times = Integer.valueOf(meet.get("times").toString());
meet.put("times", times + 1);
return;
}
}
HashMap<String, Object> newuser = new HashMap<String, Object>();
newuser.put("user", adduser);
newuser.put("times", 1);
list.add(newuser);
}
示例4: addMeet
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
private void addMeet(AVObject meet) {
String objectId = meet.getObjectId();
MeetInfo meetInfo = meetInfoHashMap.get(objectId);
if (meetInfo != null) {
meetInfo.addTimes();
} else {
AVUser user = meet.getAVUser("YourUser");
meetInfo = new MeetInfo(user.getUsername(), 1);
}
meetInfoHashMap.put(objectId, meetInfo);
}
示例5: initView
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
private void initView() {
mContext = context;
View fragmentView = getView();
AVUser user = AVUser.getCurrentUser();
userStr = user.getUsername();
pass = user.getString("password");
toQuery();
container = (RelativeLayout) fragmentView.findViewById(R.id.container);
status = (TextView) fragmentView.findViewById(R.id.txt_loveStatus);
statusWord = (TextView) fragmentView.findViewById(R.id.txt_statusWord);
loverPhone = (EditText) fragmentView.findViewById(R.id.edit_loverPhone);
loverName = (EditText) fragmentView.findViewById(R.id.edit_loverName);
toSay = (EditText) fragmentView.findViewById(R.id.edit_blog);
bind = (Button) fragmentView.findViewById(R.id.btn_bind);
writeBlog = (Button) fragmentView.findViewById(R.id.btn_toSay);
myBlog = (Button) fragmentView.findViewById(R.id.btn_myBlog);
itsBlog = (Button) fragmentView.findViewById(R.id.btn_itsBlog);
changeLove = (Button) fragmentView.findViewById(R.id.changeLove);
arrow = (ImageView) fragmentView.findViewById(R.id.img_arrow);
bind.setOnClickListener(this);
writeBlog.setOnClickListener(this);
myBlog.setOnClickListener(this);
itsBlog.setOnClickListener(this);
changeLove.setOnClickListener(this);
}
示例6: getView
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = LayoutInflater.from(context).inflate(
R.layout.item_user_friend, null);
}
TextView alpha = ViewHolder.findViewById(convertView, R.id.alpha);
TextView nameView = ViewHolder.findViewById(convertView,
R.id.tv_friend_name);
ImageView avatarView = ViewHolder.findViewById(convertView,
R.id.img_friend_avatar);
AVUser friend = data.get(position);
final String name = friend.getUsername();
final String avatarUrl = getAvatarUrl(friend);
UserService.displayAvatar(avatarUrl, avatarView);
nameView.setText(name);
int section = getSectionForPosition(position);
if (position == getPositionForSection(section)) {
alpha.setVisibility(View.VISIBLE);
alpha.setText(getSortLetters(friend));
} else {
alpha.setVisibility(View.GONE);
}
return convertView;
}
示例7: getSortLetters
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
private String getSortLetters(AVUser user) {
String username = user.getUsername();
if (username != null) {
String pinyin = CharacterParser.getPingYin(user.getUsername());
String sortString = pinyin.substring(0, 1).toUpperCase();
if (sortString.matches("[A-Z]")) {
return sortString.toUpperCase();
} else {
return "#";
}
} else {
return "#";
}
}
示例8: updateView
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
private void updateView() {
AVUser Myuser = AVUser.getCurrentUser();
String MyUrl = getAvatarUrl(Myuser);
String MyName = Myuser.getUsername();
String YourUrl = getAvatarUrl(yourUser);
String YourName = yourUser.getUsername();
UserService.displayAvatar(MyUrl, myAvatar);
UserService.displayAvatar(YourUrl, yourAvatar);
myName.setText(MyName);
yournName.setText(YourName);
}
示例9: getFromName
import com.avos.avoscloud.AVUser; //导入方法依赖的package包/类
public String getFromName() {
String peerId = getFromPeerId();
AVUser user = DemoApplication.lookupUser(peerId);
return user.getUsername();
}