Search in sources :

Example 1 with MultiObjectAdapter

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

the class FriendPickerActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    singleChoice = getIntent().getBooleanExtra(KlyphBundleExtras.SINGLE_CHOICE, false);
    setTitle(singleChoice ? R.string.friend_picker_single_choice_title : R.string.friend_picker_title);
    setListAdapter(new MultiObjectAdapter(getListView(), singleChoice ? SpecialLayout.FRIEND_PICKER_SINGLE : SpecialLayout.FRIEND_PICKER));
    getListView().setItemsCanFocus(false);
    getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
    searchText = (EditText) findViewById(R.id.search_text);
    searchText.addTextChangedListener(new TextWatcher() {

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            filter(s.toString());
        }

        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {
        }

        @Override
        public void afterTextChanged(Editable s) {
        }
    });
    setRequestType(Query.ALL_FRIENDS);
    if (getIntent().hasExtra(KlyphBundleExtras.FRIEND_PICKER_IDS)) {
        ArrayList<String> ids = getIntent().getStringArrayListExtra(KlyphBundleExtras.FRIEND_PICKER_IDS);
        if (ids != null && ids.size() > 0) {
            initialIds = ids;
        }
    }
    if (FRIEND_LIST == null) {
        load();
    } else {
        // reset previously selected objects
        for (GraphObject graphObject : FRIEND_LIST) {
            graphObject.setSelected(false);
        }
        populate(FRIEND_LIST);
    }
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) TextWatcher(android.text.TextWatcher) Editable(android.text.Editable) GraphObject(com.abewy.android.apps.klyph.core.graph.GraphObject)

Example 2 with MultiObjectAdapter

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

the class TitledViewPagerActivity 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 3 with MultiObjectAdapter

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

the class KlyphFakeHeaderGridFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    MultiObjectAdapter adapter = new MultiObjectAdapter(getListView(), getSpecialLayout());
    LayoutParams params = (LayoutParams) getGridView().getEmptyView().getLayoutParams();
    params.topMargin = fakeHeaderHeight;
    getGridView().getEmptyView().setLayoutParams(params);
    View progress = view.findViewById(android.R.id.progress);
    params = (LayoutParams) progress.getLayoutParams();
    params.topMargin = fakeHeaderHeight;
    params.gravity = Gravity.CENTER_HORIZONTAL | Gravity.TOP;
    progress.setLayoutParams(params);
    setListAdapter(adapter);
}
Also used : MarginLayoutParams(android.view.ViewGroup.MarginLayoutParams) LayoutParams(android.widget.FrameLayout.LayoutParams) MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter) View(android.view.View)

Example 4 with MultiObjectAdapter

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

the class AlbumVideos method onViewCreated.

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

Example 5 with MultiObjectAdapter

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

the class AllPhotosFragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    setListVisible(false);
    super.onViewCreated(view, savedInstanceState);
    getGridView().setAdapter(new MultiObjectAdapter(getListView(), SpecialLayout.GRID));
    defineEmptyText(R.string.empty_list_no_photo);
    setRequestType(Query.ALL_PHOTOS);
    if (KlyphData.getAllPhotos() == null) {
        load();
    } else {
        populate(KlyphData.getAllPhotos());
    }
}
Also used : MultiObjectAdapter(com.abewy.android.apps.klyph.adapter.MultiObjectAdapter)

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