Search in sources :

Example 21 with MultiObjectAdapter

use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.

the class TitledFragmentActivity method displaySpinnerInActionBar.

@Override
public void displaySpinnerInActionBar(List<GraphObject> data, int position, OnNavigationListener listener) {
    MultiObjectAdapter adapter = new MultiObjectAdapter(null, SpecialLayout.DROP_DOWN_ITEM);
    adapter.addAll(data);
    getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
    getActionBar().setListNavigationCallbacks(adapter, listener);
    getActionBar().setSelectedNavigationItem(position);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)

Example 22 with MultiObjectAdapter

use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.

the class EventDeclined method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    setListAdapter(new MultiObjectAdapter(getListView()));
    defineEmptyText(R.string.empty_list_no_user);
    setListVisible(false);
    setRequestType(Query.EVENT_DECLINED);
    super.onViewCreated(view, savedInstanceState);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)

Example 23 with MultiObjectAdapter

use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.

the class EventFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    defineEmptyText(R.string.empty_list_no_data);
    setListVisible(false);
    attendButtonListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!event.isUserAttendingEvent()) {
                handleResponseClick(Query.POST_EVENT_ATTEND);
            }
        }
    };
    unsureButtonListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!event.isUserUnsureEvent()) {
                handleResponseClick(Query.POST_EVENT_UNSURE);
            }
        }
    };
    declinedButtonListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (!event.isUserDeclinedEvent()) {
                handleResponseClick(Query.POST_EVENT_DECLINE);
            }
        }
    };
    invitedGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_invitee, event.getAll_members_count()));
            dialog.setRequestType(Query.EVENT_INVITED);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    goingGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_attending, event.getAttending_count()));
            dialog.setRequestType(Query.EVENT_GOING);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    unsureGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_unsure, event.getUnsure_count()));
            dialog.setRequestType(Query.EVENT_MAYBE);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    declinedGuestListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            UserListDialog dialog = new UserListDialog();
            dialog.setCustomTitle(getString(R.string.event_num_declined, event.getDeclined_count()));
            dialog.setRequestType(Query.EVENT_DECLINED);
            dialog.setElementId(event.getEid());
            dialog.show(getFragmentManager(), "");
            dialog.load();
        }
    };
    setRequestType(Query.EVENT_TIMELINE);
    setNewestRequestType(Query.EVENT_TIMELINE);
    super.onViewCreated(view, savedInstanceState);
    MultiObjectAdapter adapter = /*KlyphPreferences.areBannerAdsEnabled() ? new NewsfeedAdapter(getListView(), SpecialLayout.EVENT_ABOUT)
				: */
    new MultiObjectAdapter(getListView(), SpecialLayout.EVENT_ABOUT);
    if (KlyphPreferences.animateCards()) {
        GoogleCardStyleAdapter gcsAdapter = new GoogleCardStyleAdapter(adapter);
        gcsAdapter.setAbsListView(getListView());
        setListAdapter(gcsAdapter);
    } else {
        setListAdapter(adapter);
    }
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) GoogleCardStyleAdapter(com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter) OnClickListener(android.view.View.OnClickListener) View(android.view.View) KlyphGridView(com.abewy.android.apps.klyph.widget.KlyphGridView)

Example 24 with MultiObjectAdapter

use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.

the class Birthdays method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    Calendar calendar = new GregorianCalendar();
    Date trialTime = new Date();
    calendar.setTime(trialTime);
    String month = String.valueOf(calendar.get(Calendar.MONTH) + 1);
    String day = String.valueOf(calendar.get(Calendar.DAY_OF_MONTH));
    if (month.length() == 1)
        month = "0" + month;
    if (day.length() == 1)
        day = "0" + day;
    setInitialOffset(month + "/" + day);
    setListAdapter(new MultiObjectAdapter(getListView(), SpecialLayout.USER_BIRTHDAY));
    defineEmptyText(R.string.empty_list_no_birthday);
    setRequestType(Query.BIRTHDAYS);
    setListVisible(false);
    super.onViewCreated(view, savedInstanceState);
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) GregorianCalendar(java.util.GregorianCalendar) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) Date(java.util.Date)

Example 25 with MultiObjectAdapter

use of com.abewy.android.apps.klyph.adapter.MultiObjectAdapter in project Klyph by jonathangerbaud.

the class GalleryFragment method goBack.

public void goBack(ArrayList<String> uris) {
    Intent intent = new Intent();
    SparseBooleanArray positions = getGridView().getCheckedItemPositions();
    int n = getGridView().getCheckedItemCount();
    if (uris == null)
        uris = new ArrayList<String>();
    if (n > 0) {
        MultiObjectAdapter adapter = getAdapter();
        for (int i = 0; i < n; i++) {
            if (adapter.getItem(positions.keyAt(i)) instanceof Picture) {
                Picture image = (Picture) adapter.getItem(positions.keyAt(i));
                uris.add(image.getUri());
            }
        }
    }
    if (uris.size() > 0) {
        intent.putStringArrayListExtra(KlyphBundleExtras.PHOTO_LIST_URI, uris);
        getActivity().setResult(Activity.RESULT_OK, intent);
    } else {
        getActivity().setResult(Activity.RESULT_CANCELED, null);
    }
    getActivity().finish();
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) SparseBooleanArray(android.util.SparseBooleanArray) ArrayList(java.util.ArrayList) Intent(android.content.Intent)

Aggregations

MultiObjectAdapter (com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)32 View (android.view.View)7 GraphObject (com.abewy.android.apps.klyph.core.graph.GraphObject)7 ArrayList (java.util.ArrayList)5 List (java.util.List)4 Filter (android.widget.Filter)3 GoogleCardStyleAdapter (com.abewy.android.apps.klyph.adapter.animation.GoogleCardStyleAdapter)3 KlyphGridView (com.abewy.android.apps.klyph.widget.KlyphGridView)3 ImageView (android.widget.ImageView)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 Friend (com.abewy.android.apps.klyph.core.fql.Friend)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 Intent (android.content.Intent)1 Handler (android.os.Handler)1 Editable (android.text.Editable)1 TextWatcher (android.text.TextWatcher)1 SparseBooleanArray (android.util.SparseBooleanArray)1 KeyEvent (android.view.KeyEvent)1