Search in sources :

Example 1 with KlyphGridView

use of com.abewy.android.apps.klyph.widget.KlyphGridView in project Klyph by jonathangerbaud.

the class KlyphFragment2 method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Log.d("KlyphFragment2", "onCreateView");
    View view = inflater.inflate(getCustomLayout(), container, false);
    gridView = (KlyphGridView) view.findViewById(R.id.grid);
    View emptyView = getEmptyView();
    if (emptyView != null) {
        emptyView.setId(android.R.id.empty);
        ((ViewGroup) gridView.getParent()).addView(emptyView);
        gridView.setEmptyView(emptyView);
    }
    // Now set the ScrollView as the refreshable view, and the refresh listener (this)
    if (requestNewestType != Query.NONE)
        attachViewToPullToRefresh();
    return view;
}
Also used : ViewGroup(android.view.ViewGroup) ListEmptyView(com.abewy.android.apps.klyph.view.ListEmptyView) View(android.view.View) AdapterView(android.widget.AdapterView) AbsListView(android.widget.AbsListView) KlyphGridView(com.abewy.android.apps.klyph.widget.KlyphGridView)

Example 2 with KlyphGridView

use of com.abewy.android.apps.klyph.widget.KlyphGridView in project Klyph by jonathangerbaud.

the class KlyphFragment2 method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    if (gridView == null)
        throw new IllegalStateException("KlyphFragment2 : There is no KlyphGridView with id \"grid\" defined in the layout");
    backToTopButton = (ImageButton) view.findViewById(R.id.back_to_top_button);
    if (backToTopButton != null) {
        backToTopButton.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                setBackToTopButtonVisibility(false);
                gridView.setSelection(0);
            }
        });
    }
    gridView.setDrawSelectorOnTop(true);
    gridView.setNumColumns(getNumColumn());
    gridView.setFadingEdgeLength(0);
    gridView.setVerticalFadingEdgeEnabled(false);
    loadingObject = new Progress();
    loadingObject.setLoading(true);
    gridView.setVisibility(View.GONE);
    ((View) gridView.getParent()).setVisibility(View.GONE);
    loadingView = view.findViewById(android.R.id.progress);
    gridView.setOnScrollListener(this);
    gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> gridView, View view, int position, long id) {
            onGridItemClick((KlyphGridView) gridView, view, position, id);
        }
    });
    if (getArguments() != null) {
        elementId = getArguments().getString(KlyphBundleExtras.ELEMENT_ID);
    }
    if ((canAutoLoad && elementId != null) || (loadWhenViewCreated == true && elementId != null)) {
        load();
    }
}
Also used : Progress(com.abewy.klyph.items.Progress) KlyphGridView(com.abewy.android.apps.klyph.widget.KlyphGridView) AdapterView(android.widget.AdapterView) ListEmptyView(com.abewy.android.apps.klyph.view.ListEmptyView) View(android.view.View) AdapterView(android.widget.AdapterView) AbsListView(android.widget.AbsListView) KlyphGridView(com.abewy.android.apps.klyph.widget.KlyphGridView)

Aggregations

View (android.view.View)2 AbsListView (android.widget.AbsListView)2 AdapterView (android.widget.AdapterView)2 ListEmptyView (com.abewy.android.apps.klyph.view.ListEmptyView)2 KlyphGridView (com.abewy.android.apps.klyph.widget.KlyphGridView)2 ViewGroup (android.view.ViewGroup)1 Progress (com.abewy.klyph.items.Progress)1