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();
}
}
Aggregations