use of com.abewy.android.apps.klyph.core.fql.FriendList in project Klyph by jonathangerbaud.
the class StreamListFragment method onNavigationItemSelected.
@Override
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
if (spinnerPosition != itemPosition) {
spinnerPosition = itemPosition;
cancelRequest();
if (spinnerPosition == 0) {
int query = KlyphPreferences.isAlternativeNewsfeed() ? Query.ALTERNATIVE_NEWSFEED : Query.NEWSFEED;
setRequestType(query);
setNewestRequestType(query);
setElementId(KlyphSession.getSessionUserId());
canSaveStream = true;
} else {
int query = Query.FRIEND_LIST_NEWSFEED;
setRequestType(query);
setNewestRequestType(query);
FriendList fl = (FriendList) friendLists.get(itemPosition);
setElementId(fl.getFlid());
canSaveStream = false;
}
setOffset(null);
clearAndRefresh();
return true;
}
return false;
}
use of com.abewy.android.apps.klyph.core.fql.FriendList in project Klyph by jonathangerbaud.
the class FriendListDeserializer method deserializeObject.
@Override
public GraphObject deserializeObject(JSONObject data) {
FriendList friendList = new FriendList();
deserializePrimitives(friendList, data);
return friendList;
}
use of com.abewy.android.apps.klyph.core.fql.FriendList in project Klyph by jonathangerbaud.
the class FriendListAdapter method mergeViewWithData.
@Override
protected void mergeViewWithData(View view, GraphObject data) {
super.mergeViewWithData(view, data);
PicturePrimaryTextHolder holder = (PicturePrimaryTextHolder) getHolder(view);
FriendList friendList = (FriendList) data;
holder.getPrimaryText().setText(friendList.getName());
}
use of com.abewy.android.apps.klyph.core.fql.FriendList in project Klyph by jonathangerbaud.
the class StreamListFragment method onSetToFront.
@Override
public void onSetToFront(Activity activity) {
friendLists = KlyphData.getFriendLists();
if (activity != null && friendLists != null && friendLists.size() > 0) {
FriendList fl = new FriendList();
fl.setOwner(KlyphSession.getSessionUserId());
fl.setName(activity.getString(R.string.fragment_header_newsfeed));
friendLists.add(0, fl);
((IActionbarSpinner) activity).displaySpinnerInActionBar(friendLists, spinnerPosition, this);
activity.setTitle("");
}
}
use of com.abewy.android.apps.klyph.core.fql.FriendList in project Klyph by jonathangerbaud.
the class NewAlbumDialog method onCreateDialog.
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.dialog_new_album, null);
name = (TextView) view.findViewById(R.id.name);
location = (TextView) view.findViewById(R.id.location);
description = (TextView) view.findViewById(R.id.description);
privacy = (Spinner) view.findViewById(R.id.privacy);
/*ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(getActivity(), R.array.privacy,
android.R.layout.simple_spinner_item);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);*/
MultiObjectAdapter adapter = new MultiObjectAdapter(null, SpecialLayout.DROP_DOWN_ITEM);
FriendList publicFL = new FriendList();
publicFL.setName(getActivity().getString(R.string.menu_privacy_public));
FriendList friendsFL = new FriendList();
friendsFL.setName(getActivity().getString(R.string.menu_privacy_friends));
FriendList selfFL = new FriendList();
selfFL.setName(getActivity().getString(R.string.menu_privacy_self));
adapter.add(publicFL);
adapter.add(friendsFL);
adapter.add(selfFL);
List<GraphObject> friendLists = KlyphData.getFriendLists();
if (friendLists != null) {
for (GraphObject graphObject : friendLists) {
adapter.add(graphObject);
}
}
privacy.setAdapter(adapter);
privacy.setSelection(KlyphPreferences.getPrivacy());
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setView(view);
builder.setTitle(R.string.new_album).setPositiveButton(R.string.create, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
createAlbum();
}
}).setNegativeButton(R.string.cancel, null);
return builder.create();
}
Aggregations