Search in sources :

Example 1 with Progress

use of com.abewy.klyph.items.Progress 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)1 AbsListView (android.widget.AbsListView)1 AdapterView (android.widget.AdapterView)1 ListEmptyView (com.abewy.android.apps.klyph.view.ListEmptyView)1 KlyphGridView (com.abewy.android.apps.klyph.widget.KlyphGridView)1 Progress (com.abewy.klyph.items.Progress)1