Search in sources :

Example 1 with FriendList

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;
}
Also used : FriendList(com.abewy.android.apps.klyph.core.fql.FriendList)

Example 2 with FriendList

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;
}
Also used : FriendList(com.abewy.android.apps.klyph.core.fql.FriendList)

Example 3 with 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());
}
Also used : FriendList(com.abewy.android.apps.klyph.core.fql.FriendList) PicturePrimaryTextHolder(com.abewy.android.apps.klyph.adapter.holder.PicturePrimaryTextHolder)

Example 4 with FriendList

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("");
    }
}
Also used : FriendList(com.abewy.android.apps.klyph.core.fql.FriendList) IActionbarSpinner(com.abewy.android.apps.klyph.app.IActionbarSpinner)

Example 5 with FriendList

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();
}
Also used : AlertDialog(android.app.AlertDialog) FriendList(com.abewy.android.apps.klyph.core.fql.FriendList) DialogInterface(android.content.DialogInterface) MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) LayoutInflater(android.view.LayoutInflater) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject) TextView(android.widget.TextView) View(android.view.View)

Aggregations

FriendList (com.abewy.android.apps.klyph.core.fql.FriendList)6 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 LayoutInflater (android.view.LayoutInflater)1 View (android.view.View)1 TextView (android.widget.TextView)1 MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)1 PicturePrimaryTextHolder (com.abewy.android.apps.klyph.adapter.holder.PicturePrimaryTextHolder)1 IActionbarSpinner (com.abewy.android.apps.klyph.app.IActionbarSpinner)1 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)1 JSONException (org.json.JSONException)1 JSONObject (org.json.JSONObject)1