use of com.abewy.android.apps.klyph.core.fql.Friend in project Klyph by jonathangerbaud.
the class FriendPickerAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
setData(view, data);
FriendPickerHolder holder = (FriendPickerHolder) getHolder(view);
// holder.getFriendPicture().setImageDrawable(null);
Friend friend = (Friend) data;
holder.getFriendName().setText(friend.getName());
// holder.getCheckbox().setSelected(user.isSelected());
((Checkable) view).setChecked(friend.isSelected());
if (placeHolder == -1)
placeHolder = AttrUtil.getResourceId(getContext(holder.getFriendPicture()), R.attr.squarePlaceHolderIcon);
loadImage(holder.getFriendPicture(), friend.getPic(), placeHolder, data);
}
use of com.abewy.android.apps.klyph.core.fql.Friend in project Klyph by jonathangerbaud.
the class FriendPickerActivity method filter.
private void filter(String filterText) {
if (filterText.length() == 0) {
getAdapter().setData(friends);
} else {
List<GraphObject> filteredUsers = new ArrayList<GraphObject>();
final String f = filterText.toLowerCase();
for (GraphObject graphObject : friends) {
Friend u = (Friend) graphObject;
if (u.getName().toLowerCase().contains(f) == true) {
filteredUsers.add(u);
}
}
getAdapter().setData(filteredUsers);
}
refreshCheckedViews();
}
use of com.abewy.android.apps.klyph.core.fql.Friend in project Klyph by jonathangerbaud.
the class FriendPickerActivity method onListItemClick.
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
Friend friend = (Friend) getAdapter().getItem(position);
if (singleChoice) {
Intent intent = new Intent();
intent.putExtra(KlyphBundleExtras.USER_ID, friend.getUid());
intent.putExtra(KlyphBundleExtras.USER_NAME, friend.getName());
setResult(RESULT_OK, intent);
finish();
} else {
startActionMode();
friend.setSelected(!friend.isSelected());
refreshActionModeTitle();
}
}
use of com.abewy.android.apps.klyph.core.fql.Friend in project Klyph by jonathangerbaud.
the class FriendPickerActivity method goBack.
private void goBack() {
if (selectionConfirmed == true && friends.size() > 0) {
List<Friend> friends = getSelectedUsers();
String[] names = new String[friends.size()];
String[] ids = new String[friends.size()];
for (int i = 0; i < friends.size(); i++) {
Friend friend = friends.get(i);
names[i] = friend.getName();
ids[i] = friend.getUid();
}
Intent intent = new Intent();
intent.putExtra(KlyphBundleExtras.FRIEND_PICKER_NAMES, names);
intent.putExtra(KlyphBundleExtras.FRIEND_PICKER_IDS, ids);
setResult(RESULT_OK, intent);
} else {
setResult(RESULT_CANCELED, null);
}
finish();
}
use of com.abewy.android.apps.klyph.core.fql.Friend in project Klyph by jonathangerbaud.
the class FriendPickerActivity method deselectAll.
private void deselectAll() {
int n = friends.size();
for (int i = 0; i < n; i++) {
Friend friend = (Friend) friends.get(i);
friend.setSelected(false);
}
refreshCheckedViews();
refreshActionModeTitle();
}
Aggregations